@aws-sdk/client-cloudcontrol 3.310.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,76 +1,52 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { CloudControlServiceException as __BaseException } from "../models/CloudControlServiceException";
5
5
  import { AlreadyExistsException, ClientTokenConflictException, ConcurrentModificationException, ConcurrentOperationException, GeneralServiceException, HandlerFailureException, HandlerInternalFailureException, InvalidCredentialsException, InvalidRequestException, NetworkFailureException, NotStabilizedException, NotUpdatableException, PrivateTypeException, RequestTokenNotFoundException, ResourceConflictException, ResourceNotFoundException, ServiceInternalErrorException, ServiceLimitExceededException, ThrottlingException, TypeNotFoundException, UnsupportedActionException, } from "../models/models_0";
6
6
  export const se_CancelResourceRequestCommand = async (input, context) => {
7
- const headers = {
8
- "content-type": "application/x-amz-json-1.0",
9
- "x-amz-target": "CloudApiService.CancelResourceRequest",
10
- };
7
+ const headers = sharedHeaders("CancelResourceRequest");
11
8
  let body;
12
- body = JSON.stringify(se_CancelResourceRequestInput(input, context));
9
+ body = JSON.stringify(_json(input));
13
10
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
11
  };
15
12
  export const se_CreateResourceCommand = async (input, context) => {
16
- const headers = {
17
- "content-type": "application/x-amz-json-1.0",
18
- "x-amz-target": "CloudApiService.CreateResource",
19
- };
13
+ const headers = sharedHeaders("CreateResource");
20
14
  let body;
21
15
  body = JSON.stringify(se_CreateResourceInput(input, context));
22
16
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
23
17
  };
24
18
  export const se_DeleteResourceCommand = async (input, context) => {
25
- const headers = {
26
- "content-type": "application/x-amz-json-1.0",
27
- "x-amz-target": "CloudApiService.DeleteResource",
28
- };
19
+ const headers = sharedHeaders("DeleteResource");
29
20
  let body;
30
21
  body = JSON.stringify(se_DeleteResourceInput(input, context));
31
22
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
32
23
  };
33
24
  export const se_GetResourceCommand = async (input, context) => {
34
- const headers = {
35
- "content-type": "application/x-amz-json-1.0",
36
- "x-amz-target": "CloudApiService.GetResource",
37
- };
25
+ const headers = sharedHeaders("GetResource");
38
26
  let body;
39
- body = JSON.stringify(se_GetResourceInput(input, context));
27
+ body = JSON.stringify(_json(input));
40
28
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
29
  };
42
30
  export const se_GetResourceRequestStatusCommand = async (input, context) => {
43
- const headers = {
44
- "content-type": "application/x-amz-json-1.0",
45
- "x-amz-target": "CloudApiService.GetResourceRequestStatus",
46
- };
31
+ const headers = sharedHeaders("GetResourceRequestStatus");
47
32
  let body;
48
- body = JSON.stringify(se_GetResourceRequestStatusInput(input, context));
33
+ body = JSON.stringify(_json(input));
49
34
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
50
35
  };
51
36
  export const se_ListResourceRequestsCommand = async (input, context) => {
52
- const headers = {
53
- "content-type": "application/x-amz-json-1.0",
54
- "x-amz-target": "CloudApiService.ListResourceRequests",
55
- };
37
+ const headers = sharedHeaders("ListResourceRequests");
56
38
  let body;
57
- body = JSON.stringify(se_ListResourceRequestsInput(input, context));
39
+ body = JSON.stringify(_json(input));
58
40
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
59
41
  };
60
42
  export const se_ListResourcesCommand = async (input, context) => {
61
- const headers = {
62
- "content-type": "application/x-amz-json-1.0",
63
- "x-amz-target": "CloudApiService.ListResources",
64
- };
43
+ const headers = sharedHeaders("ListResources");
65
44
  let body;
66
- body = JSON.stringify(se_ListResourcesInput(input, context));
45
+ body = JSON.stringify(_json(input));
67
46
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
68
47
  };
69
48
  export const se_UpdateResourceCommand = async (input, context) => {
70
- const headers = {
71
- "content-type": "application/x-amz-json-1.0",
72
- "x-amz-target": "CloudApiService.UpdateResource",
73
- };
49
+ const headers = sharedHeaders("UpdateResource");
74
50
  let body;
75
51
  body = JSON.stringify(se_UpdateResourceInput(input, context));
76
52
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
@@ -86,7 +62,7 @@ export const de_CancelResourceRequestCommand = async (output, context) => {
86
62
  $metadata: deserializeMetadata(output),
87
63
  ...contents,
88
64
  };
89
- return Promise.resolve(response);
65
+ return response;
90
66
  };
