Skip to content

Commit 7911a7a

Browse files
authored
feat: codegen for auto-fill idempotency token (#815)
1 parent 649acaf commit 7911a7a

File tree

85 files changed

+631
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+631
-80
lines changed

Diff for: clients/client-alexa-for-business/models/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ export interface SendAnnouncementRequest {
393393
/**
394394
* <p>The unique, user-specified identifier for the request that ensures idempotency.</p>
395395
*/
396-
ClientRequestToken: string | undefined;
396+
ClientRequestToken?: string;
397397

398398
/**
399399
* <p>The announcement content. This can contain only one of the three possible announcement types (text, SSML or audio).</p>
@@ -1323,7 +1323,7 @@ export interface CreateGatewayGroupRequest {
13231323
/**
13241324
* <p> A unique, user-specified identifier for the request that ensures idempotency.</p>
13251325
*/
1326-
ClientRequestToken: string | undefined;
1326+
ClientRequestToken?: string;
13271327

13281328
/**
13291329
* <p>The description of the gateway group.</p>
@@ -1426,7 +1426,7 @@ export interface CreateNetworkProfileRequest {
14261426
/**
14271427
* <p>A unique, user-specified identifier for the request that ensures idempotency.</p>
14281428
*/
1429-
ClientRequestToken: string | undefined;
1429+
ClientRequestToken?: string;
14301430

14311431
/**
14321432
* <p>The current password of the Wi-Fi network.</p>

Diff for: clients/client-alexa-for-business/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@
5555
"@aws-sdk/util-user-agent-node": "^1.0.0-alpha.6",
5656
"@aws-sdk/util-utf8-browser": "^1.0.0-alpha.2",
5757
"@aws-sdk/util-utf8-node": "^1.0.0-alpha.2",
58-
"tslib": "^1.8.0"
58+
"tslib": "^1.8.0",
59+
"uuid": "^3.4.0"
5960
},
6061
"devDependencies": {
6162
"@types/node": "^12.7.5",
63+
"@types/uuid": "^3.4.7",
6264
"rimraf": "^3.0.0",
6365
"tslib": "^1.8.0",
6466
"typedoc": "^0.15.0",

Diff for: clients/client-alexa-for-business/protocols/Aws_json1_1.ts

+34
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ import {
646646
ResponseMetadata as __ResponseMetadata,
647647
SerdeContext as __SerdeContext
648648
} from "@aws-sdk/types";
649+
import { v4 as generateIdempotencyToken } from "uuid";
649650

650651
export async function serializeAws_json1_1SendAnnouncementCommand(
651652
input: SendAnnouncementCommandInput,
@@ -8582,6 +8583,9 @@ const serializeAws_json1_1SendAnnouncementRequest = (
85828583
context: __SerdeContext
85838584
): any => {
85848585
let bodyParams: any = {};
8586+
if (input.ClientRequestToken === undefined) {
8587+
input.ClientRequestToken = generateIdempotencyToken();
8588+
}
85858589
if (input.ClientRequestToken !== undefined) {
85868590
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
85878591
}
@@ -8798,6 +8802,9 @@ const serializeAws_json1_1CreateAddressBookRequest = (
87988802
context: __SerdeContext
87998803
): any => {
88008804
let bodyParams: any = {};
8805+
if (input.ClientRequestToken === undefined) {
8806+
input.ClientRequestToken = generateIdempotencyToken();
8807+
}
88018808
if (input.ClientRequestToken !== undefined) {
88028809
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
88038810
}
@@ -8815,6 +8822,9 @@ const serializeAws_json1_1CreateBusinessReportScheduleRequest = (
88158822
context: __SerdeContext
88168823
): any => {
88178824
let bodyParams: any = {};
8825+
if (input.ClientRequestToken === undefined) {
8826+
input.ClientRequestToken = generateIdempotencyToken();
8827+
}
88188828
if (input.ClientRequestToken !== undefined) {
88198829
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
88208830
}
@@ -8850,6 +8860,9 @@ const serializeAws_json1_1CreateConferenceProviderRequest = (
88508860
context: __SerdeContext
88518861
): any => {
88528862
let bodyParams: any = {};
8863+
if (input.ClientRequestToken === undefined) {
8864+
input.ClientRequestToken = generateIdempotencyToken();
8865+
}
88538866
if (input.ClientRequestToken !== undefined) {
88548867
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
88558868
}
@@ -8885,6 +8898,9 @@ const serializeAws_json1_1CreateContactRequest = (
88858898
context: __SerdeContext
88868899
): any => {
88878900
let bodyParams: any = {};
8901+
if (input.ClientRequestToken === undefined) {
8902+
input.ClientRequestToken = generateIdempotencyToken();
8903+
}
88888904
if (input.ClientRequestToken !== undefined) {
88898905
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
88908906
}
@@ -8942,6 +8958,9 @@ const serializeAws_json1_1CreateGatewayGroupRequest = (
89428958
context: __SerdeContext
89438959
): any => {
89448960
let bodyParams: any = {};
8961+
if (input.ClientRequestToken === undefined) {
8962+
input.ClientRequestToken = generateIdempotencyToken();
8963+
}
89458964
if (input.ClientRequestToken !== undefined) {
89468965
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
89478966
}
@@ -9008,6 +9027,9 @@ const serializeAws_json1_1CreateNetworkProfileRequest = (
90089027
if (input.CertificateAuthorityArn !== undefined) {
90099028
bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn;
90109029
}
9030+
if (input.ClientRequestToken === undefined) {
9031+
input.ClientRequestToken = generateIdempotencyToken();
9032+
}
90119033
if (input.ClientRequestToken !== undefined) {
90129034
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
90139035
}
@@ -9049,6 +9071,9 @@ const serializeAws_json1_1CreateProfileRequest = (
90499071
if (input.Address !== undefined) {
90509072
bodyParams["Address"] = input.Address;
90519073
}
9074+
if (input.ClientRequestToken === undefined) {
9075+
input.ClientRequestToken = generateIdempotencyToken();
9076+
}
90529077
if (input.ClientRequestToken !== undefined) {
90539078
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
90549079
}
@@ -9109,6 +9134,9 @@ const serializeAws_json1_1CreateRoomRequest = (
91099134
context: __SerdeContext
91109135
): any => {
91119136
let bodyParams: any = {};
9137+
if (input.ClientRequestToken === undefined) {
9138+
input.ClientRequestToken = generateIdempotencyToken();
9139+
}
91129140
if (input.ClientRequestToken !== undefined) {
91139141
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
91149142
}
@@ -9135,6 +9163,9 @@ const serializeAws_json1_1CreateSkillGroupRequest = (
91359163
context: __SerdeContext
91369164
): any => {
91379165
let bodyParams: any = {};
9166+
if (input.ClientRequestToken === undefined) {
9167+
input.ClientRequestToken = generateIdempotencyToken();
9168+
}
91389169
if (input.ClientRequestToken !== undefined) {
91399170
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
91409171
}
@@ -9152,6 +9183,9 @@ const serializeAws_json1_1CreateUserRequest = (
91529183
context: __SerdeContext
91539184
): any => {
91549185
let bodyParams: any = {};
9186+
if (input.ClientRequestToken === undefined) {
9187+
input.ClientRequestToken = generateIdempotencyToken();
9188+
}
91559189
if (input.ClientRequestToken !== undefined) {
91569190
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
91579191
}

Diff for: clients/client-app-mesh/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@
5555
"@aws-sdk/util-user-agent-browser": "^1.0.0-alpha.6",
5656
"@aws-sdk/util-user-agent-node": "^1.0.0-alpha.6",
5757
"@aws-sdk/util-utf8-browser": "^1.0.0-alpha.2",
58-
"@aws-sdk/util-utf8-node": "^1.0.0-alpha.2"
58+
"@aws-sdk/util-utf8-node": "^1.0.0-alpha.2",
59+
"uuid": "^3.4.0"
5960
},
6061
"devDependencies": {
6162
"rimraf": "^3.0.0",
6263
"typedoc": "^0.15.0",
6364
"typescript": "^3.6.3",
6465
"@types/node": "^12.7.5",
66+
"@types/uuid": "^3.4.7",
6567
"tslib": "^1.8.0"
6668
},
6769
"engines": {

Diff for: clients/client-app-mesh/protocols/Aws_restJson1_1.ts

+31
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ import {
191191
ResponseMetadata as __ResponseMetadata,
192192
SerdeContext as __SerdeContext
193193
} from "@aws-sdk/types";
194+
import { v4 as generateIdempotencyToken } from "uuid";
194195

195196
export async function serializeAws_restJson1_1CreateMeshCommand(
196197
input: CreateMeshCommandInput,
@@ -201,6 +202,9 @@ export async function serializeAws_restJson1_1CreateMeshCommand(
201202
let resolvedPath = "/v20190125/meshes";
202203
let body: any = {};
203204
const bodyParams: any = {};
205+
if (input.clientToken === undefined) {
206+
input.clientToken = generateIdempotencyToken();
207+
}
204208
if (input.clientToken !== undefined) {
205209
bodyParams["clientToken"] = input.clientToken;
206210
}
@@ -256,6 +260,9 @@ export async function serializeAws_restJson1_1CreateRouteCommand(
256260
}
257261
let body: any = {};
258262
const bodyParams: any = {};
263+
if (input.clientToken === undefined) {
264+
input.clientToken = generateIdempotencyToken();
265+
}
259266
if (input.clientToken !== undefined) {
260267
bodyParams["clientToken"] = input.clientToken;
261268
}
@@ -297,6 +304,9 @@ export async function serializeAws_restJson1_1CreateVirtualNodeCommand(
297304
}
298305
let body: any = {};
299306
const bodyParams: any = {};
307+
if (input.clientToken === undefined) {
308+
input.clientToken = generateIdempotencyToken();
309+
}
300310
if (input.clientToken !== undefined) {
301311
bodyParams["clientToken"] = input.clientToken;
302312
}
@@ -341,6 +351,9 @@ export async function serializeAws_restJson1_1CreateVirtualRouterCommand(
341351
}
342352
let body: any = {};
343353
const bodyParams: any = {};
354+
if (input.clientToken === undefined) {
355+
input.clientToken = generateIdempotencyToken();
356+
}
344357
if (input.clientToken !== undefined) {
345358
bodyParams["clientToken"] = input.clientToken;
346359
}
@@ -385,6 +398,9 @@ export async function serializeAws_restJson1_1CreateVirtualServiceCommand(
385398
}
386399
let body: any = {};
387400
const bodyParams: any = {};
401+
if (input.clientToken === undefined) {
402+
input.clientToken = generateIdempotencyToken();
403+
}
388404
if (input.clientToken !== undefined) {
389405
bodyParams["clientToken"] = input.clientToken;
390406
}
@@ -1061,6 +1077,9 @@ export async function serializeAws_restJson1_1UpdateMeshCommand(
10611077
}
10621078
let body: any = {};
10631079
const bodyParams: any = {};
1080+
if (input.clientToken === undefined) {
1081+
input.clientToken = generateIdempotencyToken();
1082+
}
10641083
if (input.clientToken !== undefined) {
10651084
bodyParams["clientToken"] = input.clientToken;
10661085
}
@@ -1119,6 +1138,9 @@ export async function serializeAws_restJson1_1UpdateRouteCommand(
11191138
}
11201139
let body: any = {};
11211140
const bodyParams: any = {};
1141+
if (input.clientToken === undefined) {
1142+
input.clientToken = generateIdempotencyToken();
1143+
}
11221144
if (input.clientToken !== undefined) {
11231145
bodyParams["clientToken"] = input.clientToken;
11241146
}
@@ -1166,6 +1188,9 @@ export async function serializeAws_restJson1_1UpdateVirtualNodeCommand(
11661188
}
11671189
let body: any = {};
11681190
const bodyParams: any = {};
1191+
if (input.clientToken === undefined) {
1192+
input.clientToken = generateIdempotencyToken();
1193+
}
11691194
if (input.clientToken !== undefined) {
11701195
bodyParams["clientToken"] = input.clientToken;
11711196
}
@@ -1218,6 +1243,9 @@ export async function serializeAws_restJson1_1UpdateVirtualRouterCommand(
12181243
}
12191244
let body: any = {};
12201245
const bodyParams: any = {};
1246+
if (input.clientToken === undefined) {
1247+
input.clientToken = generateIdempotencyToken();
1248+
}
12211249
if (input.clientToken !== undefined) {
12221250
bodyParams["clientToken"] = input.clientToken;
12231251
}
@@ -1270,6 +1298,9 @@ export async function serializeAws_restJson1_1UpdateVirtualServiceCommand(
12701298
}
12711299
let body: any = {};
12721300
const bodyParams: any = {};
1301+
if (input.clientToken === undefined) {
1302+
input.clientToken = generateIdempotencyToken();
1303+
}
12731304
if (input.clientToken !== undefined) {
12741305
bodyParams["clientToken"] = input.clientToken;
12751306
}

Diff for: clients/client-application-discovery-service/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@
5555
"@aws-sdk/util-user-agent-node": "^1.0.0-alpha.6",
5656
"@aws-sdk/util-utf8-browser": "^1.0.0-alpha.2",
5757
"@aws-sdk/util-utf8-node": "^1.0.0-alpha.2",
58-
"tslib": "^1.8.0"
58+
"tslib": "^1.8.0",
59+
"uuid": "^3.4.0"
5960
},
6061
"devDependencies": {
6162
"@types/node": "^12.7.5",
63+
"@types/uuid": "^3.4.7",
6264
"rimraf": "^3.0.0",
6365
"tslib": "^1.8.0",
6466
"typedoc": "^0.15.0",

Diff for: clients/client-application-discovery-service/protocols/Aws_json1_1.ts

+4
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ import {
187187
ResponseMetadata as __ResponseMetadata,
188188
SerdeContext as __SerdeContext
189189
} from "@aws-sdk/types";
190+
import { v4 as generateIdempotencyToken } from "uuid";
190191

191192
export async function serializeAws_json1_1AssociateConfigurationItemsToApplicationCommand(
192193
input: AssociateConfigurationItemsToApplicationCommandInput,
@@ -3659,6 +3660,9 @@ const serializeAws_json1_1StartImportTaskRequest = (
36593660
context: __SerdeContext
36603661
): any => {
36613662
let bodyParams: any = {};
3663+
if (input.clientRequestToken === undefined) {
3664+
input.clientRequestToken = generateIdempotencyToken();
3665+
}
36623666
if (input.clientRequestToken !== undefined) {
36633667
bodyParams["clientRequestToken"] = input.clientRequestToken;
36643668
}

Diff for: clients/client-athena/models/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export interface DeleteNamedQueryInput {
257257
/**
258258
* <p>The unique ID of the query to delete.</p>
259259
*/
260-
NamedQueryId: string | undefined;
260+
NamedQueryId?: string;
261261
}
262262

263263
export namespace DeleteNamedQueryInput {
@@ -1112,7 +1112,7 @@ export interface StopQueryExecutionInput {
11121112
/**
11131113
* <p>The unique ID of the query execution to stop.</p>
11141114
*/
1115-
QueryExecutionId: string | undefined;
1115+
QueryExecutionId?: string;
11161116
}
11171117

11181118
export namespace StopQueryExecutionInput {

Diff for: clients/client-athena/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@
5555
"@aws-sdk/util-user-agent-node": "^1.0.0-alpha.6",
5656
"@aws-sdk/util-utf8-browser": "^1.0.0-alpha.2",
5757
"@aws-sdk/util-utf8-node": "^1.0.0-alpha.2",
58-
"tslib": "^1.8.0"
58+
"tslib": "^1.8.0",
59+
"uuid": "^3.4.0"
5960
},
6061
"devDependencies": {
6162
"@types/node": "^12.7.5",
63+
"@types/uuid": "^3.4.7",
6264
"rimraf": "^3.0.0",
6365
"tslib": "^1.8.0",
6466
"typedoc": "^0.15.0",

Diff for: clients/client-athena/protocols/Aws_json1_1.ts

+13
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ import {
149149
ResponseMetadata as __ResponseMetadata,
150150
SerdeContext as __SerdeContext
151151
} from "@aws-sdk/types";
152+
import { v4 as generateIdempotencyToken } from "uuid";
152153

153154
export async function serializeAws_json1_1BatchGetNamedQueryCommand(
154155
input: BatchGetNamedQueryCommandInput,
@@ -1855,6 +1856,9 @@ const serializeAws_json1_1CreateNamedQueryInput = (
18551856
context: __SerdeContext
18561857
): any => {
18571858
let bodyParams: any = {};
1859+
if (input.ClientRequestToken === undefined) {
1860+
input.ClientRequestToken = generateIdempotencyToken();
1861+
}
18581862
if (input.ClientRequestToken !== undefined) {
18591863
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
18601864
}
@@ -1904,6 +1908,9 @@ const serializeAws_json1_1DeleteNamedQueryInput = (
19041908
context: __SerdeContext
19051909
): any => {
19061910
let bodyParams: any = {};
1911+
if (input.NamedQueryId === undefined) {
1912+
input.NamedQueryId = generateIdempotencyToken();
1913+
}
19071914
if (input.NamedQueryId !== undefined) {
19081915
bodyParams["NamedQueryId"] = input.NamedQueryId;
19091916
}
@@ -2128,6 +2135,9 @@ const serializeAws_json1_1StartQueryExecutionInput = (
21282135
context: __SerdeContext
21292136
): any => {
21302137
let bodyParams: any = {};
2138+
if (input.ClientRequestToken === undefined) {
2139+
input.ClientRequestToken = generateIdempotencyToken();
2140+
}
21312141
if (input.ClientRequestToken !== undefined) {
21322142
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
21332143
}
@@ -2159,6 +2169,9 @@ const serializeAws_json1_1StopQueryExecutionInput = (
21592169
context: __SerdeContext
21602170
): any => {
21612171
let bodyParams: any = {};
2172+
if (input.QueryExecutionId === undefined) {
2173+
input.QueryExecutionId = generateIdempotencyToken();
2174+
}
21622175
if (input.QueryExecutionId !== undefined) {
21632176
bodyParams["QueryExecutionId"] = input.QueryExecutionId;
21642177
}

0 commit comments

Comments
 (0)