From 970007d58dec0c61d5e80d5285260285660b965b Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 4 Jan 2024 19:51:31 +0000 Subject: [PATCH] feat(client-service-catalog): Added Idempotency token support to Service Catalog AssociateServiceActionWithProvisioningArtifact, DisassociateServiceActionFromProvisioningArtifact, DeleteServiceAction API --- ...ceActionWithProvisioningArtifactCommand.ts | 1 + .../commands/DeleteServiceActionCommand.ts | 1 + ...ceActionFromProvisioningArtifactCommand.ts | 1 + .../src/models/models_0.ts | 24 ++++++++- .../src/protocols/Aws_json1_1.ts | 49 ++++++++++++++++--- .../aws-models/service-catalog.json | 23 ++++++++- 6 files changed, 90 insertions(+), 9 deletions(-) diff --git a/clients/client-service-catalog/src/commands/AssociateServiceActionWithProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/AssociateServiceActionWithProvisioningArtifactCommand.ts index 468d9e76e1ec..4b8d67c23616 100644 --- a/clients/client-service-catalog/src/commands/AssociateServiceActionWithProvisioningArtifactCommand.ts +++ b/clients/client-service-catalog/src/commands/AssociateServiceActionWithProvisioningArtifactCommand.ts @@ -49,6 +49,7 @@ export interface AssociateServiceActionWithProvisioningArtifactCommandOutput * ProvisioningArtifactId: "STRING_VALUE", // required * ServiceActionId: "STRING_VALUE", // required * AcceptLanguage: "STRING_VALUE", + * IdempotencyToken: "STRING_VALUE", * }; * const command = new AssociateServiceActionWithProvisioningArtifactCommand(input); * const response = await client.send(command); diff --git a/clients/client-service-catalog/src/commands/DeleteServiceActionCommand.ts b/clients/client-service-catalog/src/commands/DeleteServiceActionCommand.ts index b989b9781b3b..73f82e063af9 100644 --- a/clients/client-service-catalog/src/commands/DeleteServiceActionCommand.ts +++ b/clients/client-service-catalog/src/commands/DeleteServiceActionCommand.ts @@ -38,6 +38,7 @@ export interface DeleteServiceActionCommandOutput extends DeleteServiceActionOut * const input = { // DeleteServiceActionInput * Id: "STRING_VALUE", // required * AcceptLanguage: "STRING_VALUE", + * IdempotencyToken: "STRING_VALUE", * }; * const command = new DeleteServiceActionCommand(input); * const response = await client.send(command); diff --git a/clients/client-service-catalog/src/commands/DisassociateServiceActionFromProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/DisassociateServiceActionFromProvisioningArtifactCommand.ts index 9e2ef118e924..cc587022b6e7 100644 --- a/clients/client-service-catalog/src/commands/DisassociateServiceActionFromProvisioningArtifactCommand.ts +++ b/clients/client-service-catalog/src/commands/DisassociateServiceActionFromProvisioningArtifactCommand.ts @@ -49,6 +49,7 @@ export interface DisassociateServiceActionFromProvisioningArtifactCommandOutput * ProvisioningArtifactId: "STRING_VALUE", // required * ServiceActionId: "STRING_VALUE", // required * AcceptLanguage: "STRING_VALUE", + * IdempotencyToken: "STRING_VALUE", * }; * const command = new DisassociateServiceActionFromProvisioningArtifactCommand(input); * const response = await client.send(command); diff --git a/clients/client-service-catalog/src/models/models_0.ts b/clients/client-service-catalog/src/models/models_0.ts index 17372e800e53..0d6a0eb9cfaf 100644 --- a/clients/client-service-catalog/src/models/models_0.ts +++ b/clients/client-service-catalog/src/models/models_0.ts @@ -459,6 +459,12 @@ export interface AssociateServiceActionWithProvisioningArtifactInput { * */ AcceptLanguage?: string; + + /** + * @public + *

A unique identifier that you provide to ensure idempotency. If multiple requests from the same Amazon Web Services account use the same idempotency token, the same response is returned for each repeated request.

