@aws-sdk/client-secrets-manager 3.183.0 → 3.185.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist-cjs/protocols/Aws_json1_1.js +2 -2
  3. package/dist-es/SecretsManager.js +97 -90
  4. package/dist-es/SecretsManagerClient.js +28 -22
  5. package/dist-es/commands/CancelRotateSecretCommand.js +28 -21
  6. package/dist-es/commands/CreateSecretCommand.js +28 -21
  7. package/dist-es/commands/DeleteResourcePolicyCommand.js +28 -21
  8. package/dist-es/commands/DeleteSecretCommand.js +28 -21
  9. package/dist-es/commands/DescribeSecretCommand.js +28 -21
  10. package/dist-es/commands/GetRandomPasswordCommand.js +28 -21
  11. package/dist-es/commands/GetResourcePolicyCommand.js +28 -21
  12. package/dist-es/commands/GetSecretValueCommand.js +28 -21
  13. package/dist-es/commands/ListSecretVersionIdsCommand.js +28 -21
  14. package/dist-es/commands/ListSecretsCommand.js +28 -21
  15. package/dist-es/commands/PutResourcePolicyCommand.js +28 -21
  16. package/dist-es/commands/PutSecretValueCommand.js +28 -21
  17. package/dist-es/commands/RemoveRegionsFromReplicationCommand.js +28 -21
  18. package/dist-es/commands/ReplicateSecretToRegionsCommand.js +28 -21
  19. package/dist-es/commands/RestoreSecretCommand.js +28 -21
  20. package/dist-es/commands/RotateSecretCommand.js +28 -21
  21. package/dist-es/commands/StopReplicationToReplicaCommand.js +28 -21
  22. package/dist-es/commands/TagResourceCommand.js +29 -22
  23. package/dist-es/commands/UntagResourceCommand.js +29 -22
  24. package/dist-es/commands/UpdateSecretCommand.js +28 -21
  25. package/dist-es/commands/UpdateSecretVersionStageCommand.js +28 -21
  26. package/dist-es/commands/ValidateResourcePolicyCommand.js +28 -21
  27. package/dist-es/endpoints.js +8 -8
  28. package/dist-es/models/SecretsManagerServiceException.js +10 -5
  29. package/dist-es/models/models_0.js +195 -303
  30. package/dist-es/pagination/ListSecretVersionIdsPaginator.js +68 -25
  31. package/dist-es/pagination/ListSecretsPaginator.js +68 -25
  32. package/dist-es/protocols/Aws_json1_1.js +2035 -1584
  33. package/dist-es/runtimeConfig.browser.js +12 -26
  34. package/dist-es/runtimeConfig.js +12 -30
  35. package/dist-es/runtimeConfig.native.js +5 -8
  36. package/dist-es/runtimeConfig.shared.js +11 -8
  37. package/package.json +5 -5
@@ -1,1541 +1,1970 @@
1
+ import { __assign, __awaiter, __generator, __read } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { v4 as generateIdempotencyToken } from "uuid";
4
5
  import { DecryptionFailure, EncryptionFailure, InternalServiceError, InvalidNextTokenException, InvalidParameterException, InvalidRequestException, LimitExceededException, MalformedPolicyDocumentException, PreconditionNotMetException, PublicPolicyException, ResourceExistsException, ResourceNotFoundException, } from "../models/models_0";
5
6
  import { SecretsManagerServiceException as __BaseException } from "../models/SecretsManagerServiceException";
