Skip to content

Commit ab7c49c

Browse files
committed
chore: make generateIdempotencyToken calls before consuming
1 parent fce4efe commit ab7c49c

File tree

39 files changed

+278
-262
lines changed

39 files changed

+278
-262
lines changed

clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ export const serializeAws_restJson1_1CreateAnalyzerCommand = async (
114114
};
115115
let resolvedPath = "/analyzer";
116116
let body: any;
117+
if (input.clientToken === undefined) {
118+
input.clientToken = generateIdempotencyToken();
119+
}
117120
const bodyParams: any = {};
118121
if (input.analyzerName !== undefined) {
119122
bodyParams["analyzerName"] = input.analyzerName;
@@ -124,9 +127,6 @@ export const serializeAws_restJson1_1CreateAnalyzerCommand = async (
124127
context
125128
);
126129
}
127-
if (input.clientToken === undefined) {
128-
input.clientToken = generateIdempotencyToken();
129-
}
130130
if (input.clientToken !== undefined) {
131131
bodyParams["clientToken"] = input.clientToken;
132132
}
@@ -172,10 +172,10 @@ export const serializeAws_restJson1_1CreateArchiveRuleCommand = async (
172172
throw new Error("No value provided for input HTTP label: analyzerName.");
173173
}
174174
let body: any;
175-
const bodyParams: any = {};
176175
if (input.clientToken === undefined) {
177176
input.clientToken = generateIdempotencyToken();
178177
}
178+
const bodyParams: any = {};
179179
if (input.clientToken !== undefined) {
180180
bodyParams["clientToken"] = input.clientToken;
181181
}
@@ -766,10 +766,10 @@ export const serializeAws_restJson1_1UpdateArchiveRuleCommand = async (
766766
throw new Error("No value provided for input HTTP label: ruleName.");
767767
}
768768
let body: any;
769-
const bodyParams: any = {};
770769
if (input.clientToken === undefined) {
771770
input.clientToken = generateIdempotencyToken();
772771
}
772+
const bodyParams: any = {};
773773
if (input.clientToken !== undefined) {
774774
bodyParams["clientToken"] = input.clientToken;
775775
}
@@ -801,13 +801,13 @@ export const serializeAws_restJson1_1UpdateFindingsCommand = async (
801801
};
802802
let resolvedPath = "/finding";
803803
let body: any;
804+
if (input.clientToken === undefined) {
805+
input.clientToken = generateIdempotencyToken();
806+
}
804807
const bodyParams: any = {};
805808
if (input.analyzerArn !== undefined) {
806809
bodyParams["analyzerArn"] = input.analyzerArn;
807810
}
808-
if (input.clientToken === undefined) {
809-
input.clientToken = generateIdempotencyToken();
810-
}
811811
if (input.clientToken !== undefined) {
812812
bodyParams["clientToken"] = input.clientToken;
813813
}

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8782,10 +8782,10 @@ const serializeAws_json1_1SendAnnouncementRequest = (
87828782
input: SendAnnouncementRequest,
87838783
context: __SerdeContext
87848784
): any => {
8785-
const bodyParams: any = {};
87868785
if (input.ClientRequestToken === undefined) {
87878786
input.ClientRequestToken = generateIdempotencyToken();
87888787
}
8788+
const bodyParams: any = {};
87898789
if (input.ClientRequestToken !== undefined) {
87908790
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
87918791
}
@@ -9008,10 +9008,10 @@ const serializeAws_json1_1CreateAddressBookRequest = (
90089008
input: CreateAddressBookRequest,
90099009
context: __SerdeContext
90109010
): any => {
9011-
const bodyParams: any = {};
90129011
if (input.ClientRequestToken === undefined) {
90139012
input.ClientRequestToken = generateIdempotencyToken();
90149013
}
9014+
const bodyParams: any = {};
90159015
if (input.ClientRequestToken !== undefined) {
90169016
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
90179017
}
@@ -9028,10 +9028,10 @@ const serializeAws_json1_1CreateBusinessReportScheduleRequest = (
90289028
input: CreateBusinessReportScheduleRequest,
90299029
context: __SerdeContext
90309030
): any => {
9031-
const bodyParams: any = {};
90329031
if (input.ClientRequestToken === undefined) {
90339032
input.ClientRequestToken = generateIdempotencyToken();
90349033
}
9034+
const bodyParams: any = {};
90359035
if (input.ClientRequestToken !== undefined) {
90369036
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
90379037
}
@@ -9066,10 +9066,10 @@ const serializeAws_json1_1CreateConferenceProviderRequest = (
90669066
input: CreateConferenceProviderRequest,
90679067
context: __SerdeContext
90689068
): any => {
9069-
const bodyParams: any = {};
90709069
if (input.ClientRequestToken === undefined) {
90719070
input.ClientRequestToken = generateIdempotencyToken();
90729071
}
9072+
const bodyParams: any = {};
90739073
if (input.ClientRequestToken !== undefined) {
90749074
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
90759075
}
@@ -9104,10 +9104,10 @@ const serializeAws_json1_1CreateContactRequest = (
91049104
input: CreateContactRequest,
91059105
context: __SerdeContext
91069106
): any => {
9107-
const bodyParams: any = {};
91089107
if (input.ClientRequestToken === undefined) {
91099108
input.ClientRequestToken = generateIdempotencyToken();
91109109
}
9110+
const bodyParams: any = {};
91119111
if (input.ClientRequestToken !== undefined) {
91129112
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
91139113
}
@@ -9164,10 +9164,10 @@ const serializeAws_json1_1CreateGatewayGroupRequest = (
91649164
input: CreateGatewayGroupRequest,
91659165
context: __SerdeContext
91669166
): any => {
9167-
const bodyParams: any = {};
91689167
if (input.ClientRequestToken === undefined) {
91699168
input.ClientRequestToken = generateIdempotencyToken();
91709169
}
9170+
const bodyParams: any = {};
91719171
if (input.ClientRequestToken !== undefined) {
91729172
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
91739173
}
@@ -9230,13 +9230,13 @@ const serializeAws_json1_1CreateNetworkProfileRequest = (
92309230
input: CreateNetworkProfileRequest,
92319231
context: __SerdeContext
92329232
): any => {
9233+
if (input.ClientRequestToken === undefined) {
9234+
input.ClientRequestToken = generateIdempotencyToken();
9235+
}
92339236
const bodyParams: any = {};
92349237
if (input.CertificateAuthorityArn !== undefined) {
92359238
bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn;
92369239
}
9237-
if (input.ClientRequestToken === undefined) {
9238-
input.ClientRequestToken = generateIdempotencyToken();
9239-
}
92409240
if (input.ClientRequestToken !== undefined) {
92419241
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
92429242
}
@@ -9274,13 +9274,13 @@ const serializeAws_json1_1CreateProfileRequest = (
92749274
input: CreateProfileRequest,
92759275
context: __SerdeContext
92769276
): any => {
9277+
if (input.ClientRequestToken === undefined) {
9278+
input.ClientRequestToken = generateIdempotencyToken();
9279+
}
92779280
const bodyParams: any = {};
92789281
if (input.Address !== undefined) {
92799282
bodyParams["Address"] = input.Address;
92809283
}
9281-
if (input.ClientRequestToken === undefined) {
9282-
input.ClientRequestToken = generateIdempotencyToken();
9283-
}
92849284
if (input.ClientRequestToken !== undefined) {
92859285
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
92869286
}
@@ -9340,10 +9340,10 @@ const serializeAws_json1_1CreateRoomRequest = (
93409340
input: CreateRoomRequest,
93419341
context: __SerdeContext
93429342
): any => {
9343-
const bodyParams: any = {};
93449343
if (input.ClientRequestToken === undefined) {
93459344
input.ClientRequestToken = generateIdempotencyToken();
93469345
}
9346+
const bodyParams: any = {};
93479347
if (input.ClientRequestToken !== undefined) {
93489348
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
93499349
}
@@ -9369,10 +9369,10 @@ const serializeAws_json1_1CreateSkillGroupRequest = (
93699369
input: CreateSkillGroupRequest,
93709370
context: __SerdeContext
93719371
): any => {
9372-
const bodyParams: any = {};
93739372
if (input.ClientRequestToken === undefined) {
93749373
input.ClientRequestToken = generateIdempotencyToken();
93759374
}
9375+
const bodyParams: any = {};
93769376
if (input.ClientRequestToken !== undefined) {
93779377
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
93789378
}
@@ -9389,10 +9389,10 @@ const serializeAws_json1_1CreateUserRequest = (
93899389
input: CreateUserRequest,
93909390
context: __SerdeContext
93919391
): any => {
9392-
const bodyParams: any = {};
93939392
if (input.ClientRequestToken === undefined) {
93949393
input.ClientRequestToken = generateIdempotencyToken();
93959394
}
9395+
const bodyParams: any = {};
93969396
if (input.ClientRequestToken !== undefined) {
93979397
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
93989398
}

clients/client-app-mesh/protocols/Aws_restJson1_1.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ export const serializeAws_restJson1_1CreateMeshCommand = async (
205205
};
206206
let resolvedPath = "/v20190125/meshes";
207207
let body: any;
208-
const bodyParams: any = {};
209208
if (input.clientToken === undefined) {
210209
input.clientToken = generateIdempotencyToken();
211210
}
211+
const bodyParams: any = {};
212212
if (input.clientToken !== undefined) {
213213
bodyParams["clientToken"] = input.clientToken;
214214
}
@@ -272,10 +272,10 @@ export const serializeAws_restJson1_1CreateRouteCommand = async (
272272
);
273273
}
274274
let body: any;
275-
const bodyParams: any = {};
276275
if (input.clientToken === undefined) {
277276
input.clientToken = generateIdempotencyToken();
278277
}
278+
const bodyParams: any = {};
279279
if (input.clientToken !== undefined) {
280280
bodyParams["clientToken"] = input.clientToken;
281281
}
@@ -322,10 +322,10 @@ export const serializeAws_restJson1_1CreateVirtualNodeCommand = async (
322322
throw new Error("No value provided for input HTTP label: meshName.");
323323
}
324324
let body: any;
325-
const bodyParams: any = {};
326325
if (input.clientToken === undefined) {
327326
input.clientToken = generateIdempotencyToken();
328327
}
328+
const bodyParams: any = {};
329329
if (input.clientToken !== undefined) {
330330
bodyParams["clientToken"] = input.clientToken;
331331
}
@@ -375,10 +375,10 @@ export const serializeAws_restJson1_1CreateVirtualRouterCommand = async (
375375
throw new Error("No value provided for input HTTP label: meshName.");
376376
}
377377
let body: any;
378-
const bodyParams: any = {};
379378
if (input.clientToken === undefined) {
380379
input.clientToken = generateIdempotencyToken();
381380
}
381+
const bodyParams: any = {};
382382
if (input.clientToken !== undefined) {
383383
bodyParams["clientToken"] = input.clientToken;
384384
}
@@ -428,10 +428,10 @@ export const serializeAws_restJson1_1CreateVirtualServiceCommand = async (
428428
throw new Error("No value provided for input HTTP label: meshName.");
429429
}
430430
let body: any;
431-
const bodyParams: any = {};
432431
if (input.clientToken === undefined) {
433432
input.clientToken = generateIdempotencyToken();
434433
}
434+
const bodyParams: any = {};
435435
if (input.clientToken !== undefined) {
436436
bodyParams["clientToken"] = input.clientToken;
437437
}
@@ -1252,10 +1252,10 @@ export const serializeAws_restJson1_1UpdateMeshCommand = async (
12521252
throw new Error("No value provided for input HTTP label: meshName.");
12531253
}
12541254
let body: any;
1255-
const bodyParams: any = {};
12561255
if (input.clientToken === undefined) {
12571256
input.clientToken = generateIdempotencyToken();
12581257
}
1258+
const bodyParams: any = {};
12591259
if (input.clientToken !== undefined) {
12601260
bodyParams["clientToken"] = input.clientToken;
12611261
}
@@ -1325,10 +1325,10 @@ export const serializeAws_restJson1_1UpdateRouteCommand = async (
13251325
);
13261326
}
13271327
let body: any;
1328-
const bodyParams: any = {};
13291328
if (input.clientToken === undefined) {
13301329
input.clientToken = generateIdempotencyToken();
13311330
}
1331+
const bodyParams: any = {};
13321332
if (input.clientToken !== undefined) {
13331333
bodyParams["clientToken"] = input.clientToken;
13341334
}
@@ -1384,10 +1384,10 @@ export const serializeAws_restJson1_1UpdateVirtualNodeCommand = async (
13841384
throw new Error("No value provided for input HTTP label: virtualNodeName.");
13851385
}
13861386
let body: any;
1387-
const bodyParams: any = {};
13881387
if (input.clientToken === undefined) {
13891388
input.clientToken = generateIdempotencyToken();
13901389
}
1390+
const bodyParams: any = {};
13911391
if (input.clientToken !== undefined) {
13921392
bodyParams["clientToken"] = input.clientToken;
13931393
}
@@ -1448,10 +1448,10 @@ export const serializeAws_restJson1_1UpdateVirtualRouterCommand = async (
14481448
);
14491449
}
14501450
let body: any;
1451-
const bodyParams: any = {};
14521451
if (input.clientToken === undefined) {
14531452
input.clientToken = generateIdempotencyToken();
14541453
}
1454+
const bodyParams: any = {};
14551455
if (input.clientToken !== undefined) {
14561456
bodyParams["clientToken"] = input.clientToken;
14571457
}
@@ -1512,10 +1512,10 @@ export const serializeAws_restJson1_1UpdateVirtualServiceCommand = async (
15121512
);
15131513
}
15141514
let body: any;
1515-
const bodyParams: any = {};
15161515
if (input.clientToken === undefined) {
15171516
input.clientToken = generateIdempotencyToken();
15181517
}
1518+
const bodyParams: any = {};
15191519
if (input.clientToken !== undefined) {
15201520
bodyParams["clientToken"] = input.clientToken;
15211521
}

clients/client-application-discovery-service/protocols/Aws_json1_1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4148,10 +4148,10 @@ const serializeAws_json1_1StartImportTaskRequest = (
41484148
input: StartImportTaskRequest,
41494149
context: __SerdeContext
41504150
): any => {
4151-
const bodyParams: any = {};
41524151
if (input.clientRequestToken === undefined) {
41534152
input.clientRequestToken = generateIdempotencyToken();
41544153
}
4154+
const bodyParams: any = {};
41554155
if (input.clientRequestToken !== undefined) {
41564156
bodyParams["clientRequestToken"] = input.clientRequestToken;
41574157
}

clients/client-athena/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,10 +1944,10 @@ const serializeAws_json1_1CreateNamedQueryInput = (
19441944
input: CreateNamedQueryInput,
19451945
context: __SerdeContext
19461946
): any => {
1947-
const bodyParams: any = {};
19481947
if (input.ClientRequestToken === undefined) {
19491948
input.ClientRequestToken = generateIdempotencyToken();
19501949
}
1950+
const bodyParams: any = {};
19511951
if (input.ClientRequestToken !== undefined) {
19521952
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
19531953
}
@@ -1996,10 +1996,10 @@ const serializeAws_json1_1DeleteNamedQueryInput = (
19961996
input: DeleteNamedQueryInput,
19971997
context: __SerdeContext
19981998
): any => {
1999-
const bodyParams: any = {};
20001999
if (input.NamedQueryId === undefined) {
20012000
input.NamedQueryId = generateIdempotencyToken();
20022001
}
2002+
const bodyParams: any = {};
20032003
if (input.NamedQueryId !== undefined) {
20042004
bodyParams["NamedQueryId"] = input.NamedQueryId;
20052005
}
@@ -2231,10 +2231,10 @@ const serializeAws_json1_1StartQueryExecutionInput = (
22312231
input: StartQueryExecutionInput,
22322232
context: __SerdeContext
22332233
): any => {
2234-
const bodyParams: any = {};
22352234
if (input.ClientRequestToken === undefined) {
22362235
input.ClientRequestToken = generateIdempotencyToken();
22372236
}
2237+
const bodyParams: any = {};
22382238
if (input.ClientRequestToken !== undefined) {
22392239
bodyParams["ClientRequestToken"] = input.ClientRequestToken;
22402240
}
@@ -2265,10 +2265,10 @@ const serializeAws_json1_1StopQueryExecutionInput = (
22652265
input: StopQueryExecutionInput,
22662266
context: __SerdeContext
22672267
): any => {
2268-
const bodyParams: any = {};
22692268
if (input.QueryExecutionId === undefined) {
22702269
input.QueryExecutionId = generateIdempotencyToken();
22712270
}
2271+
const bodyParams: any = {};
22722272
if (input.QueryExecutionId !== undefined) {
22732273
bodyParams["QueryExecutionId"] = input.QueryExecutionId;
22742274
}

0 commit comments

Comments
 (0)