@aws-sdk/client-cloudhsm-v2 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,95 +1,95 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { CloudHSMV2ServiceException as __BaseException } from "../models/CloudHSMV2ServiceException";
4
4
  import { CloudHsmAccessDeniedException, CloudHsmInternalFailureException, CloudHsmInvalidRequestException, CloudHsmResourceNotFoundException, CloudHsmServiceException, CloudHsmTagException, } from "../models/models_0";
5
5
  export const se_CopyBackupToRegionCommand = async (input, context) => {
6
6
  const headers = sharedHeaders("CopyBackupToRegion");
7
7
  let body;
8
- body = JSON.stringify(se_CopyBackupToRegionRequest(input, context));
8
+ body = JSON.stringify(_json(input));
9
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
10
10
  };
11
11
  export const se_CreateClusterCommand = async (input, context) => {
12
12
  const headers = sharedHeaders("CreateCluster");
13
13
  let body;
14
- body = JSON.stringify(se_CreateClusterRequest(input, context));
14
+ body = JSON.stringify(_json(input));
15
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
16
  };
17
17
  export const se_CreateHsmCommand = async (input, context) => {
18
18
  const headers = sharedHeaders("CreateHsm");
19
19
  let body;
20
- body = JSON.stringify(se_CreateHsmRequest(input, context));
20
+ body = JSON.stringify(_json(input));
21
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
22
  };
23
23
  export const se_DeleteBackupCommand = async (input, context) => {
24
24
  const headers = sharedHeaders("DeleteBackup");
25
25
  let body;
26
- body = JSON.stringify(se_DeleteBackupRequest(input, context));
26
+ body = JSON.stringify(_json(input));
27
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
28
  };
29
29
  export const se_DeleteClusterCommand = async (input, context) => {
30
30
  const headers = sharedHeaders("DeleteCluster");
31
31
  let body;
32
- body = JSON.stringify(se_DeleteClusterRequest(input, context));
32
+ body = JSON.stringify(_json(input));
33
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
34
  };
35
35
  export const se_DeleteHsmCommand = async (input, context) => {
36
36
  const headers = sharedHeaders("DeleteHsm");
37
37
  let body;
38
- body = JSON.stringify(se_DeleteHsmRequest(input, context));
38
+ body = JSON.stringify(_json(input));
39
39
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
40
  };
41
41
  export const se_DescribeBackupsCommand = async (input, context) => {
42
42
  const headers = sharedHeaders("DescribeBackups");
43
43
  let body;
44
- body = JSON.stringify(se_DescribeBackupsRequest(input, context));
44
+ body = JSON.stringify(_json(input));
45
45
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
46
46
  };
47
47
  export const se_DescribeClustersCommand = async (input, context) => {
48
48
  const headers = sharedHeaders("DescribeClusters");
49
49
  let body;
50
- body = JSON.stringify(se_DescribeClustersRequest(input, context));
50
+ body = JSON.stringify(_json(input));
51
51
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
52
52
  };
53
53
  export const se_InitializeClusterCommand = async (input, context) => {
54
54
  const headers = sharedHeaders("InitializeCluster");
55
55
  let body;
56
- body = JSON.stringify(se_InitializeClusterRequest(input, context));
56
+ body = JSON.stringify(_json(input));
57
57
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
58
  };
59
59
  export const se_ListTagsCommand = async (input, context) => {
60
60
  const headers = sharedHeaders("ListTags");
61
61
  let body;
62
- body = JSON.stringify(se_ListTagsRequest(input, context));
62
+ body = JSON.stringify(_json(input));
63
63
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
64
64
  };
65
65
  export const se_ModifyBackupAttributesCommand = async (input, context) => {
66
66
  const headers = sharedHeaders("ModifyBackupAttributes");
67
67
  let body;
68
- body = JSON.stringify(se_ModifyBackupAttributesRequest(input, context));
68
+ body = JSON.stringify(_json(input));
69
69
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
70
70
  };
71
71
  export const se_ModifyClusterCommand = async (input, context) => {
72
72
  const headers = sharedHeaders("ModifyCluster");
73
73
  let body;
74
- body = JSON.stringify(se_ModifyClusterRequest(input, context));
74
+ body = JSON.stringify(_json(input));
75
75
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
76
  };
77
77
  export const se_RestoreBackupCommand = async (input, context) => {
78
78
  const headers = sharedHeaders("RestoreBackup");
79
79
  let body;
80
- body = JSON.stringify(se_RestoreBackupRequest(input, context));
80
+ body = JSON.stringify(_json(input));
81
81
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
82
82
  };
83
83
  export const se_TagResourceCommand = async (input, context) => {
84
84
  const headers = sharedHeaders("TagResource");
85
85
  let body;
86
- body = JSON.stringify(se_TagResourceRequest(input, context));
86
+ body = JSON.stringify(_json(input));
87
87
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
88
88
  };
89
89
  export const se_UntagResourceCommand = async (input, context) => {
90
90
  const headers = sharedHeaders("UntagResource");
91
91
  let body;
92
- body = JSON.stringify(se_UntagResourceRequest(input, context));
92
+ body = JSON.stringify(_json(input));
93
93
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
94
  };