+ */ + IdempotencyToken?: string; } /** @@ -1216,8 +1222,10 @@ export interface CreatePortfolioShareInput { /** * @public - *

Enables or disables Principal sharing when creating the portfolio share. If this flag is not provided, - * principal sharing is disabled.

+ *

This parameter is only supported for portfolios with an OrganizationalNode + * Type of ORGANIZATION or ORGANIZATIONAL_UNIT.

+ *

Enables or disables Principal sharing when creating the portfolio share. If you do + * not provide this flag, principal sharing is disabled.

*

When you enable Principal Name Sharing for a portfolio share, the share recipient * account end users with a principal that matches any of the associated IAM * patterns can provision products from the portfolio. Once @@ -2658,6 +2666,12 @@ export interface DeleteServiceActionInput { * */ AcceptLanguage?: string; + + /** + * @public + *

A unique identifier that you provide to ensure idempotency. If multiple requests from the same Amazon Web Services account use the same idempotency token, the same response is returned for each repeated request.

+ */ + IdempotencyToken?: string; } /** @@ -4926,6 +4940,12 @@ export interface DisassociateServiceActionFromProvisioningArtifactInput { * */ AcceptLanguage?: string; + + /** + * @public + *

A unique identifier that you provide to ensure idempotency. If multiple requests from the same Amazon Web Services account use the same idempotency token, the same response is returned for each repeated request.

+ */ + IdempotencyToken?: string; } /** diff --git a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts index 17f7e49f430e..5b0b1a95cd68 100644 --- a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts @@ -535,7 +535,7 @@ export const se_AssociateServiceActionWithProvisioningArtifactCommand = async ( ): Promise<__HttpRequest> => { const headers: __HeaderBag = sharedHeaders("AssociateServiceActionWithProvisioningArtifact"); let body: any; - body = JSON.stringify(_json(input)); + body = JSON.stringify(se_AssociateServiceActionWithProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -782,7 +782,7 @@ export const se_DeleteServiceActionCommand = async ( ): Promise<__HttpRequest> => { const headers: __HeaderBag = sharedHeaders("DeleteServiceAction"); let body: any; - body = JSON.stringify(_json(input)); + body = JSON.stringify(se_DeleteServiceActionInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -1068,7 +1068,7 @@ export const se_DisassociateServiceActionFromProvisioningArtifactCommand = async ): Promise<__HttpRequest> => { const headers: __HeaderBag = sharedHeaders("DisassociateServiceActionFromProvisioningArtifact"); let body: any; - body = JSON.stringify(_json(input)); + body = JSON.stringify(se_DisassociateServiceActionFromProvisioningArtifactInput(input, context)); return buildHttpRpcRequest(context, headers, "/", undefined, body); }; @@ -6287,7 +6287,21 @@ const de_TagOptionNotMigratedExceptionRes = async ( // se_AssociateProductWithPortfolioInput omitted. -// se_AssociateServiceActionWithProvisioningArtifactInput omitted. +/** + * serializeAws_json1_1AssociateServiceActionWithProvisioningArtifactInput + */ +const se_AssociateServiceActionWithProvisioningArtifactInput = ( + input: AssociateServiceActionWithProvisioningArtifactInput, + context: __SerdeContext +): any => { + return take(input, { + AcceptLanguage: [], + IdempotencyToken: [true, (_) => _ ?? generateIdempotencyToken()], + ProductId: [], + ProvisioningArtifactId: [], + ServiceActionId: [], + }); +}; // se_AssociateTagOptionWithResourceInput omitted. @@ -6428,7 +6442,16 @@ const se_CreateServiceActionInput = (input: CreateServiceActionInput, context: _ // se_DeleteProvisioningArtifactInput omitted. -// se_DeleteServiceActionInput omitted. +/** + * serializeAws_json1_1DeleteServiceActionInput + */ +const se_DeleteServiceActionInput = (input: DeleteServiceActionInput, context: __SerdeContext): any => { + return take(input, { + AcceptLanguage: [], + Id: [], + IdempotencyToken: [true, (_) => _ ?? generateIdempotencyToken()], + }); +}; // se_DeleteTagOptionInput omitted. @@ -6472,7 +6495,21 @@ const se_CreateServiceActionInput = (input: CreateServiceActionInput, context: _ // se_DisassociateProductFromPortfolioInput omitted. -// se_DisassociateServiceActionFromProvisioningArtifactInput omitted. +/** + * serializeAws_json1_1DisassociateServiceActionFromProvisioningArtifactInput + */ +const se_DisassociateServiceActionFromProvisioningArtifactInput = ( + input: DisassociateServiceActionFromProvisioningArtifactInput, + context: __SerdeContext +): any => { + return take(input, { + AcceptLanguage: [], + IdempotencyToken: [true, (_) => _ ?? generateIdempotencyToken()], + ProductId: [], + ProvisioningArtifactId: [], + ServiceActionId: [], + }); +}; // se_DisassociateTagOptionFromResourceInput omitted. diff --git a/codegen/sdk-codegen/aws-models/service-catalog.json b/codegen/sdk-codegen/aws-models/service-catalog.json index 6a6ee6d327aa..7f3cc9330bdc 100644 --- a/codegen/sdk-codegen/aws-models/service-catalog.json +++ b/codegen/sdk-codegen/aws-models/service-catalog.json @@ -1710,6 +1710,13 @@ "traits": { "smithy.api#documentation": "