6
- export const serializeAws_json1_1CancelRotateSecretCommand = async (input, context) => {
7
- const headers = {
8
- "content-type": "application/x-amz-json-1.1",
9
- "x-amz-target": "secretsmanager.CancelRotateSecret",
10
- };
11
- let body;
12
- body = JSON.stringify(serializeAws_json1_1CancelRotateSecretRequest(input, context));
13
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
- };
15
- export const serializeAws_json1_1CreateSecretCommand = async (input, context) => {
16
- const headers = {
17
- "content-type": "application/x-amz-json-1.1",
18
- "x-amz-target": "secretsmanager.CreateSecret",
19
- };
20
- let body;
21
- body = JSON.stringify(serializeAws_json1_1CreateSecretRequest(input, context));
22
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
23
- };
24
- export const serializeAws_json1_1DeleteResourcePolicyCommand = async (input, context) => {
25
- const headers = {
26
- "content-type": "application/x-amz-json-1.1",
27
- "x-amz-target": "secretsmanager.DeleteResourcePolicy",
28
- };
29
- let body;
30
- body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyRequest(input, context));
31
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
32
- };
33
- export const serializeAws_json1_1DeleteSecretCommand = async (input, context) => {
34
- const headers = {
35
- "content-type": "application/x-amz-json-1.1",
36
- "x-amz-target": "secretsmanager.DeleteSecret",
37
- };
38
- let body;
39
- body = JSON.stringify(serializeAws_json1_1DeleteSecretRequest(input, context));
40
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
- };
42
- export const serializeAws_json1_1DescribeSecretCommand = async (input, context) => {
43
- const headers = {
44
- "content-type": "application/x-amz-json-1.1",
45
- "x-amz-target": "secretsmanager.DescribeSecret",
46
- };
47
- let body;
48
- body = JSON.stringify(serializeAws_json1_1DescribeSecretRequest(input, context));
49
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
50
- };
51
- export const serializeAws_json1_1GetRandomPasswordCommand = async (input, context) => {
52
- const headers = {
53
- "content-type": "application/x-amz-json-1.1",
54
- "x-amz-target": "secretsmanager.GetRandomPassword",
55
- };
56
- let body;
57
- body = JSON.stringify(serializeAws_json1_1GetRandomPasswordRequest(input, context));
58
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
59
- };
60
- export const serializeAws_json1_1GetResourcePolicyCommand = async (input, context) => {
61
- const headers = {
62
- "content-type": "application/x-amz-json-1.1",
63
- "x-amz-target": "secretsmanager.GetResourcePolicy",
64
- };
65
- let body;
66
- body = JSON.stringify(serializeAws_json1_1GetResourcePolicyRequest(input, context));
67
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
68
- };
69
- export const serializeAws_json1_1GetSecretValueCommand = async (input, context) => {
70
- const headers = {
71
- "content-type": "application/x-amz-json-1.1",
72
- "x-amz-target": "secretsmanager.GetSecretValue",
73
- };
74
- let body;
75
- body = JSON.stringify(serializeAws_json1_1GetSecretValueRequest(input, context));
76
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
- };
78
- export const serializeAws_json1_1ListSecretsCommand = async (input, context) => {
79
- const headers = {
80
- "content-type": "application/x-amz-json-1.1",
81
- "x-amz-target": "secretsmanager.ListSecrets",
82
- };
83
- let body;
84
- body = JSON.stringify(serializeAws_json1_1ListSecretsRequest(input, context));
85
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
86
- };
87
- export const serializeAws_json1_1ListSecretVersionIdsCommand = async (input, context) => {
88
- const headers = {
89
- "content-type": "application/x-amz-json-1.1",
90
- "x-amz-target": "secretsmanager.ListSecretVersionIds",
91
- };
92
- let body;
93
- body = JSON.stringify(serializeAws_json1_1ListSecretVersionIdsRequest(input, context));
94
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
95
- };
96
- export const serializeAws_json1_1PutResourcePolicyCommand = async (input, context) => {
97
- const headers = {
98
- "content-type": "application/x-amz-json-1.1",
99
- "x-amz-target": "secretsmanager.PutResourcePolicy",
100
- };
101
- let body;
102
- body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context));
103
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
104
- };
105
- export const serializeAws_json1_1PutSecretValueCommand = async (input, context) => {
106
- const headers = {
107
- "content-type": "application/x-amz-json-1.1",
108
- "x-amz-target": "secretsmanager.PutSecretValue",
109
- };
110
- let body;
111
- body = JSON.stringify(serializeAws_json1_1PutSecretValueRequest(input, context));
112
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
113
- };
114
- export const serializeAws_json1_1RemoveRegionsFromReplicationCommand = async (input, context) => {
115
- const headers = {
116
- "content-type": "application/x-amz-json-1.1",
117
- "x-amz-target": "secretsmanager.RemoveRegionsFromReplication",
118
- };
119
- let body;
120
- body = JSON.stringify(serializeAws_json1_1RemoveRegionsFromReplicationRequest(input, context));
121
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
122
- };
123
- export const serializeAws_json1_1ReplicateSecretToRegionsCommand = async (input, context) => {
124
- const headers = {
125
- "content-type": "application/x-amz-json-1.1",
126
- "x-amz-target": "secretsmanager.ReplicateSecretToRegions",
127
- };
128
- let body;
129
- body = JSON.stringify(serializeAws_json1_1ReplicateSecretToRegionsRequest(input, context));
130
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
131
- };
132
- export const serializeAws_json1_1RestoreSecretCommand = async (input, context) => {
133
- const headers = {
134
- "content-type": "application/x-amz-json-1.1",
135
- "x-amz-target": "secretsmanager.RestoreSecret",
136
- };
137
- let body;
138
- body = JSON.stringify(serializeAws_json1_1RestoreSecretRequest(input, context));
139
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
140
- };
141
- export const serializeAws_json1_1RotateSecretCommand = async (input, context) => {
142
- const headers = {
143
- "content-type": "application/x-amz-json-1.1",
144
- "x-amz-target": "secretsmanager.RotateSecret",
145
- };
146
- let body;
147
- body = JSON.stringify(serializeAws_json1_1RotateSecretRequest(input, context));
148
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
149
- };
150
- export const serializeAws_json1_1StopReplicationToReplicaCommand = async (input, context) => {
151
- const headers = {
152
- "content-type": "application/x-amz-json-1.1",
153
- "x-amz-target": "secretsmanager.StopReplicationToReplica",
154
- };
155
- let body;
156
- body = JSON.stringify(serializeAws_json1_1StopReplicationToReplicaRequest(input, context));
157
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
158
- };
159
- export const serializeAws_json1_1TagResourceCommand = async (input, context) => {
160
- const headers = {
161
- "content-type": "application/x-amz-json-1.1",
162
- "x-amz-target": "secretsmanager.TagResource",
163
- };
164
- let body;
165
- body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context));
166
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
167
- };
168
- export const serializeAws_json1_1UntagResourceCommand = async (input, context) => {
169
- const headers = {
170
- "content-type": "application/x-amz-json-1.1",
171
- "x-amz-target": "secretsmanager.UntagResource",
172
- };
173
- let body;
174
- body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context));
175
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
176
- };
177
- export const serializeAws_json1_1UpdateSecretCommand = async (input, context) => {
178
- const headers = {
179
- "content-type": "application/x-amz-json-1.1",
180
- "x-amz-target": "secretsmanager.UpdateSecret",
181
- };
182
- let body;
183
- body = JSON.stringify(serializeAws_json1_1UpdateSecretRequest(input, context));
184
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
185
- };
186
- export const serializeAws_json1_1UpdateSecretVersionStageCommand = async (input, context) => {
187
- const headers = {
188
- "content-type": "application/x-amz-json-1.1",
189
- "x-amz-target": "secretsmanager.UpdateSecretVersionStage",
190
- };
191
- let body;
192
- body = JSON.stringify(serializeAws_json1_1UpdateSecretVersionStageRequest(input, context));
193
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
194
- };
195
- export const serializeAws_json1_1ValidateResourcePolicyCommand = async (input, context) => {
196
- const headers = {
197
- "content-type": "application/x-amz-json-1.1",
198
- "x-amz-target": "secretsmanager.ValidateResourcePolicy",
199
- };
200
- let body;
201
- body = JSON.stringify(serializeAws_json1_1ValidateResourcePolicyRequest(input, context));
202
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
203
- };
204
- export const deserializeAws_json1_1CancelRotateSecretCommand = async (output, context) => {
205
- if (output.statusCode >= 300) {
206
- return deserializeAws_json1_1CancelRotateSecretCommandError(output, context);
207
- }
208
- const data = await parseBody(output.body, context);
209
- let contents = {};
210
- contents = deserializeAws_json1_1CancelRotateSecretResponse(data, context);
211
- const response = {
212
- $metadata: deserializeMetadata(output),
213
- ...contents,
214
- };
215
- return Promise.resolve(response);
216
- };
217
- const deserializeAws_json1_1CancelRotateSecretCommandError = async (output, context) => {
218
- const parsedOutput = {
219
- ...output,
220
- body: await parseErrorBody(output.body, context),
221
- };
222
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
223
- switch (errorCode) {
224
- case "InternalServiceError":
225
- case "com.amazonaws.secretsmanager#InternalServiceError":
226
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
227
- case "InvalidParameterException":
228
- case "com.amazonaws.secretsmanager#InvalidParameterException":
229
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
230
- case "InvalidRequestException":
231
- case "com.amazonaws.secretsmanager#InvalidRequestException":
232
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
233
- case "ResourceNotFoundException":
234
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
235
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
236
- default:
237
- const parsedBody = parsedOutput.body;
238
- throwDefaultError({
239
- output,
240
- parsedBody,
241
- exceptionCtor: __BaseException,
242
- errorCode,
243
- });
244
- }
245
- };
246
- export const deserializeAws_json1_1CreateSecretCommand = async (output, context) => {
247
- if (output.statusCode >= 300) {
248
- return deserializeAws_json1_1CreateSecretCommandError(output, context);
249
- }
250
- const data = await parseBody(output.body, context);
251
- let contents = {};
252
- contents = deserializeAws_json1_1CreateSecretResponse(data, context);
253
- const response = {
254
- $metadata: deserializeMetadata(output),
255
- ...contents,
256
- };
257
- return Promise.resolve(response);
258
- };
259
- const deserializeAws_json1_1CreateSecretCommandError = async (output, context) => {
260
- const parsedOutput = {
261
- ...output,
262
- body: await parseErrorBody(output.body, context),
263
- };
264
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
265
- switch (errorCode) {
266
- case "DecryptionFailure":
267
- case "com.amazonaws.secretsmanager#DecryptionFailure":
268
- throw await deserializeAws_json1_1DecryptionFailureResponse(parsedOutput, context);
269
- case "EncryptionFailure":
270
- case "com.amazonaws.secretsmanager#EncryptionFailure":
271
- throw await deserializeAws_json1_1EncryptionFailureResponse(parsedOutput, context);
272
- case "InternalServiceError":
273
- case "com.amazonaws.secretsmanager#InternalServiceError":
274
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
275
- case "InvalidParameterException":
276
- case "com.amazonaws.secretsmanager#InvalidParameterException":
277
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
278
- case "InvalidRequestException":
279
- case "com.amazonaws.secretsmanager#InvalidRequestException":
280
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
281
- case "LimitExceededException":
282
- case "com.amazonaws.secretsmanager#LimitExceededException":
283
- throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
284
- case "MalformedPolicyDocumentException":
285
- case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException":
286
- throw await deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse(parsedOutput, context);
287
- case "PreconditionNotMetException":
288
- case "com.amazonaws.secretsmanager#PreconditionNotMetException":
289
- throw await deserializeAws_json1_1PreconditionNotMetExceptionResponse(parsedOutput, context);
290
- case "ResourceExistsException":
291
- case "com.amazonaws.secretsmanager#ResourceExistsException":
292
- throw await deserializeAws_json1_1ResourceExistsExceptionResponse(parsedOutput, context);
293
- case "ResourceNotFoundException":
294
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
295
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
296
- default:
297
- const parsedBody = parsedOutput.body;
298
- throwDefaultError({
299
- output,
300
- parsedBody,
301
- exceptionCtor: __BaseException,
302
- errorCode,
303
- });
304
- }
305
- };
306
- export const deserializeAws_json1_1DeleteResourcePolicyCommand = async (output, context) => {
307
- if (output.statusCode >= 300) {
308
- return deserializeAws_json1_1DeleteResourcePolicyCommandError(output, context);
309
- }
310
- const data = await parseBody(output.body, context);
311
- let contents = {};
312
- contents = deserializeAws_json1_1DeleteResourcePolicyResponse(data, context);
313
- const response = {
314
- $metadata: deserializeMetadata(output),
315
- ...contents,
316
- };
317
- return Promise.resolve(response);
318
- };
319
- const deserializeAws_json1_1DeleteResourcePolicyCommandError = async (output, context) => {
320
- const parsedOutput = {
321
- ...output,
322
- body: await parseErrorBody(output.body, context),
323
- };
324
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
325
- switch (errorCode) {
326
- case "InternalServiceError":
327
- case "com.amazonaws.secretsmanager#InternalServiceError":
328
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
329
- case "InvalidParameterException":
330
- case "com.amazonaws.secretsmanager#InvalidParameterException":
331
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
332
- case "InvalidRequestException":
333
- case "com.amazonaws.secretsmanager#InvalidRequestException":
334
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
335
- case "ResourceNotFoundException":
336
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
337
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
338
- default:
339
- const parsedBody = parsedOutput.body;
340
- throwDefaultError({
341
- output,
342
- parsedBody,
343
- exceptionCtor: __BaseException,
344
- errorCode,
345
- });
346
- }
347
- };
348
- export const deserializeAws_json1_1DeleteSecretCommand = async (output, context) => {
349
- if (output.statusCode >= 300) {
350
- return deserializeAws_json1_1DeleteSecretCommandError(output, context);
351
- }
352
- const data = await parseBody(output.body, context);
353
- let contents = {};
354
- contents = deserializeAws_json1_1DeleteSecretResponse(data, context);
355
- const response = {
356
- $metadata: deserializeMetadata(output),
357
- ...contents,
358
- };
359
- return Promise.resolve(response);
360
- };
361
- const deserializeAws_json1_1DeleteSecretCommandError = async (output, context) => {
362
- const parsedOutput = {
363
- ...output,
364
- body: await parseErrorBody(output.body, context),
365
- };
366
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
367
- switch (errorCode) {
368
- case "InternalServiceError":
369
- case "com.amazonaws.secretsmanager#InternalServiceError":
370
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
371
- case "InvalidParameterException":
372
- case "com.amazonaws.secretsmanager#InvalidParameterException":
373
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
374
- case "InvalidRequestException":
375
- case "com.amazonaws.secretsmanager#InvalidRequestException":
376
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
377
- case "ResourceNotFoundException":
378
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
379
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
380
- default:
381
- const parsedBody = parsedOutput.body;
382
- throwDefaultError({
383
- output,
384
- parsedBody,
385
- exceptionCtor: __BaseException,
386
- errorCode,
387
- });
388
- }
389
- };
390
- export const deserializeAws_json1_1DescribeSecretCommand = async (output, context) => {
391
- if (output.statusCode >= 300) {
392
- return deserializeAws_json1_1DescribeSecretCommandError(output, context);
393
- }
394
- const data = await parseBody(output.body, context);
395
- let contents = {};
396
- contents = deserializeAws_json1_1DescribeSecretResponse(data, context);
397
- const response = {
398
- $metadata: deserializeMetadata(output),
399
- ...contents,
400
- };
401
- return Promise.resolve(response);
402
- };
403
- const deserializeAws_json1_1DescribeSecretCommandError = async (output, context) => {
404
- const parsedOutput = {
405
- ...output,
406
- body: await parseErrorBody(output.body, context),
407
- };
408
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
409
- switch (errorCode) {
410
- case "InternalServiceError":
411
- case "com.amazonaws.secretsmanager#InternalServiceError":
412
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
413
- case "InvalidParameterException":
414
- case "com.amazonaws.secretsmanager#InvalidParameterException":
415
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
416
- case "ResourceNotFoundException":
417
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
418
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
419
- default:
420
- const parsedBody = parsedOutput.body;
421
- throwDefaultError({
422
- output,
423
- parsedBody,
424
- exceptionCtor: __BaseException,
425
- errorCode,
426
- });
427
- }
428
- };
429
- export const deserializeAws_json1_1GetRandomPasswordCommand = async (output, context) => {
430
- if (output.statusCode >= 300) {
431
- return deserializeAws_json1_1GetRandomPasswordCommandError(output, context);
432
- }
433
- const data = await parseBody(output.body, context);
434
- let contents = {};
435
- contents = deserializeAws_json1_1GetRandomPasswordResponse(data, context);
436
- const response = {
437
- $metadata: deserializeMetadata(output),
438
- ...contents,
439
- };
440
- return Promise.resolve(response);
441
- };
442
- const deserializeAws_json1_1GetRandomPasswordCommandError = async (output, context) => {
443
- const parsedOutput = {
444
- ...output,
445
- body: await parseErrorBody(output.body, context),
446
- };
447
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
448
- switch (errorCode) {
449
- case "InternalServiceError":
450
- case "com.amazonaws.secretsmanager#InternalServiceError":
451
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
452
- case "InvalidParameterException":
453
- case "com.amazonaws.secretsmanager#InvalidParameterException":
454
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
455
- case "InvalidRequestException":
456
- case "com.amazonaws.secretsmanager#InvalidRequestException":
457
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
458
- default:
459
- const parsedBody = parsedOutput.body;
460
- throwDefaultError({
461
- output,
462
- parsedBody,
463
- exceptionCtor: __BaseException,
464
- errorCode,
465
- });
466
- }
467
- };
468
- export const deserializeAws_json1_1GetResourcePolicyCommand = async (output, context) => {
469
- if (output.statusCode >= 300) {
470
- return deserializeAws_json1_1GetResourcePolicyCommandError(output, context);
471
- }
472
- const data = await parseBody(output.body, context);
473
- let contents = {};
474
- contents = deserializeAws_json1_1GetResourcePolicyResponse(data, context);
475
- const response = {
476
- $metadata: deserializeMetadata(output),
477
- ...contents,
478
- };
479
- return Promise.resolve(response);
480
- };
481
- const deserializeAws_json1_1GetResourcePolicyCommandError = async (output, context) => {
482
- const parsedOutput = {
483
- ...output,
484
- body: await parseErrorBody(output.body, context),
485
- };
486
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
487
- switch (errorCode) {
488
- case "InternalServiceError":
489
- case "com.amazonaws.secretsmanager#InternalServiceError":
490
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
491
- case "InvalidParameterException":
492
- case "com.amazonaws.secretsmanager#InvalidParameterException":
493
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
494
- case "InvalidRequestException":
495
- case "com.amazonaws.secretsmanager#InvalidRequestException":
496
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
497
- case "ResourceNotFoundException":
498
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
499
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
500
- default:
501
- const parsedBody = parsedOutput.body;
502
- throwDefaultError({
503
- output,
504
- parsedBody,
505
- exceptionCtor: __BaseException,
506
- errorCode,
507
- });
508
- }
509
- };
510
- export const deserializeAws_json1_1GetSecretValueCommand = async (output, context) => {
511
- if (output.statusCode >= 300) {
512
- return deserializeAws_json1_1GetSecretValueCommandError(output, context);
513
- }
514
- const data = await parseBody(output.body, context);
515
- let contents = {};
516
- contents = deserializeAws_json1_1GetSecretValueResponse(data, context);
517
- const response = {
518
- $metadata: deserializeMetadata(output),
519
- ...contents,
520
- };
521
- return Promise.resolve(response);
522
- };
523
- const deserializeAws_json1_1GetSecretValueCommandError = async (output, context) => {
524
- const parsedOutput = {
525
- ...output,
526
- body: await parseErrorBody(output.body, context),
527
- };
528
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
529
- switch (errorCode) {
530
- case "DecryptionFailure":
531
- case "com.amazonaws.secretsmanager#DecryptionFailure":
532
- throw await deserializeAws_json1_1DecryptionFailureResponse(parsedOutput, context);
533
- case "InternalServiceError":
534
- case "com.amazonaws.secretsmanager#InternalServiceError":
535
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
536
- case "InvalidParameterException":
537
- case "com.amazonaws.secretsmanager#InvalidParameterException":
538
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
539
- case "InvalidRequestException":
540
- case "com.amazonaws.secretsmanager#InvalidRequestException":
541
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
542
- case "ResourceNotFoundException":
543
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
544
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
545
- default:
546
- const parsedBody = parsedOutput.body;
547
- throwDefaultError({
548
- output,
549
- parsedBody,
550
- exceptionCtor: __BaseException,
551
- errorCode,
552
- });
553
- }
554
- };
555
- export const deserializeAws_json1_1ListSecretsCommand = async (output, context) => {
556
- if (output.statusCode >= 300) {
557
- return deserializeAws_json1_1ListSecretsCommandError(output, context);
558
- }
559
- const data = await parseBody(output.body, context);
560
- let contents = {};
561
- contents = deserializeAws_json1_1ListSecretsResponse(data, context);
562
- const response = {
563
- $metadata: deserializeMetadata(output),
564
- ...contents,
565
- };
566
- return Promise.resolve(response);
567
- };
568
- const deserializeAws_json1_1ListSecretsCommandError = async (output, context) => {
569
- const parsedOutput = {
570
- ...output,
571
- body: await parseErrorBody(output.body, context),
572
- };
573
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
574
- switch (errorCode) {
575
- case "InternalServiceError":
576
- case "com.amazonaws.secretsmanager#InternalServiceError":
577
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
578
- case "InvalidNextTokenException":
579
- case "com.amazonaws.secretsmanager#InvalidNextTokenException":
580
- throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
581
- case "InvalidParameterException":
582
- case "com.amazonaws.secretsmanager#InvalidParameterException":
583
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
584
- default:
585
- const parsedBody = parsedOutput.body;
586
- throwDefaultError({
587
- output,
588
- parsedBody,
589
- exceptionCtor: __BaseException,
590
- errorCode,
591
- });
592
- }
593
- };
594
- export const deserializeAws_json1_1ListSecretVersionIdsCommand = async (output, context) => {
595
- if (output.statusCode >= 300) {
596
- return deserializeAws_json1_1ListSecretVersionIdsCommandError(output, context);
597
- }
598
- const data = await parseBody(output.body, context);
599
- let contents = {};
600
- contents = deserializeAws_json1_1ListSecretVersionIdsResponse(data, context);
601
- const response = {
602
- $metadata: deserializeMetadata(output),
603
- ...contents,
604
- };
605
- return Promise.resolve(response);
606
- };
607
- const deserializeAws_json1_1ListSecretVersionIdsCommandError = async (output, context) => {
608
- const parsedOutput = {
609
- ...output,
610
- body: await parseErrorBody(output.body, context),
611
- };
612
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
613
- switch (errorCode) {
614
- case "InternalServiceError":
615
- case "com.amazonaws.secretsmanager#InternalServiceError":
616
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
617
- case "InvalidNextTokenException":
618
- case "com.amazonaws.secretsmanager#InvalidNextTokenException":
619
- throw await deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context);
620
- case "InvalidParameterException":
621
- case "com.amazonaws.secretsmanager#InvalidParameterException":
622
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
623
- case "ResourceNotFoundException":
624
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
625
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
626
- default:
627
- const parsedBody = parsedOutput.body;
628
- throwDefaultError({
629
- output,
630
- parsedBody,
631
- exceptionCtor: __BaseException,
632
- errorCode,
633
- });
634
- }
635
- };
636
- export const deserializeAws_json1_1PutResourcePolicyCommand = async (output, context) => {
637
- if (output.statusCode >= 300) {
638
- return deserializeAws_json1_1PutResourcePolicyCommandError(output, context);
639
- }
640
- const data = await parseBody(output.body, context);
641
- let contents = {};
642
- contents = deserializeAws_json1_1PutResourcePolicyResponse(data, context);
643
- const response = {
644
- $metadata: deserializeMetadata(output),
645
- ...contents,
646
- };
647
- return Promise.resolve(response);
648
- };
649
- const deserializeAws_json1_1PutResourcePolicyCommandError = async (output, context) => {
650
- const parsedOutput = {
651
- ...output,
652
- body: await parseErrorBody(output.body, context),
653
- };
654
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
655
- switch (errorCode) {
656
- case "InternalServiceError":
657
- case "com.amazonaws.secretsmanager#InternalServiceError":
658
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
659
- case "InvalidParameterException":
660
- case "com.amazonaws.secretsmanager#InvalidParameterException":
661
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
662
- case "InvalidRequestException":
663
- case "com.amazonaws.secretsmanager#InvalidRequestException":
664
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
665
- case "MalformedPolicyDocumentException":
666
- case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException":
667
- throw await deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse(parsedOutput, context);
668
- case "PublicPolicyException":
669
- case "com.amazonaws.secretsmanager#PublicPolicyException":
670
- throw await deserializeAws_json1_1PublicPolicyExceptionResponse(parsedOutput, context);
671
- case "ResourceNotFoundException":
672
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
673
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
674
- default:
675
- const parsedBody = parsedOutput.body;
676
- throwDefaultError({
677
- output,
678
- parsedBody,
679
- exceptionCtor: __BaseException,
680
- errorCode,
681
- });
682
- }
683
- };
684
- export const deserializeAws_json1_1PutSecretValueCommand = async (output, context) => {
685
- if (output.statusCode >= 300) {
686
- return deserializeAws_json1_1PutSecretValueCommandError(output, context);
687
- }
688
- const data = await parseBody(output.body, context);
689
- let contents = {};
690
- contents = deserializeAws_json1_1PutSecretValueResponse(data, context);
691
- const response = {
692
- $metadata: deserializeMetadata(output),
693
- ...contents,
694
- };
695
- return Promise.resolve(response);
696
- };
697
- const deserializeAws_json1_1PutSecretValueCommandError = async (output, context) => {
698
- const parsedOutput = {
699
- ...output,
700
- body: await parseErrorBody(output.body, context),
701
- };
702
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
703
- switch (errorCode) {
704
- case "DecryptionFailure":
705
- case "com.amazonaws.secretsmanager#DecryptionFailure":
706
- throw await deserializeAws_json1_1DecryptionFailureResponse(parsedOutput, context);
707
- case "EncryptionFailure":
708
- case "com.amazonaws.secretsmanager#EncryptionFailure":
709
- throw await deserializeAws_json1_1EncryptionFailureResponse(parsedOutput, context);
710
- case "InternalServiceError":
711
- case "com.amazonaws.secretsmanager#InternalServiceError":
712
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
713
- case "InvalidParameterException":
714
- case "com.amazonaws.secretsmanager#InvalidParameterException":
715
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
716
- case "InvalidRequestException":
717
- case "com.amazonaws.secretsmanager#InvalidRequestException":
718
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
719
- case "LimitExceededException":
720
- case "com.amazonaws.secretsmanager#LimitExceededException":
721
- throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
722
- case "ResourceExistsException":
723
- case "com.amazonaws.secretsmanager#ResourceExistsException":
724
- throw await deserializeAws_json1_1ResourceExistsExceptionResponse(parsedOutput, context);
725
- case "ResourceNotFoundException":
726
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
727
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
728
- default:
729
- const parsedBody = parsedOutput.body;
730
- throwDefaultError({
731
- output,
732
- parsedBody,
733
- exceptionCtor: __BaseException,
734
- errorCode,
735
- });
736
- }
737
- };
738
- export const deserializeAws_json1_1RemoveRegionsFromReplicationCommand = async (output, context) => {
739
- if (output.statusCode >= 300) {
740
- return deserializeAws_json1_1RemoveRegionsFromReplicationCommandError(output, context);
741
- }
742
- const data = await parseBody(output.body, context);
743
- let contents = {};
744
- contents = deserializeAws_json1_1RemoveRegionsFromReplicationResponse(data, context);
745
- const response = {
746
- $metadata: deserializeMetadata(output),
747
- ...contents,
748
- };
749
- return Promise.resolve(response);
750
- };
751
- const deserializeAws_json1_1RemoveRegionsFromReplicationCommandError = async (output, context) => {
752
- const parsedOutput = {
753
- ...output,
754
- body: await parseErrorBody(output.body, context),
755
- };
756
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
757
- switch (errorCode) {
758
- case "InternalServiceError":
759
- case "com.amazonaws.secretsmanager#InternalServiceError":
760
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
761
- case "InvalidParameterException":
762
- case "com.amazonaws.secretsmanager#InvalidParameterException":
763
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
764
- case "InvalidRequestException":
765
- case "com.amazonaws.secretsmanager#InvalidRequestException":
766
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
767
- case "ResourceNotFoundException":
768
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
769
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
770
- default:
771
- const parsedBody = parsedOutput.body;
772
- throwDefaultError({
773
- output,
774
- parsedBody,
775
- exceptionCtor: __BaseException,
776
- errorCode,
777
- });
778
- }
779
- };
780
- export const deserializeAws_json1_1ReplicateSecretToRegionsCommand = async (output, context) => {
781
- if (output.statusCode >= 300) {
782
- return deserializeAws_json1_1ReplicateSecretToRegionsCommandError(output, context);
783
- }
784
- const data = await parseBody(output.body, context);
785
- let contents = {};
786
- contents = deserializeAws_json1_1ReplicateSecretToRegionsResponse(data, context);
787
- const response = {
788
- $metadata: deserializeMetadata(output),
789
- ...contents,
790
- };
791
- return Promise.resolve(response);
792
- };
793
- const deserializeAws_json1_1ReplicateSecretToRegionsCommandError = async (output, context) => {
794
- const parsedOutput = {
795
- ...output,
796
- body: await parseErrorBody(output.body, context),
797
- };
798
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
799
- switch (errorCode) {
800
- case "InternalServiceError":
801
- case "com.amazonaws.secretsmanager#InternalServiceError":
802
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
803
- case "InvalidParameterException":
804
- case "com.amazonaws.secretsmanager#InvalidParameterException":
805
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
806
- case "InvalidRequestException":
807
- case "com.amazonaws.secretsmanager#InvalidRequestException":
808
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
809
- case "ResourceNotFoundException":
810
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
811
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
812
- default:
813
- const parsedBody = parsedOutput.body;
814
- throwDefaultError({
815
- output,
816
- parsedBody,
817
- exceptionCtor: __BaseException,
818
- errorCode,
819
- });
820
- }
821
- };
822
- export const deserializeAws_json1_1RestoreSecretCommand = async (output, context) => {
823
- if (output.statusCode >= 300) {
824
- return deserializeAws_json1_1RestoreSecretCommandError(output, context);
825
- }
826
- const data = await parseBody(output.body, context);
827
- let contents = {};
828
- contents = deserializeAws_json1_1RestoreSecretResponse(data, context);
829
- const response = {
830
- $metadata: deserializeMetadata(output),
831
- ...contents,
832
- };
833
- return Promise.resolve(response);
834
- };
835
- const deserializeAws_json1_1RestoreSecretCommandError = async (output, context) => {
836
- const parsedOutput = {
837
- ...output,
838
- body: await parseErrorBody(output.body, context),
839
- };
840
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
841
- switch (errorCode) {
842
- case "InternalServiceError":
843
- case "com.amazonaws.secretsmanager#InternalServiceError":
844
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
845
- case "InvalidParameterException":
846
- case "com.amazonaws.secretsmanager#InvalidParameterException":
847
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
848
- case "InvalidRequestException":
849
- case "com.amazonaws.secretsmanager#InvalidRequestException":
850
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
851
- case "ResourceNotFoundException":
852
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
853
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
854
- default:
855
- const parsedBody = parsedOutput.body;
856
- throwDefaultError({
857
- output,
858
- parsedBody,
859
- exceptionCtor: __BaseException,
860
- errorCode,
861
- });
862
- }
863
- };
864
- export const deserializeAws_json1_1RotateSecretCommand = async (output, context) => {
865
- if (output.statusCode >= 300) {
866
- return deserializeAws_json1_1RotateSecretCommandError(output, context);
867
- }
868
- const data = await parseBody(output.body, context);
869
- let contents = {};
870
- contents = deserializeAws_json1_1RotateSecretResponse(data, context);
871
- const response = {
872
- $metadata: deserializeMetadata(output),
873
- ...contents,
874
- };
875
- return Promise.resolve(response);
876
- };
877
- const deserializeAws_json1_1RotateSecretCommandError = async (output, context) => {
878
- const parsedOutput = {
879
- ...output,
880
- body: await parseErrorBody(output.body, context),
881
- };
882
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
883
- switch (errorCode) {
884
- case "InternalServiceError":
885
- case "com.amazonaws.secretsmanager#InternalServiceError":
886
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
887
- case "InvalidParameterException":
888
- case "com.amazonaws.secretsmanager#InvalidParameterException":
889
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
890
- case "InvalidRequestException":
891
- case "com.amazonaws.secretsmanager#InvalidRequestException":
892
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
893
- case "ResourceNotFoundException":
894
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
895
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
896
- default:
897
- const parsedBody = parsedOutput.body;
898
- throwDefaultError({
899
- output,
900
- parsedBody,
901
- exceptionCtor: __BaseException,
902
- errorCode,
903
- });
904
- }
905
- };
906
- export const deserializeAws_json1_1StopReplicationToReplicaCommand = async (output, context) => {
907
- if (output.statusCode >= 300) {
908
- return deserializeAws_json1_1StopReplicationToReplicaCommandError(output, context);
909
- }
910
- const data = await parseBody(output.body, context);
911
- let contents = {};
912
- contents = deserializeAws_json1_1StopReplicationToReplicaResponse(data, context);
913
- const response = {
914
- $metadata: deserializeMetadata(output),
915
- ...contents,
916
- };
917
- return Promise.resolve(response);
918
- };
919
- const deserializeAws_json1_1StopReplicationToReplicaCommandError = async (output, context) => {
920
- const parsedOutput = {
921
- ...output,
922
- body: await parseErrorBody(output.body, context),
923
- };
924
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
925
- switch (errorCode) {
926
- case "InternalServiceError":
927
- case "com.amazonaws.secretsmanager#InternalServiceError":
928
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
929
- case "InvalidParameterException":
930
- case "com.amazonaws.secretsmanager#InvalidParameterException":
931
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
932
- case "InvalidRequestException":
933
- case "com.amazonaws.secretsmanager#InvalidRequestException":
934
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
935
- case "ResourceNotFoundException":
936
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
937
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
938
- default:
939
- const parsedBody = parsedOutput.body;
940
- throwDefaultError({
941
- output,
942
- parsedBody,
943
- exceptionCtor: __BaseException,
944
- errorCode,
945
- });
946
- }
947
- };
948
- export const deserializeAws_json1_1TagResourceCommand = async (output, context) => {
949
- if (output.statusCode >= 300) {
950
- return deserializeAws_json1_1TagResourceCommandError(output, context);
951
- }
952
- await collectBody(output.body, context);
953
- const response = {
954
- $metadata: deserializeMetadata(output),
955
- };
956
- return Promise.resolve(response);
957
- };
958
- const deserializeAws_json1_1TagResourceCommandError = async (output, context) => {
959
- const parsedOutput = {
960
- ...output,
961
- body: await parseErrorBody(output.body, context),
962
- };
963
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
964
- switch (errorCode) {
965
- case "InternalServiceError":
966
- case "com.amazonaws.secretsmanager#InternalServiceError":
967
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
968
- case "InvalidParameterException":
969
- case "com.amazonaws.secretsmanager#InvalidParameterException":
970
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
971
- case "InvalidRequestException":
972
- case "com.amazonaws.secretsmanager#InvalidRequestException":
973
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
974
- case "ResourceNotFoundException":
975
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
976
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
977
- default:
978
- const parsedBody = parsedOutput.body;
979
- throwDefaultError({
980
- output,
981
- parsedBody,
982
- exceptionCtor: __BaseException,
983
- errorCode,
984
- });
985
- }
986
- };
987
- export const deserializeAws_json1_1UntagResourceCommand = async (output, context) => {
988
- if (output.statusCode >= 300) {
989
- return deserializeAws_json1_1UntagResourceCommandError(output, context);
990
- }
991
- await collectBody(output.body, context);
992
- const response = {
993
- $metadata: deserializeMetadata(output),
994
- };
995
- return Promise.resolve(response);
996
- };
997
- const deserializeAws_json1_1UntagResourceCommandError = async (output, context) => {
998
- const parsedOutput = {
999
- ...output,
1000
- body: await parseErrorBody(output.body, context),
1001
- };
1002
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1003
- switch (errorCode) {
1004
- case "InternalServiceError":
1005
- case "com.amazonaws.secretsmanager#InternalServiceError":
1006
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
1007
- case "InvalidParameterException":
1008
- case "com.amazonaws.secretsmanager#InvalidParameterException":
1009
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
1010
- case "InvalidRequestException":
1011
- case "com.amazonaws.secretsmanager#InvalidRequestException":
1012
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
1013
- case "ResourceNotFoundException":
1014
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
1015
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1016
- default:
1017
- const parsedBody = parsedOutput.body;
1018
- throwDefaultError({
1019
- output,
1020
- parsedBody,
1021
- exceptionCtor: __BaseException,
1022
- errorCode,
1023
- });
1024
- }
1025
- };
1026
- export const deserializeAws_json1_1UpdateSecretCommand = async (output, context) => {
1027
- if (output.statusCode >= 300) {
1028
- return deserializeAws_json1_1UpdateSecretCommandError(output, context);
1029
- }
1030
- const data = await parseBody(output.body, context);
1031
- let contents = {};
1032
- contents = deserializeAws_json1_1UpdateSecretResponse(data, context);
1033
- const response = {
1034
- $metadata: deserializeMetadata(output),
1035
- ...contents,
1036
- };
1037
- return Promise.resolve(response);
1038
- };
1039
- const deserializeAws_json1_1UpdateSecretCommandError = async (output, context) => {
1040
- const parsedOutput = {
1041
- ...output,
1042
- body: await parseErrorBody(output.body, context),
1043
- };
1044
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1045
- switch (errorCode) {
1046
- case "DecryptionFailure":
1047
- case "com.amazonaws.secretsmanager#DecryptionFailure":
1048
- throw await deserializeAws_json1_1DecryptionFailureResponse(parsedOutput, context);
1049
- case "EncryptionFailure":
1050
- case "com.amazonaws.secretsmanager#EncryptionFailure":
1051
- throw await deserializeAws_json1_1EncryptionFailureResponse(parsedOutput, context);
1052
- case "InternalServiceError":
1053
- case "com.amazonaws.secretsmanager#InternalServiceError":
1054
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
1055
- case "InvalidParameterException":
1056
- case "com.amazonaws.secretsmanager#InvalidParameterException":
1057
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
1058
- case "InvalidRequestException":
1059
- case "com.amazonaws.secretsmanager#InvalidRequestException":
1060
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
1061
- case "LimitExceededException":
1062
- case "com.amazonaws.secretsmanager#LimitExceededException":
1063
- throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1064
- case "MalformedPolicyDocumentException":
1065
- case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException":
1066
- throw await deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse(parsedOutput, context);
1067
- case "PreconditionNotMetException":
1068
- case "com.amazonaws.secretsmanager#PreconditionNotMetException":
1069
- throw await deserializeAws_json1_1PreconditionNotMetExceptionResponse(parsedOutput, context);
1070
- case "ResourceExistsException":
1071
- case "com.amazonaws.secretsmanager#ResourceExistsException":
1072
- throw await deserializeAws_json1_1ResourceExistsExceptionResponse(parsedOutput, context);
1073
- case "ResourceNotFoundException":
1074
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
1075
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1076
- default:
1077
- const parsedBody = parsedOutput.body;
1078
- throwDefaultError({
1079
- output,
1080
- parsedBody,
1081
- exceptionCtor: __BaseException,
1082
- errorCode,
1083
- });
1084
- }
1085
- };
1086
- export const deserializeAws_json1_1UpdateSecretVersionStageCommand = async (output, context) => {
1087
- if (output.statusCode >= 300) {
1088
- return deserializeAws_json1_1UpdateSecretVersionStageCommandError(output, context);
1089
- }
1090
- const data = await parseBody(output.body, context);
1091
- let contents = {};
1092
- contents = deserializeAws_json1_1UpdateSecretVersionStageResponse(data, context);
1093
- const response = {
1094
- $metadata: deserializeMetadata(output),
1095
- ...contents,
1096
- };
1097
- return Promise.resolve(response);
1098
- };
1099
- const deserializeAws_json1_1UpdateSecretVersionStageCommandError = async (output, context) => {
1100
- const parsedOutput = {
1101
- ...output,
1102
- body: await parseErrorBody(output.body, context),
1103
- };
1104
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1105
- switch (errorCode) {
1106
- case "InternalServiceError":
1107
- case "com.amazonaws.secretsmanager#InternalServiceError":
1108
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
1109
- case "InvalidParameterException":
1110
- case "com.amazonaws.secretsmanager#InvalidParameterException":
1111
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
1112
- case "InvalidRequestException":
1113
- case "com.amazonaws.secretsmanager#InvalidRequestException":
1114
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
1115
- case "LimitExceededException":
1116
- case "com.amazonaws.secretsmanager#LimitExceededException":
1117
- throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1118
- case "ResourceNotFoundException":
1119
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
1120
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1121
- default:
1122
- const parsedBody = parsedOutput.body;
1123
- throwDefaultError({
1124
- output,
1125
- parsedBody,
1126
- exceptionCtor: __BaseException,
1127
- errorCode,
1128
- });
1129
- }
1130
- };
1131
- export const deserializeAws_json1_1ValidateResourcePolicyCommand = async (output, context) => {
1132
- if (output.statusCode >= 300) {
1133
- return deserializeAws_json1_1ValidateResourcePolicyCommandError(output, context);
1134
- }
1135
- const data = await parseBody(output.body, context);
1136
- let contents = {};
1137
- contents = deserializeAws_json1_1ValidateResourcePolicyResponse(data, context);
1138
- const response = {
1139
- $metadata: deserializeMetadata(output),
1140
- ...contents,
1141
- };
1142
- return Promise.resolve(response);
1143
- };
1144
- const deserializeAws_json1_1ValidateResourcePolicyCommandError = async (output, context) => {
1145
- const parsedOutput = {
1146
- ...output,
1147
- body: await parseErrorBody(output.body, context),
1148
- };
1149
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1150
- switch (errorCode) {
1151
- case "InternalServiceError":
1152
- case "com.amazonaws.secretsmanager#InternalServiceError":
1153
- throw await deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context);
1154
- case "InvalidParameterException":
1155
- case "com.amazonaws.secretsmanager#InvalidParameterException":
1156
- throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context);
1157
- case "InvalidRequestException":
1158
- case "com.amazonaws.secretsmanager#InvalidRequestException":
1159
- throw await deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context);
1160
- case "MalformedPolicyDocumentException":
1161
- case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException":
1162
- throw await deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse(parsedOutput, context);
1163
- case "ResourceNotFoundException":
1164
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
1165
- throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1166
- default:
1167
- const parsedBody = parsedOutput.body;
1168
- throwDefaultError({
1169
- output,
1170
- parsedBody,
1171
- exceptionCtor: __BaseException,
1172
- errorCode,
1173
- });
1174
- }
1175
- };
1176
- const deserializeAws_json1_1DecryptionFailureResponse = async (parsedOutput, context) => {
1177
- const body = parsedOutput.body;
1178
- const deserialized = deserializeAws_json1_1DecryptionFailure(body, context);
1179
- const exception = new DecryptionFailure({
1180
- $metadata: deserializeMetadata(parsedOutput),
1181
- ...deserialized,
1182
- });
1183
- return __decorateServiceException(exception, body);
1184
- };
1185
- const deserializeAws_json1_1EncryptionFailureResponse = async (parsedOutput, context) => {
1186
- const body = parsedOutput.body;
1187
- const deserialized = deserializeAws_json1_1EncryptionFailure(body, context);
1188
- const exception = new EncryptionFailure({
1189
- $metadata: deserializeMetadata(parsedOutput),
1190
- ...deserialized,
1191
- });
1192
- return __decorateServiceException(exception, body);
1193
- };
1194
- const deserializeAws_json1_1InternalServiceErrorResponse = async (parsedOutput, context) => {
1195
- const body = parsedOutput.body;
1196
- const deserialized = deserializeAws_json1_1InternalServiceError(body, context);
1197
- const exception = new InternalServiceError({
1198
- $metadata: deserializeMetadata(parsedOutput),
1199
- ...deserialized,
1200
- });
1201
- return __decorateServiceException(exception, body);
1202
- };
1203
- const deserializeAws_json1_1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
1204
- const body = parsedOutput.body;
1205
- const deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
1206
- const exception = new InvalidNextTokenException({
1207
- $metadata: deserializeMetadata(parsedOutput),
1208
- ...deserialized,
1209
- });
1210
- return __decorateServiceException(exception, body);
1211
- };
1212
- const deserializeAws_json1_1InvalidParameterExceptionResponse = async (parsedOutput, context) => {
1213
- const body = parsedOutput.body;
1214
- const deserialized = deserializeAws_json1_1InvalidParameterException(body, context);
1215
- const exception = new InvalidParameterException({
1216
- $metadata: deserializeMetadata(parsedOutput),
1217
- ...deserialized,
1218
- });
1219
- return __decorateServiceException(exception, body);
1220
- };
1221
- const deserializeAws_json1_1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
1222
- const body = parsedOutput.body;
1223
- const deserialized = deserializeAws_json1_1InvalidRequestException(body, context);
1224
- const exception = new InvalidRequestException({
1225
- $metadata: deserializeMetadata(parsedOutput),
1226
- ...deserialized,
1227
- });
1228
- return __decorateServiceException(exception, body);
1229
- };
1230
- const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
1231
- const body = parsedOutput.body;
1232
- const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
1233
- const exception = new LimitExceededException({
1234
- $metadata: deserializeMetadata(parsedOutput),
1235
- ...deserialized,
1236
- });
1237
- return __decorateServiceException(exception, body);
1238
- };
1239
- const deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse = async (parsedOutput, context) => {
1240
- const body = parsedOutput.body;
1241
- const deserialized = deserializeAws_json1_1MalformedPolicyDocumentException(body, context);
1242
- const exception = new MalformedPolicyDocumentException({
1243
- $metadata: deserializeMetadata(parsedOutput),
1244
- ...deserialized,
1245
- });
1246
- return __decorateServiceException(exception, body);
1247
- };
1248
- const deserializeAws_json1_1PreconditionNotMetExceptionResponse = async (parsedOutput, context) => {
1249
- const body = parsedOutput.body;
1250
- const deserialized = deserializeAws_json1_1PreconditionNotMetException(body, context);
1251
- const exception = new PreconditionNotMetException({
1252
- $metadata: deserializeMetadata(parsedOutput),
1253
- ...deserialized,
1254
- });
1255
- return __decorateServiceException(exception, body);
1256
- };
1257
- const deserializeAws_json1_1PublicPolicyExceptionResponse = async (parsedOutput, context) => {
1258
- const body = parsedOutput.body;
1259
- const deserialized = deserializeAws_json1_1PublicPolicyException(body, context);
1260
- const exception = new PublicPolicyException({
1261
- $metadata: deserializeMetadata(parsedOutput),
1262
- ...deserialized,
1263
- });
1264
- return __decorateServiceException(exception, body);
1265
- };
1266
- const deserializeAws_json1_1ResourceExistsExceptionResponse = async (parsedOutput, context) => {
1267
- const body = parsedOutput.body;
1268
- const deserialized = deserializeAws_json1_1ResourceExistsException(body, context);
1269
- const exception = new ResourceExistsException({
1270
- $metadata: deserializeMetadata(parsedOutput),
1271
- ...deserialized,
1272
- });
1273
- return __decorateServiceException(exception, body);
1274
- };
1275
- const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1276
- const body = parsedOutput.body;
1277
- const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
1278
- const exception = new ResourceNotFoundException({
1279
- $metadata: deserializeMetadata(parsedOutput),
1280
- ...deserialized,
1281
- });
1282
- return __decorateServiceException(exception, body);
1283
- };
1284
- const serializeAws_json1_1AddReplicaRegionListType = (input, context) => {
7
+ export var serializeAws_json1_1CancelRotateSecretCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
+ var headers, body;
9
+ return __generator(this, function (_a) {
10
+ headers = {
11
+ "content-type": "application/x-amz-json-1.1",
12
+ "x-amz-target": "secretsmanager.CancelRotateSecret",
13
+ };
14
+ body = JSON.stringify(serializeAws_json1_1CancelRotateSecretRequest(input, context));
15
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
16
+ });
17
+ }); };
18
+ export var serializeAws_json1_1CreateSecretCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
19
+ var headers, body;
20
+ return __generator(this, function (_a) {
21
+ headers = {
22
+ "content-type": "application/x-amz-json-1.1",
23
+ "x-amz-target": "secretsmanager.CreateSecret",
24
+ };
25
+ body = JSON.stringify(serializeAws_json1_1CreateSecretRequest(input, context));
26
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
27
+ });
28
+ }); };
29
+ export var serializeAws_json1_1DeleteResourcePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
30
+ var headers, body;
31
+ return __generator(this, function (_a) {
32
+ headers = {
33
+ "content-type": "application/x-amz-json-1.1",
34
+ "x-amz-target": "secretsmanager.DeleteResourcePolicy",
35
+ };
36
+ body = JSON.stringify(serializeAws_json1_1DeleteResourcePolicyRequest(input, context));
37
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
38
+ });
39
+ }); };
40
+ export var serializeAws_json1_1DeleteSecretCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
41
+ var headers, body;
42
+ return __generator(this, function (_a) {
43
+ headers = {
44
+ "content-type": "application/x-amz-json-1.1",
45
+ "x-amz-target": "secretsmanager.DeleteSecret",
46
+ };
47
+ body = JSON.stringify(serializeAws_json1_1DeleteSecretRequest(input, context));
48
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
49
+ });
50
+ }); };
51
+ export var serializeAws_json1_1DescribeSecretCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
52
+ var headers, body;
53
+ return __generator(this, function (_a) {
54
+ headers = {
55
+ "content-type": "application/x-amz-json-1.1",
56
+ "x-amz-target": "secretsmanager.DescribeSecret",
57
+ };
58
+ body = JSON.stringify(serializeAws_json1_1DescribeSecretRequest(input, context));
59
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
60
+ });
61
+ }); };
62
+ export var serializeAws_json1_1GetRandomPasswordCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
63
+ var headers, body;
64
+ return __generator(this, function (_a) {
65
+ headers = {
66
+ "content-type": "application/x-amz-json-1.1",
67
+ "x-amz-target": "secretsmanager.GetRandomPassword",
68
+ };
69
+ body = JSON.stringify(serializeAws_json1_1GetRandomPasswordRequest(input, context));
70
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
71
+ });
72
+ }); };
73
+ export var serializeAws_json1_1GetResourcePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
74
+ var headers, body;
75
+ return __generator(this, function (_a) {
76
+ headers = {
77
+ "content-type": "application/x-amz-json-1.1",
78
+ "x-amz-target": "secretsmanager.GetResourcePolicy",
79
+ };
80
+ body = JSON.stringify(serializeAws_json1_1GetResourcePolicyRequest(input, context));
81
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
82
+ });
83
+ }); };
84
+ export var serializeAws_json1_1GetSecretValueCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
85
+ var headers, body;
86
+ return __generator(this, function (_a) {
87
+ headers = {
88
+ "content-type": "application/x-amz-json-1.1",
89
+ "x-amz-target": "secretsmanager.GetSecretValue",
90
+ };
91
+ body = JSON.stringify(serializeAws_json1_1GetSecretValueRequest(input, context));
92
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
93
+ });
94
+ }); };
95
+ export var serializeAws_json1_1ListSecretsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
96
+ var headers, body;
97
+ return __generator(this, function (_a) {
98
+ headers = {
99
+ "content-type": "application/x-amz-json-1.1",
100
+ "x-amz-target": "secretsmanager.ListSecrets",
101
+ };
102
+ body = JSON.stringify(serializeAws_json1_1ListSecretsRequest(input, context));
103
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
104
+ });
105
+ }); };
106
+ export var serializeAws_json1_1ListSecretVersionIdsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
107
+ var headers, body;
108
+ return __generator(this, function (_a) {
109
+ headers = {
110
+ "content-type": "application/x-amz-json-1.1",
111
+ "x-amz-target": "secretsmanager.ListSecretVersionIds",
112
+ };
113
+ body = JSON.stringify(serializeAws_json1_1ListSecretVersionIdsRequest(input, context));
114
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
115
+ });
116
+ }); };
117
+ export var serializeAws_json1_1PutResourcePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
118
+ var headers, body;
119
+ return __generator(this, function (_a) {
120
+ headers = {
121
+ "content-type": "application/x-amz-json-1.1",
122
+ "x-amz-target": "secretsmanager.PutResourcePolicy",
123
+ };
124
+ body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context));
125
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
126
+ });
127
+ }); };
128
+ export var serializeAws_json1_1PutSecretValueCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
129
+ var headers, body;
130
+ return __generator(this, function (_a) {
131
+ headers = {
132
+ "content-type": "application/x-amz-json-1.1",
133
+ "x-amz-target": "secretsmanager.PutSecretValue",
134
+ };
135
+ body = JSON.stringify(serializeAws_json1_1PutSecretValueRequest(input, context));
136
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
137
+ });
138
+ }); };
139
+ export var serializeAws_json1_1RemoveRegionsFromReplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
140
+ var headers, body;
141
+ return __generator(this, function (_a) {
142
+ headers = {
143
+ "content-type": "application/x-amz-json-1.1",
144
+ "x-amz-target": "secretsmanager.RemoveRegionsFromReplication",
145
+ };
146
+ body = JSON.stringify(serializeAws_json1_1RemoveRegionsFromReplicationRequest(input, context));
147
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
148
+ });
149
+ }); };
150
+ export var serializeAws_json1_1ReplicateSecretToRegionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
151
+ var headers, body;
152
+ return __generator(this, function (_a) {
153
+ headers = {
154
+ "content-type": "application/x-amz-json-1.1",
155
+ "x-amz-target": "secretsmanager.ReplicateSecretToRegions",
156
+ };
157
+ body = JSON.stringify(serializeAws_json1_1ReplicateSecretToRegionsRequest(input, context));
158
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
159
+ });
160
+ }); };
161
+ export var serializeAws_json1_1RestoreSecretCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
162
+ var headers, body;
163
+ return __generator(this, function (_a) {
164
+ headers = {
165
+ "content-type": "application/x-amz-json-1.1",
166
+ "x-amz-target": "secretsmanager.RestoreSecret",
167
+ };
168
+ body = JSON.stringify(serializeAws_json1_1RestoreSecretRequest(input, context));
169
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
170
+ });
171
+ }); };
172
+ export var serializeAws_json1_1RotateSecretCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
173
+ var headers, body;
174
+ return __generator(this, function (_a) {
175
+ headers = {
176
+ "content-type": "application/x-amz-json-1.1",
177
+ "x-amz-target": "secretsmanager.RotateSecret",
178
+ };
179
+ body = JSON.stringify(serializeAws_json1_1RotateSecretRequest(input, context));
180
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
181
+ });
182
+ }); };
183
+ export var serializeAws_json1_1StopReplicationToReplicaCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
184
+ var headers, body;
185
+ return __generator(this, function (_a) {
186
+ headers = {
187
+ "content-type": "application/x-amz-json-1.1",
188
+ "x-amz-target": "secretsmanager.StopReplicationToReplica",
189
+ };
190
+ body = JSON.stringify(serializeAws_json1_1StopReplicationToReplicaRequest(input, context));
191
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
192
+ });
193
+ }); };
194
+ export var serializeAws_json1_1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
195
+ var headers, body;
196
+ return __generator(this, function (_a) {
197
+ headers = {
198
+ "content-type": "application/x-amz-json-1.1",
199
+ "x-amz-target": "secretsmanager.TagResource",
200
+ };
201
+ body = JSON.stringify(serializeAws_json1_1TagResourceRequest(input, context));
202
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
203
+ });
204
+ }); };
205
+ export var serializeAws_json1_1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
206
+ var headers, body;
207
+ return __generator(this, function (_a) {
208
+ headers = {
209
+ "content-type": "application/x-amz-json-1.1",
210
+ "x-amz-target": "secretsmanager.UntagResource",
211
+ };
212
+ body = JSON.stringify(serializeAws_json1_1UntagResourceRequest(input, context));
213
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
214
+ });
215
+ }); };
216
+ export var serializeAws_json1_1UpdateSecretCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
217
+ var headers, body;
218
+ return __generator(this, function (_a) {
219
+ headers = {
220
+ "content-type": "application/x-amz-json-1.1",
221
+ "x-amz-target": "secretsmanager.UpdateSecret",
222
+ };
223
+ body = JSON.stringify(serializeAws_json1_1UpdateSecretRequest(input, context));
224
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
225
+ });
226
+ }); };
227
+ export var serializeAws_json1_1UpdateSecretVersionStageCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
228
+ var headers, body;
229
+ return __generator(this, function (_a) {
230
+ headers = {
231
+ "content-type": "application/x-amz-json-1.1",
232
+ "x-amz-target": "secretsmanager.UpdateSecretVersionStage",
233
+ };
234
+ body = JSON.stringify(serializeAws_json1_1UpdateSecretVersionStageRequest(input, context));
235
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
236
+ });
237
+ }); };
238
+ export var serializeAws_json1_1ValidateResourcePolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
239
+ var headers, body;
240
+ return __generator(this, function (_a) {
241
+ headers = {
242
+ "content-type": "application/x-amz-json-1.1",
243
+ "x-amz-target": "secretsmanager.ValidateResourcePolicy",
244
+ };
245
+ body = JSON.stringify(serializeAws_json1_1ValidateResourcePolicyRequest(input, context));
246
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
247
+ });
248
+ }); };
249
+ export var deserializeAws_json1_1CancelRotateSecretCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
250
+ var data, contents, response;
251
+ return __generator(this, function (_a) {
252
+ switch (_a.label) {
253
+ case 0:
254
+ if (output.statusCode >= 300) {
255
+ return [2, deserializeAws_json1_1CancelRotateSecretCommandError(output, context)];
256
+ }
257
+ return [4, parseBody(output.body, context)];
258
+ case 1:
259
+ data = _a.sent();
260
+ contents = {};
261
+ contents = deserializeAws_json1_1CancelRotateSecretResponse(data, context);
262
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
263
+ return [2, Promise.resolve(response)];
264
+ }
265
+ });
266
+ }); };
267
+ var deserializeAws_json1_1CancelRotateSecretCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
268
+ var parsedOutput, _a, errorCode, _b, parsedBody;
269
+ var _c;
270
+ return __generator(this, function (_d) {
271
+ switch (_d.label) {
272
+ case 0:
273
+ _a = [__assign({}, output)];
274
+ _c = {};
275
+ return [4, parseErrorBody(output.body, context)];
276
+ case 1:
277
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
278
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
279
+ _b = errorCode;
280
+ switch (_b) {
281
+ case "InternalServiceError": return [3, 2];
282
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
283
+ case "InvalidParameterException": return [3, 4];
284
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
285
+ case "InvalidRequestException": return [3, 6];
286
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
287
+ case "ResourceNotFoundException": return [3, 8];
288
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
289
+ }
290
+ return [3, 10];
291
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
292
+ case 3: throw _d.sent();
293
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
294
+ case 5: throw _d.sent();
295
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
296
+ case 7: throw _d.sent();
297
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
298
+ case 9: throw _d.sent();
299
+ case 10:
300
+ parsedBody = parsedOutput.body;
301
+ throwDefaultError({
302
+ output: output,
303
+ parsedBody: parsedBody,
304
+ exceptionCtor: __BaseException,
305
+ errorCode: errorCode,
306
+ });
307
+ _d.label = 11;
308
+ case 11: return [2];
309
+ }
310
+ });
311
+ }); };
312
+ export var deserializeAws_json1_1CreateSecretCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
313
+ var data, contents, response;
314
+ return __generator(this, function (_a) {
315
+ switch (_a.label) {
316
+ case 0:
317
+ if (output.statusCode >= 300) {
318
+ return [2, deserializeAws_json1_1CreateSecretCommandError(output, context)];
319
+ }
320
+ return [4, parseBody(output.body, context)];
321
+ case 1:
322
+ data = _a.sent();
323
+ contents = {};
324
+ contents = deserializeAws_json1_1CreateSecretResponse(data, context);
325
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
326
+ return [2, Promise.resolve(response)];
327
+ }
328
+ });
329
+ }); };
330
+ var deserializeAws_json1_1CreateSecretCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
331
+ var parsedOutput, _a, errorCode, _b, parsedBody;
332
+ var _c;
333
+ return __generator(this, function (_d) {
334
+ switch (_d.label) {
335
+ case 0:
336
+ _a = [__assign({}, output)];
337
+ _c = {};
338
+ return [4, parseErrorBody(output.body, context)];
339
+ case 1:
340
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
341
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
342
+ _b = errorCode;
343
+ switch (_b) {
344
+ case "DecryptionFailure": return [3, 2];
345
+ case "com.amazonaws.secretsmanager#DecryptionFailure": return [3, 2];
346
+ case "EncryptionFailure": return [3, 4];
347
+ case "com.amazonaws.secretsmanager#EncryptionFailure": return [3, 4];
348
+ case "InternalServiceError": return [3, 6];
349
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 6];
350
+ case "InvalidParameterException": return [3, 8];
351
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 8];
352
+ case "InvalidRequestException": return [3, 10];
353
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 10];
354
+ case "LimitExceededException": return [3, 12];
355
+ case "com.amazonaws.secretsmanager#LimitExceededException": return [3, 12];
356
+ case "MalformedPolicyDocumentException": return [3, 14];
357
+ case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException": return [3, 14];
358
+ case "PreconditionNotMetException": return [3, 16];
359
+ case "com.amazonaws.secretsmanager#PreconditionNotMetException": return [3, 16];
360
+ case "ResourceExistsException": return [3, 18];
361
+ case "com.amazonaws.secretsmanager#ResourceExistsException": return [3, 18];
362
+ case "ResourceNotFoundException": return [3, 20];
363
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 20];
364
+ }
365
+ return [3, 22];
366
+ case 2: return [4, deserializeAws_json1_1DecryptionFailureResponse(parsedOutput, context)];
367
+ case 3: throw _d.sent();
368
+ case 4: return [4, deserializeAws_json1_1EncryptionFailureResponse(parsedOutput, context)];
369
+ case 5: throw _d.sent();
370
+ case 6: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
371
+ case 7: throw _d.sent();
372
+ case 8: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
373
+ case 9: throw _d.sent();
374
+ case 10: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
375
+ case 11: throw _d.sent();
376
+ case 12: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
377
+ case 13: throw _d.sent();
378
+ case 14: return [4, deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse(parsedOutput, context)];
379
+ case 15: throw _d.sent();
380
+ case 16: return [4, deserializeAws_json1_1PreconditionNotMetExceptionResponse(parsedOutput, context)];
381
+ case 17: throw _d.sent();
382
+ case 18: return [4, deserializeAws_json1_1ResourceExistsExceptionResponse(parsedOutput, context)];
383
+ case 19: throw _d.sent();
384
+ case 20: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
385
+ case 21: throw _d.sent();
386
+ case 22:
387
+ parsedBody = parsedOutput.body;
388
+ throwDefaultError({
389
+ output: output,
390
+ parsedBody: parsedBody,
391
+ exceptionCtor: __BaseException,
392
+ errorCode: errorCode,
393
+ });
394
+ _d.label = 23;
395
+ case 23: return [2];
396
+ }
397
+ });
398
+ }); };
399
+ export var deserializeAws_json1_1DeleteResourcePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
400
+ var data, contents, response;
401
+ return __generator(this, function (_a) {
402
+ switch (_a.label) {
403
+ case 0:
404
+ if (output.statusCode >= 300) {
405
+ return [2, deserializeAws_json1_1DeleteResourcePolicyCommandError(output, context)];
406
+ }
407
+ return [4, parseBody(output.body, context)];
408
+ case 1:
409
+ data = _a.sent();
410
+ contents = {};
411
+ contents = deserializeAws_json1_1DeleteResourcePolicyResponse(data, context);
412
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
413
+ return [2, Promise.resolve(response)];
414
+ }
415
+ });
416
+ }); };
417
+ var deserializeAws_json1_1DeleteResourcePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
418
+ var parsedOutput, _a, errorCode, _b, parsedBody;
419
+ var _c;
420
+ return __generator(this, function (_d) {
421
+ switch (_d.label) {
422
+ case 0:
423
+ _a = [__assign({}, output)];
424
+ _c = {};
425
+ return [4, parseErrorBody(output.body, context)];
426
+ case 1:
427
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
428
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
429
+ _b = errorCode;
430
+ switch (_b) {
431
+ case "InternalServiceError": return [3, 2];
432
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
433
+ case "InvalidParameterException": return [3, 4];
434
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
435
+ case "InvalidRequestException": return [3, 6];
436
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
437
+ case "ResourceNotFoundException": return [3, 8];
438
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
439
+ }
440
+ return [3, 10];
441
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
442
+ case 3: throw _d.sent();
443
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
444
+ case 5: throw _d.sent();
445
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
446
+ case 7: throw _d.sent();
447
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
448
+ case 9: throw _d.sent();
449
+ case 10:
450
+ parsedBody = parsedOutput.body;
451
+ throwDefaultError({
452
+ output: output,
453
+ parsedBody: parsedBody,
454
+ exceptionCtor: __BaseException,
455
+ errorCode: errorCode,
456
+ });
457
+ _d.label = 11;
458
+ case 11: return [2];
459
+ }
460
+ });
461
+ }); };
462
+ export var deserializeAws_json1_1DeleteSecretCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
463
+ var data, contents, response;
464
+ return __generator(this, function (_a) {
465
+ switch (_a.label) {
466
+ case 0:
467
+ if (output.statusCode >= 300) {
468
+ return [2, deserializeAws_json1_1DeleteSecretCommandError(output, context)];
469
+ }
470
+ return [4, parseBody(output.body, context)];
471
+ case 1:
472
+ data = _a.sent();
473
+ contents = {};
474
+ contents = deserializeAws_json1_1DeleteSecretResponse(data, context);
475
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
476
+ return [2, Promise.resolve(response)];
477
+ }
478
+ });
479
+ }); };
480
+ var deserializeAws_json1_1DeleteSecretCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
481
+ var parsedOutput, _a, errorCode, _b, parsedBody;
482
+ var _c;
483
+ return __generator(this, function (_d) {
484
+ switch (_d.label) {
485
+ case 0:
486
+ _a = [__assign({}, output)];
487
+ _c = {};
488
+ return [4, parseErrorBody(output.body, context)];
489
+ case 1:
490
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
491
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
492
+ _b = errorCode;
493
+ switch (_b) {
494
+ case "InternalServiceError": return [3, 2];
495
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
496
+ case "InvalidParameterException": return [3, 4];
497
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
498
+ case "InvalidRequestException": return [3, 6];
499
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
500
+ case "ResourceNotFoundException": return [3, 8];
501
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
502
+ }
503
+ return [3, 10];
504
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
505
+ case 3: throw _d.sent();
506
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
507
+ case 5: throw _d.sent();
508
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
509
+ case 7: throw _d.sent();
510
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
511
+ case 9: throw _d.sent();
512
+ case 10:
513
+ parsedBody = parsedOutput.body;
514
+ throwDefaultError({
515
+ output: output,
516
+ parsedBody: parsedBody,
517
+ exceptionCtor: __BaseException,
518
+ errorCode: errorCode,
519
+ });
520
+ _d.label = 11;
521
+ case 11: return [2];
522
+ }
523
+ });
524
+ }); };
525
+ export var deserializeAws_json1_1DescribeSecretCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
526
+ var data, contents, response;
527
+ return __generator(this, function (_a) {
528
+ switch (_a.label) {
529
+ case 0:
530
+ if (output.statusCode >= 300) {
531
+ return [2, deserializeAws_json1_1DescribeSecretCommandError(output, context)];
532
+ }
533
+ return [4, parseBody(output.body, context)];
534
+ case 1:
535
+ data = _a.sent();
536
+ contents = {};
537
+ contents = deserializeAws_json1_1DescribeSecretResponse(data, context);
538
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
539
+ return [2, Promise.resolve(response)];
540
+ }
541
+ });
542
+ }); };
543
+ var deserializeAws_json1_1DescribeSecretCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
544
+ var parsedOutput, _a, errorCode, _b, parsedBody;
545
+ var _c;
546
+ return __generator(this, function (_d) {
547
+ switch (_d.label) {
548
+ case 0:
549
+ _a = [__assign({}, output)];
550
+ _c = {};
551
+ return [4, parseErrorBody(output.body, context)];
552
+ case 1:
553
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
554
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
555
+ _b = errorCode;
556
+ switch (_b) {
557
+ case "InternalServiceError": return [3, 2];
558
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
559
+ case "InvalidParameterException": return [3, 4];
560
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
561
+ case "ResourceNotFoundException": return [3, 6];
562
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 6];
563
+ }
564
+ return [3, 8];
565
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
566
+ case 3: throw _d.sent();
567
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
568
+ case 5: throw _d.sent();
569
+ case 6: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
570
+ case 7: throw _d.sent();
571
+ case 8:
572
+ parsedBody = parsedOutput.body;
573
+ throwDefaultError({
574
+ output: output,
575
+ parsedBody: parsedBody,
576
+ exceptionCtor: __BaseException,
577
+ errorCode: errorCode,
578
+ });
579
+ _d.label = 9;
580
+ case 9: return [2];
581
+ }
582
+ });
583
+ }); };
584
+ export var deserializeAws_json1_1GetRandomPasswordCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
585
+ var data, contents, response;
586
+ return __generator(this, function (_a) {
587
+ switch (_a.label) {
588
+ case 0:
589
+ if (output.statusCode >= 300) {
590
+ return [2, deserializeAws_json1_1GetRandomPasswordCommandError(output, context)];
591
+ }
592
+ return [4, parseBody(output.body, context)];
593
+ case 1:
594
+ data = _a.sent();
595
+ contents = {};
596
+ contents = deserializeAws_json1_1GetRandomPasswordResponse(data, context);
597
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
598
+ return [2, Promise.resolve(response)];
599
+ }
600
+ });
601
+ }); };
602
+ var deserializeAws_json1_1GetRandomPasswordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
603
+ var parsedOutput, _a, errorCode, _b, parsedBody;
604
+ var _c;
605
+ return __generator(this, function (_d) {
606
+ switch (_d.label) {
607
+ case 0:
608
+ _a = [__assign({}, output)];
609
+ _c = {};
610
+ return [4, parseErrorBody(output.body, context)];
611
+ case 1:
612
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
613
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
614
+ _b = errorCode;
615
+ switch (_b) {
616
+ case "InternalServiceError": return [3, 2];
617
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
618
+ case "InvalidParameterException": return [3, 4];
619
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
620
+ case "InvalidRequestException": return [3, 6];
621
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
622
+ }
623
+ return [3, 8];
624
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
625
+ case 3: throw _d.sent();
626
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
627
+ case 5: throw _d.sent();
628
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
629
+ case 7: throw _d.sent();
630
+ case 8:
631
+ parsedBody = parsedOutput.body;
632
+ throwDefaultError({
633
+ output: output,
634
+ parsedBody: parsedBody,
635
+ exceptionCtor: __BaseException,
636
+ errorCode: errorCode,
637
+ });
638
+ _d.label = 9;
639
+ case 9: return [2];
640
+ }
641
+ });
642
+ }); };
643
+ export var deserializeAws_json1_1GetResourcePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
644
+ var data, contents, response;
645
+ return __generator(this, function (_a) {
646
+ switch (_a.label) {
647
+ case 0:
648
+ if (output.statusCode >= 300) {
649
+ return [2, deserializeAws_json1_1GetResourcePolicyCommandError(output, context)];
650
+ }
651
+ return [4, parseBody(output.body, context)];
652
+ case 1:
653
+ data = _a.sent();
654
+ contents = {};
655
+ contents = deserializeAws_json1_1GetResourcePolicyResponse(data, context);
656
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
657
+ return [2, Promise.resolve(response)];
658
+ }
659
+ });
660
+ }); };
661
+ var deserializeAws_json1_1GetResourcePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
662
+ var parsedOutput, _a, errorCode, _b, parsedBody;
663
+ var _c;
664
+ return __generator(this, function (_d) {
665
+ switch (_d.label) {
666
+ case 0:
667
+ _a = [__assign({}, output)];
668
+ _c = {};
669
+ return [4, parseErrorBody(output.body, context)];
670
+ case 1:
671
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
672
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
673
+ _b = errorCode;
674
+ switch (_b) {
675
+ case "InternalServiceError": return [3, 2];
676
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
677
+ case "InvalidParameterException": return [3, 4];
678
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
679
+ case "InvalidRequestException": return [3, 6];
680
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
681
+ case "ResourceNotFoundException": return [3, 8];
682
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
683
+ }
684
+ return [3, 10];
685
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
686
+ case 3: throw _d.sent();
687
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
688
+ case 5: throw _d.sent();
689
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
690
+ case 7: throw _d.sent();
691
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
692
+ case 9: throw _d.sent();
693
+ case 10:
694
+ parsedBody = parsedOutput.body;
695
+ throwDefaultError({
696
+ output: output,
697
+ parsedBody: parsedBody,
698
+ exceptionCtor: __BaseException,
699
+ errorCode: errorCode,
700
+ });
701
+ _d.label = 11;
702
+ case 11: return [2];
703
+ }
704
+ });
705
+ }); };
706
+ export var deserializeAws_json1_1GetSecretValueCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
707
+ var data, contents, response;
708
+ return __generator(this, function (_a) {
709
+ switch (_a.label) {
710
+ case 0:
711
+ if (output.statusCode >= 300) {
712
+ return [2, deserializeAws_json1_1GetSecretValueCommandError(output, context)];
713
+ }
714
+ return [4, parseBody(output.body, context)];
715
+ case 1:
716
+ data = _a.sent();
717
+ contents = {};
718
+ contents = deserializeAws_json1_1GetSecretValueResponse(data, context);
719
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
720
+ return [2, Promise.resolve(response)];
721
+ }
722
+ });
723
+ }); };
724
+ var deserializeAws_json1_1GetSecretValueCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
725
+ var parsedOutput, _a, errorCode, _b, parsedBody;
726
+ var _c;
727
+ return __generator(this, function (_d) {
728
+ switch (_d.label) {
729
+ case 0:
730
+ _a = [__assign({}, output)];
731
+ _c = {};
732
+ return [4, parseErrorBody(output.body, context)];
733
+ case 1:
734
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
735
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
736
+ _b = errorCode;
737
+ switch (_b) {
738
+ case "DecryptionFailure": return [3, 2];
739
+ case "com.amazonaws.secretsmanager#DecryptionFailure": return [3, 2];
740
+ case "InternalServiceError": return [3, 4];
741
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 4];
742
+ case "InvalidParameterException": return [3, 6];
743
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 6];
744
+ case "InvalidRequestException": return [3, 8];
745
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 8];
746
+ case "ResourceNotFoundException": return [3, 10];
747
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 10];
748
+ }
749
+ return [3, 12];
750
+ case 2: return [4, deserializeAws_json1_1DecryptionFailureResponse(parsedOutput, context)];
751
+ case 3: throw _d.sent();
752
+ case 4: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
753
+ case 5: throw _d.sent();
754
+ case 6: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
755
+ case 7: throw _d.sent();
756
+ case 8: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
757
+ case 9: throw _d.sent();
758
+ case 10: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
759
+ case 11: throw _d.sent();
760
+ case 12:
761
+ parsedBody = parsedOutput.body;
762
+ throwDefaultError({
763
+ output: output,
764
+ parsedBody: parsedBody,
765
+ exceptionCtor: __BaseException,
766
+ errorCode: errorCode,
767
+ });
768
+ _d.label = 13;
769
+ case 13: return [2];
770
+ }
771
+ });
772
+ }); };
773
+ export var deserializeAws_json1_1ListSecretsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
774
+ var data, contents, response;
775
+ return __generator(this, function (_a) {
776
+ switch (_a.label) {
777
+ case 0:
778
+ if (output.statusCode >= 300) {
779
+ return [2, deserializeAws_json1_1ListSecretsCommandError(output, context)];
780
+ }
781
+ return [4, parseBody(output.body, context)];
782
+ case 1:
783
+ data = _a.sent();
784
+ contents = {};
785
+ contents = deserializeAws_json1_1ListSecretsResponse(data, context);
786
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
787
+ return [2, Promise.resolve(response)];
788
+ }
789
+ });
790
+ }); };
791
+ var deserializeAws_json1_1ListSecretsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
792
+ var parsedOutput, _a, errorCode, _b, parsedBody;
793
+ var _c;
794
+ return __generator(this, function (_d) {
795
+ switch (_d.label) {
796
+ case 0:
797
+ _a = [__assign({}, output)];
798
+ _c = {};
799
+ return [4, parseErrorBody(output.body, context)];
800
+ case 1:
801
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
802
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
803
+ _b = errorCode;
804
+ switch (_b) {
805
+ case "InternalServiceError": return [3, 2];
806
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
807
+ case "InvalidNextTokenException": return [3, 4];
808
+ case "com.amazonaws.secretsmanager#InvalidNextTokenException": return [3, 4];
809
+ case "InvalidParameterException": return [3, 6];
810
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 6];
811
+ }
812
+ return [3, 8];
813
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
814
+ case 3: throw _d.sent();
815
+ case 4: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
816
+ case 5: throw _d.sent();
817
+ case 6: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
818
+ case 7: throw _d.sent();
819
+ case 8:
820
+ parsedBody = parsedOutput.body;
821
+ throwDefaultError({
822
+ output: output,
823
+ parsedBody: parsedBody,
824
+ exceptionCtor: __BaseException,
825
+ errorCode: errorCode,
826
+ });
827
+ _d.label = 9;
828
+ case 9: return [2];
829
+ }
830
+ });
831
+ }); };
832
+ export var deserializeAws_json1_1ListSecretVersionIdsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
833
+ var data, contents, response;
834
+ return __generator(this, function (_a) {
835
+ switch (_a.label) {
836
+ case 0:
837
+ if (output.statusCode >= 300) {
838
+ return [2, deserializeAws_json1_1ListSecretVersionIdsCommandError(output, context)];
839
+ }
840
+ return [4, parseBody(output.body, context)];
841
+ case 1:
842
+ data = _a.sent();
843
+ contents = {};
844
+ contents = deserializeAws_json1_1ListSecretVersionIdsResponse(data, context);
845
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
846
+ return [2, Promise.resolve(response)];
847
+ }
848
+ });
849
+ }); };
850
+ var deserializeAws_json1_1ListSecretVersionIdsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
851
+ var parsedOutput, _a, errorCode, _b, parsedBody;
852
+ var _c;
853
+ return __generator(this, function (_d) {
854
+ switch (_d.label) {
855
+ case 0:
856
+ _a = [__assign({}, output)];
857
+ _c = {};
858
+ return [4, parseErrorBody(output.body, context)];
859
+ case 1:
860
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
861
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
862
+ _b = errorCode;
863
+ switch (_b) {
864
+ case "InternalServiceError": return [3, 2];
865
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
866
+ case "InvalidNextTokenException": return [3, 4];
867
+ case "com.amazonaws.secretsmanager#InvalidNextTokenException": return [3, 4];
868
+ case "InvalidParameterException": return [3, 6];
869
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 6];
870
+ case "ResourceNotFoundException": return [3, 8];
871
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
872
+ }
873
+ return [3, 10];
874
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
875
+ case 3: throw _d.sent();
876
+ case 4: return [4, deserializeAws_json1_1InvalidNextTokenExceptionResponse(parsedOutput, context)];
877
+ case 5: throw _d.sent();
878
+ case 6: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
879
+ case 7: throw _d.sent();
880
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
881
+ case 9: throw _d.sent();
882
+ case 10:
883
+ parsedBody = parsedOutput.body;
884
+ throwDefaultError({
885
+ output: output,
886
+ parsedBody: parsedBody,
887
+ exceptionCtor: __BaseException,
888
+ errorCode: errorCode,
889
+ });
890
+ _d.label = 11;
891
+ case 11: return [2];
892
+ }
893
+ });
894
+ }); };
895
+ export var deserializeAws_json1_1PutResourcePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
896
+ var data, contents, response;
897
+ return __generator(this, function (_a) {
898
+ switch (_a.label) {
899
+ case 0:
900
+ if (output.statusCode >= 300) {
901
+ return [2, deserializeAws_json1_1PutResourcePolicyCommandError(output, context)];
902
+ }
903
+ return [4, parseBody(output.body, context)];
904
+ case 1:
905
+ data = _a.sent();
906
+ contents = {};
907
+ contents = deserializeAws_json1_1PutResourcePolicyResponse(data, context);
908
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
909
+ return [2, Promise.resolve(response)];
910
+ }
911
+ });
912
+ }); };
913
+ var deserializeAws_json1_1PutResourcePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
914
+ var parsedOutput, _a, errorCode, _b, parsedBody;
915
+ var _c;
916
+ return __generator(this, function (_d) {
917
+ switch (_d.label) {
918
+ case 0:
919
+ _a = [__assign({}, output)];
920
+ _c = {};
921
+ return [4, parseErrorBody(output.body, context)];
922
+ case 1:
923
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
924
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
925
+ _b = errorCode;
926
+ switch (_b) {
927
+ case "InternalServiceError": return [3, 2];
928
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
929
+ case "InvalidParameterException": return [3, 4];
930
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
931
+ case "InvalidRequestException": return [3, 6];
932
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
933
+ case "MalformedPolicyDocumentException": return [3, 8];
934
+ case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException": return [3, 8];
935
+ case "PublicPolicyException": return [3, 10];
936
+ case "com.amazonaws.secretsmanager#PublicPolicyException": return [3, 10];
937
+ case "ResourceNotFoundException": return [3, 12];
938
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 12];
939
+ }
940
+ return [3, 14];
941
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
942
+ case 3: throw _d.sent();
943
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
944
+ case 5: throw _d.sent();
945
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
946
+ case 7: throw _d.sent();
947
+ case 8: return [4, deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse(parsedOutput, context)];
948
+ case 9: throw _d.sent();
949
+ case 10: return [4, deserializeAws_json1_1PublicPolicyExceptionResponse(parsedOutput, context)];
950
+ case 11: throw _d.sent();
951
+ case 12: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
952
+ case 13: throw _d.sent();
953
+ case 14:
954
+ parsedBody = parsedOutput.body;
955
+ throwDefaultError({
956
+ output: output,
957
+ parsedBody: parsedBody,
958
+ exceptionCtor: __BaseException,
959
+ errorCode: errorCode,
960
+ });
961
+ _d.label = 15;
962
+ case 15: return [2];
963
+ }
964
+ });
965
+ }); };
966
+ export var deserializeAws_json1_1PutSecretValueCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
967
+ var data, contents, response;
968
+ return __generator(this, function (_a) {
969
+ switch (_a.label) {
970
+ case 0:
971
+ if (output.statusCode >= 300) {
972
+ return [2, deserializeAws_json1_1PutSecretValueCommandError(output, context)];
973
+ }
974
+ return [4, parseBody(output.body, context)];
975
+ case 1:
976
+ data = _a.sent();
977
+ contents = {};
978
+ contents = deserializeAws_json1_1PutSecretValueResponse(data, context);
979
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
980
+ return [2, Promise.resolve(response)];
981
+ }
982
+ });
983
+ }); };
984
+ var deserializeAws_json1_1PutSecretValueCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
985
+ var parsedOutput, _a, errorCode, _b, parsedBody;
986
+ var _c;
987
+ return __generator(this, function (_d) {
988
+ switch (_d.label) {
989
+ case 0:
990
+ _a = [__assign({}, output)];
991
+ _c = {};
992
+ return [4, parseErrorBody(output.body, context)];
993
+ case 1:
994
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
995
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
996
+ _b = errorCode;
997
+ switch (_b) {
998
+ case "DecryptionFailure": return [3, 2];
999
+ case "com.amazonaws.secretsmanager#DecryptionFailure": return [3, 2];
1000
+ case "EncryptionFailure": return [3, 4];
1001
+ case "com.amazonaws.secretsmanager#EncryptionFailure": return [3, 4];
1002
+ case "InternalServiceError": return [3, 6];
1003
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 6];
1004
+ case "InvalidParameterException": return [3, 8];
1005
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 8];
1006
+ case "InvalidRequestException": return [3, 10];
1007
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 10];
1008
+ case "LimitExceededException": return [3, 12];
1009
+ case "com.amazonaws.secretsmanager#LimitExceededException": return [3, 12];
1010
+ case "ResourceExistsException": return [3, 14];
1011
+ case "com.amazonaws.secretsmanager#ResourceExistsException": return [3, 14];
1012
+ case "ResourceNotFoundException": return [3, 16];
1013
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 16];
1014
+ }
1015
+ return [3, 18];
1016
+ case 2: return [4, deserializeAws_json1_1DecryptionFailureResponse(parsedOutput, context)];
1017
+ case 3: throw _d.sent();
1018
+ case 4: return [4, deserializeAws_json1_1EncryptionFailureResponse(parsedOutput, context)];
1019
+ case 5: throw _d.sent();
1020
+ case 6: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1021
+ case 7: throw _d.sent();
1022
+ case 8: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1023
+ case 9: throw _d.sent();
1024
+ case 10: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1025
+ case 11: throw _d.sent();
1026
+ case 12: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
1027
+ case 13: throw _d.sent();
1028
+ case 14: return [4, deserializeAws_json1_1ResourceExistsExceptionResponse(parsedOutput, context)];
1029
+ case 15: throw _d.sent();
1030
+ case 16: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1031
+ case 17: throw _d.sent();
1032
+ case 18:
1033
+ parsedBody = parsedOutput.body;
1034
+ throwDefaultError({
1035
+ output: output,
1036
+ parsedBody: parsedBody,
1037
+ exceptionCtor: __BaseException,
1038
+ errorCode: errorCode,
1039
+ });
1040
+ _d.label = 19;
1041
+ case 19: return [2];
1042
+ }
1043
+ });
1044
+ }); };
1045
+ export var deserializeAws_json1_1RemoveRegionsFromReplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1046
+ var data, contents, response;
1047
+ return __generator(this, function (_a) {
1048
+ switch (_a.label) {
1049
+ case 0:
1050
+ if (output.statusCode >= 300) {
1051
+ return [2, deserializeAws_json1_1RemoveRegionsFromReplicationCommandError(output, context)];
1052
+ }
1053
+ return [4, parseBody(output.body, context)];
1054
+ case 1:
1055
+ data = _a.sent();
1056
+ contents = {};
1057
+ contents = deserializeAws_json1_1RemoveRegionsFromReplicationResponse(data, context);
1058
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1059
+ return [2, Promise.resolve(response)];
1060
+ }
1061
+ });
1062
+ }); };
1063
+ var deserializeAws_json1_1RemoveRegionsFromReplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1064
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1065
+ var _c;
1066
+ return __generator(this, function (_d) {
1067
+ switch (_d.label) {
1068
+ case 0:
1069
+ _a = [__assign({}, output)];
1070
+ _c = {};
1071
+ return [4, parseErrorBody(output.body, context)];
1072
+ case 1:
1073
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1074
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1075
+ _b = errorCode;
1076
+ switch (_b) {
1077
+ case "InternalServiceError": return [3, 2];
1078
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
1079
+ case "InvalidParameterException": return [3, 4];
1080
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
1081
+ case "InvalidRequestException": return [3, 6];
1082
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
1083
+ case "ResourceNotFoundException": return [3, 8];
1084
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
1085
+ }
1086
+ return [3, 10];
1087
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1088
+ case 3: throw _d.sent();
1089
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1090
+ case 5: throw _d.sent();
1091
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1092
+ case 7: throw _d.sent();
1093
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1094
+ case 9: throw _d.sent();
1095
+ case 10:
1096
+ parsedBody = parsedOutput.body;
1097
+ throwDefaultError({
1098
+ output: output,
1099
+ parsedBody: parsedBody,
1100
+ exceptionCtor: __BaseException,
1101
+ errorCode: errorCode,
1102
+ });
1103
+ _d.label = 11;
1104
+ case 11: return [2];
1105
+ }
1106
+ });
1107
+ }); };
1108
+ export var deserializeAws_json1_1ReplicateSecretToRegionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1109
+ var data, contents, response;
1110
+ return __generator(this, function (_a) {
1111
+ switch (_a.label) {
1112
+ case 0:
1113
+ if (output.statusCode >= 300) {
1114
+ return [2, deserializeAws_json1_1ReplicateSecretToRegionsCommandError(output, context)];
1115
+ }
1116
+ return [4, parseBody(output.body, context)];
1117
+ case 1:
1118
+ data = _a.sent();
1119
+ contents = {};
1120
+ contents = deserializeAws_json1_1ReplicateSecretToRegionsResponse(data, context);
1121
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1122
+ return [2, Promise.resolve(response)];
1123
+ }
1124
+ });
1125
+ }); };
1126
+ var deserializeAws_json1_1ReplicateSecretToRegionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1127
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1128
+ var _c;
1129
+ return __generator(this, function (_d) {
1130
+ switch (_d.label) {
1131
+ case 0:
1132
+ _a = [__assign({}, output)];
1133
+ _c = {};
1134
+ return [4, parseErrorBody(output.body, context)];
1135
+ case 1:
1136
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1137
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1138
+ _b = errorCode;
1139
+ switch (_b) {
1140
+ case "InternalServiceError": return [3, 2];
1141
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
1142
+ case "InvalidParameterException": return [3, 4];
1143
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
1144
+ case "InvalidRequestException": return [3, 6];
1145
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
1146
+ case "ResourceNotFoundException": return [3, 8];
1147
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
1148
+ }
1149
+ return [3, 10];
1150
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1151
+ case 3: throw _d.sent();
1152
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1153
+ case 5: throw _d.sent();
1154
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1155
+ case 7: throw _d.sent();
1156
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1157
+ case 9: throw _d.sent();
1158
+ case 10:
1159
+ parsedBody = parsedOutput.body;
1160
+ throwDefaultError({
1161
+ output: output,
1162
+ parsedBody: parsedBody,
1163
+ exceptionCtor: __BaseException,
1164
+ errorCode: errorCode,
1165
+ });
1166
+ _d.label = 11;
1167
+ case 11: return [2];
1168
+ }
1169
+ });
1170
+ }); };
1171
+ export var deserializeAws_json1_1RestoreSecretCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1172
+ var data, contents, response;
1173
+ return __generator(this, function (_a) {
1174
+ switch (_a.label) {
1175
+ case 0:
1176
+ if (output.statusCode >= 300) {
1177
+ return [2, deserializeAws_json1_1RestoreSecretCommandError(output, context)];
1178
+ }
1179
+ return [4, parseBody(output.body, context)];
1180
+ case 1:
1181
+ data = _a.sent();
1182
+ contents = {};
1183
+ contents = deserializeAws_json1_1RestoreSecretResponse(data, context);
1184
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1185
+ return [2, Promise.resolve(response)];
1186
+ }
1187
+ });
1188
+ }); };
1189
+ var deserializeAws_json1_1RestoreSecretCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1190
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1191
+ var _c;
1192
+ return __generator(this, function (_d) {
1193
+ switch (_d.label) {
1194
+ case 0:
1195
+ _a = [__assign({}, output)];
1196
+ _c = {};
1197
+ return [4, parseErrorBody(output.body, context)];
1198
+ case 1:
1199
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1200
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1201
+ _b = errorCode;
1202
+ switch (_b) {
1203
+ case "InternalServiceError": return [3, 2];
1204
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
1205
+ case "InvalidParameterException": return [3, 4];
1206
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
1207
+ case "InvalidRequestException": return [3, 6];
1208
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
1209
+ case "ResourceNotFoundException": return [3, 8];
1210
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
1211
+ }
1212
+ return [3, 10];
1213
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1214
+ case 3: throw _d.sent();
1215
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1216
+ case 5: throw _d.sent();
1217
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1218
+ case 7: throw _d.sent();
1219
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1220
+ case 9: throw _d.sent();
1221
+ case 10:
1222
+ parsedBody = parsedOutput.body;
1223
+ throwDefaultError({
1224
+ output: output,
1225
+ parsedBody: parsedBody,
1226
+ exceptionCtor: __BaseException,
1227
+ errorCode: errorCode,
1228
+ });
1229
+ _d.label = 11;
1230
+ case 11: return [2];
1231
+ }
1232
+ });
1233
+ }); };
1234
+ export var deserializeAws_json1_1RotateSecretCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1235
+ var data, contents, response;
1236
+ return __generator(this, function (_a) {
1237
+ switch (_a.label) {
1238
+ case 0:
1239
+ if (output.statusCode >= 300) {
1240
+ return [2, deserializeAws_json1_1RotateSecretCommandError(output, context)];
1241
+ }
1242
+ return [4, parseBody(output.body, context)];
1243
+ case 1:
1244
+ data = _a.sent();
1245
+ contents = {};
1246
+ contents = deserializeAws_json1_1RotateSecretResponse(data, context);
1247
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1248
+ return [2, Promise.resolve(response)];
1249
+ }
1250
+ });
1251
+ }); };
1252
+ var deserializeAws_json1_1RotateSecretCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1253
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1254
+ var _c;
1255
+ return __generator(this, function (_d) {
1256
+ switch (_d.label) {
1257
+ case 0:
1258
+ _a = [__assign({}, output)];
1259
+ _c = {};
1260
+ return [4, parseErrorBody(output.body, context)];
1261
+ case 1:
1262
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1263
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1264
+ _b = errorCode;
1265
+ switch (_b) {
1266
+ case "InternalServiceError": return [3, 2];
1267
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
1268
+ case "InvalidParameterException": return [3, 4];
1269
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
1270
+ case "InvalidRequestException": return [3, 6];
1271
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
1272
+ case "ResourceNotFoundException": return [3, 8];
1273
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
1274
+ }
1275
+ return [3, 10];
1276
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1277
+ case 3: throw _d.sent();
1278
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1279
+ case 5: throw _d.sent();
1280
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1281
+ case 7: throw _d.sent();
1282
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1283
+ case 9: throw _d.sent();
1284
+ case 10:
1285
+ parsedBody = parsedOutput.body;
1286
+ throwDefaultError({
1287
+ output: output,
1288
+ parsedBody: parsedBody,
1289
+ exceptionCtor: __BaseException,
1290
+ errorCode: errorCode,
1291
+ });
1292
+ _d.label = 11;
1293
+ case 11: return [2];
1294
+ }
1295
+ });
1296
+ }); };
1297
+ export var deserializeAws_json1_1StopReplicationToReplicaCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1298
+ var data, contents, response;
1299
+ return __generator(this, function (_a) {
1300
+ switch (_a.label) {
1301
+ case 0:
1302
+ if (output.statusCode >= 300) {
1303
+ return [2, deserializeAws_json1_1StopReplicationToReplicaCommandError(output, context)];
1304
+ }
1305
+ return [4, parseBody(output.body, context)];
1306
+ case 1:
1307
+ data = _a.sent();
1308
+ contents = {};
1309
+ contents = deserializeAws_json1_1StopReplicationToReplicaResponse(data, context);
1310
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1311
+ return [2, Promise.resolve(response)];
1312
+ }
1313
+ });
1314
+ }); };
1315
+ var deserializeAws_json1_1StopReplicationToReplicaCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1316
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1317
+ var _c;
1318
+ return __generator(this, function (_d) {
1319
+ switch (_d.label) {
1320
+ case 0:
1321
+ _a = [__assign({}, output)];
1322
+ _c = {};
1323
+ return [4, parseErrorBody(output.body, context)];
1324
+ case 1:
1325
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1326
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1327
+ _b = errorCode;
1328
+ switch (_b) {
1329
+ case "InternalServiceError": return [3, 2];
1330
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
1331
+ case "InvalidParameterException": return [3, 4];
1332
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
1333
+ case "InvalidRequestException": return [3, 6];
1334
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
1335
+ case "ResourceNotFoundException": return [3, 8];
1336
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
1337
+ }
1338
+ return [3, 10];
1339
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1340
+ case 3: throw _d.sent();
1341
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1342
+ case 5: throw _d.sent();
1343
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1344
+ case 7: throw _d.sent();
1345
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1346
+ case 9: throw _d.sent();
1347
+ case 10:
1348
+ parsedBody = parsedOutput.body;
1349
+ throwDefaultError({
1350
+ output: output,
1351
+ parsedBody: parsedBody,
1352
+ exceptionCtor: __BaseException,
1353
+ errorCode: errorCode,
1354
+ });
1355
+ _d.label = 11;
1356
+ case 11: return [2];
1357
+ }
1358
+ });
1359
+ }); };
1360
+ export var deserializeAws_json1_1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1361
+ var response;
1362
+ return __generator(this, function (_a) {
1363
+ switch (_a.label) {
1364
+ case 0:
1365
+ if (output.statusCode >= 300) {
1366
+ return [2, deserializeAws_json1_1TagResourceCommandError(output, context)];
1367
+ }
1368
+ return [4, collectBody(output.body, context)];
1369
+ case 1:
1370
+ _a.sent();
1371
+ response = {
1372
+ $metadata: deserializeMetadata(output),
1373
+ };
1374
+ return [2, Promise.resolve(response)];
1375
+ }
1376
+ });
1377
+ }); };
1378
+ var deserializeAws_json1_1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1379
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1380
+ var _c;
1381
+ return __generator(this, function (_d) {
1382
+ switch (_d.label) {
1383
+ case 0:
1384
+ _a = [__assign({}, output)];
1385
+ _c = {};
1386
+ return [4, parseErrorBody(output.body, context)];
1387
+ case 1:
1388
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1389
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1390
+ _b = errorCode;
1391
+ switch (_b) {
1392
+ case "InternalServiceError": return [3, 2];
1393
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
1394
+ case "InvalidParameterException": return [3, 4];
1395
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
1396
+ case "InvalidRequestException": return [3, 6];
1397
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
1398
+ case "ResourceNotFoundException": return [3, 8];
1399
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
1400
+ }
1401
+ return [3, 10];
1402
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1403
+ case 3: throw _d.sent();
1404
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1405
+ case 5: throw _d.sent();
1406
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1407
+ case 7: throw _d.sent();
1408
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1409
+ case 9: throw _d.sent();
1410
+ case 10:
1411
+ parsedBody = parsedOutput.body;
1412
+ throwDefaultError({
1413
+ output: output,
1414
+ parsedBody: parsedBody,
1415
+ exceptionCtor: __BaseException,
1416
+ errorCode: errorCode,
1417
+ });
1418
+ _d.label = 11;
1419
+ case 11: return [2];
1420
+ }
1421
+ });
1422
+ }); };
1423
+ export var deserializeAws_json1_1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1424
+ var response;
1425
+ return __generator(this, function (_a) {
1426
+ switch (_a.label) {
1427
+ case 0:
1428
+ if (output.statusCode >= 300) {
1429
+ return [2, deserializeAws_json1_1UntagResourceCommandError(output, context)];
1430
+ }
1431
+ return [4, collectBody(output.body, context)];
1432
+ case 1:
1433
+ _a.sent();
1434
+ response = {
1435
+ $metadata: deserializeMetadata(output),
1436
+ };
1437
+ return [2, Promise.resolve(response)];
1438
+ }
1439
+ });
1440
+ }); };
1441
+ var deserializeAws_json1_1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1442
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1443
+ var _c;
1444
+ return __generator(this, function (_d) {
1445
+ switch (_d.label) {
1446
+ case 0:
1447
+ _a = [__assign({}, output)];
1448
+ _c = {};
1449
+ return [4, parseErrorBody(output.body, context)];
1450
+ case 1:
1451
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1452
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1453
+ _b = errorCode;
1454
+ switch (_b) {
1455
+ case "InternalServiceError": return [3, 2];
1456
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
1457
+ case "InvalidParameterException": return [3, 4];
1458
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
1459
+ case "InvalidRequestException": return [3, 6];
1460
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
1461
+ case "ResourceNotFoundException": return [3, 8];
1462
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 8];
1463
+ }
1464
+ return [3, 10];
1465
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1466
+ case 3: throw _d.sent();
1467
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1468
+ case 5: throw _d.sent();
1469
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1470
+ case 7: throw _d.sent();
1471
+ case 8: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1472
+ case 9: throw _d.sent();
1473
+ case 10:
1474
+ parsedBody = parsedOutput.body;
1475
+ throwDefaultError({
1476
+ output: output,
1477
+ parsedBody: parsedBody,
1478
+ exceptionCtor: __BaseException,
1479
+ errorCode: errorCode,
1480
+ });
1481
+ _d.label = 11;
1482
+ case 11: return [2];
1483
+ }
1484
+ });
1485
+ }); };
1486
+ export var deserializeAws_json1_1UpdateSecretCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1487
+ var data, contents, response;
1488
+ return __generator(this, function (_a) {
1489
+ switch (_a.label) {
1490
+ case 0:
1491
+ if (output.statusCode >= 300) {
1492
+ return [2, deserializeAws_json1_1UpdateSecretCommandError(output, context)];
1493
+ }
1494
+ return [4, parseBody(output.body, context)];
1495
+ case 1:
1496
+ data = _a.sent();
1497
+ contents = {};
1498
+ contents = deserializeAws_json1_1UpdateSecretResponse(data, context);
1499
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1500
+ return [2, Promise.resolve(response)];
1501
+ }
1502
+ });
1503
+ }); };
1504
+ var deserializeAws_json1_1UpdateSecretCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1505
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1506
+ var _c;
1507
+ return __generator(this, function (_d) {
1508
+ switch (_d.label) {
1509
+ case 0:
1510
+ _a = [__assign({}, output)];
1511
+ _c = {};
1512
+ return [4, parseErrorBody(output.body, context)];
1513
+ case 1:
1514
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1515
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1516
+ _b = errorCode;
1517
+ switch (_b) {
1518
+ case "DecryptionFailure": return [3, 2];
1519
+ case "com.amazonaws.secretsmanager#DecryptionFailure": return [3, 2];
1520
+ case "EncryptionFailure": return [3, 4];
1521
+ case "com.amazonaws.secretsmanager#EncryptionFailure": return [3, 4];
1522
+ case "InternalServiceError": return [3, 6];
1523
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 6];
1524
+ case "InvalidParameterException": return [3, 8];
1525
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 8];
1526
+ case "InvalidRequestException": return [3, 10];
1527
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 10];
1528
+ case "LimitExceededException": return [3, 12];
1529
+ case "com.amazonaws.secretsmanager#LimitExceededException": return [3, 12];
1530
+ case "MalformedPolicyDocumentException": return [3, 14];
1531
+ case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException": return [3, 14];
1532
+ case "PreconditionNotMetException": return [3, 16];
1533
+ case "com.amazonaws.secretsmanager#PreconditionNotMetException": return [3, 16];
1534
+ case "ResourceExistsException": return [3, 18];
1535
+ case "com.amazonaws.secretsmanager#ResourceExistsException": return [3, 18];
1536
+ case "ResourceNotFoundException": return [3, 20];
1537
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 20];
1538
+ }
1539
+ return [3, 22];
1540
+ case 2: return [4, deserializeAws_json1_1DecryptionFailureResponse(parsedOutput, context)];
1541
+ case 3: throw _d.sent();
1542
+ case 4: return [4, deserializeAws_json1_1EncryptionFailureResponse(parsedOutput, context)];
1543
+ case 5: throw _d.sent();
1544
+ case 6: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1545
+ case 7: throw _d.sent();
1546
+ case 8: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1547
+ case 9: throw _d.sent();
1548
+ case 10: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1549
+ case 11: throw _d.sent();
1550
+ case 12: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
1551
+ case 13: throw _d.sent();
1552
+ case 14: return [4, deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse(parsedOutput, context)];
1553
+ case 15: throw _d.sent();
1554
+ case 16: return [4, deserializeAws_json1_1PreconditionNotMetExceptionResponse(parsedOutput, context)];
1555
+ case 17: throw _d.sent();
1556
+ case 18: return [4, deserializeAws_json1_1ResourceExistsExceptionResponse(parsedOutput, context)];
1557
+ case 19: throw _d.sent();
1558
+ case 20: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1559
+ case 21: throw _d.sent();
1560
+ case 22:
1561
+ parsedBody = parsedOutput.body;
1562
+ throwDefaultError({
1563
+ output: output,
1564
+ parsedBody: parsedBody,
1565
+ exceptionCtor: __BaseException,
1566
+ errorCode: errorCode,
1567
+ });
1568
+ _d.label = 23;
1569
+ case 23: return [2];
1570
+ }
1571
+ });
1572
+ }); };
1573
+ export var deserializeAws_json1_1UpdateSecretVersionStageCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1574
+ var data, contents, response;
1575
+ return __generator(this, function (_a) {
1576
+ switch (_a.label) {
1577
+ case 0:
1578
+ if (output.statusCode >= 300) {
1579
+ return [2, deserializeAws_json1_1UpdateSecretVersionStageCommandError(output, context)];
1580
+ }
1581
+ return [4, parseBody(output.body, context)];
1582
+ case 1:
1583
+ data = _a.sent();
1584
+ contents = {};
1585
+ contents = deserializeAws_json1_1UpdateSecretVersionStageResponse(data, context);
1586
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1587
+ return [2, Promise.resolve(response)];
1588
+ }
1589
+ });
1590
+ }); };
1591
+ var deserializeAws_json1_1UpdateSecretVersionStageCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1592
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1593
+ var _c;
1594
+ return __generator(this, function (_d) {
1595
+ switch (_d.label) {
1596
+ case 0:
1597
+ _a = [__assign({}, output)];
1598
+ _c = {};
1599
+ return [4, parseErrorBody(output.body, context)];
1600
+ case 1:
1601
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1602
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1603
+ _b = errorCode;
1604
+ switch (_b) {
1605
+ case "InternalServiceError": return [3, 2];
1606
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
1607
+ case "InvalidParameterException": return [3, 4];
1608
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
1609
+ case "InvalidRequestException": return [3, 6];
1610
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
1611
+ case "LimitExceededException": return [3, 8];
1612
+ case "com.amazonaws.secretsmanager#LimitExceededException": return [3, 8];
1613
+ case "ResourceNotFoundException": return [3, 10];
1614
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 10];
1615
+ }
1616
+ return [3, 12];
1617
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1618
+ case 3: throw _d.sent();
1619
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1620
+ case 5: throw _d.sent();
1621
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1622
+ case 7: throw _d.sent();
1623
+ case 8: return [4, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];
1624
+ case 9: throw _d.sent();
1625
+ case 10: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1626
+ case 11: throw _d.sent();
1627
+ case 12:
1628
+ parsedBody = parsedOutput.body;
1629
+ throwDefaultError({
1630
+ output: output,
1631
+ parsedBody: parsedBody,
1632
+ exceptionCtor: __BaseException,
1633
+ errorCode: errorCode,
1634
+ });
1635
+ _d.label = 13;
1636
+ case 13: return [2];
1637
+ }
1638
+ });
1639
+ }); };
1640
+ export var deserializeAws_json1_1ValidateResourcePolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1641
+ var data, contents, response;
1642
+ return __generator(this, function (_a) {
1643
+ switch (_a.label) {
1644
+ case 0:
1645
+ if (output.statusCode >= 300) {
1646
+ return [2, deserializeAws_json1_1ValidateResourcePolicyCommandError(output, context)];
1647
+ }
1648
+ return [4, parseBody(output.body, context)];
1649
+ case 1:
1650
+ data = _a.sent();
1651
+ contents = {};
1652
+ contents = deserializeAws_json1_1ValidateResourcePolicyResponse(data, context);
1653
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
1654
+ return [2, Promise.resolve(response)];
1655
+ }
1656
+ });
1657
+ }); };
1658
+ var deserializeAws_json1_1ValidateResourcePolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1659
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1660
+ var _c;
1661
+ return __generator(this, function (_d) {
1662
+ switch (_d.label) {
1663
+ case 0:
1664
+ _a = [__assign({}, output)];
1665
+ _c = {};
1666
+ return [4, parseErrorBody(output.body, context)];
1667
+ case 1:
1668
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1669
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1670
+ _b = errorCode;
1671
+ switch (_b) {
1672
+ case "InternalServiceError": return [3, 2];
1673
+ case "com.amazonaws.secretsmanager#InternalServiceError": return [3, 2];
1674
+ case "InvalidParameterException": return [3, 4];
1675
+ case "com.amazonaws.secretsmanager#InvalidParameterException": return [3, 4];
1676
+ case "InvalidRequestException": return [3, 6];
1677
+ case "com.amazonaws.secretsmanager#InvalidRequestException": return [3, 6];
1678
+ case "MalformedPolicyDocumentException": return [3, 8];
1679
+ case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException": return [3, 8];
1680
+ case "ResourceNotFoundException": return [3, 10];
1681
+ case "com.amazonaws.secretsmanager#ResourceNotFoundException": return [3, 10];
1682
+ }
1683
+ return [3, 12];
1684
+ case 2: return [4, deserializeAws_json1_1InternalServiceErrorResponse(parsedOutput, context)];
1685
+ case 3: throw _d.sent();
1686
+ case 4: return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
1687
+ case 5: throw _d.sent();
1688
+ case 6: return [4, deserializeAws_json1_1InvalidRequestExceptionResponse(parsedOutput, context)];
1689
+ case 7: throw _d.sent();
1690
+ case 8: return [4, deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse(parsedOutput, context)];
1691
+ case 9: throw _d.sent();
1692
+ case 10: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1693
+ case 11: throw _d.sent();
1694
+ case 12:
1695
+ parsedBody = parsedOutput.body;
1696
+ throwDefaultError({
1697
+ output: output,
1698
+ parsedBody: parsedBody,
1699
+ exceptionCtor: __BaseException,
1700
+ errorCode: errorCode,
1701
+ });
1702
+ _d.label = 13;
1703
+ case 13: return [2];
1704
+ }
1705
+ });
1706
+ }); };
1707
+ var deserializeAws_json1_1DecryptionFailureResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1708
+ var body, deserialized, exception;
1709
+ return __generator(this, function (_a) {
1710
+ body = parsedOutput.body;
1711
+ deserialized = deserializeAws_json1_1DecryptionFailure(body, context);
1712
+ exception = new DecryptionFailure(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1713
+ return [2, __decorateServiceException(exception, body)];
1714
+ });
1715
+ }); };
1716
+ var deserializeAws_json1_1EncryptionFailureResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1717
+ var body, deserialized, exception;
1718
+ return __generator(this, function (_a) {
1719
+ body = parsedOutput.body;
1720
+ deserialized = deserializeAws_json1_1EncryptionFailure(body, context);
1721
+ exception = new EncryptionFailure(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1722
+ return [2, __decorateServiceException(exception, body)];
1723
+ });
1724
+ }); };
1725
+ var deserializeAws_json1_1InternalServiceErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1726
+ var body, deserialized, exception;
1727
+ return __generator(this, function (_a) {
1728
+ body = parsedOutput.body;
1729
+ deserialized = deserializeAws_json1_1InternalServiceError(body, context);
1730
+ exception = new InternalServiceError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1731
+ return [2, __decorateServiceException(exception, body)];
1732
+ });
1733
+ }); };
1734
+ var deserializeAws_json1_1InvalidNextTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1735
+ var body, deserialized, exception;
1736
+ return __generator(this, function (_a) {
1737
+ body = parsedOutput.body;
1738
+ deserialized = deserializeAws_json1_1InvalidNextTokenException(body, context);
1739
+ exception = new InvalidNextTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1740
+ return [2, __decorateServiceException(exception, body)];
1741
+ });
1742
+ }); };
1743
+ var deserializeAws_json1_1InvalidParameterExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1744
+ var body, deserialized, exception;
1745
+ return __generator(this, function (_a) {
1746
+ body = parsedOutput.body;
1747
+ deserialized = deserializeAws_json1_1InvalidParameterException(body, context);
1748
+ exception = new InvalidParameterException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1749
+ return [2, __decorateServiceException(exception, body)];
1750
+ });
1751
+ }); };
1752
+ var deserializeAws_json1_1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1753
+ var body, deserialized, exception;
1754
+ return __generator(this, function (_a) {
1755
+ body = parsedOutput.body;
1756
+ deserialized = deserializeAws_json1_1InvalidRequestException(body, context);
1757
+ exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1758
+ return [2, __decorateServiceException(exception, body)];
1759
+ });
1760
+ }); };
1761
+ var deserializeAws_json1_1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1762
+ var body, deserialized, exception;
1763
+ return __generator(this, function (_a) {
1764
+ body = parsedOutput.body;
1765
+ deserialized = deserializeAws_json1_1LimitExceededException(body, context);
1766
+ exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1767
+ return [2, __decorateServiceException(exception, body)];
1768
+ });
1769
+ }); };
1770
+ var deserializeAws_json1_1MalformedPolicyDocumentExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1771
+ var body, deserialized, exception;
1772
+ return __generator(this, function (_a) {
1773
+ body = parsedOutput.body;
1774
+ deserialized = deserializeAws_json1_1MalformedPolicyDocumentException(body, context);
1775
+ exception = new MalformedPolicyDocumentException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1776
+ return [2, __decorateServiceException(exception, body)];
1777
+ });
1778
+ }); };
1779
+ var deserializeAws_json1_1PreconditionNotMetExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1780
+ var body, deserialized, exception;
1781
+ return __generator(this, function (_a) {
1782
+ body = parsedOutput.body;
1783
+ deserialized = deserializeAws_json1_1PreconditionNotMetException(body, context);
1784
+ exception = new PreconditionNotMetException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1785
+ return [2, __decorateServiceException(exception, body)];
1786
+ });
1787
+ }); };
1788
+ var deserializeAws_json1_1PublicPolicyExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1789
+ var body, deserialized, exception;
1790
+ return __generator(this, function (_a) {
1791
+ body = parsedOutput.body;
1792
+ deserialized = deserializeAws_json1_1PublicPolicyException(body, context);
1793
+ exception = new PublicPolicyException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1794
+ return [2, __decorateServiceException(exception, body)];
1795
+ });
1796
+ }); };
1797
+ var deserializeAws_json1_1ResourceExistsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1798
+ var body, deserialized, exception;
1799
+ return __generator(this, function (_a) {
1800
+ body = parsedOutput.body;
1801
+ deserialized = deserializeAws_json1_1ResourceExistsException(body, context);
1802
+ exception = new ResourceExistsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1803
+ return [2, __decorateServiceException(exception, body)];
1804
+ });
1805
+ }); };
1806
+ var deserializeAws_json1_1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1807
+ var body, deserialized, exception;
1808
+ return __generator(this, function (_a) {
1809
+ body = parsedOutput.body;
1810
+ deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
1811
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
1812
+ return [2, __decorateServiceException(exception, body)];
1813
+ });
1814
+ }); };
1815
+ var serializeAws_json1_1AddReplicaRegionListType = function (input, context) {
1285
1816
  return input
1286
- .filter((e) => e != null)
1287
- .map((entry) => {
1817
+ .filter(function (e) { return e != null; })
1818
+ .map(function (entry) {
1288
1819
  return serializeAws_json1_1ReplicaRegionType(entry, context);
1289
1820
  });
1290
1821
  };
1291
- const serializeAws_json1_1CancelRotateSecretRequest = (input, context) => {
1292
- return {
1293
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1294
- };
1822
+ var serializeAws_json1_1CancelRotateSecretRequest = function (input, context) {
1823
+ return __assign({}, (input.SecretId != null && { SecretId: input.SecretId }));
1295
1824
  };
1296
- const serializeAws_json1_1CreateSecretRequest = (input, context) => {
1297
- return {
1298
- ...(input.AddReplicaRegions != null && {
1299
- AddReplicaRegions: serializeAws_json1_1AddReplicaRegionListType(input.AddReplicaRegions, context),
1300
- }),
1301
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
1302
- ...(input.Description != null && { Description: input.Description }),
1303
- ...(input.ForceOverwriteReplicaSecret != null && {
1304
- ForceOverwriteReplicaSecret: input.ForceOverwriteReplicaSecret,
1305
- }),
1306
- ...(input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId }),
1307
- ...(input.Name != null && { Name: input.Name }),
1308
- ...(input.SecretBinary != null && { SecretBinary: context.base64Encoder(input.SecretBinary) }),
1309
- ...(input.SecretString != null && { SecretString: input.SecretString }),
1310
- ...(input.Tags != null && { Tags: serializeAws_json1_1TagListType(input.Tags, context) }),
1311
- };
1825
+ var serializeAws_json1_1CreateSecretRequest = function (input, context) {
1826
+ var _a;
1827
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AddReplicaRegions != null && {
1828
+ AddReplicaRegions: serializeAws_json1_1AddReplicaRegionListType(input.AddReplicaRegions, context),
1829
+ })), { ClientRequestToken: (_a = input.ClientRequestToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }), (input.Description != null && { Description: input.Description })), (input.ForceOverwriteReplicaSecret != null && {
1830
+ ForceOverwriteReplicaSecret: input.ForceOverwriteReplicaSecret,
1831
+ })), (input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId })), (input.Name != null && { Name: input.Name })), (input.SecretBinary != null && { SecretBinary: context.base64Encoder(input.SecretBinary) })), (input.SecretString != null && { SecretString: input.SecretString })), (input.Tags != null && { Tags: serializeAws_json1_1TagListType(input.Tags, context) }));
1312
1832
  };
