@aws-sdk/client-secrets-manager 3.491.0 → 3.496.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 (40) hide show
  1. package/dist-cjs/SecretsManager.js +1 -57
  2. package/dist-cjs/SecretsManagerClient.js +1 -43
  3. package/dist-cjs/commands/BatchGetSecretValueCommand.js +1 -29
  4. package/dist-cjs/commands/CancelRotateSecretCommand.js +1 -28
  5. package/dist-cjs/commands/CreateSecretCommand.js +1 -29
  6. package/dist-cjs/commands/DeleteResourcePolicyCommand.js +1 -28
  7. package/dist-cjs/commands/DeleteSecretCommand.js +1 -28
  8. package/dist-cjs/commands/DescribeSecretCommand.js +1 -28
  9. package/dist-cjs/commands/GetRandomPasswordCommand.js +1 -29
  10. package/dist-cjs/commands/GetResourcePolicyCommand.js +1 -28
  11. package/dist-cjs/commands/GetSecretValueCommand.js +1 -29
  12. package/dist-cjs/commands/ListSecretVersionIdsCommand.js +1 -28
  13. package/dist-cjs/commands/ListSecretsCommand.js +1 -28
  14. package/dist-cjs/commands/PutResourcePolicyCommand.js +1 -28
  15. package/dist-cjs/commands/PutSecretValueCommand.js +1 -29
  16. package/dist-cjs/commands/RemoveRegionsFromReplicationCommand.js +1 -28
  17. package/dist-cjs/commands/ReplicateSecretToRegionsCommand.js +1 -28
  18. package/dist-cjs/commands/RestoreSecretCommand.js +1 -28
  19. package/dist-cjs/commands/RotateSecretCommand.js +1 -28
  20. package/dist-cjs/commands/StopReplicationToReplicaCommand.js +1 -28
  21. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  22. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  23. package/dist-cjs/commands/UpdateSecretCommand.js +1 -29
  24. package/dist-cjs/commands/UpdateSecretVersionStageCommand.js +1 -28
  25. package/dist-cjs/commands/ValidateResourcePolicyCommand.js +1 -28
  26. package/dist-cjs/commands/index.js +1 -26
  27. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  28. package/dist-cjs/extensionConfiguration.js +1 -2
  29. package/dist-cjs/index.js +2467 -11
  30. package/dist-cjs/models/SecretsManagerServiceException.js +1 -12
  31. package/dist-cjs/models/index.js +1 -4
  32. package/dist-cjs/models/models_0.js +1 -231
  33. package/dist-cjs/pagination/BatchGetSecretValuePaginator.js +1 -7
  34. package/dist-cjs/pagination/Interfaces.js +1 -2
  35. package/dist-cjs/pagination/ListSecretVersionIdsPaginator.js +1 -7
  36. package/dist-cjs/pagination/ListSecretsPaginator.js +1 -7
  37. package/dist-cjs/pagination/index.js +1 -7
  38. package/dist-cjs/protocols/Aws_json1_1.js +1 -1576
  39. package/dist-cjs/runtimeExtensions.js +1 -22
  40. package/package.json +40 -40
