@aws-sdk/client-docdb-elastic 3.312.0 → 3.315.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, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { DocDBElasticServiceException as __BaseException } from "../models/DocDBElasticServiceException";
5
5
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
@@ -10,22 +10,20 @@ export const se_CreateClusterCommand = async (input, context) => {
10
10
  };
11
11
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/cluster";
12
12
  let body;
13
- body = JSON.stringify({
14
- ...(input.adminUserName != null && { adminUserName: input.adminUserName }),
15
- ...(input.adminUserPassword != null && { adminUserPassword: input.adminUserPassword }),
16
- ...(input.authType != null && { authType: input.authType }),
17
- clientToken: input.clientToken ?? generateIdempotencyToken(),
18
- ...(input.clusterName != null && { clusterName: input.clusterName }),
19
- ...(input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId }),
20
- ...(input.preferredMaintenanceWindow != null && { preferredMaintenanceWindow: input.preferredMaintenanceWindow }),
21
- ...(input.shardCapacity != null && { shardCapacity: input.shardCapacity }),
22
- ...(input.shardCount != null && { shardCount: input.shardCount }),
23
- ...(input.subnetIds != null && { subnetIds: se_StringList(input.subnetIds, context) }),
24
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
25
- ...(input.vpcSecurityGroupIds != null && {
26
- vpcSecurityGroupIds: se_StringList(input.vpcSecurityGroupIds, context),
27
- }),
28
- });
13
+ body = JSON.stringify(take(input, {
14
+ adminUserName: [],
15
+ adminUserPassword: [],
16
+ authType: [],
17
+ clientToken: (_) => _ ?? generateIdempotencyToken(),
18
+ clusterName: [],
19
+ kmsKeyId: [],
20
+ preferredMaintenanceWindow: [],
21
+ shardCapacity: [],
22
+ shardCount: [],
23
+ subnetIds: (_) => _json(_),
24
+ tags: (_) => _json(_),
25
+ vpcSecurityGroupIds: (_) => _json(_),
26
+ }));
29
27
  return new __HttpRequest({
30
28
  protocol,
31
29
  hostname,
@@ -43,11 +41,11 @@ export const se_CreateClusterSnapshotCommand = async (input, context) => {
43
41
  };
44
42
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/cluster-snapshot";
45
43
  let body;
46
- body = JSON.stringify({
47
- ...(input.clusterArn != null && { clusterArn: input.clusterArn }),
48
- ...(input.snapshotName != null && { snapshotName: input.snapshotName }),
49
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
50
- });
44
+ body = JSON.stringify(take(input, {
45
+ clusterArn: [],
46
+ snapshotName: [],
47
+ tags: (_) => _json(_),
48
+ }));
51
49
  return new __HttpRequest({
52
50
  protocol,
53
51
  hostname,
@@ -187,15 +185,13 @@ export const se_RestoreClusterFromSnapshotCommand = async (input, context) => {
187
185
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/cluster-snapshot/{snapshotArn}/restore";
188
186
  resolvedPath = __resolvedPath(resolvedPath, input, "snapshotArn", () => input.snapshotArn, "{snapshotArn}", false);
189
187
  let body;
190
- body = JSON.stringify({
191
- ...(input.clusterName != null && { clusterName: input.clusterName }),
192
- ...(input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId }),
193
- ...(input.subnetIds != null && { subnetIds: se_StringList(input.subnetIds, context) }),
194
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
195
- ...(input.vpcSecurityGroupIds != null && {
196
- vpcSecurityGroupIds: se_StringList(input.vpcSecurityGroupIds, context),
197
- }),
198
- });
188
+ body = JSON.stringify(take(input, {
189
+ clusterName: [],
190
+ kmsKeyId: [],
191
+ subnetIds: (_) => _json(_),
192
+ tags: (_) => _json(_),
193
+ vpcSecurityGroupIds: (_) => _json(_),
194
+ }));
199
195
  return new __HttpRequest({
200
196
  protocol,
201
197
  hostname,
@@ -214,9 +210,9 @@ export const se_TagResourceCommand = async (input, context) => {
214
210
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
215
211
  resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
216
212
  let body;
217
- body = JSON.stringify({
218
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
219
- });
213
+ body = JSON.stringify(take(input, {
214
+ tags: (_) => _json(_),
215
+ }));
220
216
  return new __HttpRequest({
221
217
  protocol,
222
218
  hostname,
@@ -258,18 +254,16 @@ export const se_UpdateClusterCommand = async (input, context) => {
258
254
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/cluster/{clusterArn}";
259
255
  resolvedPath = __resolvedPath(resolvedPath, input, "clusterArn", () => input.clusterArn, "{clusterArn}", false);
260
256
  let body;
261
- body = JSON.stringify({
262
- ...(input.adminUserPassword != null && { adminUserPassword: input.adminUserPassword }),
263
- ...(input.authType != null && { authType: input.authType }),
264
- clientToken: input.clientToken ?? generateIdempotencyToken(),
265
- ...(input.preferredMaintenanceWindow != null && { preferredMaintenanceWindow: input.preferredMaintenanceWindow }),
266
- ...(input.shardCapacity != null && { shardCapacity: input.shardCapacity }),
267
- ...(input.shardCount != null && { shardCount: input.shardCount }),
268
- ...(input.subnetIds != null && { subnetIds: se_StringList(input.subnetIds, context) }),
269
- ...(input.vpcSecurityGroupIds != null && {
270
- vpcSecurityGroupIds: se_StringList(input.vpcSecurityGroupIds, context),
271
- }),
272
- });
257
+ body = JSON.stringify(take(input, {
258
+ adminUserPassword: [],
259
+ authType: [],
260
+ clientToken: (_) => _ ?? generateIdempotencyToken(),
261
+ preferredMaintenanceWindow: [],
262
+ shardCapacity: [],
263
+ shardCount: [],
264
+ subnetIds: (_) => _json(_),
265
+ vpcSecurityGroupIds: (_) => _json(_),
266
+ }));
273
267
  return new __HttpRequest({
274
268
  protocol,
275
269
  hostname,
@@ -288,9 +282,10 @@ export const de_CreateClusterCommand = async (output, context) => {
288
282
  $metadata: deserializeMetadata(output),
289
283
  });
290
284
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
291
- if (data.cluster != null) {
292
- contents.cluster = de_Cluster(data.cluster, context);
293
- }
285
+ const doc = take(data, {
286
+ cluster: _json,
287
+ });
288
+ Object.assign(contents, doc);
294
289
  return contents;
295
290
  };
296
291
  const de_CreateClusterCommandError = async (output, context) => {
@@ -320,10 +315,9 @@ const de_CreateClusterCommandError = async (output, context) => {
320
315
  throw await de_ValidationExceptionRes(parsedOutput, context);
321
316
  default:
322
317
  const parsedBody = parsedOutput.body;
323
- throwDefaultError({
318
+ return throwDefaultError({
324
319
  output,
325
320
  parsedBody,
326
- exceptionCtor: __BaseException,
327
321
  errorCode,
328
322
  });
329
323
  }
@@ -336,9 +330,10 @@ export const de_CreateClusterSnapshotCommand = async (output, context) => {
336
330
  $metadata: deserializeMetadata(output),
337
331
  });
338
332
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
339
- if (data.snapshot != null) {
340
- contents.snapshot = de_ClusterSnapshot(data.snapshot, context);
341
- }
333
+ const doc = take(data, {
334
+ snapshot: _json,
335
+ });
336
+ Object.assign(contents, doc);
342
337
  return contents;
343
338
  };
344
339
  const de_CreateClusterSnapshotCommandError = async (output, context) => {
@@ -371,10 +366,9 @@ const de_CreateClusterSnapshotCommandError = async (output, context) => {
371
366
  throw await de_ValidationExceptionRes(parsedOutput, context);
372
367
  default:
373
368
  const parsedBody = parsedOutput.body;
374
- throwDefaultError({
369
+ return throwDefaultError({
375
370
  output,
376
371
  parsedBody,
377
- exceptionCtor: __BaseException,
378
372
  errorCode,
379
373
  });
380
374
  }
@@ -387,9 +381,10 @@ export const de_DeleteClusterCommand = async (output, context) => {
387
381
  $metadata: deserializeMetadata(output),
388
382
  });
389
383
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
390
- if (data.cluster != null) {
391
- contents.cluster = de_Cluster(data.cluster, context);
392
- }
384
+ const doc = take(data, {
385
+ cluster: _json,
386
+ });
387
+ Object.assign(contents, doc);
393
388
  return contents;
394
389
  };
395
390
  const de_DeleteClusterCommandError = async (output, context) => {
@@ -419,10 +414,9 @@ const de_DeleteClusterCommandError = async (output, context) => {
419
414
  throw await de_ValidationExceptionRes(parsedOutput, context);
420
415
  default:
421
416
  const parsedBody = parsedOutput.body;
422
- throwDefaultError({
417
+ return throwDefaultError({
423
418
  output,
424
419
  parsedBody,
425
- exceptionCtor: __BaseException,
426
420
  errorCode,
427
421
  });
428
422
  }
@@ -435,9 +429,10 @@ export const de_DeleteClusterSnapshotCommand = async (output, context) => {
435
429
  $metadata: deserializeMetadata(output),
436
430
  });
437
431
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
438
- if (data.snapshot != null) {
439
- contents.snapshot = de_ClusterSnapshot(data.snapshot, context);
440
- }
432
+ const doc = take(data, {
433
+ snapshot: _json,
434
+ });
435
+ Object.assign(contents, doc);
441
436
  return contents;
442
437
  };
443
438
  const de_DeleteClusterSnapshotCommandError = async (output, context) => {
@@ -467,10 +462,9 @@ const de_DeleteClusterSnapshotCommandError = async (output, context) => {
467
462
  throw await de_ValidationExceptionRes(parsedOutput, context);
468
463
  default:
469
464
  const parsedBody = parsedOutput.body;
470
- throwDefaultError({
465
+ return throwDefaultError({
471
466
  output,
472
467
  parsedBody,
473
- exceptionCtor: __BaseException,
474
468
  errorCode,
475
469
  });
476
470
  }
@@ -483,9 +477,10 @@ export const de_GetClusterCommand = async (output, context) => {
483
477
  $metadata: deserializeMetadata(output),
484
478
  });
485
479
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
486
- if (data.cluster != null) {
487
- contents.cluster = de_Cluster(data.cluster, context);
488
- }
480
+ const doc = take(data, {
481
+ cluster: _json,
482
+ });
483
+ Object.assign(contents, doc);
489
484
  return contents;
490
485
  };
491
486
  const de_GetClusterCommandError = async (output, context) => {
@@ -512,10 +507,9 @@ const de_GetClusterCommandError = async (output, context) => {
512
507
  throw await de_ValidationExceptionRes(parsedOutput, context);
513
508
  default:
514
509
  const parsedBody = parsedOutput.body;
515
- throwDefaultError({
510
+ return throwDefaultError({
516
511
  output,
517
512
  parsedBody,
518
- exceptionCtor: __BaseException,
519
513
  errorCode,
520
514
  });
521
515
  }
@@ -528,9 +522,10 @@ export const de_GetClusterSnapshotCommand = async (output, context) => {
528
522
  $metadata: deserializeMetadata(output),
529
523
  });
530
524
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
531
- if (data.snapshot != null) {
532
- contents.snapshot = de_ClusterSnapshot(data.snapshot, context);
533
- }
525
+ const doc = take(data, {
526
+ snapshot: _json,
527
+ });
528
+ Object.assign(contents, doc);
534
529
  return contents;
535
530
  };
536
531
  const de_GetClusterSnapshotCommandError = async (output, context) => {
@@ -557,10 +552,9 @@ const de_GetClusterSnapshotCommandError = async (output, context) => {
557
552
  throw await de_ValidationExceptionRes(parsedOutput, context);
558
553
  default:
559
554
  const parsedBody = parsedOutput.body;
560
- throwDefaultError({
555
+ return throwDefaultError({
561
556
  output,
562
557
  parsedBody,
563
- exceptionCtor: __BaseException,
564
558
  errorCode,
565
559
  });
566
560
  }
@@ -573,12 +567,11 @@ export const de_ListClustersCommand = async (output, context) => {
573
567
  $metadata: deserializeMetadata(output),
574
568
  });
575
569
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
576
- if (data.clusters != null) {
577
- contents.clusters = de_ClusterList(data.clusters, context);
578
- }
579
- if (data.nextToken != null) {
580
- contents.nextToken = __expectString(data.nextToken);
581
- }
570
+ const doc = take(data, {
571
+ clusters: _json,
572
+ nextToken: __expectString,
573
+ });
574
+ Object.assign(contents, doc);
582
575
  return contents;
583
576
  };
584
577
  const de_ListClustersCommandError = async (output, context) => {
@@ -602,10 +595,9 @@ const de_ListClustersCommandError = async (output, context) => {
602
595
  throw await de_ValidationExceptionRes(parsedOutput, context);
603
596
  default:
604
597
  const parsedBody = parsedOutput.body;
605
- throwDefaultError({
598
+ return throwDefaultError({
606
599
  output,
607
600
  parsedBody,
608
- exceptionCtor: __BaseException,
609
601
  errorCode,
610
602
  });
611
603
  }
@@ -618,12 +610,11 @@ export const de_ListClusterSnapshotsCommand = async (output, context) => {
618
610
  $metadata: deserializeMetadata(output),
619
611
  });
620
612
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
621
- if (data.nextToken != null) {
622
- contents.nextToken = __expectString(data.nextToken);
623
- }
624
- if (data.snapshots != null) {
625
- contents.snapshots = de_ClusterSnapshotList(data.snapshots, context);
626
- }
613
+ const doc = take(data, {
614
+ nextToken: __expectString,
615
+ snapshots: _json,
616
+ });
617
+ Object.assign(contents, doc);
627
618
  return contents;
628
619
  };
629
620
  const de_ListClusterSnapshotsCommandError = async (output, context) => {
@@ -647,10 +638,9 @@ const de_ListClusterSnapshotsCommandError = async (output, context) => {
647
638
  throw await de_ValidationExceptionRes(parsedOutput, context);
648
639
  default:
649
640
  const parsedBody = parsedOutput.body;
650
- throwDefaultError({
641
+ return throwDefaultError({
651
642
  output,
652
643
  parsedBody,
653
- exceptionCtor: __BaseException,
654
644
  errorCode,
655
645
  });
656
646
  }
@@ -663,9 +653,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
663
653
  $metadata: deserializeMetadata(output),
664
654
  });
665
655
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
666
- if (data.tags != null) {
667
- contents.tags = de_TagMap(data.tags, context);
668
- }
656
+ const doc = take(data, {
657
+ tags: _json,
658
+ });
659
+ Object.assign(contents, doc);
669
660
  return contents;
670
661
  };
671
662
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -689,10 +680,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
689
680
  throw await de_ValidationExceptionRes(parsedOutput, context);
690
681
  default:
691
682
  const parsedBody = parsedOutput.body;
692
- throwDefaultError({
683
+ return throwDefaultError({
693
684
  output,
694
685
  parsedBody,
695
- exceptionCtor: __BaseException,
696
686
  errorCode,
697
687
  });
698
688
  }
@@ -705,9 +695,10 @@ export const de_RestoreClusterFromSnapshotCommand = async (output, context) => {
705
695
  $metadata: deserializeMetadata(output),
706
696
  });
707
697
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
708
- if (data.cluster != null) {
709
- contents.cluster = de_Cluster(data.cluster, context);
710
- }
698
+ const doc = take(data, {
699
+ cluster: _json,
700
+ });
701
+ Object.assign(contents, doc);
711
702
  return contents;
712
703
  };
713
704
  const de_RestoreClusterFromSnapshotCommandError = async (output, context) => {
@@ -740,10 +731,9 @@ const de_RestoreClusterFromSnapshotCommandError = async (output, context) => {
740
731
  throw await de_ValidationExceptionRes(parsedOutput, context);
741
732
  default:
742
733
  const parsedBody = parsedOutput.body;
743
- throwDefaultError({
734
+ return throwDefaultError({
744
735
  output,
745
736
  parsedBody,
746
- exceptionCtor: __BaseException,
747
737
  errorCode,
748
738
  });
749
739
  }
@@ -779,10 +769,9 @@ const de_TagResourceCommandError = async (output, context) => {
779
769
  throw await de_ValidationExceptionRes(parsedOutput, context);
780
770
  default:
781
771
  const parsedBody = parsedOutput.body;
782
- throwDefaultError({
772
+ return throwDefaultError({
783
773
  output,
784
774
  parsedBody,
785
- exceptionCtor: __BaseException,
786
775
  errorCode,
787
776
  });
788
777
  }
@@ -818,10 +807,9 @@ const de_UntagResourceCommandError = async (output, context) => {
818
807
  throw await de_ValidationExceptionRes(parsedOutput, context);
819
808
  default:
820
809
  const parsedBody = parsedOutput.body;
821
- throwDefaultError({
810
+ return throwDefaultError({
822
811
  output,
823
812
  parsedBody,
824
- exceptionCtor: __BaseException,
825
813
  errorCode,
826
814
  });
827
815
  }
@@ -834,9 +822,10 @@ export const de_UpdateClusterCommand = async (output, context) => {
834
822
  $metadata: deserializeMetadata(output),
835
823
  });
836
824
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
837
- if (data.cluster != null) {
838
- contents.cluster = de_Cluster(data.cluster, context);
839
- }
825
+ const doc = take(data, {
826
+ cluster: _json,
827
+ });
828
+ Object.assign(contents, doc);
840
829
  return contents;
841
830
  };
842
831
  const de_UpdateClusterCommandError = async (output, context) => {
@@ -866,21 +855,21 @@ const de_UpdateClusterCommandError = async (output, context) => {
866
855
  throw await de_ValidationExceptionRes(parsedOutput, context);
867
856
  default:
868
857
  const parsedBody = parsedOutput.body;
869
- throwDefaultError({
858
+ return throwDefaultError({
870
859
  output,
871
860
  parsedBody,
872
- exceptionCtor: __BaseException,
873
861
  errorCode,
874
862
  });
875
863
  }
876
864
  };
877
- const map = __map;
865
+ const throwDefaultError = withBaseException(__BaseException);
878
866
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
879
867
  const contents = map({});
880
868
  const data = parsedOutput.body;
881
- if (data.message != null) {
882
- contents.message = __expectString(data.message);
883
- }
869
+ const doc = take(data, {
870
+ message: __expectString,
871
+ });
872
+ Object.assign(contents, doc);
884
873
  const exception = new AccessDeniedException({
885
874
  $metadata: deserializeMetadata(parsedOutput),
886
875
  ...contents,
@@ -890,15 +879,12 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
890
879
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
891
880
  const contents = map({});
892
881
  const data = parsedOutput.body;
893
- if (data.message != null) {
894
- contents.message = __expectString(data.message);
895
- }
896
- if (data.resourceId != null) {
897
- contents.resourceId = __expectString(data.resourceId);
898
- }
899
- if (data.resourceType != null) {
900
- contents.resourceType = __expectString(data.resourceType);
901
- }
882
+ const doc = take(data, {
883
+ message: __expectString,
884
+ resourceId: __expectString,
885
+ resourceType: __expectString,
886
+ });
887
+ Object.assign(contents, doc);
902
888
  const exception = new ConflictException({
903
889
  $metadata: deserializeMetadata(parsedOutput),
904
890
  ...contents,
@@ -908,9 +894,10 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
908
894
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
909
895
  const contents = map({});
910
896
  const data = parsedOutput.body;
911
- if (data.message != null) {
912
- contents.message = __expectString(data.message);
913
- }
897
+ const doc = take(data, {
898
+ message: __expectString,
899
+ });
900
+ Object.assign(contents, doc);
914
901
  const exception = new InternalServerException({
915
902
  $metadata: deserializeMetadata(parsedOutput),
916
903
  ...contents,
@@ -920,15 +907,12 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
920
907
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
921
908
  const contents = map({});
922
909
  const data = parsedOutput.body;
923
- if (data.message != null) {
924
- contents.message = __expectString(data.message);
925
- }
926
- if (data.resourceId != null) {
927
- contents.resourceId = __expectString(data.resourceId);
928
- }
929
- if (data.resourceType != null) {
930
- contents.resourceType = __expectString(data.resourceType);
931
- }
910
+ const doc = take(data, {
911
+ message: __expectString,
912
+ resourceId: __expectString,
913
+ resourceType: __expectString,
914
+ });
915
+ Object.assign(contents, doc);
932
916
  const exception = new ResourceNotFoundException({
933
917
  $metadata: deserializeMetadata(parsedOutput),
934
918
  ...contents,
@@ -938,9 +922,10 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
938
922
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
939
923
  const contents = map({});
940
924
  const data = parsedOutput.body;
941
- if (data.message != null) {
942
- contents.message = __expectString(data.message);
943
- }
925
+ const doc = take(data, {
926
+ message: __expectString,
927
+ });
928
+ Object.assign(contents, doc);
944
929
  const exception = new ServiceQuotaExceededException({
945
930
  $metadata: deserializeMetadata(parsedOutput),
946
931
  ...contents,
@@ -955,9 +940,10 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
955
940
  ],
956
941
  });
957
942
  const data = parsedOutput.body;
958
- if (data.message != null) {
959
- contents.message = __expectString(data.message);
960
- }
943
+ const doc = take(data, {
944
+ message: __expectString,
945
+ });
946
+ Object.assign(contents, doc);
961
947
  const exception = new ThrottlingException({
962
948
  $metadata: deserializeMetadata(parsedOutput),
963
949
  ...contents,
@@ -967,143 +953,18 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
967
953
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
968
954
  const contents = map({});
969
955
  const data = parsedOutput.body;
970
- if (data.fieldList != null) {
971
- contents.fieldList = de_ValidationExceptionFieldList(data.fieldList, context);
972
- }
973
- if (data.message != null) {
974
- contents.message = __expectString(data.message);
975
- }
976
- if (data.reason != null) {
977
- contents.reason = __expectString(data.reason);
978
- }
956
+ const doc = take(data, {
957
+ fieldList: _json,
958
+ message: __expectString,
959
+ reason: __expectString,
960
+ });
961
+ Object.assign(contents, doc);
979
962
  const exception = new ValidationException({
980
963
  $metadata: deserializeMetadata(parsedOutput),
981
964
  ...contents,
982
965
  });
983
966
  return __decorateServiceException(exception, parsedOutput.body);
984
967
  };
985
- const se_StringList = (input, context) => {
986
- return input
987
- .filter((e) => e != null)
988
- .map((entry) => {
989
- return entry;
990
- });
991
- };
992
- const se_TagMap = (input, context) => {
993
- return Object.entries(input).reduce((acc, [key, value]) => {
994
- if (value === null) {
995
- return acc;
996
- }
997
- acc[key] = value;
998
- return acc;
999
- }, {});
1000
- };
1001
- const de_Cluster = (output, context) => {
1002
- return {
1003
- adminUserName: __expectString(output.adminUserName),
1004
- authType: __expectString(output.authType),
1005
- clusterArn: __expectString(output.clusterArn),
1006
- clusterEndpoint: __expectString(output.clusterEndpoint),
1007
- clusterName: __expectString(output.clusterName),
1008
- createTime: __expectString(output.createTime),
1009
- kmsKeyId: __expectString(output.kmsKeyId),
1010
- preferredMaintenanceWindow: __expectString(output.preferredMaintenanceWindow),
1011
- shardCapacity: __expectInt32(output.shardCapacity),
1012
- shardCount: __expectInt32(output.shardCount),
1013
- status: __expectString(output.status),
1014
- subnetIds: output.subnetIds != null ? de_StringList(output.subnetIds, context) : undefined,
1015
- vpcSecurityGroupIds: output.vpcSecurityGroupIds != null ? de_StringList(output.vpcSecurityGroupIds, context) : undefined,
1016
- };
1017
- };
1018
- const de_ClusterInList = (output, context) => {
1019
- return {
1020
- clusterArn: __expectString(output.clusterArn),
1021
- clusterName: __expectString(output.clusterName),
1022
- status: __expectString(output.status),
1023
- };
1024
- };
1025
- const de_ClusterList = (output, context) => {
1026
- const retVal = (output || [])
1027
- .filter((e) => e != null)
1028
- .map((entry) => {
1029
- if (entry === null) {
1030
- return null;
1031
- }
1032
- return de_ClusterInList(entry, context);
1033
- });
1034
- return retVal;
1035
- };
1036
- const de_ClusterSnapshot = (output, context) => {
1037
- return {
1038
- adminUserName: __expectString(output.adminUserName),
1039
- clusterArn: __expectString(output.clusterArn),
1040
- clusterCreationTime: __expectString(output.clusterCreationTime),
1041
- kmsKeyId: __expectString(output.kmsKeyId),
1042
- snapshotArn: __expectString(output.snapshotArn),
1043
- snapshotCreationTime: __expectString(output.snapshotCreationTime),
1044
- snapshotName: __expectString(output.snapshotName),
1045
- status: __expectString(output.status),
1046
- subnetIds: output.subnetIds != null ? de_StringList(output.subnetIds, context) : undefined,
1047
- vpcSecurityGroupIds: output.vpcSecurityGroupIds != null ? de_StringList(output.vpcSecurityGroupIds, context) : undefined,
1048
- };
1049
- };
1050
- const de_ClusterSnapshotInList = (output, context) => {
1051
- return {
1052
- clusterArn: __expectString(output.clusterArn),
1053
- snapshotArn: __expectString(output.snapshotArn),
1054
- snapshotCreationTime: __expectString(output.snapshotCreationTime),
1055
- snapshotName: __expectString(output.snapshotName),
1056
- status: __expectString(output.status),
1057
- };
1058
- };
1059
- const de_ClusterSnapshotList = (output, context) => {
1060
- const retVal = (output || [])
1061
- .filter((e) => e != null)
1062
- .map((entry) => {
1063
- if (entry === null) {
1064
- return null;
1065
- }
1066
- return de_ClusterSnapshotInList(entry, context);
1067
- });
1068
- return retVal;
1069
- };
1070
- const de_StringList = (output, context) => {
1071
- const retVal = (output || [])
1072
- .filter((e) => e != null)
1073
- .map((entry) => {
1074
- if (entry === null) {
1075
- return null;
1076
- }
1077
- return __expectString(entry);
1078
- });
1079
- return retVal;
1080
- };
1081
- const de_TagMap = (output, context) => {
1082
- return Object.entries(output).reduce((acc, [key, value]) => {
1083
- if (value === null) {
1084
- return acc;
1085
- }
1086
- acc[key] = __expectString(value);
1087
- return acc;
1088
- }, {});
1089
- };
1090
- const de_ValidationExceptionField = (output, context) => {
1091
- return {
1092
- message: __expectString(output.message),
1093
- name: __expectString(output.name),
1094
- };
1095
- };
1096
- const de_ValidationExceptionFieldList = (output, context) => {
1097
- const retVal = (output || [])
1098
- .filter((e) => e != null)
1099
- .map((entry) => {
1100
- if (entry === null) {
1101
- return null;
1102
- }
1103
- return de_ValidationExceptionField(entry, context);
1104
- });
1105
- return retVal;
1106
- };
1107
968
  const deserializeMetadata = (output) => ({
1108
969
  httpStatusCode: output.statusCode,
1109
970
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],