1313
- const serializeAws_json1_1DeleteResourcePolicyRequest = (input, context) => {
1314
- return {
1315
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1316
- };
1833
+ var serializeAws_json1_1DeleteResourcePolicyRequest = function (input, context) {
1834
+ return __assign({}, (input.SecretId != null && { SecretId: input.SecretId }));
1317
1835
  };
1318
- const serializeAws_json1_1DeleteSecretRequest = (input, context) => {
1319
- return {
1320
- ...(input.ForceDeleteWithoutRecovery != null && { ForceDeleteWithoutRecovery: input.ForceDeleteWithoutRecovery }),
1321
- ...(input.RecoveryWindowInDays != null && { RecoveryWindowInDays: input.RecoveryWindowInDays }),
1322
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1323
- };
1836
+ var serializeAws_json1_1DeleteSecretRequest = function (input, context) {
1837
+ return __assign(__assign(__assign({}, (input.ForceDeleteWithoutRecovery != null && { ForceDeleteWithoutRecovery: input.ForceDeleteWithoutRecovery })), (input.RecoveryWindowInDays != null && { RecoveryWindowInDays: input.RecoveryWindowInDays })), (input.SecretId != null && { SecretId: input.SecretId }));
1324
1838
  };
1325
- const serializeAws_json1_1DescribeSecretRequest = (input, context) => {
1326
- return {
1327
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1328
- };
1839
+ var serializeAws_json1_1DescribeSecretRequest = function (input, context) {
1840
+ return __assign({}, (input.SecretId != null && { SecretId: input.SecretId }));
1329
1841
  };
1330
- const serializeAws_json1_1Filter = (input, context) => {
1331
- return {
1332
- ...(input.Key != null && { Key: input.Key }),
1333
- ...(input.Values != null && { Values: serializeAws_json1_1FilterValuesStringList(input.Values, context) }),
1334
- };
1842
+ var serializeAws_json1_1Filter = function (input, context) {
1843
+ return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Values != null && { Values: serializeAws_json1_1FilterValuesStringList(input.Values, context) }));
1335
1844
  };
1336
- const serializeAws_json1_1FiltersListType = (input, context) => {
1845
+ var serializeAws_json1_1FiltersListType = function (input, context) {
1337
1846
  return input
1338
- .filter((e) => e != null)
1339
- .map((entry) => {
1847
+ .filter(function (e) { return e != null; })
1848
+ .map(function (entry) {
1340
1849
  return serializeAws_json1_1Filter(entry, context);
1341
1850
  });
1342
1851
  };
1343
- const serializeAws_json1_1FilterValuesStringList = (input, context) => {
1852
+ var serializeAws_json1_1FilterValuesStringList = function (input, context) {
1344
1853
  return input
1345
- .filter((e) => e != null)
1346
- .map((entry) => {
1854
+ .filter(function (e) { return e != null; })
1855
+ .map(function (entry) {
1347
1856
  return entry;
1348
1857
  });
1349
1858
  };
1350
- const serializeAws_json1_1GetRandomPasswordRequest = (input, context) => {
1351
- return {
1352
- ...(input.ExcludeCharacters != null && { ExcludeCharacters: input.ExcludeCharacters }),
1353
- ...(input.ExcludeLowercase != null && { ExcludeLowercase: input.ExcludeLowercase }),
1354
- ...(input.ExcludeNumbers != null && { ExcludeNumbers: input.ExcludeNumbers }),
1355
- ...(input.ExcludePunctuation != null && { ExcludePunctuation: input.ExcludePunctuation }),
1356
- ...(input.ExcludeUppercase != null && { ExcludeUppercase: input.ExcludeUppercase }),
1357
- ...(input.IncludeSpace != null && { IncludeSpace: input.IncludeSpace }),
1358
- ...(input.PasswordLength != null && { PasswordLength: input.PasswordLength }),
1359
- ...(input.RequireEachIncludedType != null && { RequireEachIncludedType: input.RequireEachIncludedType }),
1360
- };
1859
+ var serializeAws_json1_1GetRandomPasswordRequest = function (input, context) {
1860
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ExcludeCharacters != null && { ExcludeCharacters: input.ExcludeCharacters })), (input.ExcludeLowercase != null && { ExcludeLowercase: input.ExcludeLowercase })), (input.ExcludeNumbers != null && { ExcludeNumbers: input.ExcludeNumbers })), (input.ExcludePunctuation != null && { ExcludePunctuation: input.ExcludePunctuation })), (input.ExcludeUppercase != null && { ExcludeUppercase: input.ExcludeUppercase })), (input.IncludeSpace != null && { IncludeSpace: input.IncludeSpace })), (input.PasswordLength != null && { PasswordLength: input.PasswordLength })), (input.RequireEachIncludedType != null && { RequireEachIncludedType: input.RequireEachIncludedType }));
1361
1861
  };
