Skip to content

Commit

Permalink
feat(client-lambda): Surface ResourceConflictException in DeleteEvent…
Browse files Browse the repository at this point in the history
…SourceMapping
  • Loading branch information
awstools committed Jun 28, 2023
1 parent fb478aa commit 9aafa26
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ export interface DeleteEventSourceMappingCommandOutput extends EventSourceMappin
* @throws {@link InvalidParameterValueException} (client fault)
* <p>One of the parameters in the request is not valid.</p>
*
* @throws {@link ResourceConflictException} (client fault)
* <p>The resource already exists, or another operation is in progress.</p>
*
* @throws {@link ResourceInUseException} (client fault)
* <p>The operation conflicts with the resource's availability. For example, you tried to update an event source
* mapping in the CREATING state, or you tried to delete an event source mapping currently UPDATING.</p>
Expand Down
3 changes: 2 additions & 1 deletion clients/client-lambda/src/commands/DeleteFunctionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export interface DeleteFunctionCommandOutput extends __MetadataBearer {}
/**
* @public
* <p>Deletes a Lambda function. To delete a specific function version, use the <code>Qualifier</code> parameter.
* Otherwise, all versions and aliases are deleted.</p>
* Otherwise, all versions and aliases are deleted. This doesn't require the user to have explicit
* permissions for <a>DeleteAlias</a>.</p>
* <p>To delete Lambda event source mappings that invoke a function, use <a>DeleteEventSourceMapping</a>. For Amazon Web Services and resources that invoke your function
* directly, delete the trigger in the service where you originally configured it.</p>
* @example
Expand Down
20 changes: 9 additions & 11 deletions clients/client-lambda/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1051,15 +1051,15 @@ export interface CreateEventSourceMappingRequest {
ParallelizationFactor?: number;

/**
* <p>The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon
* DynamoDB, and Amazon MSK Streams sources. <code>AT_TIMESTAMP</code> is supported only for
* Amazon Kinesis streams and Amazon DocumentDB.</p>
* <p>The position in a stream from which to start reading. Required for Amazon Kinesis and
* Amazon DynamoDB Stream event sources. <code>AT_TIMESTAMP</code> is supported only for
* Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka.</p>
*/
StartingPosition?: EventSourcePosition | string;

/**
* <p>With <code>StartingPosition</code> set to <code>AT_TIMESTAMP</code>, the time from which to start
* reading.</p>
* reading. <code>StartingPositionTimestamp</code> cannot be in the future.</p>
*/
StartingPositionTimestamp?: Date;

