@aws-sdk/client-docdb-elastic 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.
@@ -13,22 +13,20 @@ const se_CreateClusterCommand = async (input, context) => {
13
13
  };
14
14
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/cluster";
15
15
  let body;
16
- body = JSON.stringify({
17
- ...(input.adminUserName != null && { adminUserName: input.adminUserName }),
18
- ...(input.adminUserPassword != null && { adminUserPassword: input.adminUserPassword }),
19
- ...(input.authType != null && { authType: input.authType }),
20
- clientToken: input.clientToken ?? (0, uuid_1.v4)(),
21
- ...(input.clusterName != null && { clusterName: input.clusterName }),
22
- ...(input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId }),
23
- ...(input.preferredMaintenanceWindow != null && { preferredMaintenanceWindow: input.preferredMaintenanceWindow }),
24
- ...(input.shardCapacity != null && { shardCapacity: input.shardCapacity }),
25
- ...(input.shardCount != null && { shardCount: input.shardCount }),
26
- ...(input.subnetIds != null && { subnetIds: se_StringList(input.subnetIds, context) }),
27
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
28
- ...(input.vpcSecurityGroupIds != null && {
29
- vpcSecurityGroupIds: se_StringList(input.vpcSecurityGroupIds, context),
30
- }),
31
- });
16
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
17
+ adminUserName: [],
18
+ adminUserPassword: [],
19
+ authType: [],
20
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
21
+ clusterName: [],
22
+ kmsKeyId: [],
23
+ preferredMaintenanceWindow: [],
24
+ shardCapacity: [],
25
+ shardCount: [],
26
+ subnetIds: (_) => (0, smithy_client_1._json)(_),
27
+ tags: (_) => (0, smithy_client_1._json)(_),
28
+ vpcSecurityGroupIds: (_) => (0, smithy_client_1._json)(_),
29
+ }));
32
30
  return new protocol_http_1.HttpRequest({
33
31
  protocol,
34
32
  hostname,
@@ -47,11 +45,11 @@ const se_CreateClusterSnapshotCommand = async (input, context) => {
47
45
  };
48
46
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/cluster-snapshot";
49
47
  let body;
50
- body = JSON.stringify({
51
- ...(input.clusterArn != null && { clusterArn: input.clusterArn }),
52
- ...(input.snapshotName != null && { snapshotName: input.snapshotName }),
53
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
54
- });
48
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
49
+ clusterArn: [],
50
+ snapshotName: [],
51
+ tags: (_) => (0, smithy_client_1._json)(_),
52
+ }));
55
53
  return new protocol_http_1.HttpRequest({
56
54
  protocol,
57
55
  hostname,
@@ -135,7 +133,7 @@ const se_ListClustersCommand = async (input, context) => {
135
133
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
136
134
  const headers = {};
137
135
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/clusters";
138
- const query = map({
136
+ const query = (0, smithy_client_1.map)({
139
137
  nextToken: [, input.nextToken],
140
138
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
141
139
  });
@@ -156,7 +154,7 @@ const se_ListClusterSnapshotsCommand = async (input, context) => {
156
154
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
157
155
  const headers = {};
158
156
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/cluster-snapshots";
159
- const query = map({
157
+ const query = (0, smithy_client_1.map)({
160
158
  clusterArn: [, input.clusterArn],
161
159
  nextToken: [, input.nextToken],
162
160
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
@@ -199,15 +197,13 @@ const se_RestoreClusterFromSnapshotCommand = async (input, context) => {
199
197
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/cluster-snapshot/{snapshotArn}/restore";
200
198
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "snapshotArn", () => input.snapshotArn, "{snapshotArn}", false);
201
199
  let body;
202
- body = JSON.stringify({
203
- ...(input.clusterName != null && { clusterName: input.clusterName }),
204
- ...(input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId }),
205
- ...(input.subnetIds != null && { subnetIds: se_StringList(input.subnetIds, context) }),
206
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
207
- ...(input.vpcSecurityGroupIds != null && {
208
- vpcSecurityGroupIds: se_StringList(input.vpcSecurityGroupIds, context),
209
- }),
210
- });
200
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
201
+ clusterName: [],
202
+ kmsKeyId: [],
203
+ subnetIds: (_) => (0, smithy_client_1._json)(_),
204
+ tags: (_) => (0, smithy_client_1._json)(_),
205
+ vpcSecurityGroupIds: (_) => (0, smithy_client_1._json)(_),
206
+ }));
211
207
  return new protocol_http_1.HttpRequest({
212
208
  protocol,
213
209
  hostname,
@@ -227,9 +223,9 @@ const se_TagResourceCommand = async (input, context) => {
227
223
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
228
224
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
229
225
  let body;
230
- body = JSON.stringify({
231
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
232
- });
226
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
227
+ tags: (_) => (0, smithy_client_1._json)(_),
228
+ }));
233
229
  return new protocol_http_1.HttpRequest({
234
230
  protocol,
235
231
  hostname,
@@ -246,7 +242,7 @@ const se_UntagResourceCommand = async (input, context) => {
246
242
  const headers = {};
247
243
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
248
244
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
249
- const query = map({
245
+ const query = (0, smithy_client_1.map)({
250
246
  tagKeys: [
251
247
  (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
252
248
  () => (input.tagKeys || []).map((_entry) => _entry),
@@ -273,18 +269,16 @@ const se_UpdateClusterCommand = async (input, context) => {
273
269
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/cluster/{clusterArn}";
274
270
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "clusterArn", () => input.clusterArn, "{clusterArn}", false);
275
271
  let body;
276
- body = JSON.stringify({
277
- ...(input.adminUserPassword != null && { adminUserPassword: input.adminUserPassword }),
278
- ...(input.authType != null && { authType: input.authType }),
279
- clientToken: input.clientToken ?? (0, uuid_1.v4)(),
280
- ...(input.preferredMaintenanceWindow != null && { preferredMaintenanceWindow: input.preferredMaintenanceWindow }),
281
- ...(input.shardCapacity != null && { shardCapacity: input.shardCapacity }),
282
- ...(input.shardCount != null && { shardCount: input.shardCount }),
283
- ...(input.subnetIds != null && { subnetIds: se_StringList(input.subnetIds, context) }),
284
- ...(input.vpcSecurityGroupIds != null && {
285
- vpcSecurityGroupIds: se_StringList(input.vpcSecurityGroupIds, context),
286
- }),
287
- });
272
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
273
+ adminUserPassword: [],
274
+ authType: [],
275
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
276
+ preferredMaintenanceWindow: [],
277
+ shardCapacity: [],
278
+ shardCount: [],
279
+ subnetIds: (_) => (0, smithy_client_1._json)(_),
280
+ vpcSecurityGroupIds: (_) => (0, smithy_client_1._json)(_),
281
+ }));
288
282
  return new protocol_http_1.HttpRequest({
289
283
  protocol,
290
284
  hostname,
@@ -300,13 +294,14 @@ const de_CreateClusterCommand = async (output, context) => {
300
294
  if (output.statusCode !== 200 && output.statusCode >= 300) {
301
295
  return de_CreateClusterCommandError(output, context);
302
296
  }
303
- const contents = map({
297
+ const contents = (0, smithy_client_1.map)({
304
298
  $metadata: deserializeMetadata(output),
305
299
  });
306
300
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
307
- if (data.cluster != null) {
308
- contents.cluster = de_Cluster(data.cluster, context);
309
- }
301
+ const doc = (0, smithy_client_1.take)(data, {
302
+ cluster: smithy_client_1._json,
303
+ });
304
+ Object.assign(contents, doc);
310
305
  return contents;
311
306
  };
312
307
  exports.de_CreateClusterCommand = de_CreateClusterCommand;
@@ -337,10 +332,9 @@ const de_CreateClusterCommandError = async (output, context) => {
337
332
  throw await de_ValidationExceptionRes(parsedOutput, context);
338
333
  default:
339
334
  const parsedBody = parsedOutput.body;
340
- (0, smithy_client_1.throwDefaultError)({
335
+ return throwDefaultError({
341
336
  output,
342
337
  parsedBody,
343
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
344
338
  errorCode,
345
339
  });
346
340
  }
@@ -349,13 +343,14 @@ const de_CreateClusterSnapshotCommand = async (output, context) => {
349
343
  if (output.statusCode !== 200 && output.statusCode >= 300) {
350
344
  return de_CreateClusterSnapshotCommandError(output, context);
351
345
  }
352
- const contents = map({
346
+ const contents = (0, smithy_client_1.map)({
353
347
  $metadata: deserializeMetadata(output),
354
348
  });
355
349
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
356
- if (data.snapshot != null) {
357
- contents.snapshot = de_ClusterSnapshot(data.snapshot, context);
358
- }
350
+ const doc = (0, smithy_client_1.take)(data, {
351
+ snapshot: smithy_client_1._json,
352
+ });
353
+ Object.assign(contents, doc);
359
354
  return contents;
360
355
  };
361
356
  exports.de_CreateClusterSnapshotCommand = de_CreateClusterSnapshotCommand;
@@ -389,10 +384,9 @@ const de_CreateClusterSnapshotCommandError = async (output, context) => {
389
384
  throw await de_ValidationExceptionRes(parsedOutput, context);
390
385
  default:
391
386
  const parsedBody = parsedOutput.body;
392
- (0, smithy_client_1.throwDefaultError)({
387
+ return throwDefaultError({
393
388
  output,
394
389
  parsedBody,
395
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
396
390
  errorCode,
397
391
  });
398
392
  }
@@ -401,13 +395,14 @@ const de_DeleteClusterCommand = async (output, context) => {
401
395
  if (output.statusCode !== 200 && output.statusCode >= 300) {
402
396
  return de_DeleteClusterCommandError(output, context);
403
397
  }
404
- const contents = map({
398
+ const contents = (0, smithy_client_1.map)({
405
399
  $metadata: deserializeMetadata(output),
406
400
  });
407
401
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
408
- if (data.cluster != null) {
409
- contents.cluster = de_Cluster(data.cluster, context);
410
- }
402
+ const doc = (0, smithy_client_1.take)(data, {
403
+ cluster: smithy_client_1._json,
404
+ });
405
+ Object.assign(contents, doc);
411
406
  return contents;
412
407
  };
413
408
  exports.de_DeleteClusterCommand = de_DeleteClusterCommand;
@@ -438,10 +433,9 @@ const de_DeleteClusterCommandError = async (output, context) => {
438
433
  throw await de_ValidationExceptionRes(parsedOutput, context);
439
434
  default:
440
435
  const parsedBody = parsedOutput.body;
441
- (0, smithy_client_1.throwDefaultError)({
436
+ return throwDefaultError({
442
437
  output,
443
438
  parsedBody,
444
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
445
439
  errorCode,
446
440
  });
447
441
  }
@@ -450,13 +444,14 @@ const de_DeleteClusterSnapshotCommand = async (output, context) => {
450
444
  if (output.statusCode !== 200 && output.statusCode >= 300) {
451
445
  return de_DeleteClusterSnapshotCommandError(output, context);
452
446
  }
453
- const contents = map({
447
+ const contents = (0, smithy_client_1.map)({
454
448
  $metadata: deserializeMetadata(output),
455
449
  });
456
450
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
457
- if (data.snapshot != null) {
458
- contents.snapshot = de_ClusterSnapshot(data.snapshot, context);
459
- }
451
+ const doc = (0, smithy_client_1.take)(data, {
452
+ snapshot: smithy_client_1._json,
453
+ });
454
+ Object.assign(contents, doc);
460
455
  return contents;
461
456
  };
462
457
  exports.de_DeleteClusterSnapshotCommand = de_DeleteClusterSnapshotCommand;
@@ -487,10 +482,9 @@ const de_DeleteClusterSnapshotCommandError = async (output, context) => {
487
482
  throw await de_ValidationExceptionRes(parsedOutput, context);
488
483
  default:
489
484
  const parsedBody = parsedOutput.body;
490
- (0, smithy_client_1.throwDefaultError)({
485
+ return throwDefaultError({
491
486
  output,
492
487
  parsedBody,
493
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
494
488
  errorCode,
495
489
  });
496
490
  }
@@ -499,13 +493,14 @@ const de_GetClusterCommand = async (output, context) => {
499
493
  if (output.statusCode !== 200 && output.statusCode >= 300) {
500
494
  return de_GetClusterCommandError(output, context);
501
495
  }
502
- const contents = map({
496
+ const contents = (0, smithy_client_1.map)({
503
497
  $metadata: deserializeMetadata(output),
504
498
  });
505
499
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
506
- if (data.cluster != null) {
507
- contents.cluster = de_Cluster(data.cluster, context);
508
- }
500
+ const doc = (0, smithy_client_1.take)(data, {
501
+ cluster: smithy_client_1._json,
502
+ });
503
+ Object.assign(contents, doc);
509
504
  return contents;
510
505
  };
511
506
  exports.de_GetClusterCommand = de_GetClusterCommand;
@@ -533,10 +528,9 @@ const de_GetClusterCommandError = async (output, context) => {
533
528
  throw await de_ValidationExceptionRes(parsedOutput, context);
534
529
  default:
535
530
  const parsedBody = parsedOutput.body;
536
- (0, smithy_client_1.throwDefaultError)({
531
+ return throwDefaultError({
537
532
  output,
538
533
  parsedBody,
539
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
540
534
  errorCode,
541
535
  });
542
536
  }
@@ -545,13 +539,14 @@ const de_GetClusterSnapshotCommand = async (output, context) => {
545
539
  if (output.statusCode !== 200 && output.statusCode >= 300) {
546
540
  return de_GetClusterSnapshotCommandError(output, context);
547
541
  }
548
- const contents = map({
542
+ const contents = (0, smithy_client_1.map)({
549
543
  $metadata: deserializeMetadata(output),
550
544
  });
551
545
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
552
- if (data.snapshot != null) {
553
- contents.snapshot = de_ClusterSnapshot(data.snapshot, context);
554
- }
546
+ const doc = (0, smithy_client_1.take)(data, {
547
+ snapshot: smithy_client_1._json,
548
+ });
549
+ Object.assign(contents, doc);
555
550
  return contents;
556
551
  };
557
552
  exports.de_GetClusterSnapshotCommand = de_GetClusterSnapshotCommand;
@@ -579,10 +574,9 @@ const de_GetClusterSnapshotCommandError = async (output, context) => {
579
574
  throw await de_ValidationExceptionRes(parsedOutput, context);
580
575
  default:
581
576
  const parsedBody = parsedOutput.body;
582
- (0, smithy_client_1.throwDefaultError)({
577
+ return throwDefaultError({
583
578
  output,
584
579
  parsedBody,
585
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
586
580
  errorCode,
587
581
  });
588
582
  }
@@ -591,16 +585,15 @@ const de_ListClustersCommand = async (output, context) => {
591
585
  if (output.statusCode !== 200 && output.statusCode >= 300) {
592
586
  return de_ListClustersCommandError(output, context);
593
587
  }
594
- const contents = map({
588
+ const contents = (0, smithy_client_1.map)({
595
589
  $metadata: deserializeMetadata(output),
596
590
  });
597
591
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
598
- if (data.clusters != null) {
599
- contents.clusters = de_ClusterList(data.clusters, context);
600
- }
601
- if (data.nextToken != null) {
602
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
603
- }
592
+ const doc = (0, smithy_client_1.take)(data, {
593
+ clusters: smithy_client_1._json,
594
+ nextToken: smithy_client_1.expectString,
595
+ });
596
+ Object.assign(contents, doc);
604
597
  return contents;
605
598
  };
606
599
  exports.de_ListClustersCommand = de_ListClustersCommand;
@@ -625,10 +618,9 @@ const de_ListClustersCommandError = async (output, context) => {
625
618
  throw await de_ValidationExceptionRes(parsedOutput, context);
626
619
  default:
627
620
  const parsedBody = parsedOutput.body;
628
- (0, smithy_client_1.throwDefaultError)({
621
+ return throwDefaultError({
629
622
  output,
630
623
  parsedBody,
631
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
632
624
  errorCode,
633
625
  });
634
626
  }
@@ -637,16 +629,15 @@ const de_ListClusterSnapshotsCommand = async (output, context) => {
637
629
  if (output.statusCode !== 200 && output.statusCode >= 300) {
638
630
  return de_ListClusterSnapshotsCommandError(output, context);
639
631
  }
640
- const contents = map({
632
+ const contents = (0, smithy_client_1.map)({
641
633
  $metadata: deserializeMetadata(output),
642
634
  });
643
635
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
644
- if (data.nextToken != null) {
645
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
646
- }
647
- if (data.snapshots != null) {
648
- contents.snapshots = de_ClusterSnapshotList(data.snapshots, context);
649
- }
636
+ const doc = (0, smithy_client_1.take)(data, {
637
+ nextToken: smithy_client_1.expectString,
638
+ snapshots: smithy_client_1._json,
639
+ });
640
+ Object.assign(contents, doc);
650
641
  return contents;
651
642
  };
652
643
  exports.de_ListClusterSnapshotsCommand = de_ListClusterSnapshotsCommand;
@@ -671,10 +662,9 @@ const de_ListClusterSnapshotsCommandError = async (output, context) => {
671
662
  throw await de_ValidationExceptionRes(parsedOutput, context);
672
663
  default:
673
664
  const parsedBody = parsedOutput.body;
674
- (0, smithy_client_1.throwDefaultError)({
665
+ return throwDefaultError({
675
666
  output,
676
667
  parsedBody,
677
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
678
668
  errorCode,
679
669
  });
680
670
  }
@@ -683,13 +673,14 @@ const de_ListTagsForResourceCommand = async (output, context) => {
683
673
  if (output.statusCode !== 200 && output.statusCode >= 300) {
684
674
  return de_ListTagsForResourceCommandError(output, context);
685
675
  }
686
- const contents = map({
676
+ const contents = (0, smithy_client_1.map)({
687
677
  $metadata: deserializeMetadata(output),
688
678
  });
689
679
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
690
- if (data.tags != null) {
691
- contents.tags = de_TagMap(data.tags, context);
692
- }
680
+ const doc = (0, smithy_client_1.take)(data, {
681
+ tags: smithy_client_1._json,
682
+ });
683
+ Object.assign(contents, doc);
693
684
  return contents;
694
685
  };
695
686
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
@@ -714,10 +705,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
714
705
  throw await de_ValidationExceptionRes(parsedOutput, context);
715
706
  default:
716
707
  const parsedBody = parsedOutput.body;
717
- (0, smithy_client_1.throwDefaultError)({
708
+ return throwDefaultError({
718
709
  output,
719
710
  parsedBody,
720
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
721
711
  errorCode,
722
712
  });
723
713
  }
@@ -726,13 +716,14 @@ const de_RestoreClusterFromSnapshotCommand = async (output, context) => {
726
716
  if (output.statusCode !== 200 && output.statusCode >= 300) {
727
717
  return de_RestoreClusterFromSnapshotCommandError(output, context);
728
718
  }
729
- const contents = map({
719
+ const contents = (0, smithy_client_1.map)({
730
720
  $metadata: deserializeMetadata(output),
731
721
  });
732
722
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
733
- if (data.cluster != null) {
734
- contents.cluster = de_Cluster(data.cluster, context);
735
- }
723
+ const doc = (0, smithy_client_1.take)(data, {
724
+ cluster: smithy_client_1._json,
725
+ });
726
+ Object.assign(contents, doc);
736
727
  return contents;
737
728
  };
738
729
  exports.de_RestoreClusterFromSnapshotCommand = de_RestoreClusterFromSnapshotCommand;
@@ -766,10 +757,9 @@ const de_RestoreClusterFromSnapshotCommandError = async (output, context) => {
766
757
  throw await de_ValidationExceptionRes(parsedOutput, context);
767
758
  default:
768
759
  const parsedBody = parsedOutput.body;
769
- (0, smithy_client_1.throwDefaultError)({
760
+ return throwDefaultError({
770
761
  output,
771
762
  parsedBody,
772
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
773
763
  errorCode,
774
764
  });
775
765
  }
@@ -778,7 +768,7 @@ const de_TagResourceCommand = async (output, context) => {
778
768
  if (output.statusCode !== 200 && output.statusCode >= 300) {
779
769
  return de_TagResourceCommandError(output, context);
780
770
  }
781
- const contents = map({
771
+ const contents = (0, smithy_client_1.map)({
782
772
  $metadata: deserializeMetadata(output),
783
773
  });
784
774
  await collectBody(output.body, context);
@@ -806,10 +796,9 @@ const de_TagResourceCommandError = async (output, context) => {
806
796
  throw await de_ValidationExceptionRes(parsedOutput, context);
807
797
  default:
808
798
  const parsedBody = parsedOutput.body;
809
- (0, smithy_client_1.throwDefaultError)({
799
+ return throwDefaultError({
810
800
  output,
811
801
  parsedBody,
812
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
813
802
  errorCode,
814
803
  });
815
804
  }
@@ -818,7 +807,7 @@ const de_UntagResourceCommand = async (output, context) => {
818
807
  if (output.statusCode !== 200 && output.statusCode >= 300) {
819
808
  return de_UntagResourceCommandError(output, context);
820
809
  }
821
- const contents = map({
810
+ const contents = (0, smithy_client_1.map)({
822
811
  $metadata: deserializeMetadata(output),
823
812
  });
824
813
  await collectBody(output.body, context);
@@ -846,10 +835,9 @@ const de_UntagResourceCommandError = async (output, context) => {
846
835
  throw await de_ValidationExceptionRes(parsedOutput, context);
847
836
  default:
848
837
  const parsedBody = parsedOutput.body;
849
- (0, smithy_client_1.throwDefaultError)({
838
+ return throwDefaultError({
850
839
  output,
851
840
  parsedBody,
852
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
853
841
  errorCode,
854
842
  });
855
843
  }
@@ -858,13 +846,14 @@ const de_UpdateClusterCommand = async (output, context) => {
858
846
  if (output.statusCode !== 200 && output.statusCode >= 300) {
859
847
  return de_UpdateClusterCommandError(output, context);
860
848
  }
861
- const contents = map({
849
+ const contents = (0, smithy_client_1.map)({
862
850
  $metadata: deserializeMetadata(output),
863
851
  });
864
852
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
865
- if (data.cluster != null) {
866
- contents.cluster = de_Cluster(data.cluster, context);
867
- }
853
+ const doc = (0, smithy_client_1.take)(data, {
854
+ cluster: smithy_client_1._json,
855
+ });
856
+ Object.assign(contents, doc);
868
857
  return contents;
869
858
  };
870
859
  exports.de_UpdateClusterCommand = de_UpdateClusterCommand;
@@ -895,21 +884,21 @@ const de_UpdateClusterCommandError = async (output, context) => {
895
884
  throw await de_ValidationExceptionRes(parsedOutput, context);
896
885
  default:
897
886
  const parsedBody = parsedOutput.body;
898
- (0, smithy_client_1.throwDefaultError)({
887
+ return throwDefaultError({
899
888
  output,
900
889
  parsedBody,
901
- exceptionCtor: DocDBElasticServiceException_1.DocDBElasticServiceException,
902
890
  errorCode,
903
891
  });
904
892
  }
905
893
  };
906
- const map = smithy_client_1.map;
894
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(DocDBElasticServiceException_1.DocDBElasticServiceException);
907
895
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
908
- const contents = map({});
896
+ const contents = (0, smithy_client_1.map)({});
909
897
  const data = parsedOutput.body;
910
- if (data.message != null) {
911
- contents.message = (0, smithy_client_1.expectString)(data.message);
912
- }
898
+ const doc = (0, smithy_client_1.take)(data, {
899
+ message: smithy_client_1.expectString,
900
+ });
901
+ Object.assign(contents, doc);
913
902
  const exception = new models_0_1.AccessDeniedException({
914
903
  $metadata: deserializeMetadata(parsedOutput),
915
904
  ...contents,
@@ -917,17 +906,14 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
917
906
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
918
907
  };
919
908
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
920
- const contents = map({});
909
+ const contents = (0, smithy_client_1.map)({});
921
910
  const data = parsedOutput.body;
922
- if (data.message != null) {
923
- contents.message = (0, smithy_client_1.expectString)(data.message);
924
- }
925
- if (data.resourceId != null) {
926
- contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
927
- }
928
- if (data.resourceType != null) {
929
- contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
930
- }
911
+ const doc = (0, smithy_client_1.take)(data, {
912
+ message: smithy_client_1.expectString,
913
+ resourceId: smithy_client_1.expectString,
914
+ resourceType: smithy_client_1.expectString,
915
+ });
916
+ Object.assign(contents, doc);
931
917
  const exception = new models_0_1.ConflictException({
932
918
  $metadata: deserializeMetadata(parsedOutput),
933
919
  ...contents,
@@ -935,11 +921,12 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
935
921
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
936
922
  };
937
923
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
938
- const contents = map({});
924
+ const contents = (0, smithy_client_1.map)({});
939
925
  const data = parsedOutput.body;
940
- if (data.message != null) {
941
- contents.message = (0, smithy_client_1.expectString)(data.message);
942
- }
926
+ const doc = (0, smithy_client_1.take)(data, {
927
+ message: smithy_client_1.expectString,
928
+ });
929
+ Object.assign(contents, doc);
943
930
  const exception = new models_0_1.InternalServerException({
944
931
  $metadata: deserializeMetadata(parsedOutput),
945
932
  ...contents,
@@ -947,17 +934,14 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
947
934
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
948
935
  };
949
936
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
950
- const contents = map({});
937
+ const contents = (0, smithy_client_1.map)({});
951
938
  const data = parsedOutput.body;
952
- if (data.message != null) {
953
- contents.message = (0, smithy_client_1.expectString)(data.message);
954
- }
955
- if (data.resourceId != null) {
956
- contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
957
- }
958
- if (data.resourceType != null) {
959
- contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
960
- }
939
+ const doc = (0, smithy_client_1.take)(data, {
940
+ message: smithy_client_1.expectString,
941
+ resourceId: smithy_client_1.expectString,
942
+ resourceType: smithy_client_1.expectString,
943
+ });
944
+ Object.assign(contents, doc);
961
945
  const exception = new models_0_1.ResourceNotFoundException({
962
946
  $metadata: deserializeMetadata(parsedOutput),
963
947
  ...contents,
@@ -965,11 +949,12 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
965
949
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
966
950
  };
967
951
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
968
- const contents = map({});
952
+ const contents = (0, smithy_client_1.map)({});
969
953
  const data = parsedOutput.body;
970
- if (data.message != null) {
971
- contents.message = (0, smithy_client_1.expectString)(data.message);
972
- }
954
+ const doc = (0, smithy_client_1.take)(data, {
955
+ message: smithy_client_1.expectString,
956
+ });
957
+ Object.assign(contents, doc);
973
958
  const exception = new models_0_1.ServiceQuotaExceededException({
974
959
  $metadata: deserializeMetadata(parsedOutput),
975
960
  ...contents,
@@ -977,16 +962,17 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
977
962
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
978
963
  };
979
964
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
980
- const contents = map({
965
+ const contents = (0, smithy_client_1.map)({
981
966
  retryAfterSeconds: [
982
967
  () => void 0 !== parsedOutput.headers["retry-after"],
983
968
  () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]),
984
969
  ],
985
970
  });
986
971
  const data = parsedOutput.body;
987
- if (data.message != null) {
988
- contents.message = (0, smithy_client_1.expectString)(data.message);
989
- }
972
+ const doc = (0, smithy_client_1.take)(data, {
973
+ message: smithy_client_1.expectString,
974
+ });
975
+ Object.assign(contents, doc);
990
976
  const exception = new models_0_1.ThrottlingException({
991
977
  $metadata: deserializeMetadata(parsedOutput),
992
978
  ...contents,
@@ -994,145 +980,20 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
994
980
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
995
981
  };
996
982
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
997
- const contents = map({});
983
+ const contents = (0, smithy_client_1.map)({});
998
984
  const data = parsedOutput.body;
999
- if (data.fieldList != null) {
1000
- contents.fieldList = de_ValidationExceptionFieldList(data.fieldList, context);
1001
- }
1002
- if (data.message != null) {
1003
- contents.message = (0, smithy_client_1.expectString)(data.message);
1004
- }
1005
- if (data.reason != null) {
1006
- contents.reason = (0, smithy_client_1.expectString)(data.reason);
1007
- }
985
+ const doc = (0, smithy_client_1.take)(data, {
986
+ fieldList: smithy_client_1._json,
987
+ message: smithy_client_1.expectString,
988
+ reason: smithy_client_1.expectString,
989
+ });
990
+ Object.assign(contents, doc);
1008
991
  const exception = new models_0_1.ValidationException({
1009
992
  $metadata: deserializeMetadata(parsedOutput),
1010
993
  ...contents,
1011
994
  });
1012
995
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1013
996
  };
1014
- const se_StringList = (input, context) => {
1015
- return input
1016
- .filter((e) => e != null)
1017
- .map((entry) => {
1018
- return entry;
1019
- });
1020
- };
1021
- const se_TagMap = (input, context) => {
1022
- return Object.entries(input).reduce((acc, [key, value]) => {
1023
- if (value === null) {
1024
- return acc;
1025
- }
1026
- acc[key] = value;
1027
- return acc;
1028
- }, {});
1029
- };
1030
- const de_Cluster = (output, context) => {
1031
- return {
1032
- adminUserName: (0, smithy_client_1.expectString)(output.adminUserName),
1033
- authType: (0, smithy_client_1.expectString)(output.authType),
1034
- clusterArn: (0, smithy_client_1.expectString)(output.clusterArn),
1035
- clusterEndpoint: (0, smithy_client_1.expectString)(output.clusterEndpoint),
1036
- clusterName: (0, smithy_client_1.expectString)(output.clusterName),
1037
- createTime: (0, smithy_client_1.expectString)(output.createTime),
1038
- kmsKeyId: (0, smithy_client_1.expectString)(output.kmsKeyId),
1039
- preferredMaintenanceWindow: (0, smithy_client_1.expectString)(output.preferredMaintenanceWindow),
1040
- shardCapacity: (0, smithy_client_1.expectInt32)(output.shardCapacity),
1041
- shardCount: (0, smithy_client_1.expectInt32)(output.shardCount),
1042
- status: (0, smithy_client_1.expectString)(output.status),
1043
- subnetIds: output.subnetIds != null ? de_StringList(output.subnetIds, context) : undefined,
1044
- vpcSecurityGroupIds: output.vpcSecurityGroupIds != null ? de_StringList(output.vpcSecurityGroupIds, context) : undefined,
1045
- };
1046
- };
1047
- const de_ClusterInList = (output, context) => {
1048
- return {
1049
- clusterArn: (0, smithy_client_1.expectString)(output.clusterArn),
1050
- clusterName: (0, smithy_client_1.expectString)(output.clusterName),
1051
- status: (0, smithy_client_1.expectString)(output.status),
1052
- };
1053
- };
1054
- const de_ClusterList = (output, context) => {
1055
- const retVal = (output || [])
1056
- .filter((e) => e != null)
1057
- .map((entry) => {
1058
- if (entry === null) {
1059
- return null;
1060
- }
1061
- return de_ClusterInList(entry, context);
1062
- });
1063
- return retVal;
1064
- };
1065
- const de_ClusterSnapshot = (output, context) => {
1066
- return {
1067
- adminUserName: (0, smithy_client_1.expectString)(output.adminUserName),
1068
- clusterArn: (0, smithy_client_1.expectString)(output.clusterArn),
1069
- clusterCreationTime: (0, smithy_client_1.expectString)(output.clusterCreationTime),
1070
- kmsKeyId: (0, smithy_client_1.expectString)(output.kmsKeyId),
1071
- snapshotArn: (0, smithy_client_1.expectString)(output.snapshotArn),
1072
- snapshotCreationTime: (0, smithy_client_1.expectString)(output.snapshotCreationTime),
1073
- snapshotName: (0, smithy_client_1.expectString)(output.snapshotName),
1074
- status: (0, smithy_client_1.expectString)(output.status),
1075
- subnetIds: output.subnetIds != null ? de_StringList(output.subnetIds, context) : undefined,
1076
- vpcSecurityGroupIds: output.vpcSecurityGroupIds != null ? de_StringList(output.vpcSecurityGroupIds, context) : undefined,
1077
- };
1078
- };
1079
- const de_ClusterSnapshotInList = (output, context) => {
1080
- return {
1081
- clusterArn: (0, smithy_client_1.expectString)(output.clusterArn),
1082
- snapshotArn: (0, smithy_client_1.expectString)(output.snapshotArn),
1083
- snapshotCreationTime: (0, smithy_client_1.expectString)(output.snapshotCreationTime),
1084
- snapshotName: (0, smithy_client_1.expectString)(output.snapshotName),
1085
- status: (0, smithy_client_1.expectString)(output.status),
1086
- };
1087
- };
1088
- const de_ClusterSnapshotList = (output, context) => {
1089
- const retVal = (output || [])
1090
- .filter((e) => e != null)
1091
- .map((entry) => {
1092
- if (entry === null) {
1093
- return null;
1094
- }
1095
- return de_ClusterSnapshotInList(entry, context);
1096
- });
1097
- return retVal;
1098
- };
1099
- const de_StringList = (output, context) => {
1100
- const retVal = (output || [])
1101
- .filter((e) => e != null)
1102
- .map((entry) => {
1103
- if (entry === null) {
1104
- return null;
1105
- }
1106
- return (0, smithy_client_1.expectString)(entry);
1107
- });
1108
- return retVal;
1109
- };
1110
- const de_TagMap = (output, context) => {
1111
- return Object.entries(output).reduce((acc, [key, value]) => {
1112
- if (value === null) {
1113
- return acc;
1114
- }
1115
- acc[key] = (0, smithy_client_1.expectString)(value);
1116
- return acc;
1117
- }, {});
1118
- };
1119
- const de_ValidationExceptionField = (output, context) => {
1120
- return {
1121
- message: (0, smithy_client_1.expectString)(output.message),
1122
- name: (0, smithy_client_1.expectString)(output.name),
1123
- };
1124
- };
1125
- const de_ValidationExceptionFieldList = (output, context) => {
1126
- const retVal = (output || [])
1127
- .filter((e) => e != null)
1128
- .map((entry) => {
1129
- if (entry === null) {
1130
- return null;
1131
- }
1132
- return de_ValidationExceptionField(entry, context);
1133
- });
1134
- return retVal;
1135
- };
1136
997
  const deserializeMetadata = (output) => ({
1137
998
  httpStatusCode: output.statusCode,
1138
999
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],