1362
- const serializeAws_json1_1GetResourcePolicyRequest = (input, context) => {
1363
- return {
1364
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1365
- };
1862
+ var serializeAws_json1_1GetResourcePolicyRequest = function (input, context) {
1863
+ return __assign({}, (input.SecretId != null && { SecretId: input.SecretId }));
1366
1864
  };
1367
- const serializeAws_json1_1GetSecretValueRequest = (input, context) => {
1368
- return {
1369
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1370
- ...(input.VersionId != null && { VersionId: input.VersionId }),
1371
- ...(input.VersionStage != null && { VersionStage: input.VersionStage }),
1372
- };
1865
+ var serializeAws_json1_1GetSecretValueRequest = function (input, context) {
1866
+ return __assign(__assign(__assign({}, (input.SecretId != null && { SecretId: input.SecretId })), (input.VersionId != null && { VersionId: input.VersionId })), (input.VersionStage != null && { VersionStage: input.VersionStage }));
1373
1867
  };
1374
- const serializeAws_json1_1ListSecretsRequest = (input, context) => {
1375
- return {
1376
- ...(input.Filters != null && { Filters: serializeAws_json1_1FiltersListType(input.Filters, context) }),
1377
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1378
- ...(input.NextToken != null && { NextToken: input.NextToken }),
1379
- ...(input.SortOrder != null && { SortOrder: input.SortOrder }),
1380
- };
1868
+ var serializeAws_json1_1ListSecretsRequest = function (input, context) {
1869
+ return __assign(__assign(__assign(__assign({}, (input.Filters != null && { Filters: serializeAws_json1_1FiltersListType(input.Filters, context) })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.SortOrder != null && { SortOrder: input.SortOrder }));
1381
1870
  };
1382
- const serializeAws_json1_1ListSecretVersionIdsRequest = (input, context) => {
1383
- return {
1384
- ...(input.IncludeDeprecated != null && { IncludeDeprecated: input.IncludeDeprecated }),
1385
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1386
- ...(input.NextToken != null && { NextToken: input.NextToken }),
1387
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1388
- };
1871
+ var serializeAws_json1_1ListSecretVersionIdsRequest = function (input, context) {
1872
+ return __assign(__assign(__assign(__assign({}, (input.IncludeDeprecated != null && { IncludeDeprecated: input.IncludeDeprecated })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.SecretId != null && { SecretId: input.SecretId }));
1389
1873
  };
1390
- const serializeAws_json1_1PutResourcePolicyRequest = (input, context) => {
1391
- return {
1392
- ...(input.BlockPublicPolicy != null && { BlockPublicPolicy: input.BlockPublicPolicy }),
1393
- ...(input.ResourcePolicy != null && { ResourcePolicy: input.ResourcePolicy }),
1394
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1395
- };
1874
+ var serializeAws_json1_1PutResourcePolicyRequest = function (input, context) {
1875
+ return __assign(__assign(__assign({}, (input.BlockPublicPolicy != null && { BlockPublicPolicy: input.BlockPublicPolicy })), (input.ResourcePolicy != null && { ResourcePolicy: input.ResourcePolicy })), (input.SecretId != null && { SecretId: input.SecretId }));
1396
1876
  };
1397
- const serializeAws_json1_1PutSecretValueRequest = (input, context) => {
1398
- return {
1399
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
1400
- ...(input.SecretBinary != null && { SecretBinary: context.base64Encoder(input.SecretBinary) }),
1401
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1402
- ...(input.SecretString != null && { SecretString: input.SecretString }),
1403
- ...(input.VersionStages != null && {
1404
- VersionStages: serializeAws_json1_1SecretVersionStagesType(input.VersionStages, context),
1405
- }),
1406
- };
1877
+ var serializeAws_json1_1PutSecretValueRequest = function (input, context) {
1878
+ var _a;
1879
+ return __assign(__assign(__assign(__assign({ ClientRequestToken: (_a = input.ClientRequestToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.SecretBinary != null && { SecretBinary: context.base64Encoder(input.SecretBinary) })), (input.SecretId != null && { SecretId: input.SecretId })), (input.SecretString != null && { SecretString: input.SecretString })), (input.VersionStages != null && {
1880
+ VersionStages: serializeAws_json1_1SecretVersionStagesType(input.VersionStages, context),
1881
+ }));
1407
1882
  };
1408
- const serializeAws_json1_1RemoveRegionsFromReplicationRequest = (input, context) => {
1409
- return {
1410
- ...(input.RemoveReplicaRegions != null && {
1411
- RemoveReplicaRegions: serializeAws_json1_1RemoveReplicaRegionListType(input.RemoveReplicaRegions, context),
1412
- }),
1413
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1414
- };
1883
+ var serializeAws_json1_1RemoveRegionsFromReplicationRequest = function (input, context) {
1884
+ return __assign(__assign({}, (input.RemoveReplicaRegions != null && {
1885
+ RemoveReplicaRegions: serializeAws_json1_1RemoveReplicaRegionListType(input.RemoveReplicaRegions, context),
1886
+ })), (input.SecretId != null && { SecretId: input.SecretId }));
1415
1887
  };
1416
- const serializeAws_json1_1RemoveReplicaRegionListType = (input, context) => {
1888
+ var serializeAws_json1_1RemoveReplicaRegionListType = function (input, context) {
1417
1889
  return input
1418
- .filter((e) => e != null)
1419
- .map((entry) => {
1890
+ .filter(function (e) { return e != null; })
1891
+ .map(function (entry) {
1420
1892
  return entry;
1421
1893
  });
1422
1894
  };
1423
- const serializeAws_json1_1ReplicaRegionType = (input, context) => {
1424
- return {
1425
- ...(input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId }),
1426
- ...(input.Region != null && { Region: input.Region }),
1427
- };
1895
+ var serializeAws_json1_1ReplicaRegionType = function (input, context) {
1896
+ return __assign(__assign({}, (input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId })), (input.Region != null && { Region: input.Region }));
1428
1897
  };
1429
- const serializeAws_json1_1ReplicateSecretToRegionsRequest = (input, context) => {
1430
- return {
1431
- ...(input.AddReplicaRegions != null && {
1432
- AddReplicaRegions: serializeAws_json1_1AddReplicaRegionListType(input.AddReplicaRegions, context),
1433
- }),
1434
- ...(input.ForceOverwriteReplicaSecret != null && {
1435
- ForceOverwriteReplicaSecret: input.ForceOverwriteReplicaSecret,
1436
- }),
1437
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1438
- };
1898
+ var serializeAws_json1_1ReplicateSecretToRegionsRequest = function (input, context) {
1899
+ return __assign(__assign(__assign({}, (input.AddReplicaRegions != null && {
1900
+ AddReplicaRegions: serializeAws_json1_1AddReplicaRegionListType(input.AddReplicaRegions, context),
1901
+ })), (input.ForceOverwriteReplicaSecret != null && {
1902
+ ForceOverwriteReplicaSecret: input.ForceOverwriteReplicaSecret,
1903
+ })), (input.SecretId != null && { SecretId: input.SecretId }));
1439
1904
  };
1440
- const serializeAws_json1_1RestoreSecretRequest = (input, context) => {
1441
- return {
1442
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1443
- };
1905
+ var serializeAws_json1_1RestoreSecretRequest = function (input, context) {
1906
+ return __assign({}, (input.SecretId != null && { SecretId: input.SecretId }));
1444
1907
  };
1445
- const serializeAws_json1_1RotateSecretRequest = (input, context) => {
1446
- return {
1447
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
1448
- ...(input.RotateImmediately != null && { RotateImmediately: input.RotateImmediately }),
1449
- ...(input.RotationLambdaARN != null && { RotationLambdaARN: input.RotationLambdaARN }),
1450
- ...(input.RotationRules != null && {
1451
- RotationRules: serializeAws_json1_1RotationRulesType(input.RotationRules, context),
1452
- }),
1453
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1454
- };
1908
+ var serializeAws_json1_1RotateSecretRequest = function (input, context) {
1909
+ var _a;
1910
+ return __assign(__assign(__assign(__assign({ ClientRequestToken: (_a = input.ClientRequestToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.RotateImmediately != null && { RotateImmediately: input.RotateImmediately })), (input.RotationLambdaARN != null && { RotationLambdaARN: input.RotationLambdaARN })), (input.RotationRules != null && {
1911
+ RotationRules: serializeAws_json1_1RotationRulesType(input.RotationRules, context),
1912
+ })), (input.SecretId != null && { SecretId: input.SecretId }));
1455
1913
  };
1456
- const serializeAws_json1_1RotationRulesType = (input, context) => {
1457
- return {
1458
- ...(input.AutomaticallyAfterDays != null && { AutomaticallyAfterDays: input.AutomaticallyAfterDays }),
1459
- ...(input.Duration != null && { Duration: input.Duration }),
1460
- ...(input.ScheduleExpression != null && { ScheduleExpression: input.ScheduleExpression }),
1461
- };
1914
+ var serializeAws_json1_1RotationRulesType = function (input, context) {
1915
+ return __assign(__assign(__assign({}, (input.AutomaticallyAfterDays != null && { AutomaticallyAfterDays: input.AutomaticallyAfterDays })), (input.Duration != null && { Duration: input.Duration })), (input.ScheduleExpression != null && { ScheduleExpression: input.ScheduleExpression }));
1462
1916
  };
1463
- const serializeAws_json1_1SecretVersionStagesType = (input, context) => {
1917
+ var serializeAws_json1_1SecretVersionStagesType = function (input, context) {
1464
1918
  return input
1465
- .filter((e) => e != null)
1466
- .map((entry) => {
1919
+ .filter(function (e) { return e != null; })
1920
+ .map(function (entry) {
1467
1921
  return entry;
1468
1922
  });
1469
1923
  };
1470
- const serializeAws_json1_1StopReplicationToReplicaRequest = (input, context) => {
1471
- return {
1472
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1473
- };
1924
+ var serializeAws_json1_1StopReplicationToReplicaRequest = function (input, context) {
1925
+ return __assign({}, (input.SecretId != null && { SecretId: input.SecretId }));
1474
1926
  };
1475
- const serializeAws_json1_1Tag = (input, context) => {
1476
- return {
1477
- ...(input.Key != null && { Key: input.Key }),
1478
- ...(input.Value != null && { Value: input.Value }),
1479
- };
1927
+ var serializeAws_json1_1Tag = function (input, context) {
1928
+ return __assign(__assign({}, (input.Key != null && { Key: input.Key })), (input.Value != null && { Value: input.Value }));
1480
1929
  };
1481
- const serializeAws_json1_1TagKeyListType = (input, context) => {
1930
+ var serializeAws_json1_1TagKeyListType = function (input, context) {
1482
1931
  return input
1483
- .filter((e) => e != null)
1484
- .map((entry) => {
1932
+ .filter(function (e) { return e != null; })
1933
+ .map(function (entry) {
1485
1934
  return entry;
1486
1935
  });
1487
1936
  };
1488
- const serializeAws_json1_1TagListType = (input, context) => {
1937
+ var serializeAws_json1_1TagListType = function (input, context) {
1489
1938
  return input
1490
- .filter((e) => e != null)
1491
- .map((entry) => {
1939
+ .filter(function (e) { return e != null; })
1940
+ .map(function (entry) {
1492
1941
  return serializeAws_json1_1Tag(entry, context);
1493
1942
  });
1494
1943
  };
1495
- const serializeAws_json1_1TagResourceRequest = (input, context) => {
1496
- return {
1497
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1498
- ...(input.Tags != null && { Tags: serializeAws_json1_1TagListType(input.Tags, context) }),
1499
- };
1944
+ var serializeAws_json1_1TagResourceRequest = function (input, context) {
1945
+ return __assign(__assign({}, (input.SecretId != null && { SecretId: input.SecretId })), (input.Tags != null && { Tags: serializeAws_json1_1TagListType(input.Tags, context) }));
1500
1946
  };
1501
- const serializeAws_json1_1UntagResourceRequest = (input, context) => {
1502
- return {
1503
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1504
- ...(input.TagKeys != null && { TagKeys: serializeAws_json1_1TagKeyListType(input.TagKeys, context) }),
1505
- };
1947
+ var serializeAws_json1_1UntagResourceRequest = function (input, context) {
1948
+ return __assign(__assign({}, (input.SecretId != null && { SecretId: input.SecretId })), (input.TagKeys != null && { TagKeys: serializeAws_json1_1TagKeyListType(input.TagKeys, context) }));
1506
1949
  };
1507
- const serializeAws_json1_1UpdateSecretRequest = (input, context) => {
1508
- return {
1509
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
1510
- ...(input.Description != null && { Description: input.Description }),
1511
- ...(input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId }),
1512
- ...(input.SecretBinary != null && { SecretBinary: context.base64Encoder(input.SecretBinary) }),
1513
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1514
- ...(input.SecretString != null && { SecretString: input.SecretString }),
1515
- };
1950
+ var serializeAws_json1_1UpdateSecretRequest = function (input, context) {
1951
+ var _a;
1952
+ return __assign(__assign(__assign(__assign(__assign({ ClientRequestToken: (_a = input.ClientRequestToken) !== null && _a !== void 0 ? _a : generateIdempotencyToken() }, (input.Description != null && { Description: input.Description })), (input.KmsKeyId != null && { KmsKeyId: input.KmsKeyId })), (input.SecretBinary != null && { SecretBinary: context.base64Encoder(input.SecretBinary) })), (input.SecretId != null && { SecretId: input.SecretId })), (input.SecretString != null && { SecretString: input.SecretString }));
1516
1953
  };
1517
- const serializeAws_json1_1UpdateSecretVersionStageRequest = (input, context) => {
1518
- return {
1519
- ...(input.MoveToVersionId != null && { MoveToVersionId: input.MoveToVersionId }),
1520
- ...(input.RemoveFromVersionId != null && { RemoveFromVersionId: input.RemoveFromVersionId }),
1521
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1522
- ...(input.VersionStage != null && { VersionStage: input.VersionStage }),
1523
- };
1954
+ var serializeAws_json1_1UpdateSecretVersionStageRequest = function (input, context) {
1955
+ return __assign(__assign(__assign(__assign({}, (input.MoveToVersionId != null && { MoveToVersionId: input.MoveToVersionId })), (input.RemoveFromVersionId != null && { RemoveFromVersionId: input.RemoveFromVersionId })), (input.SecretId != null && { SecretId: input.SecretId })), (input.VersionStage != null && { VersionStage: input.VersionStage }));
1524
1956
  };
1525
- const serializeAws_json1_1ValidateResourcePolicyRequest = (input, context) => {
1526
- return {
1527
- ...(input.ResourcePolicy != null && { ResourcePolicy: input.ResourcePolicy }),
1528
- ...(input.SecretId != null && { SecretId: input.SecretId }),
1529
- };
1957
+ var serializeAws_json1_1ValidateResourcePolicyRequest = function (input, context) {
1958
+ return __assign(__assign({}, (input.ResourcePolicy != null && { ResourcePolicy: input.ResourcePolicy })), (input.SecretId != null && { SecretId: input.SecretId }));
1530
1959
  };
1531
- const deserializeAws_json1_1CancelRotateSecretResponse = (output, context) => {
1960
+ var deserializeAws_json1_1CancelRotateSecretResponse = function (output, context) {
1532
1961
  return {
1533
1962
  ARN: __expectString(output.ARN),
1534
1963
  Name: __expectString(output.Name),
1535
1964
  VersionId: __expectString(output.VersionId),
1536
1965
  };
1537
1966
  };
1538
- const deserializeAws_json1_1CreateSecretResponse = (output, context) => {
1967
+ var deserializeAws_json1_1CreateSecretResponse = function (output, context) {
1539
1968
  return {
1540
1969
  ARN: __expectString(output.ARN),
1541
1970
  Name: __expectString(output.Name),
@@ -1545,18 +1974,18 @@ const deserializeAws_json1_1CreateSecretResponse = (output, context) => {
1545
1974
  VersionId: __expectString(output.VersionId),
1546
1975
  };
1547
1976
  };
1548
- const deserializeAws_json1_1DecryptionFailure = (output, context) => {
1977
+ var deserializeAws_json1_1DecryptionFailure = function (output, context) {
1549
1978
  return {
1550
1979
  Message: __expectString(output.Message),
1551
1980
  };
1552
1981
  };
1553
- const deserializeAws_json1_1DeleteResourcePolicyResponse = (output, context) => {
1982
+ var deserializeAws_json1_1DeleteResourcePolicyResponse = function (output, context) {
1554
1983
  return {
1555
1984
  ARN: __expectString(output.ARN),
1556
1985
  Name: __expectString(output.Name),
1557
1986
  };
1558
1987
  };
1559
- const deserializeAws_json1_1DeleteSecretResponse = (output, context) => {
1988
+ var deserializeAws_json1_1DeleteSecretResponse = function (output, context) {
1560
1989
  return {
1561
1990
  ARN: __expectString(output.ARN),
1562
1991
  DeletionDate: output.DeletionDate != null
@@ -1565,7 +1994,7 @@ const deserializeAws_json1_1DeleteSecretResponse = (output, context) => {
1565
1994
  Name: __expectString(output.Name),
1566
1995
  };
1567
1996
  };
1568
- const deserializeAws_json1_1DescribeSecretResponse = (output, context) => {
1997
+ var deserializeAws_json1_1DescribeSecretResponse = function (output, context) {
1569
1998
  return {
1570
1999
  ARN: __expectString(output.ARN),
1571
2000
  CreatedDate: output.CreatedDate != null
@@ -1600,24 +2029,24 @@ const deserializeAws_json1_1DescribeSecretResponse = (output, context) => {
1600
2029
  : undefined,
1601
2030
  };
1602
2031
  };
1603
- const deserializeAws_json1_1EncryptionFailure = (output, context) => {
2032
+ var deserializeAws_json1_1EncryptionFailure = function (output, context) {
1604
2033
  return {
1605
2034
  Message: __expectString(output.Message),
1606
2035
  };
1607
2036
  };
1608
- const deserializeAws_json1_1GetRandomPasswordResponse = (output, context) => {
2037
+ var deserializeAws_json1_1GetRandomPasswordResponse = function (output, context) {
1609
2038
  return {
1610
2039
  RandomPassword: __expectString(output.RandomPassword),
1611
2040
  };
1612
2041
  };
1613
- const deserializeAws_json1_1GetResourcePolicyResponse = (output, context) => {
2042
+ var deserializeAws_json1_1GetResourcePolicyResponse = function (output, context) {
1614
2043
  return {
1615
2044
  ARN: __expectString(output.ARN),
1616
2045
  Name: __expectString(output.Name),
1617
2046
  ResourcePolicy: __expectString(output.ResourcePolicy),
1618
2047
  };
1619
2048
  };
1620
- const deserializeAws_json1_1GetSecretValueResponse = (output, context) => {
2049
+ var deserializeAws_json1_1GetSecretValueResponse = function (output, context) {
1621
2050
  return {
1622
2051
  ARN: __expectString(output.ARN),
1623
2052
  CreatedDate: output.CreatedDate != null
@@ -1632,30 +2061,30 @@ const deserializeAws_json1_1GetSecretValueResponse = (output, context) => {
1632
2061
  : undefined,
1633
2062
  };
1634
2063
  };
1635
- const deserializeAws_json1_1InternalServiceError = (output, context) => {
2064
+ var deserializeAws_json1_1InternalServiceError = function (output, context) {
1636
2065
  return {
1637
2066
  Message: __expectString(output.Message),
1638
2067
  };
1639
2068
  };
1640
- const deserializeAws_json1_1InvalidNextTokenException = (output, context) => {
2069
+ var deserializeAws_json1_1InvalidNextTokenException = function (output, context) {
1641
2070
  return {
1642
2071
  Message: __expectString(output.Message),
1643
2072
  };
1644
2073
  };
1645
- const deserializeAws_json1_1InvalidParameterException = (output, context) => {
2074
+ var deserializeAws_json1_1InvalidParameterException = function (output, context) {
1646
2075
  return {
1647
2076
  Message: __expectString(output.Message),
1648
2077
  };
1649
2078
  };
1650
- const deserializeAws_json1_1InvalidRequestException = (output, context) => {
2079
+ var deserializeAws_json1_1InvalidRequestException = function (output, context) {
1651
2080
  return {
1652
2081
  Message: __expectString(output.Message),
1653
2082
  };
1654
2083
  };
1655
- const deserializeAws_json1_1KmsKeyIdListType = (output, context) => {
1656
- const retVal = (output || [])
1657
- .filter((e) => e != null)
1658
- .map((entry) => {
2084
+ var deserializeAws_json1_1KmsKeyIdListType = function (output, context) {
2085
+ var retVal = (output || [])
2086
+ .filter(function (e) { return e != null; })
2087
+ .map(function (entry) {
1659
2088
  if (entry === null) {
1660
2089
  return null;
1661
2090
  }
@@ -1663,18 +2092,18 @@ const deserializeAws_json1_1KmsKeyIdListType = (output, context) => {
1663
2092
  });
1664
2093
  return retVal;
1665
2094
  };
1666
- const deserializeAws_json1_1LimitExceededException = (output, context) => {
2095
+ var deserializeAws_json1_1LimitExceededException = function (output, context) {
1667
2096
  return {
1668
2097
  Message: __expectString(output.Message),
1669
2098
  };
1670
2099
  };
1671
- const deserializeAws_json1_1ListSecretsResponse = (output, context) => {
2100
+ var deserializeAws_json1_1ListSecretsResponse = function (output, context) {
1672
2101
  return {
1673
2102
  NextToken: __expectString(output.NextToken),
1674
2103
  SecretList: output.SecretList != null ? deserializeAws_json1_1SecretListType(output.SecretList, context) : undefined,
1675
2104
  };
1676
2105
  };
1677
- const deserializeAws_json1_1ListSecretVersionIdsResponse = (output, context) => {
2106
+ var deserializeAws_json1_1ListSecretVersionIdsResponse = function (output, context) {
1678
2107
  return {
1679
2108
  ARN: __expectString(output.ARN),
1680
2109
  Name: __expectString(output.Name),
@@ -1682,28 +2111,28 @@ const deserializeAws_json1_1ListSecretVersionIdsResponse = (output, context) =>
1682
2111
  Versions: output.Versions != null ? deserializeAws_json1_1SecretVersionsListType(output.Versions, context) : undefined,
1683
2112
  };
1684
2113
  };
1685
- const deserializeAws_json1_1MalformedPolicyDocumentException = (output, context) => {
2114
+ var deserializeAws_json1_1MalformedPolicyDocumentException = function (output, context) {
1686
2115
  return {
1687
2116
  Message: __expectString(output.Message),
1688
2117
  };
1689
2118
  };
1690
- const deserializeAws_json1_1PreconditionNotMetException = (output, context) => {
2119
+ var deserializeAws_json1_1PreconditionNotMetException = function (output, context) {
1691
2120
  return {
1692
2121
  Message: __expectString(output.Message),
1693
2122
  };
1694
2123
  };
1695
- const deserializeAws_json1_1PublicPolicyException = (output, context) => {
2124
+ var deserializeAws_json1_1PublicPolicyException = function (output, context) {
1696
2125
  return {
1697
2126
  Message: __expectString(output.Message),
1698
2127
  };
1699
2128
  };
1700
- const deserializeAws_json1_1PutResourcePolicyResponse = (output, context) => {
2129
+ var deserializeAws_json1_1PutResourcePolicyResponse = function (output, context) {
1701
2130
  return {
1702
2131
  ARN: __expectString(output.ARN),
1703
2132
  Name: __expectString(output.Name),
1704
2133
  };
1705
2134
  };
1706
- const deserializeAws_json1_1PutSecretValueResponse = (output, context) => {
2135
+ var deserializeAws_json1_1PutSecretValueResponse = function (output, context) {
1707
2136
  return {
1708
2137
  ARN: __expectString(output.ARN),
1709
2138
  Name: __expectString(output.Name),
@@ -1713,7 +2142,7 @@ const deserializeAws_json1_1PutSecretValueResponse = (output, context) => {
1713
2142
  : undefined,
1714
2143
  };
1715
2144
  };
1716
- const deserializeAws_json1_1RemoveRegionsFromReplicationResponse = (output, context) => {
2145
+ var deserializeAws_json1_1RemoveRegionsFromReplicationResponse = function (output, context) {
1717
2146
  return {
1718
2147
  ARN: __expectString(output.ARN),
1719
2148
  ReplicationStatus: output.ReplicationStatus != null
@@ -1721,7 +2150,7 @@ const deserializeAws_json1_1RemoveRegionsFromReplicationResponse = (output, cont
1721
2150
  : undefined,
1722
2151
  };
1723
2152
  };
1724
- const deserializeAws_json1_1ReplicateSecretToRegionsResponse = (output, context) => {
2153
+ var deserializeAws_json1_1ReplicateSecretToRegionsResponse = function (output, context) {
1725
2154
  return {
1726
2155
  ARN: __expectString(output.ARN),
1727
2156
  ReplicationStatus: output.ReplicationStatus != null
@@ -1729,10 +2158,10 @@ const deserializeAws_json1_1ReplicateSecretToRegionsResponse = (output, context)
1729
2158
  : undefined,
1730
2159
  };
1731
2160
  };
1732
- const deserializeAws_json1_1ReplicationStatusListType = (output, context) => {
1733
- const retVal = (output || [])
1734
- .filter((e) => e != null)
1735
- .map((entry) => {
2161
+ var deserializeAws_json1_1ReplicationStatusListType = function (output, context) {
2162
+ var retVal = (output || [])
2163
+ .filter(function (e) { return e != null; })
2164
+ .map(function (entry) {
1736
2165
  if (entry === null) {
1737
2166
  return null;
1738
2167
  }
@@ -1740,7 +2169,7 @@ const deserializeAws_json1_1ReplicationStatusListType = (output, context) => {
1740
2169
  });
1741
2170
  return retVal;
1742
2171
  };
1743
- const deserializeAws_json1_1ReplicationStatusType = (output, context) => {
2172
+ var deserializeAws_json1_1ReplicationStatusType = function (output, context) {
1744
2173
  return {
1745
2174
  KmsKeyId: __expectString(output.KmsKeyId),
1746
2175
  LastAccessedDate: output.LastAccessedDate != null
@@ -1751,37 +2180,37 @@ const deserializeAws_json1_1ReplicationStatusType = (output, context) => {
1751
2180
  StatusMessage: __expectString(output.StatusMessage),
1752
2181
  };
1753
2182
  };
1754
- const deserializeAws_json1_1ResourceExistsException = (output, context) => {
2183
+ var deserializeAws_json1_1ResourceExistsException = function (output, context) {
1755
2184
  return {
1756
2185
  Message: __expectString(output.Message),
1757
2186
  };
1758
2187
  };
1759
- const deserializeAws_json1_1ResourceNotFoundException = (output, context) => {
2188
+ var deserializeAws_json1_1ResourceNotFoundException = function (output, context) {
1760
2189
  return {
1761
2190
  Message: __expectString(output.Message),
1762
2191
  };
1763
2192
  };
1764
- const deserializeAws_json1_1RestoreSecretResponse = (output, context) => {
2193
+ var deserializeAws_json1_1RestoreSecretResponse = function (output, context) {
1765
2194
  return {
1766
2195
  ARN: __expectString(output.ARN),
1767
2196
  Name: __expectString(output.Name),
1768
2197
  };
1769
2198
  };
1770
- const deserializeAws_json1_1RotateSecretResponse = (output, context) => {
2199
+ var deserializeAws_json1_1RotateSecretResponse = function (output, context) {
1771
2200
  return {
1772
2201
  ARN: __expectString(output.ARN),
1773
2202
  Name: __expectString(output.Name),
1774
2203
  VersionId: __expectString(output.VersionId),
1775
2204
  };
1776
2205
  };
1777
- const deserializeAws_json1_1RotationRulesType = (output, context) => {
2206
+ var deserializeAws_json1_1RotationRulesType = function (output, context) {
1778
2207
  return {
1779
2208
  AutomaticallyAfterDays: __expectLong(output.AutomaticallyAfterDays),
1780
2209
  Duration: __expectString(output.Duration),
1781
2210
  ScheduleExpression: __expectString(output.ScheduleExpression),
1782
2211
  };
1783
2212
  };
1784
- const deserializeAws_json1_1SecretListEntry = (output, context) => {
2213
+ var deserializeAws_json1_1SecretListEntry = function (output, context) {
1785
2214
  return {
1786
2215
  ARN: __expectString(output.ARN),
1787
2216
  CreatedDate: output.CreatedDate != null
@@ -1813,10 +2242,10 @@ const deserializeAws_json1_1SecretListEntry = (output, context) => {
1813
2242
  Tags: output.Tags != null ? deserializeAws_json1_1TagListType(output.Tags, context) : undefined,
1814
2243
  };
1815
2244
  };
1816
- const deserializeAws_json1_1SecretListType = (output, context) => {
1817
- const retVal = (output || [])
1818
- .filter((e) => e != null)
1819
- .map((entry) => {
2245
+ var deserializeAws_json1_1SecretListType = function (output, context) {
2246
+ var retVal = (output || [])
2247
+ .filter(function (e) { return e != null; })
2248
+ .map(function (entry) {
1820
2249
  if (entry === null) {
1821
2250
  return null;
1822
2251
  }
@@ -1824,7 +2253,7 @@ const deserializeAws_json1_1SecretListType = (output, context) => {
1824
2253
  });
1825
2254
  return retVal;
1826
2255
  };
1827
- const deserializeAws_json1_1SecretVersionsListEntry = (output, context) => {
2256
+ var deserializeAws_json1_1SecretVersionsListEntry = function (output, context) {
1828
2257
  return {
1829
2258
  CreatedDate: output.CreatedDate != null
1830
2259
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedDate)))
@@ -1839,10 +2268,10 @@ const deserializeAws_json1_1SecretVersionsListEntry = (output, context) => {
1839
2268
  : undefined,
1840
2269
  };
1841
2270
  };
1842
- const deserializeAws_json1_1SecretVersionsListType = (output, context) => {
1843
- const retVal = (output || [])
1844
- .filter((e) => e != null)
1845
- .map((entry) => {
2271
+ var deserializeAws_json1_1SecretVersionsListType = function (output, context) {
2272
+ var retVal = (output || [])
2273
+ .filter(function (e) { return e != null; })
2274
+ .map(function (entry) {
1846
2275
  if (entry === null) {
1847
2276
  return null;
1848
2277
  }
@@ -1850,10 +2279,10 @@ const deserializeAws_json1_1SecretVersionsListType = (output, context) => {
1850
2279
  });
1851
2280
  return retVal;
1852
2281
  };
1853
- const deserializeAws_json1_1SecretVersionStagesType = (output, context) => {
1854
- const retVal = (output || [])
1855
- .filter((e) => e != null)
1856
- .map((entry) => {
2282
+ var deserializeAws_json1_1SecretVersionStagesType = function (output, context) {
2283
+ var retVal = (output || [])
2284
+ .filter(function (e) { return e != null; })
2285
+ .map(function (entry) {
1857
2286
  if (entry === null) {
1858
2287
  return null;
1859
2288
  }
@@ -1861,32 +2290,31 @@ const deserializeAws_json1_1SecretVersionStagesType = (output, context) => {
1861
2290
  });
1862
2291
  return retVal;
1863
2292
  };
1864
- const deserializeAws_json1_1SecretVersionsToStagesMapType = (output, context) => {
1865
- return Object.entries(output).reduce((acc, [key, value]) => {
2293
+ var deserializeAws_json1_1SecretVersionsToStagesMapType = function (output, context) {
2294
+ return Object.entries(output).reduce(function (acc, _a) {
2295
+ var _b;
2296
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1866
2297
  if (value === null) {
1867
2298
  return acc;
1868
2299
  }
1869
- return {
1870
- ...acc,
1871
- [key]: deserializeAws_json1_1SecretVersionStagesType(value, context),
1872
- };
2300
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_json1_1SecretVersionStagesType(value, context), _b));
1873
2301
  }, {});
1874
2302
  };
1875
- const deserializeAws_json1_1StopReplicationToReplicaResponse = (output, context) => {
2303
+ var deserializeAws_json1_1StopReplicationToReplicaResponse = function (output, context) {
1876
2304
  return {
1877
2305
  ARN: __expectString(output.ARN),
1878
2306
  };
1879
2307
  };
1880
- const deserializeAws_json1_1Tag = (output, context) => {
2308
+ var deserializeAws_json1_1Tag = function (output, context) {
1881
2309
  return {
1882
2310
  Key: __expectString(output.Key),
1883
2311
  Value: __expectString(output.Value),
1884
2312
  };
1885
2313
  };
1886
- const deserializeAws_json1_1TagListType = (output, context) => {
1887
- const retVal = (output || [])
1888
- .filter((e) => e != null)
1889
- .map((entry) => {
2314
+ var deserializeAws_json1_1TagListType = function (output, context) {
2315
+ var retVal = (output || [])
2316
+ .filter(function (e) { return e != null; })
2317
+ .map(function (entry) {
1890
2318
  if (entry === null) {
1891
2319
  return null;
1892
2320
  }
@@ -1894,20 +2322,20 @@ const deserializeAws_json1_1TagListType = (output, context) => {
1894
2322
  });
1895
2323
  return retVal;
1896
2324
  };
1897
- const deserializeAws_json1_1UpdateSecretResponse = (output, context) => {
2325
+ var deserializeAws_json1_1UpdateSecretResponse = function (output, context) {
1898
2326
  return {
1899
2327
  ARN: __expectString(output.ARN),
1900
2328
  Name: __expectString(output.Name),
1901
2329
  VersionId: __expectString(output.VersionId),
1902
2330
  };
1903
2331
  };
1904
- const deserializeAws_json1_1UpdateSecretVersionStageResponse = (output, context) => {
2332
+ var deserializeAws_json1_1UpdateSecretVersionStageResponse = function (output, context) {
1905
2333
  return {
1906
2334
  ARN: __expectString(output.ARN),
1907
2335
  Name: __expectString(output.Name),
1908
2336
  };
1909
2337
  };
1910
- const deserializeAws_json1_1ValidateResourcePolicyResponse = (output, context) => {
2338
+ var deserializeAws_json1_1ValidateResourcePolicyResponse = function (output, context) {
1911
2339
  return {
1912
2340
  PolicyValidationPassed: __expectBoolean(output.PolicyValidationPassed),
1913
2341
  ValidationErrors: output.ValidationErrors != null
@@ -1915,16 +2343,16 @@ const deserializeAws_json1_1ValidateResourcePolicyResponse = (output, context) =
1915
2343
  : undefined,
1916
2344
  };
1917
2345
  };
1918
- const deserializeAws_json1_1ValidationErrorsEntry = (output, context) => {
2346
+ var deserializeAws_json1_1ValidationErrorsEntry = function (output, context) {
1919
2347
  return {
1920
2348
  CheckName: __expectString(output.CheckName),
1921
2349
  ErrorMessage: __expectString(output.ErrorMessage),
1922
2350
  };
1923
2351
  };
1924
- const deserializeAws_json1_1ValidationErrorsType = (output, context) => {
1925
- const retVal = (output || [])
1926
- .filter((e) => e != null)
1927
- .map((entry) => {
2352
+ var deserializeAws_json1_1ValidationErrorsType = function (output, context) {
2353
+ var retVal = (output || [])
2354
+ .filter(function (e) { return e != null; })
2355
+ .map(function (entry) {
1928
2356
  if (entry === null) {
1929
2357
  return null;
1930
2358
  }
@@ -1932,52 +2360,75 @@ const deserializeAws_json1_1ValidationErrorsType = (output, context) => {
1932
2360
  });
1933
2361
  return retVal;
1934
2362
  };
1935
- const deserializeMetadata = (output) => ({
1936
- httpStatusCode: output.statusCode,
1937
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1938
- extendedRequestId: output.headers["x-amz-id-2"],
1939
- cfId: output.headers["x-amz-cf-id"],
1940
- });
1941
- const collectBody = (streamBody = new Uint8Array(), context) => {
2363
+ var deserializeMetadata = function (output) {
2364
+ var _a, _b;
2365
+ return ({
2366
+ httpStatusCode: output.statusCode,
2367
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
2368
+ extendedRequestId: output.headers["x-amz-id-2"],
2369
+ cfId: output.headers["x-amz-cf-id"],
2370
+ });
2371
+ };
2372
+ var collectBody = function (streamBody, context) {
2373
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
1942
2374
  if (streamBody instanceof Uint8Array) {
1943
2375
  return Promise.resolve(streamBody);
1944
2376
  }
1945
2377
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1946
2378
  };
1947
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1948
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1949
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1950
- const contents = {
1951
- protocol,
1952
- hostname,
1953
- port,
1954
- method: "POST",
1955
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1956
- headers,
1957
- };
1958
- if (resolvedHostname !== undefined) {
1959
- contents.hostname = resolvedHostname;
1960
- }
1961
- if (body !== undefined) {
1962
- contents.body = body;
1963
- }
1964
- return new __HttpRequest(contents);
2379
+ var collectBodyString = function (streamBody, context) {
2380
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2381
+ };
2382
+ var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
2383
+ var _a, hostname, _b, protocol, port, basePath, contents;
2384
+ return __generator(this, function (_c) {
2385
+ switch (_c.label) {
2386
+ case 0: return [4, context.endpoint()];
2387
+ case 1:
2388
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
2389
+ contents = {
2390
+ protocol: protocol,
2391
+ hostname: hostname,
2392
+ port: port,
2393
+ method: "POST",
2394
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
2395
+ headers: headers,
2396
+ };
2397
+ if (resolvedHostname !== undefined) {
2398
+ contents.hostname = resolvedHostname;
2399
+ }
2400
+ if (body !== undefined) {
2401
+ contents.body = body;
2402
+ }
2403
+ return [2, new __HttpRequest(contents)];
2404
+ }
2405
+ });
2406
+ }); };
2407
+ var parseBody = function (streamBody, context) {
2408
+ return collectBodyString(streamBody, context).then(function (encoded) {
2409
+ if (encoded.length) {
2410
+ return JSON.parse(encoded);
2411
+ }
2412
+ return {};
2413
+ });
1965
2414
  };
1966
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1967
- if (encoded.length) {
1968
- return JSON.parse(encoded);
1969
- }
1970
- return {};
1971
- });
1972
- const parseErrorBody = async (errorBody, context) => {
1973
- const value = await parseBody(errorBody, context);
1974
- value.message = value.message ?? value.Message;
1975
- return value;
1976
- };
1977
- const loadRestJsonErrorCode = (output, data) => {
1978
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1979
- const sanitizeErrorCode = (rawValue) => {
1980
- let cleanValue = rawValue;
2415
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2416
+ var value;
2417
+ var _a;
2418
+ return __generator(this, function (_b) {
2419
+ switch (_b.label) {
2420
+ case 0: return [4, parseBody(errorBody, context)];
2421
+ case 1:
2422
+ value = _b.sent();
2423
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2424
+ return [2, value];
2425
+ }
2426
+ });
2427
+ }); };
2428
+ var loadRestJsonErrorCode = function (output, data) {
2429
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2430
+ var sanitizeErrorCode = function (rawValue) {
2431
+ var cleanValue = rawValue;
1981
2432
  if (typeof cleanValue === "number") {
1982
2433
  cleanValue = cleanValue.toString();
1983
2434
  }
@@ -1992,7 +2443,7 @@ const loadRestJsonErrorCode = (output, data) => {
1992
2443
  }
1993
2444
  return cleanValue;
1994
2445
  };
1995
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2446
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
1996
2447
  if (headerKey !== undefined) {
1997
2448
  return sanitizeErrorCode(output.headers[headerKey]);
1998
2449
  }