@aws-sdk/client-rbin 3.312.0 → 3.316.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.
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
4
4
  import { RbinServiceException as __BaseException } from "../models/RbinServiceException";
5
5
  export const se_CreateRuleCommand = async (input, context) => {
@@ -9,16 +9,14 @@ export const se_CreateRuleCommand = async (input, context) => {
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules";
11
11
  let body;
12
- body = JSON.stringify({
13
- ...(input.Description != null && { Description: input.Description }),
14
- ...(input.LockConfiguration != null && {
15
- LockConfiguration: se_LockConfiguration(input.LockConfiguration, context),
16
- }),
17
- ...(input.ResourceTags != null && { ResourceTags: se_ResourceTags(input.ResourceTags, context) }),
18
- ...(input.ResourceType != null && { ResourceType: input.ResourceType }),
19
- ...(input.RetentionPeriod != null && { RetentionPeriod: se_RetentionPeriod(input.RetentionPeriod, context) }),
20
- ...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
21
- });
12
+ body = JSON.stringify(take(input, {
13
+ Description: [],
14
+ LockConfiguration: (_) => _json(_),
15
+ ResourceTags: (_) => _json(_),
16
+ ResourceType: [],
17
+ RetentionPeriod: (_) => _json(_),
18
+ Tags: (_) => _json(_),
19
+ }));
22
20
  return new __HttpRequest({
23
21
  protocol,
24
22
  hostname,
@@ -68,13 +66,13 @@ export const se_ListRulesCommand = async (input, context) => {
68
66
  };
69
67
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-rules";
70
68
  let body;
71
- body = JSON.stringify({
72
- ...(input.LockState != null && { LockState: input.LockState }),
73
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
74
- ...(input.NextToken != null && { NextToken: input.NextToken }),
75
- ...(input.ResourceTags != null && { ResourceTags: se_ResourceTags(input.ResourceTags, context) }),
76
- ...(input.ResourceType != null && { ResourceType: input.ResourceType }),
77
- });
69
+ body = JSON.stringify(take(input, {
70
+ LockState: [],
71
+ MaxResults: [],
72
+ NextToken: [],
73
+ ResourceTags: (_) => _json(_),
74
+ ResourceType: [],
75
+ }));
78
76
  return new __HttpRequest({
79
77
  protocol,
80
78
  hostname,
@@ -109,11 +107,9 @@ export const se_LockRuleCommand = async (input, context) => {
109
107
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}/lock";
110
108
  resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
111
109
  let body;
112
- body = JSON.stringify({
113
- ...(input.LockConfiguration != null && {
114
- LockConfiguration: se_LockConfiguration(input.LockConfiguration, context),
115
- }),
116
- });
110
+ body = JSON.stringify(take(input, {
111
+ LockConfiguration: (_) => _json(_),
112
+ }));
117
113
  return new __HttpRequest({
118
114
  protocol,
119
115
  hostname,
@@ -132,9 +128,9 @@ export const se_TagResourceCommand = async (input, context) => {
132
128
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
133
129
  resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
134
130
  let body;
135
- body = JSON.stringify({
136
- ...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
137
- });
131
+ body = JSON.stringify(take(input, {
132
+ Tags: (_) => _json(_),
133
+ }));
138
134
  return new __HttpRequest({
139
135
  protocol,
140
136
  hostname,
@@ -192,12 +188,12 @@ export const se_UpdateRuleCommand = async (input, context) => {
192
188
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}";
193
189
  resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
194
190
  let body;
195
- body = JSON.stringify({
196
- ...(input.Description != null && { Description: input.Description }),
197
- ...(input.ResourceTags != null && { ResourceTags: se_ResourceTags(input.ResourceTags, context) }),
198
- ...(input.ResourceType != null && { ResourceType: input.ResourceType }),
199
- ...(input.RetentionPeriod != null && { RetentionPeriod: se_RetentionPeriod(input.RetentionPeriod, context) }),
200
- });
191
+ body = JSON.stringify(take(input, {
192
+ Description: [],
193
+ ResourceTags: (_) => _json(_),
194
+ ResourceType: [],
195
+ RetentionPeriod: (_) => _json(_),
196
+ }));
201
197
  return new __HttpRequest({
202
198
  protocol,
203
199
  hostname,
@@ -216,33 +212,18 @@ export const de_CreateRuleCommand = async (output, context) => {
216
212
  $metadata: deserializeMetadata(output),
217
213
  });
218
214
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
219
- if (data.Description != null) {
220
- contents.Description = __expectString(data.Description);
221
- }
222
- if (data.Identifier != null) {
223
- contents.Identifier = __expectString(data.Identifier);
224
- }
225
- if (data.LockConfiguration != null) {
226
- contents.LockConfiguration = de_LockConfiguration(data.LockConfiguration, context);
227
- }
228
- if (data.LockState != null) {
229
- contents.LockState = __expectString(data.LockState);
230
- }
231
- if (data.ResourceTags != null) {
232
- contents.ResourceTags = de_ResourceTags(data.ResourceTags, context);
233
- }
234
- if (data.ResourceType != null) {
235
- contents.ResourceType = __expectString(data.ResourceType);
236
- }
237
- if (data.RetentionPeriod != null) {
238
- contents.RetentionPeriod = de_RetentionPeriod(data.RetentionPeriod, context);
239
- }
240
- if (data.Status != null) {
241
- contents.Status = __expectString(data.Status);
242
- }
243
- if (data.Tags != null) {
244
- contents.Tags = de_TagList(data.Tags, context);
245
- }
215
+ const doc = take(data, {
216
+ Description: __expectString,
217
+ Identifier: __expectString,
218
+ LockConfiguration: _json,
219
+ LockState: __expectString,
220
+ ResourceTags: _json,
221
+ ResourceType: __expectString,
222
+ RetentionPeriod: _json,
223
+ Status: __expectString,
224
+ Tags: _json,
225
+ });
226
+ Object.assign(contents, doc);
246
227
  return contents;
247
228
  };
248
229
  const de_CreateRuleCommandError = async (output, context) => {
@@ -263,10 +244,9 @@ const de_CreateRuleCommandError = async (output, context) => {
263
244
  throw await de_ValidationExceptionRes(parsedOutput, context);
264
245
  default:
265
246
  const parsedBody = parsedOutput.body;
266
- throwDefaultError({
247
+ return throwDefaultError({
267
248
  output,
268
249
  parsedBody,
269
- exceptionCtor: __BaseException,
270
250
  errorCode,
271
251
  });
272
252
  }
@@ -302,10 +282,9 @@ const de_DeleteRuleCommandError = async (output, context) => {
302
282
  throw await de_ValidationExceptionRes(parsedOutput, context);
303
283
  default:
304
284
  const parsedBody = parsedOutput.body;
305
- throwDefaultError({
285
+ return throwDefaultError({
306
286
  output,
307
287
  parsedBody,
308
- exceptionCtor: __BaseException,
309
288
  errorCode,
310
289
  });
311
290
  }
@@ -318,33 +297,18 @@ export const de_GetRuleCommand = async (output, context) => {
318
297
  $metadata: deserializeMetadata(output),
319
298
  });
320
299
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
321
- if (data.Description != null) {
322
- contents.Description = __expectString(data.Description);
323
- }
324
- if (data.Identifier != null) {
325
- contents.Identifier = __expectString(data.Identifier);
326
- }
327
- if (data.LockConfiguration != null) {
328
- contents.LockConfiguration = de_LockConfiguration(data.LockConfiguration, context);
329
- }
330
- if (data.LockEndTime != null) {
331
- contents.LockEndTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LockEndTime)));
332
- }
333
- if (data.LockState != null) {
334
- contents.LockState = __expectString(data.LockState);
335
- }
336
- if (data.ResourceTags != null) {
337
- contents.ResourceTags = de_ResourceTags(data.ResourceTags, context);
338
- }
339
- if (data.ResourceType != null) {
340
- contents.ResourceType = __expectString(data.ResourceType);
341
- }
342
- if (data.RetentionPeriod != null) {
343
- contents.RetentionPeriod = de_RetentionPeriod(data.RetentionPeriod, context);
344
- }
345
- if (data.Status != null) {
346
- contents.Status = __expectString(data.Status);
347
- }
300
+ const doc = take(data, {
301
+ Description: __expectString,
302
+ Identifier: __expectString,
303
+ LockConfiguration: _json,
304
+ LockEndTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
305
+ LockState: __expectString,
306
+ ResourceTags: _json,
307
+ ResourceType: __expectString,
308
+ RetentionPeriod: _json,
309
+ Status: __expectString,
310
+ });
311
+ Object.assign(contents, doc);
348
312
  return contents;
349
313
  };
350
314
  const de_GetRuleCommandError = async (output, context) => {
@@ -365,10 +329,9 @@ const de_GetRuleCommandError = async (output, context) => {
365
329
  throw await de_ValidationExceptionRes(parsedOutput, context);
366
330
  default:
367
331
  const parsedBody = parsedOutput.body;
368
- throwDefaultError({
332
+ return throwDefaultError({
369
333
  output,
370
334
  parsedBody,
371
- exceptionCtor: __BaseException,
372
335
  errorCode,
373
336
  });
374
337
  }
@@ -381,12 +344,11 @@ export const de_ListRulesCommand = async (output, context) => {
381
344
  $metadata: deserializeMetadata(output),
382
345
  });
383
346
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
384
- if (data.NextToken != null) {
385
- contents.NextToken = __expectString(data.NextToken);
386
- }
387
- if (data.Rules != null) {
388
- contents.Rules = de_RuleSummaryList(data.Rules, context);
389
- }
347
+ const doc = take(data, {
348
+ NextToken: __expectString,
349
+ Rules: _json,
350
+ });
351
+ Object.assign(contents, doc);
390
352
  return contents;
391
353
  };
392
354
  const de_ListRulesCommandError = async (output, context) => {
@@ -404,10 +366,9 @@ const de_ListRulesCommandError = async (output, context) => {
404
366
  throw await de_ValidationExceptionRes(parsedOutput, context);
405
367
  default:
406
368
  const parsedBody = parsedOutput.body;
407
- throwDefaultError({
369
+ return throwDefaultError({
408
370
  output,
409
371
  parsedBody,
410
- exceptionCtor: __BaseException,
411
372
  errorCode,
412
373
  });
413
374
  }
@@ -420,9 +381,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
420
381
  $metadata: deserializeMetadata(output),
421
382
  });
422
383
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
423
- if (data.Tags != null) {
424
- contents.Tags = de_TagList(data.Tags, context);
425
- }
384
+ const doc = take(data, {
385
+ Tags: _json,
386
+ });
387
+ Object.assign(contents, doc);
426
388
  return contents;
427
389
  };
428
390
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -443,10 +405,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
443
405
  throw await de_ValidationExceptionRes(parsedOutput, context);
444
406
  default:
445
407
  const parsedBody = parsedOutput.body;
446
- throwDefaultError({
408
+ return throwDefaultError({
447
409
  output,
448
410
  parsedBody,
449
- exceptionCtor: __BaseException,
450
411
  errorCode,
451
412
  });
452
413
  }
@@ -459,30 +420,17 @@ export const de_LockRuleCommand = async (output, context) => {
459
420
  $metadata: deserializeMetadata(output),
460
421
  });
461
422
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
462
- if (data.Description != null) {
463
- contents.Description = __expectString(data.Description);
464
- }
465
- if (data.Identifier != null) {
466
- contents.Identifier = __expectString(data.Identifier);
467
- }
468
- if (data.LockConfiguration != null) {
469
- contents.LockConfiguration = de_LockConfiguration(data.LockConfiguration, context);
470
- }
471
- if (data.LockState != null) {
472
- contents.LockState = __expectString(data.LockState);
473
- }
474
- if (data.ResourceTags != null) {
475
- contents.ResourceTags = de_ResourceTags(data.ResourceTags, context);
476
- }
477
- if (data.ResourceType != null) {
478
- contents.ResourceType = __expectString(data.ResourceType);
479
- }
480
- if (data.RetentionPeriod != null) {
481
- contents.RetentionPeriod = de_RetentionPeriod(data.RetentionPeriod, context);
482
- }
483
- if (data.Status != null) {
484
- contents.Status = __expectString(data.Status);
485
- }
423
+ const doc = take(data, {
424
+ Description: __expectString,
425
+ Identifier: __expectString,
426
+ LockConfiguration: _json,
427
+ LockState: __expectString,
428
+ ResourceTags: _json,
429
+ ResourceType: __expectString,
430
+ RetentionPeriod: _json,
431
+ Status: __expectString,
432
+ });
433
+ Object.assign(contents, doc);
486
434
  return contents;
487
435
  };
488
436
  const de_LockRuleCommandError = async (output, context) => {
@@ -506,10 +454,9 @@ const de_LockRuleCommandError = async (output, context) => {
506
454
  throw await de_ValidationExceptionRes(parsedOutput, context);
507
455
  default:
508
456
  const parsedBody = parsedOutput.body;
509
- throwDefaultError({
457
+ return throwDefaultError({
510
458
  output,
511
459
  parsedBody,
512
- exceptionCtor: __BaseException,
513
460
  errorCode,
514
461
  });
515
462
  }
@@ -545,10 +492,9 @@ const de_TagResourceCommandError = async (output, context) => {
545
492
  throw await de_ValidationExceptionRes(parsedOutput, context);
546
493
  default:
547
494
  const parsedBody = parsedOutput.body;
548
- throwDefaultError({
495
+ return throwDefaultError({
549
496
  output,
550
497
  parsedBody,
551
- exceptionCtor: __BaseException,
552
498
  errorCode,
553
499
  });
554
500
  }
@@ -561,33 +507,18 @@ export const de_UnlockRuleCommand = async (output, context) => {
561
507
  $metadata: deserializeMetadata(output),
562
508
  });
563
509
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
564
- if (data.Description != null) {
565
- contents.Description = __expectString(data.Description);
566
- }
567
- if (data.Identifier != null) {
568
- contents.Identifier = __expectString(data.Identifier);
569
- }
570
- if (data.LockConfiguration != null) {
571
- contents.LockConfiguration = de_LockConfiguration(data.LockConfiguration, context);
572
- }
573
- if (data.LockEndTime != null) {
574
- contents.LockEndTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LockEndTime)));
575
- }
576
- if (data.LockState != null) {
577
- contents.LockState = __expectString(data.LockState);
578
- }
579
- if (data.ResourceTags != null) {
580
- contents.ResourceTags = de_ResourceTags(data.ResourceTags, context);
581
- }
582
- if (data.ResourceType != null) {
583
- contents.ResourceType = __expectString(data.ResourceType);
584
- }
585
- if (data.RetentionPeriod != null) {
586
- contents.RetentionPeriod = de_RetentionPeriod(data.RetentionPeriod, context);
587
- }
588
- if (data.Status != null) {
589
- contents.Status = __expectString(data.Status);
590
- }
510
+ const doc = take(data, {
511
+ Description: __expectString,
512
+ Identifier: __expectString,
513
+ LockConfiguration: _json,
514
+ LockEndTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
515
+ LockState: __expectString,
516
+ ResourceTags: _json,
517
+ ResourceType: __expectString,
518
+ RetentionPeriod: _json,
519
+ Status: __expectString,
520
+ });
521
+ Object.assign(contents, doc);
591
522
  return contents;
592
523
  };
593
524
  const de_UnlockRuleCommandError = async (output, context) => {
@@ -611,10 +542,9 @@ const de_UnlockRuleCommandError = async (output, context) => {
611
542
  throw await de_ValidationExceptionRes(parsedOutput, context);
612
543
  default:
613
544
  const parsedBody = parsedOutput.body;
614
- throwDefaultError({
545
+ return throwDefaultError({
615
546
  output,
616
547
  parsedBody,
617
- exceptionCtor: __BaseException,
618
548
  errorCode,
619
549
  });
620
550
  }
@@ -647,10 +577,9 @@ const de_UntagResourceCommandError = async (output, context) => {
647
577
  throw await de_ValidationExceptionRes(parsedOutput, context);
648
578
  default:
649
579
  const parsedBody = parsedOutput.body;
650
- throwDefaultError({
580
+ return throwDefaultError({
651
581
  output,
652
582
  parsedBody,
653
- exceptionCtor: __BaseException,
654
583
  errorCode,
655
584
  });
656
585
  }
@@ -663,30 +592,17 @@ export const de_UpdateRuleCommand = async (output, context) => {
663
592
  $metadata: deserializeMetadata(output),
664
593
  });
665
594
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
666
- if (data.Description != null) {
667
- contents.Description = __expectString(data.Description);
668
- }
669
- if (data.Identifier != null) {
670
- contents.Identifier = __expectString(data.Identifier);
671
- }
672
- if (data.LockEndTime != null) {
673
- contents.LockEndTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LockEndTime)));
674
- }
675
- if (data.LockState != null) {
676
- contents.LockState = __expectString(data.LockState);
677
- }
678
- if (data.ResourceTags != null) {
679
- contents.ResourceTags = de_ResourceTags(data.ResourceTags, context);
680
- }
681
- if (data.ResourceType != null) {
682
- contents.ResourceType = __expectString(data.ResourceType);
683
- }
684
- if (data.RetentionPeriod != null) {
685
- contents.RetentionPeriod = de_RetentionPeriod(data.RetentionPeriod, context);
686
- }
687
- if (data.Status != null) {
688
- contents.Status = __expectString(data.Status);
689
- }
595
+ const doc = take(data, {
596
+ Description: __expectString,
597
+ Identifier: __expectString,
598
+ LockEndTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
599
+ LockState: __expectString,
600
+ ResourceTags: _json,
601
+ ResourceType: __expectString,
602
+ RetentionPeriod: _json,
603
+ Status: __expectString,
604
+ });
605
+ Object.assign(contents, doc);
690
606
  return contents;
691
607
  };
692
608
  const de_UpdateRuleCommandError = async (output, context) => {
@@ -710,24 +626,22 @@ const de_UpdateRuleCommandError = async (output, context) => {
710
626
  throw await de_ValidationExceptionRes(parsedOutput, context);
711
627
  default:
712
628
  const parsedBody = parsedOutput.body;
713
- throwDefaultError({
629
+ return throwDefaultError({
714
630
  output,
715
631
  parsedBody,
716
- exceptionCtor: __BaseException,
717
632
  errorCode,
718
633
  });
719
634
  }
720
635
  };
721
- const map = __map;
636
+ const throwDefaultError = withBaseException(__BaseException);
722
637
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
723
638
  const contents = map({});
724
639
  const data = parsedOutput.body;
725
- if (data.Message != null) {
726
- contents.Message = __expectString(data.Message);
727
- }
728
- if (data.Reason != null) {
729
- contents.Reason = __expectString(data.Reason);
730
- }
640
+ const doc = take(data, {
641
+ Message: __expectString,
642
+ Reason: __expectString,
643
+ });
644
+ Object.assign(contents, doc);
731
645
  const exception = new ConflictException({
732
646
  $metadata: deserializeMetadata(parsedOutput),
733
647
  ...contents,
@@ -737,9 +651,10 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
737
651
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
738
652
  const contents = map({});
739
653
  const data = parsedOutput.body;
740
- if (data.Message != null) {
741
- contents.Message = __expectString(data.Message);
742
- }
654
+ const doc = take(data, {
655
+ Message: __expectString,
656
+ });
657
+ Object.assign(contents, doc);
743
658
  const exception = new InternalServerException({
744
659
  $metadata: deserializeMetadata(parsedOutput),
745
660
  ...contents,
@@ -749,12 +664,11 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
749
664
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
750
665
  const contents = map({});
751
666
  const data = parsedOutput.body;
752
- if (data.Message != null) {
753
- contents.Message = __expectString(data.Message);
754
- }
755
- if (data.Reason != null) {
756
- contents.Reason = __expectString(data.Reason);
757
- }
667
+ const doc = take(data, {
668
+ Message: __expectString,
669
+ Reason: __expectString,
670
+ });
671
+ Object.assign(contents, doc);
758
672
  const exception = new ResourceNotFoundException({
759
673
  $metadata: deserializeMetadata(parsedOutput),
760
674
  ...contents,
@@ -764,12 +678,11 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
764
678
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
765
679
  const contents = map({});
766
680
  const data = parsedOutput.body;
767
- if (data.Message != null) {
768
- contents.Message = __expectString(data.Message);
769
- }
770
- if (data.Reason != null) {
771
- contents.Reason = __expectString(data.Reason);
772
- }
681
+ const doc = take(data, {
682
+ Message: __expectString,
683
+ Reason: __expectString,
684
+ });
685
+ Object.assign(contents, doc);
773
686
  const exception = new ServiceQuotaExceededException({
774
687
  $metadata: deserializeMetadata(parsedOutput),
775
688
  ...contents,
@@ -779,131 +692,17 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
779
692
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
780
693
  const contents = map({});
781
694
  const data = parsedOutput.body;
782
- if (data.Message != null) {
783
- contents.Message = __expectString(data.Message);
784
- }
785
- if (data.Reason != null) {
786
- contents.Reason = __expectString(data.Reason);
787
- }
695
+ const doc = take(data, {
696
+ Message: __expectString,
697
+ Reason: __expectString,
698
+ });
699
+ Object.assign(contents, doc);
788
700
  const exception = new ValidationException({
789
701
  $metadata: deserializeMetadata(parsedOutput),
790
702
  ...contents,
791
703
  });
792
704
  return __decorateServiceException(exception, parsedOutput.body);
793
705
  };
794
- const se_LockConfiguration = (input, context) => {
795
- return {
796
- ...(input.UnlockDelay != null && { UnlockDelay: se_UnlockDelay(input.UnlockDelay, context) }),
797
- };
798
- };
799
- const se_ResourceTag = (input, context) => {
800
- return {
801
- ...(input.ResourceTagKey != null && { ResourceTagKey: input.ResourceTagKey }),
802
- ...(input.ResourceTagValue != null && { ResourceTagValue: input.ResourceTagValue }),
803
- };
804
- };
805
- const se_ResourceTags = (input, context) => {
806
- return input
807
- .filter((e) => e != null)
808
- .map((entry) => {
809
- return se_ResourceTag(entry, context);
810
- });
811
- };
812
- const se_RetentionPeriod = (input, context) => {
813
- return {
814
- ...(input.RetentionPeriodUnit != null && { RetentionPeriodUnit: input.RetentionPeriodUnit }),
815
- ...(input.RetentionPeriodValue != null && { RetentionPeriodValue: input.RetentionPeriodValue }),
816
- };
817
- };
818
- const se_Tag = (input, context) => {
819
- return {
820
- ...(input.Key != null && { Key: input.Key }),
821
- ...(input.Value != null && { Value: input.Value }),
822
- };
823
- };
824
- const se_TagList = (input, context) => {
825
- return input
826
- .filter((e) => e != null)
827
- .map((entry) => {
828
- return se_Tag(entry, context);
829
- });
830
- };
831
- const se_UnlockDelay = (input, context) => {
832
- return {
833
- ...(input.UnlockDelayUnit != null && { UnlockDelayUnit: input.UnlockDelayUnit }),
834
- ...(input.UnlockDelayValue != null && { UnlockDelayValue: input.UnlockDelayValue }),
835
- };
836
- };
837
- const de_LockConfiguration = (output, context) => {
838
- return {
839
- UnlockDelay: output.UnlockDelay != null ? de_UnlockDelay(output.UnlockDelay, context) : undefined,
840
- };
841
- };
842
- const de_ResourceTag = (output, context) => {
843
- return {
844
- ResourceTagKey: __expectString(output.ResourceTagKey),
845
- ResourceTagValue: __expectString(output.ResourceTagValue),
846
- };
847
- };
848
- const de_ResourceTags = (output, context) => {
849
- const retVal = (output || [])
850
- .filter((e) => e != null)
851
- .map((entry) => {
852
- if (entry === null) {
853
- return null;
854
- }
855
- return de_ResourceTag(entry, context);
856
- });
857
- return retVal;
858
- };
859
- const de_RetentionPeriod = (output, context) => {
860
- return {
861
- RetentionPeriodUnit: __expectString(output.RetentionPeriodUnit),
862
- RetentionPeriodValue: __expectInt32(output.RetentionPeriodValue),
863
- };
864
- };
865
- const de_RuleSummary = (output, context) => {
866
- return {
867
- Description: __expectString(output.Description),
868
- Identifier: __expectString(output.Identifier),
869
- LockState: __expectString(output.LockState),
870
- RetentionPeriod: output.RetentionPeriod != null ? de_RetentionPeriod(output.RetentionPeriod, context) : undefined,
871
- };
872
- };
873
- const de_RuleSummaryList = (output, context) => {
874
- const retVal = (output || [])
875
- .filter((e) => e != null)
876
- .map((entry) => {
877
- if (entry === null) {
878
- return null;
879
- }
880
- return de_RuleSummary(entry, context);
881
- });
882
- return retVal;
883
- };
884
- const de_Tag = (output, context) => {
885
- return {
886
- Key: __expectString(output.Key),
887
- Value: __expectString(output.Value),
888
- };
889
- };
890
- const de_TagList = (output, context) => {
891
- const retVal = (output || [])
892
- .filter((e) => e != null)
893
- .map((entry) => {
894
- if (entry === null) {
895
- return null;
896
- }
897
- return de_Tag(entry, context);
898
- });
899
- return retVal;
900
- };
901
- const de_UnlockDelay = (output, context) => {
902
- return {
903
- UnlockDelayUnit: __expectString(output.UnlockDelayUnit),
904
- UnlockDelayValue: __expectInt32(output.UnlockDelayValue),
905
- };
906
- };
907
706
  const deserializeMetadata = (output) => ({
908
707
  httpStatusCode: output.statusCode,
909
708
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],