Skip to content

Commit

Permalink
feat(client-lambda): This release adds RecursiveInvocationException t…
Browse files Browse the repository at this point in the history
…o the Invoke API and InvokeWithResponseStream API.
  • Loading branch information
awstools committed Jun 20, 2023
1 parent c1c68bc commit bef0216
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clients/client-lambda/src/commands/InvokeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export interface InvokeCommandOutput extends InvocationResponse, __MetadataBeare
* <p>Lambda couldn't decrypt the environment variables because the KMS key was not
* found. Check the function's KMS key settings.</p>
*
* @throws {@link RecursiveInvocationException} (client fault)
* <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>
*
* @throws {@link RequestTooLargeException} (client fault)
* <p>The request payload exceeded the <code>Invoke</code> request body JSON input quota. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda
* quotas</a>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ export interface InvokeWithResponseStreamCommandOutput extends InvokeWithRespons
* <p>Lambda couldn't decrypt the environment variables because the KMS key was not
* found. Check the function's KMS key settings.</p>
*
* @throws {@link RecursiveInvocationException} (client fault)
* <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>
*
* @throws {@link RequestTooLargeException} (client fault)
* <p>The request payload exceeded the <code>Invoke</code> request body JSON input quota. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda
* quotas</a>.</p>
Expand Down
31 changes: 31 additions & 0 deletions clients/client-lambda/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4152,6 +4152,37 @@ export class KMSNotFoundException extends __BaseException {
}
}

/**
* @public
* <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>
*/
export class RecursiveInvocationException extends __BaseException {
readonly name: "RecursiveInvocationException" = "RecursiveInvocationException";
readonly $fault: "client" = "client";
/**
* <p>The exception type.</p>
*/
Type?: string;

/**
* <p>The exception message.</p>
*/
Message?: string;
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<RecursiveInvocationException, __BaseException>) {
super({
name: "RecursiveInvocationException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, RecursiveInvocationException.prototype);
this.Type = opts.Type;
this.Message = opts.Message;
}
}

/**
* @public
* <p>The request payload exceeded the <code>Invoke</code> request body JSON input quota. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda
Expand Down
28 changes: 28 additions & 0 deletions clients/client-lambda/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ import {
PolicyLengthExceededException,
PreconditionFailedException,
ProvisionedConcurrencyConfigNotFoundException,
RecursiveInvocationException,
RequestTooLargeException,
ResourceConflictException,
ResourceInUseException,
Expand Down Expand Up @@ -4867,6 +4868,9 @@ const de_InvokeCommandError = async (output: __HttpResponse, context: __SerdeCon
case "KMSNotFoundException":
case "com.amazonaws.lambda#KMSNotFoundException":
throw await de_KMSNotFoundExceptionRes(parsedOutput, context);
case "RecursiveInvocationException":
case "com.amazonaws.lambda#RecursiveInvocationException":
throw await de_RecursiveInvocationExceptionRes(parsedOutput, context);
case "RequestTooLargeException":
case "com.amazonaws.lambda#RequestTooLargeException":
throw await de_RequestTooLargeExceptionRes(parsedOutput, context);
Expand Down Expand Up @@ -5058,6 +5062,9 @@ const de_InvokeWithResponseStreamCommandError = async (
case "KMSNotFoundException":
case "com.amazonaws.lambda#KMSNotFoundException":
throw await de_KMSNotFoundExceptionRes(parsedOutput, context);
case "RecursiveInvocationException":
case "com.amazonaws.lambda#RecursiveInvocationException":
throw await de_RecursiveInvocationExceptionRes(parsedOutput, context);
case "RequestTooLargeException":
case "com.amazonaws.lambda#RequestTooLargeException":
throw await de_RequestTooLargeExceptionRes(parsedOutput, context);
Expand Down Expand Up @@ -7538,6 +7545,27 @@ const de_ProvisionedConcurrencyConfigNotFoundExceptionRes = async (
return __decorateServiceException(exception, parsedOutput.body);
};

/**
* deserializeAws_restJson1RecursiveInvocationExceptionRes
*/
const de_RecursiveInvocationExceptionRes = async (
parsedOutput: any,
context: __SerdeContext
): Promise<RecursiveInvocationException> => {
const contents: any = map({});
const data: any = parsedOutput.body;
const doc = take(data, {
Message: __expectString,
Type: __expectString,
});
Object.assign(contents, doc);
const exception = new RecursiveInvocationException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return __decorateServiceException(exception, parsedOutput.body);
};

/**
* deserializeAws_restJson1RequestTooLargeExceptionRes
*/
Expand Down
28 changes: 28 additions & 0 deletions codegen/sdk-codegen/aws-models/lambda.json
Original file line number Diff line number Diff line change
Expand Up @@ -6450,6 +6450,9 @@
{
"target": "com.amazonaws.lambda#KMSNotFoundException"
},
{
"target": "com.amazonaws.lambda#RecursiveInvocationException"
},
{
"target": "com.amazonaws.lambda#RequestTooLargeException"
},
Expand Down Expand Up @@ -6666,6 +6669,9 @@
{
"target": "com.amazonaws.lambda#KMSNotFoundException"
},
{
"target": "com.amazonaws.lambda#RecursiveInvocationException"
},
{
"target": "com.amazonaws.lambda#RequestTooLargeException"
},
Expand Down Expand Up @@ -9485,6 +9491,28 @@
}
}
},
"com.amazonaws.lambda#RecursiveInvocationException": {
"type": "structure",
"members": {
"Type": {
"target": "com.amazonaws.lambda#String",
"traits": {
"smithy.api#documentation": "<p>The exception type.</p>"
}
},
"Message": {
"target": "com.amazonaws.lambda#String",
"traits": {
"smithy.api#documentation": "<p>The exception message.</p>"
}
}
},
"traits": {
"smithy.api#documentation": "<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>",
"smithy.api#error": "client",
"smithy.api#httpError": 400
}
},
"com.amazonaws.lambda#RemoveLayerVersionPermission": {
"type": "operation",
"input": {
Expand Down

0 comments on commit bef0216

Please sign in to comment.