@@ -1,1576 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ValidateResourcePolicyCommand = exports.de_UpdateSecretVersionStageCommand = exports.de_UpdateSecretCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StopReplicationToReplicaCommand = exports.de_RotateSecretCommand = exports.de_RestoreSecretCommand = exports.de_ReplicateSecretToRegionsCommand = exports.de_RemoveRegionsFromReplicationCommand = exports.de_PutSecretValueCommand = exports.de_PutResourcePolicyCommand = exports.de_ListSecretVersionIdsCommand = exports.de_ListSecretsCommand = exports.de_GetSecretValueCommand = exports.de_GetResourcePolicyCommand = exports.de_GetRandomPasswordCommand = exports.de_DescribeSecretCommand = exports.de_DeleteSecretCommand = exports.de_DeleteResourcePolicyCommand = exports.de_CreateSecretCommand = exports.de_CancelRotateSecretCommand = exports.de_BatchGetSecretValueCommand = exports.se_ValidateResourcePolicyCommand = exports.se_UpdateSecretVersionStageCommand = exports.se_UpdateSecretCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StopReplicationToReplicaCommand = exports.se_RotateSecretCommand = exports.se_RestoreSecretCommand = exports.se_ReplicateSecretToRegionsCommand = exports.se_RemoveRegionsFromReplicationCommand = exports.se_PutSecretValueCommand = exports.se_PutResourcePolicyCommand = exports.se_ListSecretVersionIdsCommand = exports.se_ListSecretsCommand = exports.se_GetSecretValueCommand = exports.se_GetResourcePolicyCommand = exports.se_GetRandomPasswordCommand = exports.se_DescribeSecretCommand = exports.se_DeleteSecretCommand = exports.se_DeleteResourcePolicyCommand = exports.se_CreateSecretCommand = exports.se_CancelRotateSecretCommand = exports.se_BatchGetSecretValueCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const uuid_1 = require("uuid");
7
- const models_0_1 = require("../models/models_0");
8
- const SecretsManagerServiceException_1 = require("../models/SecretsManagerServiceException");
9
- const se_BatchGetSecretValueCommand = async (input, context) => {
10
- const headers = sharedHeaders("BatchGetSecretValue");
11
- let body;
12
- body = JSON.stringify((0, smithy_client_1._json)(input));
13
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
- };
15
- exports.se_BatchGetSecretValueCommand = se_BatchGetSecretValueCommand;
16
- const se_CancelRotateSecretCommand = async (input, context) => {
17
- const headers = sharedHeaders("CancelRotateSecret");
18
- let body;
19
- body = JSON.stringify((0, smithy_client_1._json)(input));
20
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
21
- };
22
- exports.se_CancelRotateSecretCommand = se_CancelRotateSecretCommand;
23
- const se_CreateSecretCommand = async (input, context) => {
24
- const headers = sharedHeaders("CreateSecret");
25
- let body;
26
- body = JSON.stringify(se_CreateSecretRequest(input, context));
27
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
- };
29
- exports.se_CreateSecretCommand = se_CreateSecretCommand;
30
- const se_DeleteResourcePolicyCommand = async (input, context) => {
31
- const headers = sharedHeaders("DeleteResourcePolicy");
32
- let body;
33
- body = JSON.stringify((0, smithy_client_1._json)(input));
34
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
35
- };
36
- exports.se_DeleteResourcePolicyCommand = se_DeleteResourcePolicyCommand;
37
- const se_DeleteSecretCommand = async (input, context) => {
38
- const headers = sharedHeaders("DeleteSecret");
39
- let body;
40
- body = JSON.stringify((0, smithy_client_1._json)(input));
41
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
42
- };
43
- exports.se_DeleteSecretCommand = se_DeleteSecretCommand;
44
- const se_DescribeSecretCommand = async (input, context) => {
45
- const headers = sharedHeaders("DescribeSecret");
46
- let body;
47
- body = JSON.stringify((0, smithy_client_1._json)(input));
48
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
- };
50
- exports.se_DescribeSecretCommand = se_DescribeSecretCommand;
51
- const se_GetRandomPasswordCommand = async (input, context) => {
52
- const headers = sharedHeaders("GetRandomPassword");
53
- let body;
54
- body = JSON.stringify((0, smithy_client_1._json)(input));
55
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
56
- };
57
- exports.se_GetRandomPasswordCommand = se_GetRandomPasswordCommand;
58
- const se_GetResourcePolicyCommand = async (input, context) => {
59
- const headers = sharedHeaders("GetResourcePolicy");
60
- let body;
61
- body = JSON.stringify((0, smithy_client_1._json)(input));
62
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
63
- };
64
- exports.se_GetResourcePolicyCommand = se_GetResourcePolicyCommand;
65
- const se_GetSecretValueCommand = async (input, context) => {
66
- const headers = sharedHeaders("GetSecretValue");
67
- let body;
68
- body = JSON.stringify((0, smithy_client_1._json)(input));
69
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
70
- };
71
- exports.se_GetSecretValueCommand = se_GetSecretValueCommand;
72
- const se_ListSecretsCommand = async (input, context) => {
73
- const headers = sharedHeaders("ListSecrets");
74
- let body;
75
- body = JSON.stringify((0, smithy_client_1._json)(input));
76
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
- };
78
- exports.se_ListSecretsCommand = se_ListSecretsCommand;
79
- const se_ListSecretVersionIdsCommand = async (input, context) => {
80
- const headers = sharedHeaders("ListSecretVersionIds");
81
- let body;
82
- body = JSON.stringify((0, smithy_client_1._json)(input));
83
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
84
- };
85
- exports.se_ListSecretVersionIdsCommand = se_ListSecretVersionIdsCommand;
86
- const se_PutResourcePolicyCommand = async (input, context) => {
87
- const headers = sharedHeaders("PutResourcePolicy");
88
- let body;
89
- body = JSON.stringify((0, smithy_client_1._json)(input));
90
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
91
- };
92
- exports.se_PutResourcePolicyCommand = se_PutResourcePolicyCommand;
93
- const se_PutSecretValueCommand = async (input, context) => {
94
- const headers = sharedHeaders("PutSecretValue");
95
- let body;
96
- body = JSON.stringify(se_PutSecretValueRequest(input, context));
97
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
98
- };
99
- exports.se_PutSecretValueCommand = se_PutSecretValueCommand;
100
- const se_RemoveRegionsFromReplicationCommand = async (input, context) => {
101
- const headers = sharedHeaders("RemoveRegionsFromReplication");
102
- let body;
103
- body = JSON.stringify((0, smithy_client_1._json)(input));
104
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
105
- };
106
- exports.se_RemoveRegionsFromReplicationCommand = se_RemoveRegionsFromReplicationCommand;
107
- const se_ReplicateSecretToRegionsCommand = async (input, context) => {
108
- const headers = sharedHeaders("ReplicateSecretToRegions");
109
- let body;
110
- body = JSON.stringify((0, smithy_client_1._json)(input));
111
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
- };
113
- exports.se_ReplicateSecretToRegionsCommand = se_ReplicateSecretToRegionsCommand;
114
- const se_RestoreSecretCommand = async (input, context) => {
115
- const headers = sharedHeaders("RestoreSecret");
116
- let body;
117
- body = JSON.stringify((0, smithy_client_1._json)(input));
118
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
119
- };
120
- exports.se_RestoreSecretCommand = se_RestoreSecretCommand;
121
- const se_RotateSecretCommand = async (input, context) => {
122
- const headers = sharedHeaders("RotateSecret");
123
- let body;
124
- body = JSON.stringify(se_RotateSecretRequest(input, context));
125
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
126
- };
127
- exports.se_RotateSecretCommand = se_RotateSecretCommand;
128
- const se_StopReplicationToReplicaCommand = async (input, context) => {
129
- const headers = sharedHeaders("StopReplicationToReplica");
130
- let body;
131
- body = JSON.stringify((0, smithy_client_1._json)(input));
132
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
133
- };
134
- exports.se_StopReplicationToReplicaCommand = se_StopReplicationToReplicaCommand;
135
- const se_TagResourceCommand = async (input, context) => {
136
- const headers = sharedHeaders("TagResource");
137
- let body;
138
- body = JSON.stringify((0, smithy_client_1._json)(input));
139
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
140
- };
141
- exports.se_TagResourceCommand = se_TagResourceCommand;
142
- const se_UntagResourceCommand = async (input, context) => {
143
- const headers = sharedHeaders("UntagResource");
144
- let body;
145
- body = JSON.stringify((0, smithy_client_1._json)(input));
146
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
147
- };
148
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
149
- const se_UpdateSecretCommand = async (input, context) => {
150
- const headers = sharedHeaders("UpdateSecret");
151
- let body;
152
- body = JSON.stringify(se_UpdateSecretRequest(input, context));
153
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
154
- };
155
- exports.se_UpdateSecretCommand = se_UpdateSecretCommand;
156
- const se_UpdateSecretVersionStageCommand = async (input, context) => {
157
- const headers = sharedHeaders("UpdateSecretVersionStage");
158
- let body;
159
- body = JSON.stringify((0, smithy_client_1._json)(input));
160
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
161
- };
162
- exports.se_UpdateSecretVersionStageCommand = se_UpdateSecretVersionStageCommand;
163
- const se_ValidateResourcePolicyCommand = async (input, context) => {
164
- const headers = sharedHeaders("ValidateResourcePolicy");
165
- let body;
166
- body = JSON.stringify((0, smithy_client_1._json)(input));
167
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
168
- };
169
- exports.se_ValidateResourcePolicyCommand = se_ValidateResourcePolicyCommand;
170
- const de_BatchGetSecretValueCommand = async (output, context) => {
171
- if (output.statusCode >= 300) {
172
- return de_BatchGetSecretValueCommandError(output, context);
173
- }
174
- const data = await parseBody(output.body, context);
175
- let contents = {};
176
- contents = de_BatchGetSecretValueResponse(data, context);
177
- const response = {
178
- $metadata: deserializeMetadata(output),
179
- ...contents,
180
- };
181
- return response;
182
- };
183
- exports.de_BatchGetSecretValueCommand = de_BatchGetSecretValueCommand;
184
- const de_BatchGetSecretValueCommandError = async (output, context) => {
185
- const parsedOutput = {
186
- ...output,
187
- body: await parseErrorBody(output.body, context),
188
- };
189
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
190
- switch (errorCode) {
191
- case "DecryptionFailure":
192
- case "com.amazonaws.secretsmanager#DecryptionFailure":
193
- throw await de_DecryptionFailureRes(parsedOutput, context);
194
- case "InternalServiceError":
195
- case "com.amazonaws.secretsmanager#InternalServiceError":
196
- throw await de_InternalServiceErrorRes(parsedOutput, context);
197
- case "InvalidNextTokenException":
198
- case "com.amazonaws.secretsmanager#InvalidNextTokenException":
199
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
200
- case "InvalidParameterException":
201
- case "com.amazonaws.secretsmanager#InvalidParameterException":
202
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
203
- case "InvalidRequestException":
204
- case "com.amazonaws.secretsmanager#InvalidRequestException":
205
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
206
- case "ResourceNotFoundException":
207
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
208
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
209
- default:
210
- const parsedBody = parsedOutput.body;
211
- return throwDefaultError({
212
- output,
213
- parsedBody,
214
- errorCode,
215
- });
216
- }
217
- };
218
- const de_CancelRotateSecretCommand = async (output, context) => {
219
- if (output.statusCode >= 300) {
220
- return de_CancelRotateSecretCommandError(output, context);
221
- }
222
- const data = await parseBody(output.body, context);
223
- let contents = {};
224
- contents = (0, smithy_client_1._json)(data);
225
- const response = {
226
- $metadata: deserializeMetadata(output),
227
- ...contents,
228
- };
229
- return response;
230
- };
231
- exports.de_CancelRotateSecretCommand = de_CancelRotateSecretCommand;
232
- const de_CancelRotateSecretCommandError = async (output, context) => {
233
- const parsedOutput = {
234
- ...output,
235
- body: await parseErrorBody(output.body, context),
236
- };
237
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
238
- switch (errorCode) {
239
- case "InternalServiceError":
240
- case "com.amazonaws.secretsmanager#InternalServiceError":
241
- throw await de_InternalServiceErrorRes(parsedOutput, context);
242
- case "InvalidParameterException":
243
- case "com.amazonaws.secretsmanager#InvalidParameterException":
244
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
245
- case "InvalidRequestException":
246
- case "com.amazonaws.secretsmanager#InvalidRequestException":
247
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
248
- case "ResourceNotFoundException":
249
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
250
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
251
- default:
252
- const parsedBody = parsedOutput.body;
253
- return throwDefaultError({
254
- output,
255
- parsedBody,
256
- errorCode,
257
- });
258
- }
259
- };
260
- const de_CreateSecretCommand = async (output, context) => {
261
- if (output.statusCode >= 300) {
262
- return de_CreateSecretCommandError(output, context);
263
- }
264
- const data = await parseBody(output.body, context);
265
- let contents = {};
266
- contents = de_CreateSecretResponse(data, context);
267
- const response = {
268
- $metadata: deserializeMetadata(output),
269
- ...contents,
270
- };
271
- return response;
272
- };
273
- exports.de_CreateSecretCommand = de_CreateSecretCommand;
274
- const de_CreateSecretCommandError = async (output, context) => {
275
- const parsedOutput = {
276
- ...output,
277
- body: await parseErrorBody(output.body, context),
278
- };
279
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
280
- switch (errorCode) {
281
- case "DecryptionFailure":
282
- case "com.amazonaws.secretsmanager#DecryptionFailure":
283
- throw await de_DecryptionFailureRes(parsedOutput, context);
284
- case "EncryptionFailure":
285
- case "com.amazonaws.secretsmanager#EncryptionFailure":
286
- throw await de_EncryptionFailureRes(parsedOutput, context);
287
- case "InternalServiceError":
288
- case "com.amazonaws.secretsmanager#InternalServiceError":
289
- throw await de_InternalServiceErrorRes(parsedOutput, context);
290
- case "InvalidParameterException":
291
- case "com.amazonaws.secretsmanager#InvalidParameterException":
292
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
293
- case "InvalidRequestException":
294
- case "com.amazonaws.secretsmanager#InvalidRequestException":
295
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
296
- case "LimitExceededException":
297
- case "com.amazonaws.secretsmanager#LimitExceededException":
298
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
299
- case "MalformedPolicyDocumentException":
300
- case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException":
301
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
302
- case "PreconditionNotMetException":
303
- case "com.amazonaws.secretsmanager#PreconditionNotMetException":
304
- throw await de_PreconditionNotMetExceptionRes(parsedOutput, context);
305
- case "ResourceExistsException":
306
- case "com.amazonaws.secretsmanager#ResourceExistsException":
307
- throw await de_ResourceExistsExceptionRes(parsedOutput, context);
308
- case "ResourceNotFoundException":
309
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
310
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
311
- default:
312
- const parsedBody = parsedOutput.body;
313
- return throwDefaultError({
314
- output,
315
- parsedBody,
316
- errorCode,
317
- });
318
- }
319
- };
320
- const de_DeleteResourcePolicyCommand = async (output, context) => {
321
- if (output.statusCode >= 300) {
322
- return de_DeleteResourcePolicyCommandError(output, context);
323
- }
324
- const data = await parseBody(output.body, context);
325
- let contents = {};
326
- contents = (0, smithy_client_1._json)(data);
327
- const response = {
328
- $metadata: deserializeMetadata(output),
329
- ...contents,
330
- };
331
- return response;
332
- };
333
- exports.de_DeleteResourcePolicyCommand = de_DeleteResourcePolicyCommand;
334
- const de_DeleteResourcePolicyCommandError = async (output, context) => {
335
- const parsedOutput = {
336
- ...output,
337
- body: await parseErrorBody(output.body, context),
338
- };
339
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
340
- switch (errorCode) {
341
- case "InternalServiceError":
342
- case "com.amazonaws.secretsmanager#InternalServiceError":
343
- throw await de_InternalServiceErrorRes(parsedOutput, context);
344
- case "InvalidParameterException":
345
- case "com.amazonaws.secretsmanager#InvalidParameterException":
346
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
347
- case "InvalidRequestException":
348
- case "com.amazonaws.secretsmanager#InvalidRequestException":
349
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
350
- case "ResourceNotFoundException":
351
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
352
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
353
- default:
354
- const parsedBody = parsedOutput.body;
355
- return throwDefaultError({
356
- output,
357
- parsedBody,
358
- errorCode,
359
- });
360
- }
361
- };
362
- const de_DeleteSecretCommand = async (output, context) => {
363
- if (output.statusCode >= 300) {
364
- return de_DeleteSecretCommandError(output, context);
365
- }
366
- const data = await parseBody(output.body, context);
367
- let contents = {};
368
- contents = de_DeleteSecretResponse(data, context);
369
- const response = {
370
- $metadata: deserializeMetadata(output),
371
- ...contents,
372
- };
373
- return response;
374
- };
375
- exports.de_DeleteSecretCommand = de_DeleteSecretCommand;
376
- const de_DeleteSecretCommandError = async (output, context) => {
377
- const parsedOutput = {
378
- ...output,
379
- body: await parseErrorBody(output.body, context),
380
- };
381
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
382
- switch (errorCode) {
383
- case "InternalServiceError":
384
- case "com.amazonaws.secretsmanager#InternalServiceError":
385
- throw await de_InternalServiceErrorRes(parsedOutput, context);
386
- case "InvalidParameterException":
387
- case "com.amazonaws.secretsmanager#InvalidParameterException":
388
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
389
- case "InvalidRequestException":
390
- case "com.amazonaws.secretsmanager#InvalidRequestException":
391
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
392
- case "ResourceNotFoundException":
393
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
394
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
395
- default:
396
- const parsedBody = parsedOutput.body;
397
- return throwDefaultError({
398
- output,
399
- parsedBody,
400
- errorCode,
401
- });
402
- }
403
- };
404
- const de_DescribeSecretCommand = async (output, context) => {
405
- if (output.statusCode >= 300) {
406
- return de_DescribeSecretCommandError(output, context);
407
- }
408
- const data = await parseBody(output.body, context);
409
- let contents = {};
410
- contents = de_DescribeSecretResponse(data, context);
411
- const response = {
412
- $metadata: deserializeMetadata(output),
413
- ...contents,
414
- };
415
- return response;
416
- };
417
- exports.de_DescribeSecretCommand = de_DescribeSecretCommand;
418
- const de_DescribeSecretCommandError = async (output, context) => {
419
- const parsedOutput = {
420
- ...output,
421
- body: await parseErrorBody(output.body, context),
422
- };
423
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
424
- switch (errorCode) {
425
- case "InternalServiceError":
426
- case "com.amazonaws.secretsmanager#InternalServiceError":
427
- throw await de_InternalServiceErrorRes(parsedOutput, context);
428
- case "InvalidParameterException":
429
- case "com.amazonaws.secretsmanager#InvalidParameterException":
430
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
431
- case "ResourceNotFoundException":
432
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
433
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
434
- default:
435
- const parsedBody = parsedOutput.body;
436
- return throwDefaultError({
437
- output,
438
- parsedBody,
439
- errorCode,
440
- });
441
- }
442
- };
443
- const de_GetRandomPasswordCommand = async (output, context) => {
444
- if (output.statusCode >= 300) {
445
- return de_GetRandomPasswordCommandError(output, context);
446
- }
447
- const data = await parseBody(output.body, context);
448
- let contents = {};
449
- contents = (0, smithy_client_1._json)(data);
450
- const response = {
451
- $metadata: deserializeMetadata(output),
452
- ...contents,
453
- };
454
- return response;
455
- };
456
- exports.de_GetRandomPasswordCommand = de_GetRandomPasswordCommand;
457
- const de_GetRandomPasswordCommandError = async (output, context) => {
458
- const parsedOutput = {
459
- ...output,
460
- body: await parseErrorBody(output.body, context),
461
- };
462
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
463
- switch (errorCode) {
464
- case "InternalServiceError":
465
- case "com.amazonaws.secretsmanager#InternalServiceError":
466
- throw await de_InternalServiceErrorRes(parsedOutput, context);
467
- case "InvalidParameterException":
468
- case "com.amazonaws.secretsmanager#InvalidParameterException":
469
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
470
- case "InvalidRequestException":
471
- case "com.amazonaws.secretsmanager#InvalidRequestException":
472
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
473
- default:
474
- const parsedBody = parsedOutput.body;
475
- return throwDefaultError({
476
- output,
477
- parsedBody,
478
- errorCode,
479
- });
480
- }
481
- };
482
- const de_GetResourcePolicyCommand = async (output, context) => {
483
- if (output.statusCode >= 300) {
484
- return de_GetResourcePolicyCommandError(output, context);
485
- }
486
- const data = await parseBody(output.body, context);
487
- let contents = {};
488
- contents = (0, smithy_client_1._json)(data);
489
- const response = {
490
- $metadata: deserializeMetadata(output),
491
- ...contents,
492
- };
493
- return response;
494
- };
495
- exports.de_GetResourcePolicyCommand = de_GetResourcePolicyCommand;
496
- const de_GetResourcePolicyCommandError = async (output, context) => {
497
- const parsedOutput = {
498
- ...output,
499
- body: await parseErrorBody(output.body, context),
500
- };
501
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
502
- switch (errorCode) {
503
- case "InternalServiceError":
504
- case "com.amazonaws.secretsmanager#InternalServiceError":
505
- throw await de_InternalServiceErrorRes(parsedOutput, context);
506
- case "InvalidParameterException":
507
- case "com.amazonaws.secretsmanager#InvalidParameterException":
508
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
509
- case "InvalidRequestException":
510
- case "com.amazonaws.secretsmanager#InvalidRequestException":
511
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
512
- case "ResourceNotFoundException":
513
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
514
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
515
- default:
516
- const parsedBody = parsedOutput.body;
517
- return throwDefaultError({
518
- output,
519
- parsedBody,
520
- errorCode,
521
- });
522
- }
523
- };
524
- const de_GetSecretValueCommand = async (output, context) => {
525
- if (output.statusCode >= 300) {
526
- return de_GetSecretValueCommandError(output, context);
527
- }
528
- const data = await parseBody(output.body, context);
529
- let contents = {};
530
- contents = de_GetSecretValueResponse(data, context);
531
- const response = {
532
- $metadata: deserializeMetadata(output),
533
- ...contents,
534
- };
535
- return response;
536
- };
537
- exports.de_GetSecretValueCommand = de_GetSecretValueCommand;
538
- const de_GetSecretValueCommandError = async (output, context) => {
539
- const parsedOutput = {
540
- ...output,
541
- body: await parseErrorBody(output.body, context),
542
- };
543
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
544
- switch (errorCode) {
545
- case "DecryptionFailure":
546
- case "com.amazonaws.secretsmanager#DecryptionFailure":
547
- throw await de_DecryptionFailureRes(parsedOutput, context);
548
- case "InternalServiceError":
549
- case "com.amazonaws.secretsmanager#InternalServiceError":
550
- throw await de_InternalServiceErrorRes(parsedOutput, context);
551
- case "InvalidParameterException":
552
- case "com.amazonaws.secretsmanager#InvalidParameterException":
553
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
554
- case "InvalidRequestException":
555
- case "com.amazonaws.secretsmanager#InvalidRequestException":
556
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
557
- case "ResourceNotFoundException":
558
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
559
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
560
- default:
561
- const parsedBody = parsedOutput.body;
562
- return throwDefaultError({
563
- output,
564
- parsedBody,
565
- errorCode,
566
- });
567
- }
568
- };
569
- const de_ListSecretsCommand = async (output, context) => {
570
- if (output.statusCode >= 300) {
571
- return de_ListSecretsCommandError(output, context);
572
- }
573
- const data = await parseBody(output.body, context);
574
- let contents = {};
575
- contents = de_ListSecretsResponse(data, context);
576
- const response = {
577
- $metadata: deserializeMetadata(output),
578
- ...contents,
579
- };
580
- return response;
581
- };
582
- exports.de_ListSecretsCommand = de_ListSecretsCommand;
583
- const de_ListSecretsCommandError = async (output, context) => {
584
- const parsedOutput = {
585
- ...output,
586
- body: await parseErrorBody(output.body, context),
587
- };
588
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
589
- switch (errorCode) {
590
- case "InternalServiceError":
591
- case "com.amazonaws.secretsmanager#InternalServiceError":
592
- throw await de_InternalServiceErrorRes(parsedOutput, context);
593
- case "InvalidNextTokenException":
594
- case "com.amazonaws.secretsmanager#InvalidNextTokenException":
595
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
596
- case "InvalidParameterException":
597
- case "com.amazonaws.secretsmanager#InvalidParameterException":
598
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
599
- case "InvalidRequestException":
600
- case "com.amazonaws.secretsmanager#InvalidRequestException":
601
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
602
- default:
603
- const parsedBody = parsedOutput.body;
604
- return throwDefaultError({
605
- output,
606
- parsedBody,
607
- errorCode,
608
- });
609
- }
610
- };
611
- const de_ListSecretVersionIdsCommand = async (output, context) => {
612
- if (output.statusCode >= 300) {
613
- return de_ListSecretVersionIdsCommandError(output, context);
614
- }
615
- const data = await parseBody(output.body, context);
616
- let contents = {};
617
- contents = de_ListSecretVersionIdsResponse(data, context);
618
- const response = {
619
- $metadata: deserializeMetadata(output),
620
- ...contents,
621
- };
622
- return response;
623
- };
624
- exports.de_ListSecretVersionIdsCommand = de_ListSecretVersionIdsCommand;
625
- const de_ListSecretVersionIdsCommandError = async (output, context) => {
626
- const parsedOutput = {
627
- ...output,
628
- body: await parseErrorBody(output.body, context),
629
- };
630
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
631
- switch (errorCode) {
632
- case "InternalServiceError":
633
- case "com.amazonaws.secretsmanager#InternalServiceError":
634
- throw await de_InternalServiceErrorRes(parsedOutput, context);
635
- case "InvalidNextTokenException":
636
- case "com.amazonaws.secretsmanager#InvalidNextTokenException":
637
- throw await de_InvalidNextTokenExceptionRes(parsedOutput, context);
638
- case "InvalidParameterException":
639
- case "com.amazonaws.secretsmanager#InvalidParameterException":
640
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
641
- case "ResourceNotFoundException":
642
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
643
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
644
- default:
645
- const parsedBody = parsedOutput.body;
646
- return throwDefaultError({
647
- output,
648
- parsedBody,
649
- errorCode,
650
- });
651
- }
652
- };
653
- const de_PutResourcePolicyCommand = async (output, context) => {
654
- if (output.statusCode >= 300) {
655
- return de_PutResourcePolicyCommandError(output, context);
656
- }
657
- const data = await parseBody(output.body, context);
658
- let contents = {};
659
- contents = (0, smithy_client_1._json)(data);
660
- const response = {
661
- $metadata: deserializeMetadata(output),
662
- ...contents,
663
- };
664
- return response;
665
- };
666
- exports.de_PutResourcePolicyCommand = de_PutResourcePolicyCommand;
667
- const de_PutResourcePolicyCommandError = async (output, context) => {
668
- const parsedOutput = {
669
- ...output,
670
- body: await parseErrorBody(output.body, context),
671
- };
672
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
673
- switch (errorCode) {
674
- case "InternalServiceError":
675
- case "com.amazonaws.secretsmanager#InternalServiceError":
676
- throw await de_InternalServiceErrorRes(parsedOutput, context);
677
- case "InvalidParameterException":
678
- case "com.amazonaws.secretsmanager#InvalidParameterException":
679
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
680
- case "InvalidRequestException":
681
- case "com.amazonaws.secretsmanager#InvalidRequestException":
682
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
683
- case "MalformedPolicyDocumentException":
684
- case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException":
685
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
686
- case "PublicPolicyException":
687
- case "com.amazonaws.secretsmanager#PublicPolicyException":
688
- throw await de_PublicPolicyExceptionRes(parsedOutput, context);
689
- case "ResourceNotFoundException":
690
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
691
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
692
- default:
693
- const parsedBody = parsedOutput.body;
694
- return throwDefaultError({
695
- output,
696
- parsedBody,
697
- errorCode,
698
- });
699
- }
700
- };
701
- const de_PutSecretValueCommand = async (output, context) => {
702
- if (output.statusCode >= 300) {
703
- return de_PutSecretValueCommandError(output, context);
704
- }
705
- const data = await parseBody(output.body, context);
706
- let contents = {};
707
- contents = (0, smithy_client_1._json)(data);
708
- const response = {
709
- $metadata: deserializeMetadata(output),
710
- ...contents,
711
- };
712
- return response;
713
- };
714
- exports.de_PutSecretValueCommand = de_PutSecretValueCommand;
715
- const de_PutSecretValueCommandError = async (output, context) => {
716
- const parsedOutput = {
717
- ...output,
718
- body: await parseErrorBody(output.body, context),
719
- };
720
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
721
- switch (errorCode) {
722
- case "DecryptionFailure":
723
- case "com.amazonaws.secretsmanager#DecryptionFailure":
724
- throw await de_DecryptionFailureRes(parsedOutput, context);
725
- case "EncryptionFailure":
726
- case "com.amazonaws.secretsmanager#EncryptionFailure":
727
- throw await de_EncryptionFailureRes(parsedOutput, context);
728
- case "InternalServiceError":
729
- case "com.amazonaws.secretsmanager#InternalServiceError":
730
- throw await de_InternalServiceErrorRes(parsedOutput, context);
731
- case "InvalidParameterException":
732
- case "com.amazonaws.secretsmanager#InvalidParameterException":
733
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
734
- case "InvalidRequestException":
735
- case "com.amazonaws.secretsmanager#InvalidRequestException":
736
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
737
- case "LimitExceededException":
738
- case "com.amazonaws.secretsmanager#LimitExceededException":
739
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
740
- case "ResourceExistsException":
741
- case "com.amazonaws.secretsmanager#ResourceExistsException":
742
- throw await de_ResourceExistsExceptionRes(parsedOutput, context);
743
- case "ResourceNotFoundException":
744
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
745
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
746
- default:
747
- const parsedBody = parsedOutput.body;
748
- return throwDefaultError({
749
- output,
750
- parsedBody,
751
- errorCode,
752
- });
753
- }
754
- };
755
- const de_RemoveRegionsFromReplicationCommand = async (output, context) => {
756
- if (output.statusCode >= 300) {
757
- return de_RemoveRegionsFromReplicationCommandError(output, context);
758
- }
759
- const data = await parseBody(output.body, context);
760
- let contents = {};
761
- contents = de_RemoveRegionsFromReplicationResponse(data, context);
762
- const response = {
763
- $metadata: deserializeMetadata(output),
764
- ...contents,
765
- };
766
- return response;
767
- };
768
- exports.de_RemoveRegionsFromReplicationCommand = de_RemoveRegionsFromReplicationCommand;
769
- const de_RemoveRegionsFromReplicationCommandError = async (output, context) => {
770
- const parsedOutput = {
771
- ...output,
772
- body: await parseErrorBody(output.body, context),
773
- };
774
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
775
- switch (errorCode) {
776
- case "InternalServiceError":
777
- case "com.amazonaws.secretsmanager#InternalServiceError":
778
- throw await de_InternalServiceErrorRes(parsedOutput, context);
779
- case "InvalidParameterException":
780
- case "com.amazonaws.secretsmanager#InvalidParameterException":
781
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
782
- case "InvalidRequestException":
783
- case "com.amazonaws.secretsmanager#InvalidRequestException":
784
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
785
- case "ResourceNotFoundException":
786
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
787
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
788
- default:
789
- const parsedBody = parsedOutput.body;
790
- return throwDefaultError({
791
- output,
792
- parsedBody,
793
- errorCode,
794
- });
795
- }
796
- };
797
- const de_ReplicateSecretToRegionsCommand = async (output, context) => {
798
- if (output.statusCode >= 300) {
799
- return de_ReplicateSecretToRegionsCommandError(output, context);
800
- }
801
- const data = await parseBody(output.body, context);
802
- let contents = {};
803
- contents = de_ReplicateSecretToRegionsResponse(data, context);
804
- const response = {
805
- $metadata: deserializeMetadata(output),
806
- ...contents,
807
- };
808
- return response;
809
- };
810
- exports.de_ReplicateSecretToRegionsCommand = de_ReplicateSecretToRegionsCommand;
811
- const de_ReplicateSecretToRegionsCommandError = async (output, context) => {
812
- const parsedOutput = {
813
- ...output,
814
- body: await parseErrorBody(output.body, context),
815
- };
816
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
817
- switch (errorCode) {
818
- case "InternalServiceError":
819
- case "com.amazonaws.secretsmanager#InternalServiceError":
820
- throw await de_InternalServiceErrorRes(parsedOutput, context);
821
- case "InvalidParameterException":
822
- case "com.amazonaws.secretsmanager#InvalidParameterException":
823
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
824
- case "InvalidRequestException":
825
- case "com.amazonaws.secretsmanager#InvalidRequestException":
826
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
827
- case "ResourceNotFoundException":
828
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
829
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
830
- default:
831
- const parsedBody = parsedOutput.body;
832
- return throwDefaultError({
833
- output,
834
- parsedBody,
835
- errorCode,
836
- });
837
- }
838
- };
839
- const de_RestoreSecretCommand = async (output, context) => {
840
- if (output.statusCode >= 300) {
841
- return de_RestoreSecretCommandError(output, context);
842
- }
843
- const data = await parseBody(output.body, context);
844
- let contents = {};
845
- contents = (0, smithy_client_1._json)(data);
846
- const response = {
847
- $metadata: deserializeMetadata(output),
848
- ...contents,
849
- };
850
- return response;
851
- };
852
- exports.de_RestoreSecretCommand = de_RestoreSecretCommand;
853
- const de_RestoreSecretCommandError = async (output, context) => {
854
- const parsedOutput = {
855
- ...output,
856
- body: await parseErrorBody(output.body, context),
857
- };
858
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
859
- switch (errorCode) {
860
- case "InternalServiceError":
861
- case "com.amazonaws.secretsmanager#InternalServiceError":
862
- throw await de_InternalServiceErrorRes(parsedOutput, context);
863
- case "InvalidParameterException":
864
- case "com.amazonaws.secretsmanager#InvalidParameterException":
865
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
866
- case "InvalidRequestException":
867
- case "com.amazonaws.secretsmanager#InvalidRequestException":
868
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
869
- case "ResourceNotFoundException":
870
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
871
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
872
- default:
873
- const parsedBody = parsedOutput.body;
874
- return throwDefaultError({
875
- output,
876
- parsedBody,
877
- errorCode,
878
- });
879
- }
880
- };
881
- const de_RotateSecretCommand = async (output, context) => {
882
- if (output.statusCode >= 300) {
883
- return de_RotateSecretCommandError(output, context);
884
- }
885
- const data = await parseBody(output.body, context);
886
- let contents = {};
887
- contents = (0, smithy_client_1._json)(data);
888
- const response = {
889
- $metadata: deserializeMetadata(output),
890
- ...contents,
891
- };
892
- return response;
893
- };
894
- exports.de_RotateSecretCommand = de_RotateSecretCommand;
895
- const de_RotateSecretCommandError = async (output, context) => {
896
- const parsedOutput = {
897
- ...output,
898
- body: await parseErrorBody(output.body, context),
899
- };
900
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
901
- switch (errorCode) {
902
- case "InternalServiceError":
903
- case "com.amazonaws.secretsmanager#InternalServiceError":
904
- throw await de_InternalServiceErrorRes(parsedOutput, context);
905
- case "InvalidParameterException":
906
- case "com.amazonaws.secretsmanager#InvalidParameterException":
907
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
908
- case "InvalidRequestException":
909
- case "com.amazonaws.secretsmanager#InvalidRequestException":
910
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
911
- case "ResourceNotFoundException":
912
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
913
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
914
- default:
915
- const parsedBody = parsedOutput.body;
916
- return throwDefaultError({
917
- output,
918
- parsedBody,
919
- errorCode,
920
- });
921
- }
922
- };
923
- const de_StopReplicationToReplicaCommand = async (output, context) => {
924
- if (output.statusCode >= 300) {
925
- return de_StopReplicationToReplicaCommandError(output, context);
926
- }
927
- const data = await parseBody(output.body, context);
928
- let contents = {};
929
- contents = (0, smithy_client_1._json)(data);
930
- const response = {
931
- $metadata: deserializeMetadata(output),
932
- ...contents,
933
- };
934
- return response;
935
- };
936
- exports.de_StopReplicationToReplicaCommand = de_StopReplicationToReplicaCommand;
937
- const de_StopReplicationToReplicaCommandError = async (output, context) => {
938
- const parsedOutput = {
939
- ...output,
940
- body: await parseErrorBody(output.body, context),
941
- };
942
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
943
- switch (errorCode) {
944
- case "InternalServiceError":
945
- case "com.amazonaws.secretsmanager#InternalServiceError":
946
- throw await de_InternalServiceErrorRes(parsedOutput, context);
947
- case "InvalidParameterException":
948
- case "com.amazonaws.secretsmanager#InvalidParameterException":
949
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
950
- case "InvalidRequestException":
951
- case "com.amazonaws.secretsmanager#InvalidRequestException":
952
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
953
- case "ResourceNotFoundException":
954
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
955
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
956
- default:
957
- const parsedBody = parsedOutput.body;
958
- return throwDefaultError({
959
- output,
960
- parsedBody,
961
- errorCode,
962
- });
963
- }
964
- };
965
- const de_TagResourceCommand = async (output, context) => {
966
- if (output.statusCode >= 300) {
967
- return de_TagResourceCommandError(output, context);
968
- }
969
- await (0, smithy_client_1.collectBody)(output.body, context);
970
- const response = {
971
- $metadata: deserializeMetadata(output),
972
- };
973
- return response;
974
- };
975
- exports.de_TagResourceCommand = de_TagResourceCommand;
976
- const de_TagResourceCommandError = async (output, context) => {
977
- const parsedOutput = {
978
- ...output,
979
- body: await parseErrorBody(output.body, context),
980
- };
981
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
982
- switch (errorCode) {
983
- case "InternalServiceError":
984
- case "com.amazonaws.secretsmanager#InternalServiceError":
985
- throw await de_InternalServiceErrorRes(parsedOutput, context);
986
- case "InvalidParameterException":
987
- case "com.amazonaws.secretsmanager#InvalidParameterException":
988
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
989
- case "InvalidRequestException":
990
- case "com.amazonaws.secretsmanager#InvalidRequestException":
991
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
992
- case "ResourceNotFoundException":
993
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
994
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
995
- default:
996
- const parsedBody = parsedOutput.body;
997
- return throwDefaultError({
998
- output,
999
- parsedBody,
1000
- errorCode,
1001
- });
1002
- }
1003
- };
1004
- const de_UntagResourceCommand = async (output, context) => {
1005
- if (output.statusCode >= 300) {
1006
- return de_UntagResourceCommandError(output, context);
1007
- }
1008
- await (0, smithy_client_1.collectBody)(output.body, context);
1009
- const response = {
1010
- $metadata: deserializeMetadata(output),
1011
- };
1012
- return response;
1013
- };
1014
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
1015
- const de_UntagResourceCommandError = async (output, context) => {
1016
- const parsedOutput = {
1017
- ...output,
1018
- body: await parseErrorBody(output.body, context),
1019
- };
1020
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1021
- switch (errorCode) {
1022
- case "InternalServiceError":
1023
- case "com.amazonaws.secretsmanager#InternalServiceError":
1024
- throw await de_InternalServiceErrorRes(parsedOutput, context);
1025
- case "InvalidParameterException":
1026
- case "com.amazonaws.secretsmanager#InvalidParameterException":
1027
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
1028
- case "InvalidRequestException":
1029
- case "com.amazonaws.secretsmanager#InvalidRequestException":
1030
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1031
- case "ResourceNotFoundException":
1032
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
1033
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1034
- default:
1035
- const parsedBody = parsedOutput.body;
1036
- return throwDefaultError({
1037
- output,
1038
- parsedBody,
1039
- errorCode,
1040
- });
1041
- }
1042
- };
1043
- const de_UpdateSecretCommand = async (output, context) => {
1044
- if (output.statusCode >= 300) {
1045
- return de_UpdateSecretCommandError(output, context);
1046
- }
1047
- const data = await parseBody(output.body, context);
1048
- let contents = {};
1049
- contents = (0, smithy_client_1._json)(data);
1050
- const response = {
1051
- $metadata: deserializeMetadata(output),
1052
- ...contents,
1053
- };
1054
- return response;
1055
- };
1056
- exports.de_UpdateSecretCommand = de_UpdateSecretCommand;
1057
- const de_UpdateSecretCommandError = async (output, context) => {
1058
- const parsedOutput = {
1059
- ...output,
1060
- body: await parseErrorBody(output.body, context),
1061
- };
1062
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1063
- switch (errorCode) {
1064
- case "DecryptionFailure":
1065
- case "com.amazonaws.secretsmanager#DecryptionFailure":
1066
- throw await de_DecryptionFailureRes(parsedOutput, context);
1067
- case "EncryptionFailure":
1068
- case "com.amazonaws.secretsmanager#EncryptionFailure":
1069
- throw await de_EncryptionFailureRes(parsedOutput, context);
1070
- case "InternalServiceError":
1071
- case "com.amazonaws.secretsmanager#InternalServiceError":
1072
- throw await de_InternalServiceErrorRes(parsedOutput, context);
1073
- case "InvalidParameterException":
1074
- case "com.amazonaws.secretsmanager#InvalidParameterException":
1075
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
1076
- case "InvalidRequestException":
1077
- case "com.amazonaws.secretsmanager#InvalidRequestException":
1078
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1079
- case "LimitExceededException":
1080
- case "com.amazonaws.secretsmanager#LimitExceededException":
1081
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1082
- case "MalformedPolicyDocumentException":
1083
- case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException":
1084
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
1085
- case "PreconditionNotMetException":
1086
- case "com.amazonaws.secretsmanager#PreconditionNotMetException":
1087
- throw await de_PreconditionNotMetExceptionRes(parsedOutput, context);
1088
- case "ResourceExistsException":
1089
- case "com.amazonaws.secretsmanager#ResourceExistsException":
1090
- throw await de_ResourceExistsExceptionRes(parsedOutput, context);
1091
- case "ResourceNotFoundException":
1092
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
1093
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1094
- default:
1095
- const parsedBody = parsedOutput.body;
1096
- return throwDefaultError({
1097
- output,
1098
- parsedBody,
1099
- errorCode,
1100
- });
1101
- }
1102
- };
1103
- const de_UpdateSecretVersionStageCommand = async (output, context) => {
1104
- if (output.statusCode >= 300) {
1105
- return de_UpdateSecretVersionStageCommandError(output, context);
1106
- }
1107
- const data = await parseBody(output.body, context);
1108
- let contents = {};
1109
- contents = (0, smithy_client_1._json)(data);
1110
- const response = {
1111
- $metadata: deserializeMetadata(output),
1112
- ...contents,
1113
- };
1114
- return response;
1115
- };
1116
- exports.de_UpdateSecretVersionStageCommand = de_UpdateSecretVersionStageCommand;
1117
- const de_UpdateSecretVersionStageCommandError = async (output, context) => {
1118
- const parsedOutput = {
1119
- ...output,
1120
- body: await parseErrorBody(output.body, context),
1121
- };
1122
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1123
- switch (errorCode) {
1124
- case "InternalServiceError":
1125
- case "com.amazonaws.secretsmanager#InternalServiceError":
1126
- throw await de_InternalServiceErrorRes(parsedOutput, context);
1127
- case "InvalidParameterException":
1128
- case "com.amazonaws.secretsmanager#InvalidParameterException":
1129
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
1130
- case "InvalidRequestException":
1131
- case "com.amazonaws.secretsmanager#InvalidRequestException":
1132
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1133
- case "LimitExceededException":
1134
- case "com.amazonaws.secretsmanager#LimitExceededException":
1135
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1136
- case "ResourceNotFoundException":
1137
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
1138
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1139
- default:
1140
- const parsedBody = parsedOutput.body;
1141
- return throwDefaultError({
1142
- output,
1143
- parsedBody,
1144
- errorCode,
1145
- });
1146
- }
1147
- };
1148
- const de_ValidateResourcePolicyCommand = async (output, context) => {
1149
- if (output.statusCode >= 300) {
1150
- return de_ValidateResourcePolicyCommandError(output, context);
1151
- }
1152
- const data = await parseBody(output.body, context);
1153
- let contents = {};
1154
- contents = (0, smithy_client_1._json)(data);
1155
- const response = {
1156
- $metadata: deserializeMetadata(output),
1157
- ...contents,
1158
- };
1159
- return response;
1160
- };
1161
- exports.de_ValidateResourcePolicyCommand = de_ValidateResourcePolicyCommand;
1162
- const de_ValidateResourcePolicyCommandError = async (output, context) => {
1163
- const parsedOutput = {
1164
- ...output,
1165
- body: await parseErrorBody(output.body, context),
1166
- };
1167
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1168
- switch (errorCode) {
1169
- case "InternalServiceError":
1170
- case "com.amazonaws.secretsmanager#InternalServiceError":
1171
- throw await de_InternalServiceErrorRes(parsedOutput, context);
1172
- case "InvalidParameterException":
1173
- case "com.amazonaws.secretsmanager#InvalidParameterException":
1174
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
1175
- case "InvalidRequestException":
1176
- case "com.amazonaws.secretsmanager#InvalidRequestException":
1177
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1178
- case "MalformedPolicyDocumentException":
1179
- case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException":
1180
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
1181
- case "ResourceNotFoundException":
1182
- case "com.amazonaws.secretsmanager#ResourceNotFoundException":
1183
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1184
- default:
1185
- const parsedBody = parsedOutput.body;
1186
- return throwDefaultError({
1187
- output,
1188
- parsedBody,
1189
- errorCode,
1190
- });
1191
- }
1192
- };
1193
- const de_DecryptionFailureRes = async (parsedOutput, context) => {
1194
- const body = parsedOutput.body;
1195
- const deserialized = (0, smithy_client_1._json)(body);
1196
- const exception = new models_0_1.DecryptionFailure({
1197
- $metadata: deserializeMetadata(parsedOutput),
1198
- ...deserialized,
1199
- });
1200
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1201
- };
1202
- const de_EncryptionFailureRes = async (parsedOutput, context) => {
1203
- const body = parsedOutput.body;
1204
- const deserialized = (0, smithy_client_1._json)(body);
1205
- const exception = new models_0_1.EncryptionFailure({
1206
- $metadata: deserializeMetadata(parsedOutput),
1207
- ...deserialized,
1208
- });
1209
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1210
- };
1211
- const de_InternalServiceErrorRes = async (parsedOutput, context) => {
1212
- const body = parsedOutput.body;
1213
- const deserialized = (0, smithy_client_1._json)(body);
1214
- const exception = new models_0_1.InternalServiceError({
1215
- $metadata: deserializeMetadata(parsedOutput),
1216
- ...deserialized,
1217
- });
1218
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1219
- };
1220
- const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
1221
- const body = parsedOutput.body;
1222
- const deserialized = (0, smithy_client_1._json)(body);
1223
- const exception = new models_0_1.InvalidNextTokenException({
1224
- $metadata: deserializeMetadata(parsedOutput),
1225
- ...deserialized,
1226
- });
1227
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1228
- };
1229
- const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
1230
- const body = parsedOutput.body;
1231
- const deserialized = (0, smithy_client_1._json)(body);
1232
- const exception = new models_0_1.InvalidParameterException({
1233
- $metadata: deserializeMetadata(parsedOutput),
1234
- ...deserialized,
1235
- });
1236
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1237
- };
1238
- const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
1239
- const body = parsedOutput.body;
1240
- const deserialized = (0, smithy_client_1._json)(body);
1241
- const exception = new models_0_1.InvalidRequestException({
1242
- $metadata: deserializeMetadata(parsedOutput),
1243
- ...deserialized,
1244
- });
1245
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1246
- };
1247
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
1248
- const body = parsedOutput.body;
1249
- const deserialized = (0, smithy_client_1._json)(body);
1250
- const exception = new models_0_1.LimitExceededException({
1251
- $metadata: deserializeMetadata(parsedOutput),
1252
- ...deserialized,
1253
- });
1254
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1255
- };
1256
- const de_MalformedPolicyDocumentExceptionRes = async (parsedOutput, context) => {
1257
- const body = parsedOutput.body;
1258
- const deserialized = (0, smithy_client_1._json)(body);
1259
- const exception = new models_0_1.MalformedPolicyDocumentException({
1260
- $metadata: deserializeMetadata(parsedOutput),
1261
- ...deserialized,
1262
- });
1263
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1264
- };
1265
- const de_PreconditionNotMetExceptionRes = async (parsedOutput, context) => {
1266
- const body = parsedOutput.body;
1267
- const deserialized = (0, smithy_client_1._json)(body);
1268
- const exception = new models_0_1.PreconditionNotMetException({
1269
- $metadata: deserializeMetadata(parsedOutput),
1270
- ...deserialized,
1271
- });
1272
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1273
- };
1274
- const de_PublicPolicyExceptionRes = async (parsedOutput, context) => {
1275
- const body = parsedOutput.body;
1276
- const deserialized = (0, smithy_client_1._json)(body);
1277
- const exception = new models_0_1.PublicPolicyException({
1278
- $metadata: deserializeMetadata(parsedOutput),
1279
- ...deserialized,
1280
- });
1281
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1282
- };
1283
- const de_ResourceExistsExceptionRes = async (parsedOutput, context) => {
1284
- const body = parsedOutput.body;
1285
- const deserialized = (0, smithy_client_1._json)(body);
1286
- const exception = new models_0_1.ResourceExistsException({
1287
- $metadata: deserializeMetadata(parsedOutput),
1288
- ...deserialized,
1289
- });
1290
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1291
- };
1292
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1293
- const body = parsedOutput.body;
1294
- const deserialized = (0, smithy_client_1._json)(body);
1295
- const exception = new models_0_1.ResourceNotFoundException({
1296
- $metadata: deserializeMetadata(parsedOutput),
1297
- ...deserialized,
1298
- });
1299
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1300
- };
1301
- const se_CreateSecretRequest = (input, context) => {
1302
- return (0, smithy_client_1.take)(input, {
1303
- AddReplicaRegions: smithy_client_1._json,
1304
- ClientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1305
- Description: [],
1306
- ForceOverwriteReplicaSecret: [],
1307
- KmsKeyId: [],
1308
- Name: [],
1309
- SecretBinary: context.base64Encoder,
1310
- SecretString: [],
1311
- Tags: smithy_client_1._json,
1312
- });
1313
- };
1314
- const se_PutSecretValueRequest = (input, context) => {
1315
- return (0, smithy_client_1.take)(input, {
1316
- ClientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1317
- SecretBinary: context.base64Encoder,
1318
- SecretId: [],
1319
- SecretString: [],
1320
- VersionStages: smithy_client_1._json,
1321
- });
1322
- };
1323
- const se_RotateSecretRequest = (input, context) => {
1324
- return (0, smithy_client_1.take)(input, {
1325
- ClientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1326
- RotateImmediately: [],
1327
- RotationLambdaARN: [],
1328
- RotationRules: smithy_client_1._json,
1329
- SecretId: [],
1330
- });
1331
- };
1332
- const se_UpdateSecretRequest = (input, context) => {
1333
- return (0, smithy_client_1.take)(input, {
1334
- ClientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1335
- Description: [],
1336
- KmsKeyId: [],
1337
- SecretBinary: context.base64Encoder,
1338
- SecretId: [],
1339
- SecretString: [],
1340
- });
1341
- };
1342
- const de_BatchGetSecretValueResponse = (output, context) => {
1343
- return (0, smithy_client_1.take)(output, {
1344
- Errors: smithy_client_1._json,
1345
- NextToken: smithy_client_1.expectString,
1346
- SecretValues: (_) => de_SecretValuesType(_, context),
1347
- });
1348
- };
1349
- const de_CreateSecretResponse = (output, context) => {
1350
- return (0, smithy_client_1.take)(output, {
1351
- ARN: smithy_client_1.expectString,
1352
- Name: smithy_client_1.expectString,
1353
- ReplicationStatus: (_) => de_ReplicationStatusListType(_, context),
1354
- VersionId: smithy_client_1.expectString,
1355
- });
1356
- };
1357
- const de_DeleteSecretResponse = (output, context) => {
1358
- return (0, smithy_client_1.take)(output, {
1359
- ARN: smithy_client_1.expectString,
1360
- DeletionDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1361
- Name: smithy_client_1.expectString,
1362
- });
1363
- };
1364
- const de_DescribeSecretResponse = (output, context) => {
1365
- return (0, smithy_client_1.take)(output, {
1366
- ARN: smithy_client_1.expectString,
1367
- CreatedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1368
- DeletedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1369
- Description: smithy_client_1.expectString,
1370
- KmsKeyId: smithy_client_1.expectString,
1371
- LastAccessedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1372
- LastChangedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1373
- LastRotatedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1374
- Name: smithy_client_1.expectString,
1375
- NextRotationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1376
- OwningService: smithy_client_1.expectString,
1377
- PrimaryRegion: smithy_client_1.expectString,
1378
- ReplicationStatus: (_) => de_ReplicationStatusListType(_, context),
1379
- RotationEnabled: smithy_client_1.expectBoolean,
1380
- RotationLambdaARN: smithy_client_1.expectString,
1381
- RotationRules: smithy_client_1._json,
1382
- Tags: smithy_client_1._json,
1383
- VersionIdsToStages: smithy_client_1._json,
1384
- });
1385
- };
1386
- const de_GetSecretValueResponse = (output, context) => {
1387
- return (0, smithy_client_1.take)(output, {
1388
- ARN: smithy_client_1.expectString,
1389
- CreatedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1390
- Name: smithy_client_1.expectString,
1391
- SecretBinary: context.base64Decoder,
1392
- SecretString: smithy_client_1.expectString,
1393
- VersionId: smithy_client_1.expectString,
1394
- VersionStages: smithy_client_1._json,
1395
- });
1396
- };
1397
- const de_ListSecretsResponse = (output, context) => {
1398
- return (0, smithy_client_1.take)(output, {
1399
- NextToken: smithy_client_1.expectString,
1400
- SecretList: (_) => de_SecretListType(_, context),
1401
- });
1402
- };
1403
- const de_ListSecretVersionIdsResponse = (output, context) => {
1404
- return (0, smithy_client_1.take)(output, {
1405
- ARN: smithy_client_1.expectString,
1406
- Name: smithy_client_1.expectString,
1407
- NextToken: smithy_client_1.expectString,
1408
- Versions: (_) => de_SecretVersionsListType(_, context),
1409
- });
1410
- };
1411
- const de_RemoveRegionsFromReplicationResponse = (output, context) => {
1412
- return (0, smithy_client_1.take)(output, {
1413
- ARN: smithy_client_1.expectString,
1414
- ReplicationStatus: (_) => de_ReplicationStatusListType(_, context),
1415
- });
1416
- };
1417
- const de_ReplicateSecretToRegionsResponse = (output, context) => {
1418
- return (0, smithy_client_1.take)(output, {
1419
- ARN: smithy_client_1.expectString,
1420
- ReplicationStatus: (_) => de_ReplicationStatusListType(_, context),
1421
- });
1422
- };
1423
- const de_ReplicationStatusListType = (output, context) => {
1424
- const retVal = (output || [])
1425
- .filter((e) => e != null)
1426
- .map((entry) => {
1427
- return de_ReplicationStatusType(entry, context);
1428
- });
1429
- return retVal;
1430
- };
1431
- const de_ReplicationStatusType = (output, context) => {
1432
- return (0, smithy_client_1.take)(output, {
1433
- KmsKeyId: smithy_client_1.expectString,
1434
- LastAccessedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1435
- Region: smithy_client_1.expectString,
1436
- Status: smithy_client_1.expectString,
1437
- StatusMessage: smithy_client_1.expectString,
1438
- });
1439
- };
1440
- const de_SecretListEntry = (output, context) => {
1441
- return (0, smithy_client_1.take)(output, {
1442
- ARN: smithy_client_1.expectString,
1443
- CreatedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1444
- DeletedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1445
- Description: smithy_client_1.expectString,
1446
- KmsKeyId: smithy_client_1.expectString,
1447
- LastAccessedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1448
- LastChangedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1449
- LastRotatedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1450
- Name: smithy_client_1.expectString,
1451
- NextRotationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1452
- OwningService: smithy_client_1.expectString,
1453
- PrimaryRegion: smithy_client_1.expectString,
1454
- RotationEnabled: smithy_client_1.expectBoolean,
1455
- RotationLambdaARN: smithy_client_1.expectString,
1456
- RotationRules: smithy_client_1._json,
1457
- SecretVersionsToStages: smithy_client_1._json,
1458
- Tags: smithy_client_1._json,
1459
- });
1460
- };
1461
- const de_SecretListType = (output, context) => {
1462
- const retVal = (output || [])
1463
- .filter((e) => e != null)
1464
- .map((entry) => {
1465
- return de_SecretListEntry(entry, context);
1466
- });
1467
- return retVal;
1468
- };
1469
- const de_SecretValueEntry = (output, context) => {
1470
- return (0, smithy_client_1.take)(output, {
1471
- ARN: smithy_client_1.expectString,
1472
- CreatedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1473
- Name: smithy_client_1.expectString,
1474
- SecretBinary: context.base64Decoder,
1475
- SecretString: smithy_client_1.expectString,
1476
- VersionId: smithy_client_1.expectString,
1477
- VersionStages: smithy_client_1._json,
1478
- });
1479
- };
1480
- const de_SecretValuesType = (output, context) => {
1481
- const retVal = (output || [])
1482
- .filter((e) => e != null)
1483
- .map((entry) => {
1484
- return de_SecretValueEntry(entry, context);
1485
- });
1486
- return retVal;
1487
- };
1488
- const de_SecretVersionsListEntry = (output, context) => {
1489
- return (0, smithy_client_1.take)(output, {
1490
- CreatedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1491
- KmsKeyIds: smithy_client_1._json,
1492
- LastAccessedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1493
- VersionId: smithy_client_1.expectString,
1494
- VersionStages: smithy_client_1._json,
1495
- });
1496
- };
1497
- const de_SecretVersionsListType = (output, context) => {
1498
- const retVal = (output || [])
1499
- .filter((e) => e != null)
1500
- .map((entry) => {
1501
- return de_SecretVersionsListEntry(entry, context);
1502
- });
1503
- return retVal;
1504
- };
1505
- const deserializeMetadata = (output) => ({
1506
- httpStatusCode: output.statusCode,
1507
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1508
- extendedRequestId: output.headers["x-amz-id-2"],
1509
- cfId: output.headers["x-amz-cf-id"],
1510
- });
1511
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1512
- const throwDefaultError = (0, smithy_client_1.withBaseException)(SecretsManagerServiceException_1.SecretsManagerServiceException);
1513
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1514
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1515
- const contents = {
1516
- protocol,
1517
- hostname,
1518
- port,
1519
- method: "POST",
1520
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1521
- headers,
1522
- };
1523
- if (resolvedHostname !== undefined) {
1524
- contents.hostname = resolvedHostname;
1525
- }
1526
- if (body !== undefined) {
1527
- contents.body = body;
1528
- }
1529
- return new protocol_http_1.HttpRequest(contents);
1530
- };
1531
- function sharedHeaders(operation) {
1532
- return {
1533
- "content-type": "application/x-amz-json-1.1",
1534
- "x-amz-target": `secretsmanager.${operation}`,
1535
- };
1536
- }
1537
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1538
- if (encoded.length) {
1539
- return JSON.parse(encoded);
1540
- }
1541
- return {};
1542
- });
1543
- const parseErrorBody = async (errorBody, context) => {
1544
- const value = await parseBody(errorBody, context);
1545
- value.message = value.message ?? value.Message;
1546
- return value;
1547
- };
1548
- const loadRestJsonErrorCode = (output, data) => {
1549
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1550
- const sanitizeErrorCode = (rawValue) => {
1551
- let cleanValue = rawValue;
1552
- if (typeof cleanValue === "number") {
1553
- cleanValue = cleanValue.toString();
1554
- }
1555
- if (cleanValue.indexOf(",") >= 0) {
1556
- cleanValue = cleanValue.split(",")[0];
1557
- }
1558
- if (cleanValue.indexOf(":") >= 0) {
1559
- cleanValue = cleanValue.split(":")[0];
1560
- }
1561
- if (cleanValue.indexOf("#") >= 0) {
1562
- cleanValue = cleanValue.split("#")[1];
1563
- }
1564
- return cleanValue;
1565
- };
1566
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1567
- if (headerKey !== undefined) {
1568
- return sanitizeErrorCode(output.headers[headerKey]);
1569
- }
1570
- if (data.code !== undefined) {
1571
- return sanitizeErrorCode(data.code);
1572
- }
1573
- if (data["__type"] !== undefined) {
1574
- return sanitizeErrorCode(data["__type"]);
1575
- }
1576
- };
1
+ module.exports = require("../index.js");