91
67
  const de_CancelResourceRequestCommandError = async (output, context) => {
92
68
  const parsedOutput = {
@@ -103,10 +79,9 @@ const de_CancelResourceRequestCommandError = async (output, context) => {
103
79
  throw await de_RequestTokenNotFoundExceptionRes(parsedOutput, context);
104
80
  default:
105
81
  const parsedBody = parsedOutput.body;
106
- throwDefaultError({
82
+ return throwDefaultError({
107
83
  output,
108
84
  parsedBody,
109
- exceptionCtor: __BaseException,
110
85
  errorCode,
111
86
  });
112
87
  }
@@ -122,7 +97,7 @@ export const de_CreateResourceCommand = async (output, context) => {
122
97
  $metadata: deserializeMetadata(output),
123
98
  ...contents,
124
99
  };
125
- return Promise.resolve(response);
100
+ return response;
126
101
  };
127
102
  const de_CreateResourceCommandError = async (output, context) => {
128
103
  const parsedOutput = {
@@ -190,10 +165,9 @@ const de_CreateResourceCommandError = async (output, context) => {
190
165
  throw await de_UnsupportedActionExceptionRes(parsedOutput, context);
191
166
  default:
192
167
  const parsedBody = parsedOutput.body;
193
- throwDefaultError({
168
+ return throwDefaultError({
194
169
  output,
195
170
  parsedBody,
196
- exceptionCtor: __BaseException,
197
171
  errorCode,
198
172
  });
199
173
  }
@@ -209,7 +183,7 @@ export const de_DeleteResourceCommand = async (output, context) => {
209
183
  $metadata: deserializeMetadata(output),
210
184
  ...contents,
211
185
  };
212
- return Promise.resolve(response);
186
+ return response;
213
187
  };
214
188
  const de_DeleteResourceCommandError = async (output, context) => {
215
189
  const parsedOutput = {
@@ -277,10 +251,9 @@ const de_DeleteResourceCommandError = async (output, context) => {
277
251
  throw await de_UnsupportedActionExceptionRes(parsedOutput, context);
278
252
  default:
279
253
  const parsedBody = parsedOutput.body;
280
- throwDefaultError({
254
+ return throwDefaultError({
281
255
  output,
282
256
  parsedBody,
283
- exceptionCtor: __BaseException,
284
257
  errorCode,
285
258
  });
286
259
  }
@@ -291,12 +264,12 @@ export const de_GetResourceCommand = async (output, context) => {
291
264
  }
292
265
  const data = await parseBody(output.body, context);
293
266
  let contents = {};
294
- contents = de_GetResourceOutput(data, context);
267
+ contents = _json(data);
295
268
  const response = {
296
269
  $metadata: deserializeMetadata(output),
297
270
  ...contents,
298
271
  };
299
- return Promise.resolve(response);
272
+ return response;
300
273
  };
301
274
  const de_GetResourceCommandError = async (output, context) => {
302
275
  const parsedOutput = {
@@ -358,10 +331,9 @@ const de_GetResourceCommandError = async (output, context) => {
358
331
  throw await de_UnsupportedActionExceptionRes(parsedOutput, context);
359
332
  default:
360
333
  const parsedBody = parsedOutput.body;
361
- throwDefaultError({
334
+ return throwDefaultError({
362
335
  output,
363
336
  parsedBody,
364
- exceptionCtor: __BaseException,
365
337
  errorCode,
366
338
  });
367
339
  }
@@ -377,7 +349,7 @@ export const de_GetResourceRequestStatusCommand = async (output, context) => {
377
349
  $metadata: deserializeMetadata(output),
378
350
  ...contents,
379
351
  };
380
- return Promise.resolve(response);
352
+ return response;
381
353
  };
382
354
  const de_GetResourceRequestStatusCommandError = async (output, context) => {
383
355
  const parsedOutput = {
@@ -391,10 +363,9 @@ const de_GetResourceRequestStatusCommandError = async (output, context) => {
391
363
  throw await de_RequestTokenNotFoundExceptionRes(parsedOutput, context);
392
364
  default:
393
365
  const parsedBody = parsedOutput.body;
394
- throwDefaultError({
366
+ return throwDefaultError({
395
367
  output,
396
368
  parsedBody,
397
- exceptionCtor: __BaseException,
398
369
  errorCode,
399
370
  });
400
371
  }
@@ -410,7 +381,7 @@ export const de_ListResourceRequestsCommand = async (output, context) => {
410
381
  $metadata: deserializeMetadata(output),
411
382
  ...contents,
412
383
  };
413
- return Promise.resolve(response);
384
+ return response;
414
385
  };
415
386
  const de_ListResourceRequestsCommandError = async (output, context) => {
416
387
  const parsedOutput = {
@@ -419,10 +390,9 @@ const de_ListResourceRequestsCommandError = async (output, context) => {
419
390
  };
420
391
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
421
392
  const parsedBody = parsedOutput.body;
422
- throwDefaultError({
393
+ return throwDefaultError({
423
394
  output,
424
395
  parsedBody,
425
- exceptionCtor: __BaseException,
426
396
  errorCode,
427
397
  });
428
398
  };
@@ -432,12 +402,12 @@ export const de_ListResourcesCommand = async (output, context) => {
432
402
  }
433
403
  const data = await parseBody(output.body, context);
434
404
  let contents = {};
435
- contents = de_ListResourcesOutput(data, context);
405
+ contents = _json(data);
436
406
  const response = {
437
407
  $metadata: deserializeMetadata(output),
438
408
  ...contents,
439
409
  };
440
- return Promise.resolve(response);
410
+ return response;
441
411
  };
442
412
  const de_ListResourcesCommandError = async (output, context) => {
443
413
  const parsedOutput = {
@@ -499,10 +469,9 @@ const de_ListResourcesCommandError = async (output, context) => {
499
469
  throw await de_UnsupportedActionExceptionRes(parsedOutput, context);
500
470
  default:
501
471
  const parsedBody = parsedOutput.body;
502
- throwDefaultError({
472
+ return throwDefaultError({
503
473
  output,
504
474
  parsedBody,
505
- exceptionCtor: __BaseException,
506
475
  errorCode,
507
476
  });
508
477
  }
@@ -518,7 +487,7 @@ export const de_UpdateResourceCommand = async (output, context) => {
518
487
  $metadata: deserializeMetadata(output),
519
488
  ...contents,
520
489
  };
521
- return Promise.resolve(response);
490
+ return response;
522
491
  };
523
492
  const de_UpdateResourceCommandError = async (output, context) => {
524
493
  const parsedOutput = {
@@ -586,17 +555,16 @@ const de_UpdateResourceCommandError = async (output, context) => {
586
555
  throw await de_UnsupportedActionExceptionRes(parsedOutput, context);
587
556
  default:
588
557
  const parsedBody = parsedOutput.body;
589
- throwDefaultError({
558
+ return throwDefaultError({
590
559
  output,
591
560
  parsedBody,
592
- exceptionCtor: __BaseException,
593
561
  errorCode,
594
562
  });
595
563
  }
596
564
  };
597
565
  const de_AlreadyExistsExceptionRes = async (parsedOutput, context) => {
598
566
  const body = parsedOutput.body;
599
- const deserialized = de_AlreadyExistsException(body, context);
567
+ const deserialized = _json(body);
600
568
  const exception = new AlreadyExistsException({
601
569
  $metadata: deserializeMetadata(parsedOutput),
602
570
  ...deserialized,
@@ -605,7 +573,7 @@ const de_AlreadyExistsExceptionRes = async (parsedOutput, context) => {
605
573
  };
606
574
  const de_ClientTokenConflictExceptionRes = async (parsedOutput, context) => {
607
575
  const body = parsedOutput.body;
608
- const deserialized = de_ClientTokenConflictException(body, context);
576
+ const deserialized = _json(body);
609
577
  const exception = new ClientTokenConflictException({
610
578
  $metadata: deserializeMetadata(parsedOutput),
611
579
  ...deserialized,
@@ -614,7 +582,7 @@ const de_ClientTokenConflictExceptionRes = async (parsedOutput, context) => {
614
582
  };
615
583
  const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
616
584
  const body = parsedOutput.body;
617
- const deserialized = de_ConcurrentModificationException(body, context);
585
+ const deserialized = _json(body);
618
586
  const exception = new ConcurrentModificationException({
619
587
  $metadata: deserializeMetadata(parsedOutput),
620
588
  ...deserialized,
@@ -623,7 +591,7 @@ const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
623
591
  };
624
592
  const de_ConcurrentOperationExceptionRes = async (parsedOutput, context) => {
625
593
  const body = parsedOutput.body;
626
- const deserialized = de_ConcurrentOperationException(body, context);
594
+ const deserialized = _json(body);
627
595
  const exception = new ConcurrentOperationException({
628
596
  $metadata: deserializeMetadata(parsedOutput),
629
597
  ...deserialized,
@@ -632,7 +600,7 @@ const de_ConcurrentOperationExceptionRes = async (parsedOutput, context) => {
632
600
  };
633
601
  const de_GeneralServiceExceptionRes = async (parsedOutput, context) => {
634
602
  const body = parsedOutput.body;
635
- const deserialized = de_GeneralServiceException(body, context);
603
+ const deserialized = _json(body);
636
604
  const exception = new GeneralServiceException({
637
605
  $metadata: deserializeMetadata(parsedOutput),
638
606
  ...deserialized,
@@ -641,7 +609,7 @@ const de_GeneralServiceExceptionRes = async (parsedOutput, context) => {
641
609
  };
642
610
  const de_HandlerFailureExceptionRes = async (parsedOutput, context) => {
643
611
  const body = parsedOutput.body;
644
- const deserialized = de_HandlerFailureException(body, context);
612
+ const deserialized = _json(body);
645
613
  const exception = new HandlerFailureException({
646
614
  $metadata: deserializeMetadata(parsedOutput),
647
615
  ...deserialized,
@@ -650,7 +618,7 @@ const de_HandlerFailureExceptionRes = async (parsedOutput, context) => {
650
618
  };
651
619
  const de_HandlerInternalFailureExceptionRes = async (parsedOutput, context) => {
652
620
  const body = parsedOutput.body;
653
- const deserialized = de_HandlerInternalFailureException(body, context);
621
+ const deserialized = _json(body);
654
622
  const exception = new HandlerInternalFailureException({
655
623
  $metadata: deserializeMetadata(parsedOutput),
656
624
  ...deserialized,
@@ -659,7 +627,7 @@ const de_HandlerInternalFailureExceptionRes = async (parsedOutput, context) => {
659
627
  };
660
628
  const de_InvalidCredentialsExceptionRes = async (parsedOutput, context) => {
661
629
  const body = parsedOutput.body;
662
- const deserialized = de_InvalidCredentialsException(body, context);
630
+ const deserialized = _json(body);
663
631
  const exception = new InvalidCredentialsException({
664
632
  $metadata: deserializeMetadata(parsedOutput),
665
633
  ...deserialized,
@@ -668,7 +636,7 @@ const de_InvalidCredentialsExceptionRes = async (parsedOutput, context) => {
668
636
  };
669
637
  const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
670
638
  const body = parsedOutput.body;
671
- const deserialized = de_InvalidRequestException(body, context);
639
+ const deserialized = _json(body);
672
640
  const exception = new InvalidRequestException({
673
641
  $metadata: deserializeMetadata(parsedOutput),
674
642
  ...deserialized,
@@ -677,7 +645,7 @@ const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
677
645
  };
678
646
  const de_NetworkFailureExceptionRes = async (parsedOutput, context) => {
679
647
  const body = parsedOutput.body;
680
- const deserialized = de_NetworkFailureException(body, context);
648
+ const deserialized = _json(body);
681
649
  const exception = new NetworkFailureException({
682
650
  $metadata: deserializeMetadata(parsedOutput),
683
651
  ...deserialized,
@@ -686,7 +654,7 @@ const de_NetworkFailureExceptionRes = async (parsedOutput, context) => {
686
654
  };
687
655
  const de_NotStabilizedExceptionRes = async (parsedOutput, context) => {
688
656
  const body = parsedOutput.body;
689
- const deserialized = de_NotStabilizedException(body, context);
657
+ const deserialized = _json(body);
690
658
  const exception = new NotStabilizedException({
691
659
  $metadata: deserializeMetadata(parsedOutput),
692
660
  ...deserialized,
@@ -695,7 +663,7 @@ const de_NotStabilizedExceptionRes = async (parsedOutput, context) => {
695
663
  };
696
664
  const de_NotUpdatableExceptionRes = async (parsedOutput, context) => {
697
665
  const body = parsedOutput.body;
698
- const deserialized = de_NotUpdatableException(body, context);
666
+ const deserialized = _json(body);
699
667
  const exception = new NotUpdatableException({
700
668
  $metadata: deserializeMetadata(parsedOutput),
701
669
  ...deserialized,
@@ -704,7 +672,7 @@ const de_NotUpdatableExceptionRes = async (parsedOutput, context) => {
704
672
  };
705
673
  const de_PrivateTypeExceptionRes = async (parsedOutput, context) => {
706
674
  const body = parsedOutput.body;
707
- const deserialized = de_PrivateTypeException(body, context);
675
+ const deserialized = _json(body);
708
676
  const exception = new PrivateTypeException({
709
677
  $metadata: deserializeMetadata(parsedOutput),
710
678
  ...deserialized,
@@ -713,7 +681,7 @@ const de_PrivateTypeExceptionRes = async (parsedOutput, context) => {
713
681
  };
714
682
  const de_RequestTokenNotFoundExceptionRes = async (parsedOutput, context) => {
715
683
  const body = parsedOutput.body;
716
- const deserialized = de_RequestTokenNotFoundException(body, context);
684
+ const deserialized = _json(body);
717
685
  const exception = new RequestTokenNotFoundException({
718
686
  $metadata: deserializeMetadata(parsedOutput),
719
687
  ...deserialized,
@@ -722,7 +690,7 @@ const de_RequestTokenNotFoundExceptionRes = async (parsedOutput, context) => {
722
690
  };
723
691
  const de_ResourceConflictExceptionRes = async (parsedOutput, context) => {
724
692
  const body = parsedOutput.body;
725
- const deserialized = de_ResourceConflictException(body, context);
693
+ const deserialized = _json(body);
726
694
  const exception = new ResourceConflictException({
727
695
  $metadata: deserializeMetadata(parsedOutput),
728
696
  ...deserialized,
@@ -731,7 +699,7 @@ const de_ResourceConflictExceptionRes = async (parsedOutput, context) => {
731
699
  };
732
700
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
733
701
  const body = parsedOutput.body;
734
- const deserialized = de_ResourceNotFoundException(body, context);
702
+ const deserialized = _json(body);
735
703
  const exception = new ResourceNotFoundException({
736
704
  $metadata: deserializeMetadata(parsedOutput),
737
705
  ...deserialized,
@@ -740,7 +708,7 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
740
708
  };
741
709
  const de_ServiceInternalErrorExceptionRes = async (parsedOutput, context) => {
742
710
  const body = parsedOutput.body;
743
- const deserialized = de_ServiceInternalErrorException(body, context);
711
+ const deserialized = _json(body);
744
712
  const exception = new ServiceInternalErrorException({
745
713
  $metadata: deserializeMetadata(parsedOutput),
746
714
  ...deserialized,
@@ -749,7 +717,7 @@ const de_ServiceInternalErrorExceptionRes = async (parsedOutput, context) => {
749
717
  };
750
718
  const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
751
719
  const body = parsedOutput.body;
752
- const deserialized = de_ServiceLimitExceededException(body, context);
720
+ const deserialized = _json(body);
753
721
  const exception = new ServiceLimitExceededException({
754
722
  $metadata: deserializeMetadata(parsedOutput),
755
723
  ...deserialized,
@@ -758,7 +726,7 @@ const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
758
726
  };
759
727
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
760
728
  const body = parsedOutput.body;
761
- const deserialized = de_ThrottlingException(body, context);
729
+ const deserialized = _json(body);
762
730
  const exception = new ThrottlingException({
763
731
  $metadata: deserializeMetadata(parsedOutput),
764
732
  ...deserialized,
@@ -767,7 +735,7 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
767
735
  };
768
736
  const de_TypeNotFoundExceptionRes = async (parsedOutput, context) => {
769
737
  const body = parsedOutput.body;
770
- const deserialized = de_TypeNotFoundException(body, context);
738
+ const deserialized = _json(body);
771
739
  const exception = new TypeNotFoundException({
772
740
  $metadata: deserializeMetadata(parsedOutput),
773
741
  ...deserialized,
@@ -776,292 +744,93 @@ const de_TypeNotFoundExceptionRes = async (parsedOutput, context) => {
776
744
  };
777
745
  const de_UnsupportedActionExceptionRes = async (parsedOutput, context) => {
778
746
  const body = parsedOutput.body;
779
- const deserialized = de_UnsupportedActionException(body, context);
747
+ const deserialized = _json(body);
780
748
  const exception = new UnsupportedActionException({
781
749
  $metadata: deserializeMetadata(parsedOutput),
782
750
  ...deserialized,
783
751
  });
784
752
  return __decorateServiceException(exception, body);
785
753
  };
786
- const se_CancelResourceRequestInput = (input, context) => {
787
- return {
788
- ...(input.RequestToken != null && { RequestToken: input.RequestToken }),
789
- };
790
- };
791
754
  const se_CreateResourceInput = (input, context) => {
792
- return {
793
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
794
- ...(input.DesiredState != null && { DesiredState: input.DesiredState }),
795
- ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
796
- ...(input.TypeName != null && { TypeName: input.TypeName }),
797
- ...(input.TypeVersionId != null && { TypeVersionId: input.TypeVersionId }),
798
- };
799
- };
800
- const se_DeleteResourceInput = (input, context) => {
801
- return {
802
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
803
- ...(input.Identifier != null && { Identifier: input.Identifier }),
804
- ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
805
- ...(input.TypeName != null && { TypeName: input.TypeName }),
806
- ...(input.TypeVersionId != null && { TypeVersionId: input.TypeVersionId }),
807
- };
808
- };
809
- const se_GetResourceInput = (input, context) => {
810
- return {
811
- ...(input.Identifier != null && { Identifier: input.Identifier }),
812
- ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
813
- ...(input.TypeName != null && { TypeName: input.TypeName }),
814
- ...(input.TypeVersionId != null && { TypeVersionId: input.TypeVersionId }),
815
- };
816
- };
817
- const se_GetResourceRequestStatusInput = (input, context) => {
818
- return {
819
- ...(input.RequestToken != null && { RequestToken: input.RequestToken }),
820
- };
821
- };
822
- const se_ListResourceRequestsInput = (input, context) => {
823
- return {
824
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
825
- ...(input.NextToken != null && { NextToken: input.NextToken }),
826
- ...(input.ResourceRequestStatusFilter != null && {
827
- ResourceRequestStatusFilter: se_ResourceRequestStatusFilter(input.ResourceRequestStatusFilter, context),
828
- }),
829
- };
830
- };
831
- const se_ListResourcesInput = (input, context) => {
832
- return {
833
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
834
- ...(input.NextToken != null && { NextToken: input.NextToken }),
835
- ...(input.ResourceModel != null && { ResourceModel: input.ResourceModel }),
836
- ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
837
- ...(input.TypeName != null && { TypeName: input.TypeName }),
838
- ...(input.TypeVersionId != null && { TypeVersionId: input.TypeVersionId }),
839
- };
840
- };
841
- const se_Operations = (input, context) => {
842
- return input
843
- .filter((e) => e != null)
844
- .map((entry) => {
845
- return entry;
755
+ return take(input, {
756
+ ClientToken: (_) => _ ?? generateIdempotencyToken(),
757
+ DesiredState: [],
758
+ RoleArn: [],
759
+ TypeName: [],
760
+ TypeVersionId: [],
846
761
  });
847
762
  };
848
- const se_OperationStatuses = (input, context) => {
849
- return input
850
- .filter((e) => e != null)
851
- .map((entry) => {
852
- return entry;
763
+ const se_DeleteResourceInput = (input, context) => {
764
+ return take(input, {
765
+ ClientToken: (_) => _ ?? generateIdempotencyToken(),
766
+ Identifier: [],
767
+ RoleArn: [],
768
+ TypeName: [],
769
+ TypeVersionId: [],
853
770
  });
854
771
  };
855
- const se_ResourceRequestStatusFilter = (input, context) => {
856
- return {
857
- ...(input.OperationStatuses != null && {
858
- OperationStatuses: se_OperationStatuses(input.OperationStatuses, context),
859
- }),
860
- ...(input.Operations != null && { Operations: se_Operations(input.Operations, context) }),
861
- };
862
- };
863
772
  const se_UpdateResourceInput = (input, context) => {
864
- return {
865
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
866
- ...(input.Identifier != null && { Identifier: input.Identifier }),
867
- ...(input.PatchDocument != null && { PatchDocument: input.PatchDocument }),
868
- ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
869
- ...(input.TypeName != null && { TypeName: input.TypeName }),
870
- ...(input.TypeVersionId != null && { TypeVersionId: input.TypeVersionId }),
871
- };
872
- };
873
- const de_AlreadyExistsException = (output, context) => {
874
- return {
875
- Message: __expectString(output.Message),
876
- };
773
+ return take(input, {
774
+ ClientToken: (_) => _ ?? generateIdempotencyToken(),
775
+ Identifier: [],
776
+ PatchDocument: [],
777
+ RoleArn: [],
778
+ TypeName: [],
779
+ TypeVersionId: [],
780
+ });
877
781
  };
878
782
  const de_CancelResourceRequestOutput = (output, context) => {
879
- return {
880
- ProgressEvent: output.ProgressEvent != null ? de_ProgressEvent(output.ProgressEvent, context) : undefined,
881
- };
882
- };
883
- const de_ClientTokenConflictException = (output, context) => {
884
- return {
885
- Message: __expectString(output.Message),
886
- };
887
- };
888
- const de_ConcurrentModificationException = (output, context) => {
889
- return {
890
- Message: __expectString(output.Message),
891
- };
892
- };
893
- const de_ConcurrentOperationException = (output, context) => {
894
- return {
895
- Message: __expectString(output.Message),
896
- };
783
+ return take(output, {
784
+ ProgressEvent: (_) => de_ProgressEvent(_, context),
785
+ });
897
786
  };
898
787
  const de_CreateResourceOutput = (output, context) => {
899
- return {
900
- ProgressEvent: output.ProgressEvent != null ? de_ProgressEvent(output.ProgressEvent, context) : undefined,
901
- };
788
+ return take(output, {
789
+ ProgressEvent: (_) => de_ProgressEvent(_, context),
790
+ });
902
791
  };
903
792
  const de_DeleteResourceOutput = (output, context) => {
904
- return {
905
- ProgressEvent: output.ProgressEvent != null ? de_ProgressEvent(output.ProgressEvent, context) : undefined,
906
- };
907
- };
908
- const de_GeneralServiceException = (output, context) => {
909
- return {
910
- Message: __expectString(output.Message),
911
- };
912
- };
913
- const de_GetResourceOutput = (output, context) => {
914
- return {
915
- ResourceDescription: output.ResourceDescription != null ? de_ResourceDescription(output.ResourceDescription, context) : undefined,
916
- TypeName: __expectString(output.TypeName),
917
- };
793
+ return take(output, {
794
+ ProgressEvent: (_) => de_ProgressEvent(_, context),
795
+ });
918
796
  };
919
797
  const de_GetResourceRequestStatusOutput = (output, context) => {
920
- return {
921
- ProgressEvent: output.ProgressEvent != null ? de_ProgressEvent(output.ProgressEvent, context) : undefined,
922
- };
923
- };
924
- const de_HandlerFailureException = (output, context) => {
925
- return {
926
- Message: __expectString(output.Message),
927
- };
928
- };
929
- const de_HandlerInternalFailureException = (output, context) => {
930
- return {
931
- Message: __expectString(output.Message),
932
- };
933
- };
934
- const de_InvalidCredentialsException = (output, context) => {
935
- return {
936
- Message: __expectString(output.Message),
937
- };
938
- };
939
- const de_InvalidRequestException = (output, context) => {
940
- return {
941
- Message: __expectString(output.Message),
942
- };
798
+ return take(output, {
799
+ ProgressEvent: (_) => de_ProgressEvent(_, context),
800
+ });
943
801
  };
944
802
  const de_ListResourceRequestsOutput = (output, context) => {
945
- return {
946
- NextToken: __expectString(output.NextToken),
947
- ResourceRequestStatusSummaries: output.ResourceRequestStatusSummaries != null
948
- ? de_ResourceRequestStatusSummaries(output.ResourceRequestStatusSummaries, context)
949
- : undefined,
950
- };
951
- };
952
- const de_ListResourcesOutput = (output, context) => {
953
- return {
954
- NextToken: __expectString(output.NextToken),
955
- ResourceDescriptions: output.ResourceDescriptions != null ? de_ResourceDescriptions(output.ResourceDescriptions, context) : undefined,
956
- TypeName: __expectString(output.TypeName),
957
- };
958
- };
959
- const de_NetworkFailureException = (output, context) => {
960
- return {
961
- Message: __expectString(output.Message),
962
- };
963
- };
964
- const de_NotStabilizedException = (output, context) => {
965
- return {
966
- Message: __expectString(output.Message),
967
- };
968
- };
969
- const de_NotUpdatableException = (output, context) => {
970
- return {
971
- Message: __expectString(output.Message),
972
- };
973
- };
974
- const de_PrivateTypeException = (output, context) => {
975
- return {
976
- Message: __expectString(output.Message),
977
- };
803
+ return take(output, {
804
+ NextToken: __expectString,
805
+ ResourceRequestStatusSummaries: (_) => de_ResourceRequestStatusSummaries(_, context),
806
+ });
978
807
  };
979
808
  const de_ProgressEvent = (output, context) => {
980
- return {
981
- ErrorCode: __expectString(output.ErrorCode),
982
- EventTime: output.EventTime != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.EventTime))) : undefined,
983
- Identifier: __expectString(output.Identifier),
984
- Operation: __expectString(output.Operation),
985
- OperationStatus: __expectString(output.OperationStatus),
986
- RequestToken: __expectString(output.RequestToken),
987
- ResourceModel: __expectString(output.ResourceModel),
988
- RetryAfter: output.RetryAfter != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.RetryAfter))) : undefined,
989
- StatusMessage: __expectString(output.StatusMessage),
990
- TypeName: __expectString(output.TypeName),
991
- };
992
- };
993
- const de_RequestTokenNotFoundException = (output, context) => {
994
- return {
995
- Message: __expectString(output.Message),
996
- };
997
- };
998
- const de_ResourceConflictException = (output, context) => {
999
- return {
1000
- Message: __expectString(output.Message),
1001
- };
1002
- };
1003
- const de_ResourceDescription = (output, context) => {
1004
- return {
1005
- Identifier: __expectString(output.Identifier),
1006
- Properties: __expectString(output.Properties),
1007
- };
1008
- };
1009
- const de_ResourceDescriptions = (output, context) => {
1010
- const retVal = (output || [])
1011
- .filter((e) => e != null)
1012
- .map((entry) => {
1013
- if (entry === null) {
1014
- return null;
1015
- }
1016
- return de_ResourceDescription(entry, context);
809
+ return take(output, {
810
+ ErrorCode: __expectString,
811
+ EventTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
812
+ Identifier: __expectString,
813
+ Operation: __expectString,
814
+ OperationStatus: __expectString,
815
+ RequestToken: __expectString,
816
+ ResourceModel: __expectString,
817
+ RetryAfter: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
818
+ StatusMessage: __expectString,
819
+ TypeName: __expectString,
1017
820
  });
1018
- return retVal;
1019
- };
1020
- const de_ResourceNotFoundException = (output, context) => {
1021
- return {
1022
- Message: __expectString(output.Message),
1023
- };
1024
821
  };
1025
822
  const de_ResourceRequestStatusSummaries = (output, context) => {
1026
823
  const retVal = (output || [])
1027
824
  .filter((e) => e != null)
1028
825
  .map((entry) => {
1029
- if (entry === null) {
1030
- return null;
1031
- }
1032
826
  return de_ProgressEvent(entry, context);
1033
827
  });
1034
828
  return retVal;
1035
829
  };
1036
- const de_ServiceInternalErrorException = (output, context) => {
1037
- return {
1038
- Message: __expectString(output.Message),
1039
- };
1040
- };
1041
- const de_ServiceLimitExceededException = (output, context) => {
1042
- return {
1043
- Message: __expectString(output.Message),
1044
- };
1045
- };
1046
- const de_ThrottlingException = (output, context) => {
1047
- return {
1048
- Message: __expectString(output.Message),
1049
- };
1050
- };
1051
- const de_TypeNotFoundException = (output, context) => {
1052
- return {
1053
- Message: __expectString(output.Message),
1054
- };
1055
- };
1056
- const de_UnsupportedActionException = (output, context) => {
1057
- return {
1058
- Message: __expectString(output.Message),
1059
- };
1060
- };
1061
830
  const de_UpdateResourceOutput = (output, context) => {
1062
- return {
1063
- ProgressEvent: output.ProgressEvent != null ? de_ProgressEvent(output.ProgressEvent, context) : undefined,
1064
- };
831
+ return take(output, {
832
+ ProgressEvent: (_) => de_ProgressEvent(_, context),
833
+ });
1065
834
  };
1066
835
  const deserializeMetadata = (output) => ({
1067
836
  httpStatusCode: output.statusCode,
@@ -1076,6 +845,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
1076
845
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1077
846
  };
1078
847
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
848
+ const throwDefaultError = withBaseException(__BaseException);
1079
849
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1080
850
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1081
851
  const contents = {
@@ -1094,6 +864,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
1094
864
  }
1095
865
  return new __HttpRequest(contents);
1096
866
  };
867
+ function sharedHeaders(operation) {
868
+ return {
869
+ "content-type": "application/x-amz-json-1.0",
870
+ "x-amz-target": `CloudApiService.${operation}`,
871
+ };
872
+ }
1097
873
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1098
874
  if (encoded.length) {
1099
875
  return JSON.parse(encoded);