Expand Down Expand Up @@ -1145,14 +1145,15 @@ export interface EventSourceMappingConfiguration {
UUID?: string;

/**
* <p>The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources. <code>AT_TIMESTAMP</code> is supported only for Amazon Kinesis
* streams and Amazon DocumentDB.</p>
* <p>The position in a stream from which to start reading. Required for Amazon Kinesis and
* Amazon DynamoDB Stream event sources. <code>AT_TIMESTAMP</code> is supported only for
* Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka.</p>
*/
StartingPosition?: EventSourcePosition | string;

/**
* <p>With <code>StartingPosition</code> set to <code>AT_TIMESTAMP</code>, the time from which to start
* reading.</p>
* reading. <code>StartingPositionTimestamp</code> cannot be in the future.</p>
*/
StartingPositionTimestamp?: Date;

Expand Down Expand Up @@ -1551,11 +1552,8 @@ export type SnapStartApplyOn = (typeof SnapStartApplyOn)[keyof typeof SnapStartA

/**
* @public
* <p>The function's Lambda SnapStart setting. Set <code>ApplyOn</code> to <code>PublishedVersions</code> to create a
* <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html">Lambda SnapStart</a> setting. Set <code>ApplyOn</code> to <code>PublishedVersions</code> to create a
* snapshot of the initialized execution environment when you publish a function version.</p>
* <p>SnapStart is supported with the <code>java11</code> runtime. For more information, see
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html">Improving startup performance with Lambda
* SnapStart</a>.</p>
*/
export interface SnapStart {
/**
Expand Down
3 changes: 3 additions & 0 deletions clients/client-lambda/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3388,6 +3388,9 @@ const de_DeleteEventSourceMappingCommandError = async (
case "InvalidParameterValueException":
case "com.amazonaws.lambda#InvalidParameterValueException":
throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
case "ResourceConflictException":
case "com.amazonaws.lambda#ResourceConflictException":
throw await de_ResourceConflictExceptionRes(parsedOutput, context);
case "ResourceInUseException":
case "com.amazonaws.lambda#ResourceInUseException":
throw await de_ResourceInUseExceptionRes(parsedOutput, context);
Expand Down
15 changes: 9 additions & 6 deletions codegen/sdk-codegen/aws-models/lambda.json
Original file line number Diff line number Diff line change
Expand Up @@ -2567,13 +2567,13 @@
"StartingPosition": {
"target": "com.amazonaws.lambda#EventSourcePosition",
"traits": {
"smithy.api#documentation": "<p>The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon\n DynamoDB, and Amazon MSK Streams sources. <code>AT_TIMESTAMP</code> is supported only for\n Amazon Kinesis streams and Amazon DocumentDB.</p>"
"smithy.api#documentation": "<p>The position in a stream from which to start reading. Required for Amazon Kinesis and\n Amazon DynamoDB Stream event sources. <code>AT_TIMESTAMP</code> is supported only for\n Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka.</p>"
}
},
"StartingPositionTimestamp": {
"target": "com.amazonaws.lambda#Date",
"traits": {
"smithy.api#documentation": "<p>With <code>StartingPosition</code> set to <code>AT_TIMESTAMP</code>, the time from which to start\n reading.</p>"
"smithy.api#documentation": "<p>With <code>StartingPosition</code> set to <code>AT_TIMESTAMP</code>, the time from which to start\n reading. <code>StartingPositionTimestamp</code> cannot be in the future.</p>"
}
},
"DestinationConfig": {
Expand Down Expand Up @@ -3133,6 +3133,9 @@
{
"target": "com.amazonaws.lambda#InvalidParameterValueException"
},
{
"target": "com.amazonaws.lambda#ResourceConflictException"
},
{
"target": "com.amazonaws.lambda#ResourceInUseException"
},
Expand Down Expand Up @@ -3197,7 +3200,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Deletes a Lambda function. To delete a specific function version, use the <code>Qualifier</code> parameter.\n Otherwise, all versions and aliases are deleted.</p>\n <p>To delete Lambda event source mappings that invoke a function, use <a>DeleteEventSourceMapping</a>. For Amazon Web Services and resources that invoke your function\n directly, delete the trigger in the service where you originally configured it.</p>",
"smithy.api#documentation": "<p>Deletes a Lambda function. To delete a specific function version, use the <code>Qualifier</code> parameter.\n Otherwise, all versions and aliases are deleted. This doesn't require the user to have explicit\n permissions for <a>DeleteAlias</a>.</p>\n <p>To delete Lambda event source mappings that invoke a function, use <a>DeleteEventSourceMapping</a>. For Amazon Web Services and resources that invoke your function\n directly, delete the trigger in the service where you originally configured it.</p>",
"smithy.api#http": {
"method": "DELETE",
"uri": "/2015-03-31/functions/{FunctionName}",
Expand Down Expand Up @@ -3912,13 +3915,13 @@
"StartingPosition": {
"target": "com.amazonaws.lambda#EventSourcePosition",
"traits": {
"smithy.api#documentation": "<p>The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources. <code>AT_TIMESTAMP</code> is supported only for Amazon Kinesis\n streams and Amazon DocumentDB.</p>"
"smithy.api#documentation": "<p>The position in a stream from which to start reading. Required for Amazon Kinesis and\n Amazon DynamoDB Stream event sources. <code>AT_TIMESTAMP</code> is supported only for\n Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka.</p>"
}
},
"StartingPositionTimestamp": {
"target": "com.amazonaws.lambda#Date",
"traits": {
"smithy.api#documentation": "<p>With <code>StartingPosition</code> set to <code>AT_TIMESTAMP</code>, the time from which to start\n reading.</p>"
"smithy.api#documentation": "<p>With <code>StartingPosition</code> set to <code>AT_TIMESTAMP</code>, the time from which to start\n reading. <code>StartingPositionTimestamp</code> cannot be in the future.</p>"
}
},
"BatchSize": {
Expand Down Expand Up @@ -10159,7 +10162,7 @@
}
},
"traits": {
"smithy.api#documentation": "<p>The function's Lambda SnapStart setting. Set <code>ApplyOn</code> to <code>PublishedVersions</code> to create a\n snapshot of the initialized execution environment when you publish a function version.</p>\n <p>SnapStart is supported with the <code>java11</code> runtime. For more information, see\n <a href=\"https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html\">Improving startup performance with Lambda\n SnapStart</a>.</p>"
"smithy.api#documentation": "<p>The function's <a href=\"https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html\">Lambda SnapStart</a> setting. Set <code>ApplyOn</code> to <code>PublishedVersions</code> to create a\n snapshot of the initialized execution environment when you publish a function version.</p>"
}
},
"com.amazonaws.lambda#SnapStartApplyOn": {
Expand Down

0 comments on commit 9aafa26

Please sign in to comment.