Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lambda Update models to latest #3329

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}