Skip to content

Commit

Permalink
feat(client-service-catalog): Added Idempotency token support to Serv…
Browse files Browse the repository at this point in the history
…ice Catalog AssociateServiceActionWithProvisioningArtifact, DisassociateServiceActionFromProvisioningArtifact, DeleteServiceAction API
  • Loading branch information
awstools committed Jan 4, 2024
1 parent 645d19a commit 970007d
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
24 changes: 22 additions & 2 deletions clients/client-service-catalog/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,12 @@ export interface AssociateServiceActionWithProvisioningArtifactInput {
* </ul>
*/
AcceptLanguage?: string;

/**
* @public
* <p>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. </p>
*/
IdempotencyToken?: string;
}

/**
Expand Down Expand Up @@ -1216,8 +1222,10 @@ export interface CreatePortfolioShareInput {

/**
* @public
* <p>Enables or disables <code>Principal</code> sharing when creating the portfolio share. If this flag is not provided,
* principal sharing is disabled. </p>
* <p>This parameter is only supported for portfolios with an <b>OrganizationalNode</b>
* Type of <code>ORGANIZATION</code> or <code>ORGANIZATIONAL_UNIT</code>. </p>
* <p>Enables or disables <code>Principal</code> sharing when creating the portfolio share. If you do
* <b>not</b> provide this flag, principal sharing is disabled. </p>
* <p>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
Expand Down Expand Up @@ -2658,6 +2666,12 @@ export interface DeleteServiceActionInput {
* </ul>
*/
AcceptLanguage?: string;

/**
* @public
* <p>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. </p>
*/
IdempotencyToken?: string;
}

/**
Expand Down Expand Up @@ -4926,6 +4940,12 @@ export interface DisassociateServiceActionFromProvisioningArtifactInput {
* </ul>
*/
AcceptLanguage?: string;

/**
* @public
* <p>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. </p>
*/
IdempotencyToken?: string;
}

/**
Expand Down
49 changes: 43 additions & 6 deletions clients/client-service-catalog/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down Expand Up @@ -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);
};

Expand Down Expand Up @@ -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);
};

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
23 changes: 22 additions & 1 deletion codegen/sdk-codegen/aws-models/service-catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,13 @@
"traits": {
"smithy.api#documentation": "<p>The language code.</p>\n <ul>\n <li>\n <p>\n <code>jp</code> - Japanese</p>\n </li>\n <li>\n <p>\n <code>zh</code> - Chinese</p>\n </li>\n </ul>"
}
},
"IdempotencyToken": {
"target": "com.amazonaws.servicecatalog#IdempotencyToken",
"traits": {
"smithy.api#documentation": "<p>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. </p>",
"smithy.api#idempotencyToken": {}
}
}
},
"traits": {
Expand Down Expand Up @@ -2512,7 +2519,7 @@
"target": "com.amazonaws.servicecatalog#Boolean",
"traits": {
"smithy.api#default": false,
"smithy.api#documentation": "<p>Enables or disables <code>Principal</code> sharing when creating the portfolio share. If this flag is not provided,\n principal sharing is disabled. </p>\n <p>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 <code>PrincipalType</code>: \n <code>IAM_PATTERN</code> on their portfolio. You can create the principals in the recipient account before or \n after creating the share. </p>"
"smithy.api#documentation": "<p>This parameter is only supported for portfolios with an <b>OrganizationalNode</b> \n Type of <code>ORGANIZATION</code> or <code>ORGANIZATIONAL_UNIT</code>. </p>\n <p>Enables or disables <code>Principal</code> sharing when creating the portfolio share. If you do \n <b>not</b> provide this flag, principal sharing is disabled. </p>\n <p>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 <code>PrincipalType</code>: \n <code>IAM_PATTERN</code> on their portfolio. You can create the principals in the recipient account before or \n after creating the share. </p>"
}
}
},
Expand Down Expand Up @@ -3429,6 +3436,13 @@
"traits": {
"smithy.api#documentation": "<p>The language code.</p>\n <ul>\n <li>\n <p>\n <code>jp</code> - Japanese</p>\n </li>\n <li>\n <p>\n <code>zh</code> - Chinese</p>\n </li>\n </ul>"
}
},
"IdempotencyToken": {
"target": "com.amazonaws.servicecatalog#IdempotencyToken",
"traits": {
"smithy.api#documentation": "<p>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. </p>",
"smithy.api#idempotencyToken": {}
}
}
},
"traits": {
Expand Down Expand Up @@ -4972,6 +4986,13 @@
"traits": {
"smithy.api#documentation": "<p>The language code.</p>\n <ul>\n <li>\n <p>\n <code>jp</code> - Japanese</p>\n </li>\n <li>\n <p>\n <code>zh</code> - Chinese</p>\n </li>\n </ul>"
}
},
"IdempotencyToken": {
"target": "com.amazonaws.servicecatalog#IdempotencyToken",
"traits": {
"smithy.api#documentation": "<p>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. </p>",
"smithy.api#idempotencyToken": {}
}
}
},
"traits": {
Expand Down

0 comments on commit 970007d

Please sign in to comment.