Skip to content

Commit

Permalink
feat(aws-android-sdk-lambda): update models to latest (#3341)
Browse files Browse the repository at this point in the history
Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>
  • Loading branch information
awsmobilesdk and eeatonaws authored Jun 28, 2023
1 parent 8887f19 commit 6d2f730
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ public interface AWSLambda {
* @throws InvalidRuntimeException
* @throws ResourceConflictException
* @throws ResourceNotReadyException
* @throws RecursiveInvocationException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ private void init() {
jsonErrorUnmarshallers.add(new KMSDisabledExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new KMSInvalidStateExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new KMSNotFoundExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new RecursiveInvocationExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new RequestTooLargeExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ResourceConflictExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ResourceNotFoundExceptionUnmarshaller());
Expand Down Expand Up @@ -576,6 +577,7 @@ private static ClientConfiguration adjustClientConfiguration(ClientConfiguration
* @throws InvalidRuntimeException
* @throws ResourceConflictException
* @throws ResourceNotReadyException
* @throws RecursiveInvocationException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package com.amazonaws.services.lambda.model;

import com.amazonaws.AmazonServiceException;

/**
* <p>
* Lambda has detected your function being invoked in a recursive loop with
* other Amazon Web Services resources and stopped your function's invocation.
* </p>
*/
public class RecursiveInvocationException extends AmazonServiceException {
private static final long serialVersionUID = 1L;

/**
* <p>
* The exception type.
* </p>
*/
private String type;

/**
* Constructs a new RecursiveInvocationException with the specified error
* message.
*
* @param message Describes the error encountered.
*/
public RecursiveInvocationException(String message) {
super(message);
}

/**
* <p>
* The exception type.
* </p>
*
* @return <p>
* The exception type.
* </p>
*/
public String getType() {
return type;
}

/**
* <p>
* The exception type.
* </p>
*
* @param type <p>
* The exception type.
* </p>
*/
public void setType(String type) {
this.type = type;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package com.amazonaws.services.lambda.model.transform;

import com.amazonaws.AmazonServiceException;
import com.amazonaws.http.JsonErrorResponseHandler.JsonErrorResponse;
import com.amazonaws.transform.JsonErrorUnmarshaller;
import com.amazonaws.services.lambda.model.RecursiveInvocationException;

public class RecursiveInvocationExceptionUnmarshaller extends JsonErrorUnmarshaller {

public RecursiveInvocationExceptionUnmarshaller() {
super(RecursiveInvocationException.class);
}

@Override
public boolean match(JsonErrorResponse error) throws Exception {
return error.getErrorCode().equals("RecursiveInvocationException");
}

@Override
public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception {

RecursiveInvocationException e = (RecursiveInvocationException) super.unmarshall(error);
e.setErrorCode("RecursiveInvocationException");
e.setType(String.valueOf(error.get("Type")));

return e;
}
}

0 comments on commit 6d2f730

Please sign in to comment.