95
95
  export const de_CopyBackupToRegionCommand = async (output, context) => {
@@ -103,7 +103,7 @@ export const de_CopyBackupToRegionCommand = async (output, context) => {
103
103
  $metadata: deserializeMetadata(output),
104
104
  ...contents,
105
105
  };
106
- return Promise.resolve(response);
106
+ return response;
107
107
  };
108
108
  const de_CopyBackupToRegionCommandError = async (output, context) => {
109
109
  const parsedOutput = {
@@ -132,10 +132,9 @@ const de_CopyBackupToRegionCommandError = async (output, context) => {
132
132
  throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
133
133
  default:
134
134
  const parsedBody = parsedOutput.body;
135
- throwDefaultError({
135
+ return throwDefaultError({
136
136
  output,
137
137
  parsedBody,
138
- exceptionCtor: __BaseException,
139
138
  errorCode,
140
139
  });
141
140
  }
@@ -151,7 +150,7 @@ export const de_CreateClusterCommand = async (output, context) => {
151
150
  $metadata: deserializeMetadata(output),
152
151
  ...contents,
153
152
  };
154
- return Promise.resolve(response);
153
+ return response;
155
154
  };
156
155
  const de_CreateClusterCommandError = async (output, context) => {
157
156
  const parsedOutput = {
@@ -180,10 +179,9 @@ const de_CreateClusterCommandError = async (output, context) => {
180
179
  throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
181
180
  default:
182
181
  const parsedBody = parsedOutput.body;
183
- throwDefaultError({
182
+ return throwDefaultError({
184
183
  output,
185
184
  parsedBody,
186
- exceptionCtor: __BaseException,
187
185
  errorCode,
188
186
  });
189
187
  }
@@ -194,12 +192,12 @@ export const de_CreateHsmCommand = async (output, context) => {
194
192
  }
195
193
  const data = await parseBody(output.body, context);
196
194
  let contents = {};
197
- contents = de_CreateHsmResponse(data, context);
195
+ contents = _json(data);
198
196
  const response = {
199
197
  $metadata: deserializeMetadata(output),
200
198
  ...contents,
201
199
  };
202
- return Promise.resolve(response);
200
+ return response;
203
201
  };
204
202
  const de_CreateHsmCommandError = async (output, context) => {
205
203
  const parsedOutput = {
@@ -225,10 +223,9 @@ const de_CreateHsmCommandError = async (output, context) => {
225
223
  throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
226
224
  default:
227
225
  const parsedBody = parsedOutput.body;
228
- throwDefaultError({
226
+ return throwDefaultError({
229
227
  output,
230
228
  parsedBody,
231
- exceptionCtor: __BaseException,
232
229
  errorCode,
233
230
  });
234
231
  }
@@ -244,7 +241,7 @@ export const de_DeleteBackupCommand = async (output, context) => {
244
241
  $metadata: deserializeMetadata(output),
245
242
  ...contents,
246
243
  };
247
- return Promise.resolve(response);
244
+ return response;
248
245
  };
249
246
  const de_DeleteBackupCommandError = async (output, context) => {
250
247
  const parsedOutput = {
@@ -270,10 +267,9 @@ const de_DeleteBackupCommandError = async (output, context) => {
270
267
  throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
271
268
  default:
272
269
  const parsedBody = parsedOutput.body;
273
- throwDefaultError({
270
+ return throwDefaultError({
274
271
  output,
275
272
  parsedBody,
276
- exceptionCtor: __BaseException,
277
273
  errorCode,
278
274
  });
279
275
  }
@@ -289,7 +285,7 @@ export const de_DeleteClusterCommand = async (output, context) => {
289
285
  $metadata: deserializeMetadata(output),
290
286
  ...contents,
291
287
  };
292
- return Promise.resolve(response);
288
+ return response;
293
289
  };
294
290
  const de_DeleteClusterCommandError = async (output, context) => {
295
291
  const parsedOutput = {
@@ -318,10 +314,9 @@ const de_DeleteClusterCommandError = async (output, context) => {
318
314
  throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
319
315
  default:
320
316
  const parsedBody = parsedOutput.body;
321
- throwDefaultError({
317
+ return throwDefaultError({
322
318
  output,
323
319
  parsedBody,
324
- exceptionCtor: __BaseException,
325
320
  errorCode,
326
321
  });
327
322
  }
@@ -332,12 +327,12 @@ export const de_DeleteHsmCommand = async (output, context) => {
332
327
  }
333
328
  const data = await parseBody(output.body, context);
334
329
  let contents = {};
335
- contents = de_DeleteHsmResponse(data, context);
330
+ contents = _json(data);
336
331
  const response = {
337
332
  $metadata: deserializeMetadata(output),
338
333
  ...contents,
339
334
  };
340
- return Promise.resolve(response);
335
+ return response;
341
336
  };
342
337
  const de_DeleteHsmCommandError = async (output, context) => {
343
338
  const parsedOutput = {
@@ -363,10 +358,9 @@ const de_DeleteHsmCommandError = async (output, context) => {
363
358
  throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
364
359
  default:
365
360
  const parsedBody = parsedOutput.body;
366
- throwDefaultError({
361
+ return throwDefaultError({
367
362
  output,
368
363
  parsedBody,
369
- exceptionCtor: __BaseException,
370
364
  errorCode,
371
365
  });
372
366
  }
@@ -382,7 +376,7 @@ export const de_DescribeBackupsCommand = async (output, context) => {
382
376
  $metadata: deserializeMetadata(output),
383
377
  ...contents,
384
378
  };
385
- return Promise.resolve(response);
379
+ return response;
386
380
  };
387
381
  const de_DescribeBackupsCommandError = async (output, context) => {
388
382
  const parsedOutput = {
@@ -411,10 +405,9 @@ const de_DescribeBackupsCommandError = async (output, context) => {
411
405
  throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
412
406
  default:
413
407
  const parsedBody = parsedOutput.body;
414
- throwDefaultError({
408
+ return throwDefaultError({
415
409
  output,
416
410
  parsedBody,
417
- exceptionCtor: __BaseException,
418
411
  errorCode,
419
412
  });
420
413
  }
@@ -430,7 +423,7 @@ export const de_DescribeClustersCommand = async (output, context) => {
430
423
  $metadata: deserializeMetadata(output),
431
424
  ...contents,
432
425
  };
433
- return Promise.resolve(response);
426
+ return response;
434
427
  };
435
428
  const de_DescribeClustersCommandError = async (output, context) => {
436
429
  const parsedOutput = {
@@ -456,10 +449,9 @@ const de_DescribeClustersCommandError = async (output, context) => {
456
449
  throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
457
450
  default:
458
451
  const parsedBody = parsedOutput.body;
459
- throwDefaultError({
452
+ return throwDefaultError({
460
453
  output,
461
454
  parsedBody,
462
- exceptionCtor: __BaseException,
463
455
  errorCode,
464
456
  });
465
457
  }
@@ -470,12 +462,12 @@ export const de_InitializeClusterCommand = async (output, context) => {
470
462
  }
471
463
  const data = await parseBody(output.body, context);
472
464
  let contents = {};
473
- contents = de_InitializeClusterResponse(data, context);
465
+ contents = _json(data);
474
466
  const response = {
475
467
  $metadata: deserializeMetadata(output),
476
468
  ...contents,
477
469
  };
478
- return Promise.resolve(response);
470
+ return response;
479
471
  };
480
472
  const de_InitializeClusterCommandError = async (output, context) => {
481
473
  const parsedOutput = {
@@ -501,10 +493,9 @@ const de_InitializeClusterCommandError = async (output, context) => {
501
493
  throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
502
494
  default:
503
495
  const parsedBody = parsedOutput.body;
504
- throwDefaultError({
496
+ return throwDefaultError({
505
497
  output,
506
498
  parsedBody,
507
- exceptionCtor: __BaseException,
508
499
  errorCode,
509
500
  });
510
501
  }
@@ -515,12 +506,12 @@ export const de_ListTagsCommand = async (output, context) => {
515
506
  }
516
507
  const data = await parseBody(output.body, context);
517
508
  let contents = {};
518
- contents = de_ListTagsResponse(data, context);
509
+ contents = _json(data);
519
510
  const response = {
520
511
  $metadata: deserializeMetadata(output),
521
512
  ...contents,
522
513
  };
523
- return Promise.resolve(response);
514
+ return response;
524
515
  };
525
516
  const de_ListTagsCommandError = async (output, context) => {
526
517
  const parsedOutput = {
@@ -549,10 +540,9 @@ const de_ListTagsCommandError = async (output, context) => {
549
540
  throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
550
541
  default:
551
542
  const parsedBody = parsedOutput.body;
552
- throwDefaultError({
543
+ return throwDefaultError({
553
544
  output,
554
545
  parsedBody,
555
- exceptionCtor: __BaseException,
556
546
  errorCode,
557
547
  });
558
548
  }
@@ -568,7 +558,7 @@ export const de_ModifyBackupAttributesCommand = async (output, context) => {
568
558
  $metadata: deserializeMetadata(output),
569
559
  ...contents,
570
560
  };
571
- return Promise.resolve(response);
561
+ return response;
572
562
  };
573
563
  const de_ModifyBackupAttributesCommandError = async (output, context) => {
574
564
  const parsedOutput = {
@@ -594,10 +584,9 @@ const de_ModifyBackupAttributesCommandError = async (output, context) => {
594
584
  throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
595
585
  default:
596
586
  const parsedBody = parsedOutput.body;
597
- throwDefaultError({
587
+ return throwDefaultError({
598
588
  output,
599
589
  parsedBody,
600
- exceptionCtor: __BaseException,
601
590
  errorCode,
602
591
  });
603
592
  }
@@ -613,7 +602,7 @@ export const de_ModifyClusterCommand = async (output, context) => {
613
602
  $metadata: deserializeMetadata(output),
614
603
  ...contents,
615
604
  };
616
- return Promise.resolve(response);
605
+ return response;
617
606
  };
618
607
  const de_ModifyClusterCommandError = async (output, context) => {
619
608
  const parsedOutput = {
@@ -639,10 +628,9 @@ const de_ModifyClusterCommandError = async (output, context) => {
639
628
  throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
640
629
  default:
641
630
  const parsedBody = parsedOutput.body;
642
- throwDefaultError({
631
+ return throwDefaultError({
643
632
  output,
644
633
  parsedBody,
645
- exceptionCtor: __BaseException,
646
634
  errorCode,
647
635
  });
648
636
  }
@@ -658,7 +646,7 @@ export const de_RestoreBackupCommand = async (output, context) => {
658
646
  $metadata: deserializeMetadata(output),
659
647
  ...contents,
660
648
  };
661
- return Promise.resolve(response);
649
+ return response;
662
650
  };
663
651
  const de_RestoreBackupCommandError = async (output, context) => {
664
652
  const parsedOutput = {
@@ -684,10 +672,9 @@ const de_RestoreBackupCommandError = async (output, context) => {
684
672
  throw await de_CloudHsmServiceExceptionRes(parsedOutput, context);
685
673
  default:
686
674
  const parsedBody = parsedOutput.body;
687
- throwDefaultError({
675
+ return throwDefaultError({
688
676
  output,
689
677
  parsedBody,
690
- exceptionCtor: __BaseException,
691
678
  errorCode,
692
679
  });
693
680
  }
@@ -698,12 +685,12 @@ export const de_TagResourceCommand = async (output, context) => {
698
685
  }
699
686
  const data = await parseBody(output.body, context);
700
687
  let contents = {};
701
- contents = de_TagResourceResponse(data, context);
688
+ contents = _json(data);
702
689
  const response = {
703
690
  $metadata: deserializeMetadata(output),
704
691
  ...contents,
705
692
  };
706
- return Promise.resolve(response);
693
+ return response;
707
694
  };
708
695
  const de_TagResourceCommandError = async (output, context) => {
709
696
  const parsedOutput = {
@@ -732,10 +719,9 @@ const de_TagResourceCommandError = async (output, context) => {
732
719
  throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
733
720
  default:
734
721
  const parsedBody = parsedOutput.body;
735
- throwDefaultError({
722
+ return throwDefaultError({
736
723
  output,
737
724
  parsedBody,
738
- exceptionCtor: __BaseException,
739
725
  errorCode,
740
726
  });
741
727
  }
@@ -746,12 +732,12 @@ export const de_UntagResourceCommand = async (output, context) => {
746
732
  }
747
733
  const data = await parseBody(output.body, context);
748
734
  let contents = {};
749
- contents = de_UntagResourceResponse(data, context);
735
+ contents = _json(data);
750
736
  const response = {
751
737
  $metadata: deserializeMetadata(output),
752
738
  ...contents,
753
739
  };
754
- return Promise.resolve(response);
740
+ return response;
755
741
  };
756
742
  const de_UntagResourceCommandError = async (output, context) => {
757
743
  const parsedOutput = {
@@ -780,17 +766,16 @@ const de_UntagResourceCommandError = async (output, context) => {
780
766
  throw await de_CloudHsmTagExceptionRes(parsedOutput, context);
781
767
  default:
782
768
  const parsedBody = parsedOutput.body;
783
- throwDefaultError({
769
+ return throwDefaultError({
784
770
  output,
785
771
  parsedBody,
786
- exceptionCtor: __BaseException,
787
772
  errorCode,
788
773
  });
789
774
  }
790
775
  };
791
776
  const de_CloudHsmAccessDeniedExceptionRes = async (parsedOutput, context) => {
792
777
  const body = parsedOutput.body;
793
- const deserialized = de_CloudHsmAccessDeniedException(body, context);
778
+ const deserialized = _json(body);
794
779
  const exception = new CloudHsmAccessDeniedException({
795
780
  $metadata: deserializeMetadata(parsedOutput),
796
781
  ...deserialized,
@@ -799,7 +784,7 @@ const de_CloudHsmAccessDeniedExceptionRes = async (parsedOutput, context) => {
799
784
  };
800
785
  const de_CloudHsmInternalFailureExceptionRes = async (parsedOutput, context) => {
801
786
  const body = parsedOutput.body;
802
- const deserialized = de_CloudHsmInternalFailureException(body, context);
787
+ const deserialized = _json(body);
803
788
  const exception = new CloudHsmInternalFailureException({
804
789
  $metadata: deserializeMetadata(parsedOutput),
805
790
  ...deserialized,
@@ -808,7 +793,7 @@ const de_CloudHsmInternalFailureExceptionRes = async (parsedOutput, context) =>
808
793
  };
809
794
  const de_CloudHsmInvalidRequestExceptionRes = async (parsedOutput, context) => {
810
795
  const body = parsedOutput.body;
811
- const deserialized = de_CloudHsmInvalidRequestException(body, context);
796
+ const deserialized = _json(body);
812
797
  const exception = new CloudHsmInvalidRequestException({
813
798
  $metadata: deserializeMetadata(parsedOutput),
814
799
  ...deserialized,
@@ -817,7 +802,7 @@ const de_CloudHsmInvalidRequestExceptionRes = async (parsedOutput, context) => {
817
802
  };
818
803
  const de_CloudHsmResourceNotFoundExceptionRes = async (parsedOutput, context) => {
819
804
  const body = parsedOutput.body;
820
- const deserialized = de_CloudHsmResourceNotFoundException(body, context);
805
+ const deserialized = _json(body);
821
806
  const exception = new CloudHsmResourceNotFoundException({
822
807
  $metadata: deserializeMetadata(parsedOutput),
823
808
  ...deserialized,
@@ -826,7 +811,7 @@ const de_CloudHsmResourceNotFoundExceptionRes = async (parsedOutput, context) =>
826
811
  };
827
812
  const de_CloudHsmServiceExceptionRes = async (parsedOutput, context) => {
828
813
  const body = parsedOutput.body;
829
- const deserialized = de_CloudHsmServiceException(body, context);
814
+ const deserialized = _json(body);
830
815
  const exception = new CloudHsmServiceException({
831
816
  $metadata: deserializeMetadata(parsedOutput),
832
817
  ...deserialized,
@@ -835,409 +820,117 @@ const de_CloudHsmServiceExceptionRes = async (parsedOutput, context) => {
835
820
  };
836
821
  const de_CloudHsmTagExceptionRes = async (parsedOutput, context) => {
837
822
  const body = parsedOutput.body;
838
- const deserialized = de_CloudHsmTagException(body, context);
823
+ const deserialized = _json(body);
839
824
  const exception = new CloudHsmTagException({
840
825
  $metadata: deserializeMetadata(parsedOutput),
841
826
  ...deserialized,
842
827
  });
843
828
  return __decorateServiceException(exception, body);
844
829
  };
845
- const se_BackupRetentionPolicy = (input, context) => {
846
- return {
847
- ...(input.Type != null && { Type: input.Type }),
848
- ...(input.Value != null && { Value: input.Value }),
849
- };
850
- };
851
- const se_CopyBackupToRegionRequest = (input, context) => {
852
- return {
853
- ...(input.BackupId != null && { BackupId: input.BackupId }),
854
- ...(input.DestinationRegion != null && { DestinationRegion: input.DestinationRegion }),
855
- ...(input.TagList != null && { TagList: se_TagList(input.TagList, context) }),
856
- };
857
- };
858
- const se_CreateClusterRequest = (input, context) => {
859
- return {
860
- ...(input.BackupRetentionPolicy != null && {
861
- BackupRetentionPolicy: se_BackupRetentionPolicy(input.BackupRetentionPolicy, context),
862
- }),
863
- ...(input.HsmType != null && { HsmType: input.HsmType }),
864
- ...(input.SourceBackupId != null && { SourceBackupId: input.SourceBackupId }),
865
- ...(input.SubnetIds != null && { SubnetIds: se_SubnetIds(input.SubnetIds, context) }),
866
- ...(input.TagList != null && { TagList: se_TagList(input.TagList, context) }),
867
- };
868
- };
869
- const se_CreateHsmRequest = (input, context) => {
870
- return {
871
- ...(input.AvailabilityZone != null && { AvailabilityZone: input.AvailabilityZone }),
872
- ...(input.ClusterId != null && { ClusterId: input.ClusterId }),
873
- ...(input.IpAddress != null && { IpAddress: input.IpAddress }),
874
- };
875
- };
876
- const se_DeleteBackupRequest = (input, context) => {
877
- return {
878
- ...(input.BackupId != null && { BackupId: input.BackupId }),
879
- };
880
- };
881
- const se_DeleteClusterRequest = (input, context) => {
882
- return {
883
- ...(input.ClusterId != null && { ClusterId: input.ClusterId }),
884
- };
885
- };
886
- const se_DeleteHsmRequest = (input, context) => {
887
- return {
888
- ...(input.ClusterId != null && { ClusterId: input.ClusterId }),
889
- ...(input.EniId != null && { EniId: input.EniId }),
890
- ...(input.EniIp != null && { EniIp: input.EniIp }),
891
- ...(input.HsmId != null && { HsmId: input.HsmId }),
892
- };
893
- };
894
- const se_DescribeBackupsRequest = (input, context) => {
895
- return {
896
- ...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
897
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
898
- ...(input.NextToken != null && { NextToken: input.NextToken }),
899
- ...(input.SortAscending != null && { SortAscending: input.SortAscending }),
900
- };
901
- };
902
- const se_DescribeClustersRequest = (input, context) => {
903
- return {
904
- ...(input.Filters != null && { Filters: se_Filters(input.Filters, context) }),
905
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
906
- ...(input.NextToken != null && { NextToken: input.NextToken }),
907
- };
908
- };
909
- const se_Filters = (input, context) => {
910
- return Object.entries(input).reduce((acc, [key, value]) => {
911
- if (value === null) {
912
- return acc;
913
- }
914
- acc[key] = se_Strings(value, context);
915
- return acc;
916
- }, {});
917
- };
918
- const se_InitializeClusterRequest = (input, context) => {
919
- return {
920
- ...(input.ClusterId != null && { ClusterId: input.ClusterId }),
921
- ...(input.SignedCert != null && { SignedCert: input.SignedCert }),
922
- ...(input.TrustAnchor != null && { TrustAnchor: input.TrustAnchor }),
923
- };
924
- };
925
- const se_ListTagsRequest = (input, context) => {
926
- return {
927
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
928
- ...(input.NextToken != null && { NextToken: input.NextToken }),
929
- ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
930
- };
931
- };
932
- const se_ModifyBackupAttributesRequest = (input, context) => {
933
- return {
934
- ...(input.BackupId != null && { BackupId: input.BackupId }),
935
- ...(input.NeverExpires != null && { NeverExpires: input.NeverExpires }),
936
- };
937
- };
938
- const se_ModifyClusterRequest = (input, context) => {
939
- return {
940
- ...(input.BackupRetentionPolicy != null && {
941
- BackupRetentionPolicy: se_BackupRetentionPolicy(input.BackupRetentionPolicy, context),
942
- }),
943
- ...(input.ClusterId != null && { ClusterId: input.ClusterId }),
944
- };
945
- };
946
- const se_RestoreBackupRequest = (input, context) => {
947
- return {
948
- ...(input.BackupId != null && { BackupId: input.BackupId }),
949
- };
950
- };
951
- const se_Strings = (input, context) => {
952
- return input
953
- .filter((e) => e != null)
954
- .map((entry) => {
955
- return entry;
956
- });
957
- };
958
- const se_SubnetIds = (input, context) => {
959
- return input
960
- .filter((e) => e != null)
961
- .map((entry) => {
962
- return entry;
963
- });
964
- };
965
- const se_Tag = (input, context) => {
966
- return {
967
- ...(input.Key != null && { Key: input.Key }),
968
- ...(input.Value != null && { Value: input.Value }),
969
- };
970
- };
971
- const se_TagKeyList = (input, context) => {
972
- return input
973
- .filter((e) => e != null)
974
- .map((entry) => {
975
- return entry;
976
- });
977
- };
978
- const se_TagList = (input, context) => {
979
- return input
980
- .filter((e) => e != null)
981
- .map((entry) => {
982
- return se_Tag(entry, context);
983
- });
984
- };
985
- const se_TagResourceRequest = (input, context) => {
986
- return {
987
- ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
988
- ...(input.TagList != null && { TagList: se_TagList(input.TagList, context) }),
989
- };
990
- };
991
- const se_UntagResourceRequest = (input, context) => {
992
- return {
993
- ...(input.ResourceId != null && { ResourceId: input.ResourceId }),
994
- ...(input.TagKeyList != null && { TagKeyList: se_TagKeyList(input.TagKeyList, context) }),
995
- };
996
- };
997
830
  const de_Backup = (output, context) => {
998
- return {
999
- BackupId: __expectString(output.BackupId),
1000
- BackupState: __expectString(output.BackupState),
1001
- ClusterId: __expectString(output.ClusterId),
1002
- CopyTimestamp: output.CopyTimestamp != null
1003
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CopyTimestamp)))
1004
- : undefined,
1005
- CreateTimestamp: output.CreateTimestamp != null
1006
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreateTimestamp)))
1007
- : undefined,
1008
- DeleteTimestamp: output.DeleteTimestamp != null
1009
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.DeleteTimestamp)))
1010
- : undefined,
1011
- NeverExpires: __expectBoolean(output.NeverExpires),
1012
- SourceBackup: __expectString(output.SourceBackup),
1013
- SourceCluster: __expectString(output.SourceCluster),
1014
- SourceRegion: __expectString(output.SourceRegion),
1015
- TagList: output.TagList != null ? de_TagList(output.TagList, context) : undefined,
1016
- };
1017
- };
1018
- const de_BackupRetentionPolicy = (output, context) => {
1019
- return {
1020
- Type: __expectString(output.Type),
1021
- Value: __expectString(output.Value),
1022
- };
831
+ return take(output, {
832
+ BackupId: __expectString,
833
+ BackupState: __expectString,
834
+ ClusterId: __expectString,
835
+ CopyTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
836
+ CreateTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
837
+ DeleteTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
838
+ NeverExpires: __expectBoolean,
839
+ SourceBackup: __expectString,
840
+ SourceCluster: __expectString,
841
+ SourceRegion: __expectString,
842
+ TagList: _json,
843
+ });
1023
844
  };
1024
845
  const de_Backups = (output, context) => {
1025
846
  const retVal = (output || [])
1026
847
  .filter((e) => e != null)
1027
848
  .map((entry) => {
1028
- if (entry === null) {
1029
- return null;
1030
- }
1031
849
  return de_Backup(entry, context);
1032
850
  });
1033
851
  return retVal;
1034
852
  };
1035
- const de_Certificates = (output, context) => {
1036
- return {
1037
- AwsHardwareCertificate: __expectString(output.AwsHardwareCertificate),
1038
- ClusterCertificate: __expectString(output.ClusterCertificate),
1039
- ClusterCsr: __expectString(output.ClusterCsr),
1040
- HsmCertificate: __expectString(output.HsmCertificate),
1041
- ManufacturerHardwareCertificate: __expectString(output.ManufacturerHardwareCertificate),
1042
- };
1043
- };
1044
- const de_CloudHsmAccessDeniedException = (output, context) => {
1045
- return {
1046
- Message: __expectString(output.Message),
1047
- };
1048
- };
1049
- const de_CloudHsmInternalFailureException = (output, context) => {
1050
- return {
1051
- Message: __expectString(output.Message),
1052
- };
1053
- };
1054
- const de_CloudHsmInvalidRequestException = (output, context) => {
1055
- return {
1056
- Message: __expectString(output.Message),
1057
- };
1058
- };
1059
- const de_CloudHsmResourceNotFoundException = (output, context) => {
1060
- return {
1061
- Message: __expectString(output.Message),
1062
- };
1063
- };
1064
- const de_CloudHsmServiceException = (output, context) => {
1065
- return {
1066
- Message: __expectString(output.Message),
1067
- };
1068
- };
1069
- const de_CloudHsmTagException = (output, context) => {
1070
- return {
1071
- Message: __expectString(output.Message),
1072
- };
1073
- };
1074
853
  const de_Cluster = (output, context) => {
1075
- return {
1076
- BackupPolicy: __expectString(output.BackupPolicy),
1077
- BackupRetentionPolicy: output.BackupRetentionPolicy != null
1078
- ? de_BackupRetentionPolicy(output.BackupRetentionPolicy, context)
1079
- : undefined,
1080
- Certificates: output.Certificates != null ? de_Certificates(output.Certificates, context) : undefined,
1081
- ClusterId: __expectString(output.ClusterId),
1082
- CreateTimestamp: output.CreateTimestamp != null
1083
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreateTimestamp)))
1084
- : undefined,
1085
- HsmType: __expectString(output.HsmType),
1086
- Hsms: output.Hsms != null ? de_Hsms(output.Hsms, context) : undefined,
1087
- PreCoPassword: __expectString(output.PreCoPassword),
1088
- SecurityGroup: __expectString(output.SecurityGroup),
1089
- SourceBackupId: __expectString(output.SourceBackupId),
1090
- State: __expectString(output.State),
1091
- StateMessage: __expectString(output.StateMessage),
1092
- SubnetMapping: output.SubnetMapping != null ? de_ExternalSubnetMapping(output.SubnetMapping, context) : undefined,
1093
- TagList: output.TagList != null ? de_TagList(output.TagList, context) : undefined,
1094
- VpcId: __expectString(output.VpcId),
1095
- };
854
+ return take(output, {
855
+ BackupPolicy: __expectString,
856
+ BackupRetentionPolicy: _json,
857
+ Certificates: _json,
858
+ ClusterId: __expectString,
859
+ CreateTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
860
+ HsmType: __expectString,
861
+ Hsms: _json,
862
+ PreCoPassword: __expectString,
863
+ SecurityGroup: __expectString,
864
+ SourceBackupId: __expectString,
865
+ State: __expectString,
866
+ StateMessage: __expectString,
867
+ SubnetMapping: _json,
868
+ TagList: _json,
869
+ VpcId: __expectString,
870
+ });
1096
871
  };
1097
872
  const de_Clusters = (output, context) => {
1098
873
  const retVal = (output || [])
1099
874
  .filter((e) => e != null)
1100
875
  .map((entry) => {
1101
- if (entry === null) {
1102
- return null;
1103
- }
1104
876
  return de_Cluster(entry, context);
1105
877
  });
1106
878
  return retVal;
1107
879
  };
1108
880
  const de_CopyBackupToRegionResponse = (output, context) => {
1109
- return {
1110
- DestinationBackup: output.DestinationBackup != null ? de_DestinationBackup(output.DestinationBackup, context) : undefined,
1111
- };
881
+ return take(output, {
882
+ DestinationBackup: (_) => de_DestinationBackup(_, context),
883
+ });
1112
884
  };
1113
885
  const de_CreateClusterResponse = (output, context) => {
1114
- return {
1115
- Cluster: output.Cluster != null ? de_Cluster(output.Cluster, context) : undefined,
1116
- };
1117
- };
1118
- const de_CreateHsmResponse = (output, context) => {
1119
- return {
1120
- Hsm: output.Hsm != null ? de_Hsm(output.Hsm, context) : undefined,
1121
- };
886
+ return take(output, {
887
+ Cluster: (_) => de_Cluster(_, context),
888
+ });
1122
889
  };
1123
890
  const de_DeleteBackupResponse = (output, context) => {
1124
- return {
1125
- Backup: output.Backup != null ? de_Backup(output.Backup, context) : undefined,
1126
- };
891
+ return take(output, {
892
+ Backup: (_) => de_Backup(_, context),
893
+ });
1127
894
  };
1128
895
  const de_DeleteClusterResponse = (output, context) => {
1129
- return {
1130
- Cluster: output.Cluster != null ? de_Cluster(output.Cluster, context) : undefined,
1131
- };
1132
- };
1133
- const de_DeleteHsmResponse = (output, context) => {
1134
- return {
1135
- HsmId: __expectString(output.HsmId),
1136
- };
896
+ return take(output, {
897
+ Cluster: (_) => de_Cluster(_, context),
898
+ });
1137
899
  };
1138
900
  const de_DescribeBackupsResponse = (output, context) => {
1139
- return {
1140
- Backups: output.Backups != null ? de_Backups(output.Backups, context) : undefined,
1141
- NextToken: __expectString(output.NextToken),
1142
- };
901
+ return take(output, {
902
+ Backups: (_) => de_Backups(_, context),
903
+ NextToken: __expectString,
904
+ });
1143
905
  };
1144
906
  const de_DescribeClustersResponse = (output, context) => {
1145
- return {
1146
- Clusters: output.Clusters != null ? de_Clusters(output.Clusters, context) : undefined,
1147
- NextToken: __expectString(output.NextToken),
1148
- };
907
+ return take(output, {
908
+ Clusters: (_) => de_Clusters(_, context),
909
+ NextToken: __expectString,
910
+ });
1149
911
  };
1150
912
  const de_DestinationBackup = (output, context) => {
1151
- return {
1152
- CreateTimestamp: output.CreateTimestamp != null
1153
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreateTimestamp)))
1154
- : undefined,
1155
- SourceBackup: __expectString(output.SourceBackup),
1156
- SourceCluster: __expectString(output.SourceCluster),
1157
- SourceRegion: __expectString(output.SourceRegion),
1158
- };
1159
- };
1160
- const de_ExternalSubnetMapping = (output, context) => {
1161
- return Object.entries(output).reduce((acc, [key, value]) => {
1162
- if (value === null) {
1163
- return acc;
1164
- }
1165
- acc[key] = __expectString(value);
1166
- return acc;
1167
- }, {});
1168
- };
1169
- const de_Hsm = (output, context) => {
1170
- return {
1171
- AvailabilityZone: __expectString(output.AvailabilityZone),
1172
- ClusterId: __expectString(output.ClusterId),
1173
- EniId: __expectString(output.EniId),
1174
- EniIp: __expectString(output.EniIp),
1175
- HsmId: __expectString(output.HsmId),
1176
- State: __expectString(output.State),
1177
- StateMessage: __expectString(output.StateMessage),
1178
- SubnetId: __expectString(output.SubnetId),
1179
- };
1180
- };
1181
- const de_Hsms = (output, context) => {
1182
- const retVal = (output || [])
1183
- .filter((e) => e != null)
1184
- .map((entry) => {
1185
- if (entry === null) {
1186
- return null;
1187
- }
1188
- return de_Hsm(entry, context);
913
+ return take(output, {
914
+ CreateTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
915
+ SourceBackup: __expectString,
916
+ SourceCluster: __expectString,
917
+ SourceRegion: __expectString,
1189
918
  });
1190
- return retVal;
1191
- };
1192
- const de_InitializeClusterResponse = (output, context) => {
1193
- return {
1194
- State: __expectString(output.State),
1195
- StateMessage: __expectString(output.StateMessage),
1196
- };
1197
- };
1198
- const de_ListTagsResponse = (output, context) => {
1199
- return {
1200
- NextToken: __expectString(output.NextToken),
1201
- TagList: output.TagList != null ? de_TagList(output.TagList, context) : undefined,
1202
- };
1203
919
  };
1204
920
  const de_ModifyBackupAttributesResponse = (output, context) => {
1205
- return {
1206
- Backup: output.Backup != null ? de_Backup(output.Backup, context) : undefined,
1207
- };
921
+ return take(output, {
922
+ Backup: (_) => de_Backup(_, context),
923
+ });
1208
924
  };
1209
925
  const de_ModifyClusterResponse = (output, context) => {
1210
- return {
1211
- Cluster: output.Cluster != null ? de_Cluster(output.Cluster, context) : undefined,
1212
- };
926
+ return take(output, {
927
+ Cluster: (_) => de_Cluster(_, context),
928
+ });
1213
929
  };
1214
930
  const de_RestoreBackupResponse = (output, context) => {
1215
- return {
1216
- Backup: output.Backup != null ? de_Backup(output.Backup, context) : undefined,
1217
- };
1218
- };
1219
- const de_Tag = (output, context) => {
1220
- return {
1221
- Key: __expectString(output.Key),
1222
- Value: __expectString(output.Value),
1223
- };
1224
- };
1225
- const de_TagList = (output, context) => {
1226
- const retVal = (output || [])
1227
- .filter((e) => e != null)
1228
- .map((entry) => {
1229
- if (entry === null) {
1230
- return null;
1231
- }
1232
- return de_Tag(entry, context);
931
+ return take(output, {
932
+ Backup: (_) => de_Backup(_, context),
1233
933
  });
1234
- return retVal;
1235
- };
1236
- const de_TagResourceResponse = (output, context) => {
1237
- return {};
1238
- };
1239
- const de_UntagResourceResponse = (output, context) => {
1240
- return {};
1241
934
  };
1242
935
  const deserializeMetadata = (output) => ({
1243
936
  httpStatusCode: output.statusCode,
@@ -1252,6 +945,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
1252
945
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1253
946
  };
1254
947
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
948
+ const throwDefaultError = withBaseException(__BaseException);
1255
949
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1256
950
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1257
951
  const contents = {