diff --git a/clients/client-iotdeviceadvisor/package.json b/clients/client-iotdeviceadvisor/package.json index 38d0a454cd67..cdc125994578 100644 --- a/clients/client-iotdeviceadvisor/package.json +++ b/clients/client-iotdeviceadvisor/package.json @@ -58,11 +58,13 @@ "@smithy/util-middleware": "^3.0.7", "@smithy/util-retry": "^3.0.7", "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "devDependencies": { "@tsconfig/node16": "16.1.3", "@types/node": "^16.18.96", + "@types/uuid": "^9.0.4", "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", diff --git a/clients/client-iotdeviceadvisor/src/commands/CreateSuiteDefinitionCommand.ts b/clients/client-iotdeviceadvisor/src/commands/CreateSuiteDefinitionCommand.ts index d0c015cd301a..0e695626d338 100644 --- a/clients/client-iotdeviceadvisor/src/commands/CreateSuiteDefinitionCommand.ts +++ b/clients/client-iotdeviceadvisor/src/commands/CreateSuiteDefinitionCommand.ts @@ -55,6 +55,7 @@ export interface CreateSuiteDefinitionCommandOutput extends CreateSuiteDefinitio * tags: { // TagMap * "": "STRING_VALUE", * }, + * clientToken: "STRING_VALUE", * }; * const command = new CreateSuiteDefinitionCommand(input); * const response = await client.send(command); diff --git a/clients/client-iotdeviceadvisor/src/models/models_0.ts b/clients/client-iotdeviceadvisor/src/models/models_0.ts index c8f94f39d0e2..6d52dfb5587d 100644 --- a/clients/client-iotdeviceadvisor/src/models/models_0.ts +++ b/clients/client-iotdeviceadvisor/src/models/models_0.ts @@ -152,6 +152,14 @@ export interface CreateSuiteDefinitionRequest { * @public */ tags?: Record; + + /** + *

The client token for the test suite definition creation. + * This token is used for tracking test suite definition creation + * using retries and obtaining its status. This parameter is optional.

+ * @public + */ + clientToken?: string; } /** diff --git a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts index 0ba2d9f9fbc8..89cfee23c3a1 100644 --- a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts @@ -24,6 +24,7 @@ import { ResponseMetadata as __ResponseMetadata, SerdeContext as __SerdeContext, } from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; import { CreateSuiteDefinitionCommandInput, @@ -85,6 +86,7 @@ export const se_CreateSuiteDefinitionCommand = async ( let body: any; body = JSON.stringify( take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], suiteDefinitionConfiguration: (_) => _json(_), tags: (_) => _json(_), }) diff --git a/codegen/sdk-codegen/aws-models/iotdeviceadvisor.json b/codegen/sdk-codegen/aws-models/iotdeviceadvisor.json index a34008be7b15..13bfca145ae8 100644 --- a/codegen/sdk-codegen/aws-models/iotdeviceadvisor.json +++ b/codegen/sdk-codegen/aws-models/iotdeviceadvisor.json @@ -55,6 +55,16 @@ } } }, + "com.amazonaws.iotdeviceadvisor#ClientToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "^[\\u0021-\\u007E]+$" + } + }, "com.amazonaws.iotdeviceadvisor#ConflictException": { "type": "structure", "members": { @@ -112,6 +122,13 @@ "traits": { "smithy.api#documentation": "

The tags to be attached to the suite definition.

" } + }, + "clientToken": { + "target": "com.amazonaws.iotdeviceadvisor#ClientToken", + "traits": { + "smithy.api#documentation": "

The client token for the test suite definition creation. \n This token is used for tracking test suite definition creation \n using retries and obtaining its status. This parameter is optional.

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