The language code.

\n " } + }, + "IdempotencyToken": { + "target": "com.amazonaws.servicecatalog#IdempotencyToken", + "traits": { + "smithy.api#documentation": "

A unique identifier that you provide to ensure idempotency. If multiple requests from the same Amazon Web Services account use the same idempotency token, the same response is returned for each repeated request.

", + "smithy.api#idempotencyToken": {} + } } }, "traits": { @@ -2512,7 +2519,7 @@ "target": "com.amazonaws.servicecatalog#Boolean", "traits": { "smithy.api#default": false, - "smithy.api#documentation": "

Enables or disables Principal sharing when creating the portfolio share. If this flag is not provided,\n principal sharing is disabled.

\n

When you enable Principal Name Sharing for a portfolio share, the share recipient\n account end users with a principal that matches any of the associated IAM\n patterns can provision products from the portfolio. Once\n shared, the share recipient can view associations of PrincipalType: \n IAM_PATTERN on their portfolio. You can create the principals in the recipient account before or \n after creating the share.

" + "smithy.api#documentation": "

This parameter is only supported for portfolios with an OrganizationalNode \n Type of ORGANIZATION or ORGANIZATIONAL_UNIT.

\n

Enables or disables Principal sharing when creating the portfolio share. If you do \n not provide this flag, principal sharing is disabled.

\n

When you enable Principal Name Sharing for a portfolio share, the share recipient\n account end users with a principal that matches any of the associated IAM\n patterns can provision products from the portfolio. Once\n shared, the share recipient can view associations of PrincipalType: \n IAM_PATTERN on their portfolio. You can create the principals in the recipient account before or \n after creating the share.

" } } }, @@ -3429,6 +3436,13 @@ "traits": { "smithy.api#documentation": "

The language code.

\n " } + }, + "IdempotencyToken": { + "target": "com.amazonaws.servicecatalog#IdempotencyToken", + "traits": { + "smithy.api#documentation": "

A unique identifier that you provide to ensure idempotency. If multiple requests from the same Amazon Web Services account use the same idempotency token, the same response is returned for each repeated request.

", + "smithy.api#idempotencyToken": {} + } } }, "traits": { @@ -4972,6 +4986,13 @@ "traits": { "smithy.api#documentation": "

The language code.

\n " } + }, + "IdempotencyToken": { + "target": "com.amazonaws.servicecatalog#IdempotencyToken", + "traits": { + "smithy.api#documentation": "

A unique identifier that you provide to ensure idempotency. If multiple requests from the same Amazon Web Services account use the same idempotency token, the same response is returned for each repeated request.

", + "smithy.api#idempotencyToken": {} + } } }, "traits": {