@aws-sdk/client-oam 3.312.0 → 3.315.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, resolvedPath as __resolvedPath, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { ConflictException, InternalServiceFault, InvalidParameterException, MissingRequiredParameterException, ResourceNotFoundException, ServiceQuotaExceededException, TooManyTagsException, ValidationException, } from "../models/models_0";
4
4
  import { OAMServiceException as __BaseException } from "../models/OAMServiceException";
5
5
  export const se_CreateLinkCommand = async (input, context) => {
@@ -9,12 +9,12 @@ export const se_CreateLinkCommand = async (input, context) => {
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateLink";
11
11
  let body;
12
- body = JSON.stringify({
13
- ...(input.LabelTemplate != null && { LabelTemplate: input.LabelTemplate }),
14
- ...(input.ResourceTypes != null && { ResourceTypes: se_ResourceTypesInput(input.ResourceTypes, context) }),
15
- ...(input.SinkIdentifier != null && { SinkIdentifier: input.SinkIdentifier }),
16
- ...(input.Tags != null && { Tags: se_TagMapInput(input.Tags, context) }),
17
- });
12
+ body = JSON.stringify(take(input, {
13
+ LabelTemplate: [],
14
+ ResourceTypes: (_) => _json(_),
15
+ SinkIdentifier: [],
16
+ Tags: (_) => _json(_),
17
+ }));
18
18
  return new __HttpRequest({
19
19
  protocol,
20
20
  hostname,
@@ -32,10 +32,10 @@ export const se_CreateSinkCommand = async (input, context) => {
32
32
  };
33
33
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateSink";
34
34
  let body;
35
- body = JSON.stringify({
36
- ...(input.Name != null && { Name: input.Name }),
37
- ...(input.Tags != null && { Tags: se_TagMapInput(input.Tags, context) }),
38
- });
35
+ body = JSON.stringify(take(input, {
36
+ Name: [],
37
+ Tags: (_) => _json(_),
38
+ }));
39
39
  return new __HttpRequest({
40
40
  protocol,
41
41
  hostname,
@@ -53,9 +53,9 @@ export const se_DeleteLinkCommand = async (input, context) => {
53
53
  };
54
54
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteLink";
55
55
  let body;
56
- body = JSON.stringify({
57
- ...(input.Identifier != null && { Identifier: input.Identifier }),
58
- });
56
+ body = JSON.stringify(take(input, {
57
+ Identifier: [],
58
+ }));
59
59
  return new __HttpRequest({
60
60
  protocol,
61
61
  hostname,
@@ -73,9 +73,9 @@ export const se_DeleteSinkCommand = async (input, context) => {
73
73
  };
74
74
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteSink";
75
75
  let body;
76
- body = JSON.stringify({
77
- ...(input.Identifier != null && { Identifier: input.Identifier }),
78
- });
76
+ body = JSON.stringify(take(input, {
77
+ Identifier: [],
78
+ }));
79
79
  return new __HttpRequest({
80
80
  protocol,
81
81
  hostname,
@@ -93,9 +93,9 @@ export const se_GetLinkCommand = async (input, context) => {
93
93
  };
94
94
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetLink";
95
95
  let body;
96
- body = JSON.stringify({
97
- ...(input.Identifier != null && { Identifier: input.Identifier }),
98
- });
96
+ body = JSON.stringify(take(input, {
97
+ Identifier: [],
98
+ }));
99
99
  return new __HttpRequest({
100
100
  protocol,
101
101
  hostname,
@@ -113,9 +113,9 @@ export const se_GetSinkCommand = async (input, context) => {
113
113
  };
114
114
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetSink";
115
115
  let body;
116
- body = JSON.stringify({
117
- ...(input.Identifier != null && { Identifier: input.Identifier }),
118
- });
116
+ body = JSON.stringify(take(input, {
117
+ Identifier: [],
118
+ }));
119
119
  return new __HttpRequest({
120
120
  protocol,
121
121
  hostname,
@@ -133,9 +133,9 @@ export const se_GetSinkPolicyCommand = async (input, context) => {
133
133
  };
134
134
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetSinkPolicy";
135
135
  let body;
136
- body = JSON.stringify({
137
- ...(input.SinkIdentifier != null && { SinkIdentifier: input.SinkIdentifier }),
138
- });
136
+ body = JSON.stringify(take(input, {
137
+ SinkIdentifier: [],
138
+ }));
139
139
  return new __HttpRequest({
140
140
  protocol,
141
141
  hostname,
@@ -153,11 +153,11 @@ export const se_ListAttachedLinksCommand = async (input, context) => {
153
153
  };
154
154
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListAttachedLinks";
155
155
  let body;
156
- body = JSON.stringify({
157
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
158
- ...(input.NextToken != null && { NextToken: input.NextToken }),
159
- ...(input.SinkIdentifier != null && { SinkIdentifier: input.SinkIdentifier }),
160
- });
156
+ body = JSON.stringify(take(input, {
157
+ MaxResults: [],
158
+ NextToken: [],
159
+ SinkIdentifier: [],
160
+ }));
161
161
  return new __HttpRequest({
162
162
  protocol,
163
163
  hostname,
@@ -175,10 +175,10 @@ export const se_ListLinksCommand = async (input, context) => {
175
175
  };
176
176
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListLinks";
177
177
  let body;
178
- body = JSON.stringify({
179
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
180
- ...(input.NextToken != null && { NextToken: input.NextToken }),
181
- });
178
+ body = JSON.stringify(take(input, {
179
+ MaxResults: [],
180
+ NextToken: [],
181
+ }));
182
182
  return new __HttpRequest({
183
183
  protocol,
184
184
  hostname,
@@ -196,10 +196,10 @@ export const se_ListSinksCommand = async (input, context) => {
196
196
  };
197
197
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListSinks";
198
198
  let body;
199
- body = JSON.stringify({
200
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
201
- ...(input.NextToken != null && { NextToken: input.NextToken }),
202
- });
199
+ body = JSON.stringify(take(input, {
200
+ MaxResults: [],
201
+ NextToken: [],
202
+ }));
203
203
  return new __HttpRequest({
204
204
  protocol,
205
205
  hostname,
@@ -233,10 +233,10 @@ export const se_PutSinkPolicyCommand = async (input, context) => {
233
233
  };
234
234
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/PutSinkPolicy";
235
235
  let body;
236
- body = JSON.stringify({
237
- ...(input.Policy != null && { Policy: input.Policy }),
238
- ...(input.SinkIdentifier != null && { SinkIdentifier: input.SinkIdentifier }),
239
- });
236
+ body = JSON.stringify(take(input, {
237
+ Policy: [],
238
+ SinkIdentifier: [],
239
+ }));
240
240
  return new __HttpRequest({
241
241
  protocol,
242
242
  hostname,
@@ -255,9 +255,9 @@ export const se_TagResourceCommand = async (input, context) => {
255
255
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
256
256
  resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
257
257
  let body;
258
- body = JSON.stringify({
259
- ...(input.Tags != null && { Tags: se_TagMapInput(input.Tags, context) }),
260
- });
258
+ body = JSON.stringify(take(input, {
259
+ Tags: (_) => _json(_),
260
+ }));
261
261
  return new __HttpRequest({
262
262
  protocol,
263
263
  hostname,
@@ -298,10 +298,10 @@ export const se_UpdateLinkCommand = async (input, context) => {
298
298
  };
299
299
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateLink";
300
300
  let body;
301
- body = JSON.stringify({
302
- ...(input.Identifier != null && { Identifier: input.Identifier }),
303
- ...(input.ResourceTypes != null && { ResourceTypes: se_ResourceTypesInput(input.ResourceTypes, context) }),
304
- });
301
+ body = JSON.stringify(take(input, {
302
+ Identifier: [],
303
+ ResourceTypes: (_) => _json(_),
304
+ }));
305
305
  return new __HttpRequest({
306
306
  protocol,
307
307
  hostname,
@@ -320,27 +320,16 @@ export const de_CreateLinkCommand = async (output, context) => {
320
320
  $metadata: deserializeMetadata(output),
321
321
  });
322
322
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
323
- if (data.Arn != null) {
324
- contents.Arn = __expectString(data.Arn);
325
- }
326
- if (data.Id != null) {
327
- contents.Id = __expectString(data.Id);
328
- }
329
- if (data.Label != null) {
330
- contents.Label = __expectString(data.Label);
331
- }
332
- if (data.LabelTemplate != null) {
333
- contents.LabelTemplate = __expectString(data.LabelTemplate);
334
- }
335
- if (data.ResourceTypes != null) {
336
- contents.ResourceTypes = de_ResourceTypesOutput(data.ResourceTypes, context);
337
- }
338
- if (data.SinkArn != null) {
339
- contents.SinkArn = __expectString(data.SinkArn);
340
- }
341
- if (data.Tags != null) {
342
- contents.Tags = de_TagMapOutput(data.Tags, context);
343
- }
323
+ const doc = take(data, {
324
+ Arn: __expectString,
325
+ Id: __expectString,
326
+ Label: __expectString,
327
+ LabelTemplate: __expectString,
328
+ ResourceTypes: _json,
329
+ SinkArn: __expectString,
330
+ Tags: _json,
331
+ });
332
+ Object.assign(contents, doc);
344
333
  return contents;
345
334
  };
346
335
  const de_CreateLinkCommandError = async (output, context) => {
@@ -367,10 +356,9 @@ const de_CreateLinkCommandError = async (output, context) => {
367
356
  throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
368
357
  default:
369
358
  const parsedBody = parsedOutput.body;
370
- throwDefaultError({
359
+ return throwDefaultError({
371
360
  output,
372
361
  parsedBody,
373
- exceptionCtor: __BaseException,
374
362
  errorCode,
375
363
  });
376
364
  }
@@ -383,18 +371,13 @@ export const de_CreateSinkCommand = async (output, context) => {
383
371
  $metadata: deserializeMetadata(output),
384
372
  });
385
373
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
386
- if (data.Arn != null) {
387
- contents.Arn = __expectString(data.Arn);
388
- }
389
- if (data.Id != null) {
390
- contents.Id = __expectString(data.Id);
391
- }
392
- if (data.Name != null) {
393
- contents.Name = __expectString(data.Name);
394
- }
395
- if (data.Tags != null) {
396
- contents.Tags = de_TagMapOutput(data.Tags, context);
397
- }
374
+ const doc = take(data, {
375
+ Arn: __expectString,
376
+ Id: __expectString,
377
+ Name: __expectString,
378
+ Tags: _json,
379
+ });
380
+ Object.assign(contents, doc);
398
381
  return contents;
399
382
  };
400
383
  const de_CreateSinkCommandError = async (output, context) => {
@@ -421,10 +404,9 @@ const de_CreateSinkCommandError = async (output, context) => {
421
404
  throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
422
405
  default:
423
406
  const parsedBody = parsedOutput.body;
424
- throwDefaultError({
407
+ return throwDefaultError({
425
408
  output,
426
409
  parsedBody,
427
- exceptionCtor: __BaseException,
428
410
  errorCode,
429
411
  });
430
412
  }
@@ -460,10 +442,9 @@ const de_DeleteLinkCommandError = async (output, context) => {
460
442
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
461
443
  default:
462
444
  const parsedBody = parsedOutput.body;
463
- throwDefaultError({
445
+ return throwDefaultError({
464
446
  output,
465
447
  parsedBody,
466
- exceptionCtor: __BaseException,
467
448
  errorCode,
468
449
  });
469
450
  }
@@ -502,10 +483,9 @@ const de_DeleteSinkCommandError = async (output, context) => {
502
483
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
503
484
  default:
504
485
  const parsedBody = parsedOutput.body;
505
- throwDefaultError({
486
+ return throwDefaultError({
506
487
  output,
507
488
  parsedBody,
508
- exceptionCtor: __BaseException,
509
489
  errorCode,
510
490
  });
511
491
  }
@@ -518,27 +498,16 @@ export const de_GetLinkCommand = async (output, context) => {
518
498
  $metadata: deserializeMetadata(output),
519
499
  });
520
500
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
521
- if (data.Arn != null) {
522
- contents.Arn = __expectString(data.Arn);
523
- }
524
- if (data.Id != null) {
525
- contents.Id = __expectString(data.Id);
526
- }
527
- if (data.Label != null) {
528
- contents.Label = __expectString(data.Label);
529
- }
530
- if (data.LabelTemplate != null) {
531
- contents.LabelTemplate = __expectString(data.LabelTemplate);
532
- }
533
- if (data.ResourceTypes != null) {
534
- contents.ResourceTypes = de_ResourceTypesOutput(data.ResourceTypes, context);
535
- }
536
- if (data.SinkArn != null) {
537
- contents.SinkArn = __expectString(data.SinkArn);
538
- }
539
- if (data.Tags != null) {
540
- contents.Tags = de_TagMapOutput(data.Tags, context);
541
- }
501
+ const doc = take(data, {
502
+ Arn: __expectString,
503
+ Id: __expectString,
504
+ Label: __expectString,
505
+ LabelTemplate: __expectString,
506
+ ResourceTypes: _json,
507
+ SinkArn: __expectString,
508
+ Tags: _json,
509
+ });
510
+ Object.assign(contents, doc);
542
511
  return contents;
543
512
  };
544
513
  const de_GetLinkCommandError = async (output, context) => {
@@ -562,10 +531,9 @@ const de_GetLinkCommandError = async (output, context) => {
562
531
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
563
532
  default:
564
533
  const parsedBody = parsedOutput.body;
565
- throwDefaultError({
534
+ return throwDefaultError({
566
535
  output,
567
536
  parsedBody,
568
- exceptionCtor: __BaseException,
569
537
  errorCode,
570
538
  });
571
539
  }
@@ -578,18 +546,13 @@ export const de_GetSinkCommand = async (output, context) => {
578
546
  $metadata: deserializeMetadata(output),
579
547
  });
580
548
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
581
- if (data.Arn != null) {
582
- contents.Arn = __expectString(data.Arn);
583
- }
584
- if (data.Id != null) {
585
- contents.Id = __expectString(data.Id);
586
- }
587
- if (data.Name != null) {
588
- contents.Name = __expectString(data.Name);
589
- }
590
- if (data.Tags != null) {
591
- contents.Tags = de_TagMapOutput(data.Tags, context);
592
- }
549
+ const doc = take(data, {
550
+ Arn: __expectString,
551
+ Id: __expectString,
552
+ Name: __expectString,
553
+ Tags: _json,
554
+ });
555
+ Object.assign(contents, doc);
593
556
  return contents;
594
557
  };
595
558
  const de_GetSinkCommandError = async (output, context) => {
@@ -613,10 +576,9 @@ const de_GetSinkCommandError = async (output, context) => {
613
576
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
614
577
  default:
615
578
  const parsedBody = parsedOutput.body;
616
- throwDefaultError({
579
+ return throwDefaultError({
617
580
  output,
618
581
  parsedBody,
619
- exceptionCtor: __BaseException,
620
582
  errorCode,
621
583
  });
622
584
  }
@@ -629,15 +591,12 @@ export const de_GetSinkPolicyCommand = async (output, context) => {
629
591
  $metadata: deserializeMetadata(output),
630
592
  });
631
593
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
632
- if (data.Policy != null) {
633
- contents.Policy = __expectString(data.Policy);
634
- }
635
- if (data.SinkArn != null) {
636
- contents.SinkArn = __expectString(data.SinkArn);
637
- }
638
- if (data.SinkId != null) {
639
- contents.SinkId = __expectString(data.SinkId);
640
- }
594
+ const doc = take(data, {
595
+ Policy: __expectString,
596
+ SinkArn: __expectString,
597
+ SinkId: __expectString,
598
+ });
599
+ Object.assign(contents, doc);
641
600
  return contents;
642
601
  };
643
602
  const de_GetSinkPolicyCommandError = async (output, context) => {
@@ -661,10 +620,9 @@ const de_GetSinkPolicyCommandError = async (output, context) => {
661
620
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
662
621
  default:
663
622
  const parsedBody = parsedOutput.body;
664
- throwDefaultError({
623
+ return throwDefaultError({
665
624
  output,
666
625
  parsedBody,
667
- exceptionCtor: __BaseException,
668
626
  errorCode,
669
627
  });
670
628
  }
@@ -677,12 +635,11 @@ export const de_ListAttachedLinksCommand = async (output, context) => {
677
635
  $metadata: deserializeMetadata(output),
678
636
  });
679
637
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
680
- if (data.Items != null) {
681
- contents.Items = de_ListAttachedLinksItems(data.Items, context);
682
- }
683
- if (data.NextToken != null) {
684
- contents.NextToken = __expectString(data.NextToken);
685
- }
638
+ const doc = take(data, {
639
+ Items: _json,
640
+ NextToken: __expectString,
641
+ });
642
+ Object.assign(contents, doc);
686
643
  return contents;
687
644
  };
688
645
  const de_ListAttachedLinksCommandError = async (output, context) => {
@@ -706,10 +663,9 @@ const de_ListAttachedLinksCommandError = async (output, context) => {
706
663
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
707
664
  default:
708
665
  const parsedBody = parsedOutput.body;
709
- throwDefaultError({
666
+ return throwDefaultError({
710
667
  output,
711
668
  parsedBody,
712
- exceptionCtor: __BaseException,
713
669
  errorCode,
714
670
  });
715
671
  }
@@ -722,12 +678,11 @@ export const de_ListLinksCommand = async (output, context) => {
722
678
  $metadata: deserializeMetadata(output),
723
679
  });
724
680
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
725
- if (data.Items != null) {
726
- contents.Items = de_ListLinksItems(data.Items, context);
727
- }
728
- if (data.NextToken != null) {
729
- contents.NextToken = __expectString(data.NextToken);
730
- }
681
+ const doc = take(data, {
682
+ Items: _json,
683
+ NextToken: __expectString,
684
+ });
685
+ Object.assign(contents, doc);
731
686
  return contents;
732
687
  };
733
688
  const de_ListLinksCommandError = async (output, context) => {
@@ -748,10 +703,9 @@ const de_ListLinksCommandError = async (output, context) => {
748
703
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
749
704
  default:
750
705
  const parsedBody = parsedOutput.body;
751
- throwDefaultError({
706
+ return throwDefaultError({
752
707
  output,
753
708
  parsedBody,
754
- exceptionCtor: __BaseException,
755
709
  errorCode,
756
710
  });
757
711
  }
@@ -764,12 +718,11 @@ export const de_ListSinksCommand = async (output, context) => {
764
718
  $metadata: deserializeMetadata(output),
765
719
  });
766
720
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
767
- if (data.Items != null) {
768
- contents.Items = de_ListSinksItems(data.Items, context);
769
- }
770
- if (data.NextToken != null) {
771
- contents.NextToken = __expectString(data.NextToken);
772
- }
721
+ const doc = take(data, {
722
+ Items: _json,
723
+ NextToken: __expectString,
724
+ });
725
+ Object.assign(contents, doc);
773
726
  return contents;
774
727
  };
775
728
  const de_ListSinksCommandError = async (output, context) => {
@@ -790,10 +743,9 @@ const de_ListSinksCommandError = async (output, context) => {
790
743
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
791
744
  default:
792
745
  const parsedBody = parsedOutput.body;
793
- throwDefaultError({
746
+ return throwDefaultError({
794
747
  output,
795
748
  parsedBody,
796
- exceptionCtor: __BaseException,
797
749
  errorCode,
798
750
  });
799
751
  }
@@ -806,9 +758,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
806
758
  $metadata: deserializeMetadata(output),
807
759
  });
808
760
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
809
- if (data.Tags != null) {
810
- contents.Tags = de_TagMapOutput(data.Tags, context);
811
- }
761
+ const doc = take(data, {
762
+ Tags: _json,
763
+ });
764
+ Object.assign(contents, doc);
812
765
  return contents;
813
766
  };
814
767
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -826,10 +779,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
826
779
  throw await de_ValidationExceptionRes(parsedOutput, context);
827
780
  default:
828
781
  const parsedBody = parsedOutput.body;
829
- throwDefaultError({
782
+ return throwDefaultError({
830
783
  output,
831
784
  parsedBody,
832
- exceptionCtor: __BaseException,
833
785
  errorCode,
834
786
  });
835
787
  }
@@ -842,15 +794,12 @@ export const de_PutSinkPolicyCommand = async (output, context) => {
842
794
  $metadata: deserializeMetadata(output),
843
795
  });
844
796
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
845
- if (data.Policy != null) {
846
- contents.Policy = __expectString(data.Policy);
847
- }
848
- if (data.SinkArn != null) {
849
- contents.SinkArn = __expectString(data.SinkArn);
850
- }
851
- if (data.SinkId != null) {
852
- contents.SinkId = __expectString(data.SinkId);
853
- }
797
+ const doc = take(data, {
798
+ Policy: __expectString,
799
+ SinkArn: __expectString,
800
+ SinkId: __expectString,
801
+ });
802
+ Object.assign(contents, doc);
854
803
  return contents;
855
804
  };
856
805
  const de_PutSinkPolicyCommandError = async (output, context) => {
@@ -874,10 +823,9 @@ const de_PutSinkPolicyCommandError = async (output, context) => {
874
823
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
875
824
  default:
876
825
  const parsedBody = parsedOutput.body;
877
- throwDefaultError({
826
+ return throwDefaultError({
878
827
  output,
879
828
  parsedBody,
880
- exceptionCtor: __BaseException,
881
829
  errorCode,
882
830
  });
883
831
  }
@@ -910,10 +858,9 @@ const de_TagResourceCommandError = async (output, context) => {
910
858
  throw await de_ValidationExceptionRes(parsedOutput, context);
911
859
  default:
912
860
  const parsedBody = parsedOutput.body;
913
- throwDefaultError({
861
+ return throwDefaultError({
914
862
  output,
915
863
  parsedBody,
916
- exceptionCtor: __BaseException,
917
864
  errorCode,
918
865
  });
919
866
  }
@@ -943,10 +890,9 @@ const de_UntagResourceCommandError = async (output, context) => {
943
890
  throw await de_ValidationExceptionRes(parsedOutput, context);
944
891
  default:
945
892
  const parsedBody = parsedOutput.body;
946
- throwDefaultError({
893
+ return throwDefaultError({
947
894
  output,
948
895
  parsedBody,
949
- exceptionCtor: __BaseException,
950
896
  errorCode,
951
897
  });
952
898
  }
@@ -959,27 +905,16 @@ export const de_UpdateLinkCommand = async (output, context) => {
959
905
  $metadata: deserializeMetadata(output),
960
906
  });
961
907
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
962
- if (data.Arn != null) {
963
- contents.Arn = __expectString(data.Arn);
964
- }
965
- if (data.Id != null) {
966
- contents.Id = __expectString(data.Id);
967
- }
968
- if (data.Label != null) {
969
- contents.Label = __expectString(data.Label);
970
- }
971
- if (data.LabelTemplate != null) {
972
- contents.LabelTemplate = __expectString(data.LabelTemplate);
973
- }
974
- if (data.ResourceTypes != null) {
975
- contents.ResourceTypes = de_ResourceTypesOutput(data.ResourceTypes, context);
976
- }
977
- if (data.SinkArn != null) {
978
- contents.SinkArn = __expectString(data.SinkArn);
979
- }
980
- if (data.Tags != null) {
981
- contents.Tags = de_TagMapOutput(data.Tags, context);
982
- }
908
+ const doc = take(data, {
909
+ Arn: __expectString,
910
+ Id: __expectString,
911
+ Label: __expectString,
912
+ LabelTemplate: __expectString,
913
+ ResourceTypes: _json,
914
+ SinkArn: __expectString,
915
+ Tags: _json,
916
+ });
917
+ Object.assign(contents, doc);
983
918
  return contents;
984
919
  };
985
920
  const de_UpdateLinkCommandError = async (output, context) => {
@@ -1003,23 +938,23 @@ const de_UpdateLinkCommandError = async (output, context) => {
1003
938
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1004
939
  default:
1005
940
  const parsedBody = parsedOutput.body;
1006
- throwDefaultError({
941
+ return throwDefaultError({
1007
942
  output,
1008
943
  parsedBody,
1009
- exceptionCtor: __BaseException,
1010
944
  errorCode,
1011
945
  });
1012
946
  }
1013
947
  };
1014
- const map = __map;
948
+ const throwDefaultError = withBaseException(__BaseException);
1015
949
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
1016
950
  const contents = map({
1017
951
  amznErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1018
952
  });
1019
953
  const data = parsedOutput.body;
1020
- if (data.Message != null) {
1021
- contents.Message = __expectString(data.Message);
1022
- }
954
+ const doc = take(data, {
955
+ Message: __expectString,
956
+ });
957
+ Object.assign(contents, doc);
1023
958
  const exception = new ConflictException({
1024
959
  $metadata: deserializeMetadata(parsedOutput),
1025
960
  ...contents,
@@ -1031,9 +966,10 @@ const de_InternalServiceFaultRes = async (parsedOutput, context) => {
1031
966
  amznErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1032
967
  });
1033
968
  const data = parsedOutput.body;
1034
- if (data.Message != null) {
1035
- contents.Message = __expectString(data.Message);
1036
- }
969
+ const doc = take(data, {
970
+ Message: __expectString,
971
+ });
972
+ Object.assign(contents, doc);
1037
973
  const exception = new InternalServiceFault({
1038
974
  $metadata: deserializeMetadata(parsedOutput),
1039
975
  ...contents,
@@ -1045,9 +981,10 @@ const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
1045
981
  amznErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1046
982
  });
1047
983
  const data = parsedOutput.body;
1048
- if (data.message != null) {
1049
- contents.message = __expectString(data.message);
1050
- }
984
+ const doc = take(data, {
985
+ message: __expectString,
986
+ });
987
+ Object.assign(contents, doc);
1051
988
  const exception = new InvalidParameterException({
1052
989
  $metadata: deserializeMetadata(parsedOutput),
1053
990
  ...contents,
@@ -1059,9 +996,10 @@ const de_MissingRequiredParameterExceptionRes = async (parsedOutput, context) =>
1059
996
  amznErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1060
997
  });
1061
998
  const data = parsedOutput.body;
1062
- if (data.message != null) {
1063
- contents.message = __expectString(data.message);
1064
- }
999
+ const doc = take(data, {
1000
+ message: __expectString,
1001
+ });
1002
+ Object.assign(contents, doc);
1065
1003
  const exception = new MissingRequiredParameterException({
1066
1004
  $metadata: deserializeMetadata(parsedOutput),
1067
1005
  ...contents,
@@ -1073,9 +1011,10 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1073
1011
  amznErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1074
1012
  });
1075
1013
  const data = parsedOutput.body;
1076
- if (data.Message != null) {
1077
- contents.Message = __expectString(data.Message);
1078
- }
1014
+ const doc = take(data, {
1015
+ Message: __expectString,
1016
+ });
1017
+ Object.assign(contents, doc);
1079
1018
  const exception = new ResourceNotFoundException({
1080
1019
  $metadata: deserializeMetadata(parsedOutput),
1081
1020
  ...contents,
@@ -1087,9 +1026,10 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1087
1026
  amznErrorType: [, parsedOutput.headers["x-amzn-errortype"]],
1088
1027
  });
1089
1028
  const data = parsedOutput.body;
1090
- if (data.Message != null) {
1091
- contents.Message = __expectString(data.Message);
1092
- }
1029
+ const doc = take(data, {
1030
+ Message: __expectString,
1031
+ });
1032
+ Object.assign(contents, doc);
1093
1033
  const exception = new ServiceQuotaExceededException({
1094
1034
  $metadata: deserializeMetadata(parsedOutput),
1095
1035
  ...contents,
@@ -1099,9 +1039,10 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1099
1039
  const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
1100
1040
  const contents = map({});
1101
1041
  const data = parsedOutput.body;
1102
- if (data.Message != null) {
1103
- contents.Message = __expectString(data.Message);
1104
- }
1042
+ const doc = take(data, {
1043
+ Message: __expectString,
1044
+ });
1045
+ Object.assign(contents, doc);
1105
1046
  const exception = new TooManyTagsException({
1106
1047
  $metadata: deserializeMetadata(parsedOutput),
1107
1048
  ...contents,
@@ -1111,107 +1052,16 @@ const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
1111
1052
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
1112
1053
  const contents = map({});
1113
1054
  const data = parsedOutput.body;
1114
- if (data.Message != null) {
1115
- contents.Message = __expectString(data.Message);
1116
- }
1055
+ const doc = take(data, {
1056
+ Message: __expectString,
1057
+ });
1058
+ Object.assign(contents, doc);
1117
1059
  const exception = new ValidationException({
1118
1060
  $metadata: deserializeMetadata(parsedOutput),
1119
1061
  ...contents,
1120
1062
  });
1121
1063
  return __decorateServiceException(exception, parsedOutput.body);
1122
1064
  };
1123
- const se_ResourceTypesInput = (input, context) => {
1124
- return input
1125
- .filter((e) => e != null)
1126
- .map((entry) => {
1127
- return entry;
1128
- });
1129
- };
1130
- const se_TagMapInput = (input, context) => {
1131
- return Object.entries(input).reduce((acc, [key, value]) => {
1132
- if (value === null) {
1133
- return acc;
1134
- }
1135
- acc[key] = value;
1136
- return acc;
1137
- }, {});
1138
- };
1139
- const de_ListAttachedLinksItem = (output, context) => {
1140
- return {
1141
- Label: __expectString(output.Label),
1142
- LinkArn: __expectString(output.LinkArn),
1143
- ResourceTypes: output.ResourceTypes != null ? de_ResourceTypesOutput(output.ResourceTypes, context) : undefined,
1144
- };
1145
- };
1146
- const de_ListAttachedLinksItems = (output, context) => {
1147
- const retVal = (output || [])
1148
- .filter((e) => e != null)
1149
- .map((entry) => {
1150
- if (entry === null) {
1151
- return null;
1152
- }
1153
- return de_ListAttachedLinksItem(entry, context);
1154
- });
1155
- return retVal;
1156
- };
1157
- const de_ListLinksItem = (output, context) => {
1158
- return {
1159
- Arn: __expectString(output.Arn),
1160
- Id: __expectString(output.Id),
1161
- Label: __expectString(output.Label),
1162
- ResourceTypes: output.ResourceTypes != null ? de_ResourceTypesOutput(output.ResourceTypes, context) : undefined,
1163
- SinkArn: __expectString(output.SinkArn),
1164
- };
1165
- };
1166
- const de_ListLinksItems = (output, context) => {
1167
- const retVal = (output || [])
1168
- .filter((e) => e != null)
1169
- .map((entry) => {
1170
- if (entry === null) {
1171
- return null;
1172
- }
1173
- return de_ListLinksItem(entry, context);
1174
- });
1175
- return retVal;
1176
- };
1177
- const de_ListSinksItem = (output, context) => {
1178
- return {
1179
- Arn: __expectString(output.Arn),
1180
- Id: __expectString(output.Id),
1181
- Name: __expectString(output.Name),
1182
- };
1183
- };
1184
- const de_ListSinksItems = (output, context) => {
1185
- const retVal = (output || [])
1186
- .filter((e) => e != null)
1187
- .map((entry) => {
1188
- if (entry === null) {
1189
- return null;
1190
- }
1191
- return de_ListSinksItem(entry, context);
1192
- });
1193
- return retVal;
1194
- };
1195
- const de_ResourceTypesOutput = (output, context) => {
1196
- const retVal = (output || [])
1197
- .filter((e) => e != null)
1198
- .map((entry) => {
1199
- if (entry === null) {
1200
- return null;
1201
- }
1202
- return __expectString(entry);
1203
- });
1204
- return retVal;
1205
- };
1206
- const de_TagMapOutput = (output, context) => {
1207
- return Object.entries(output).reduce((acc, [key, value]) => {
1208
- if (value === null) {
1209
- return acc;
1210
- }
1211
- acc[key] = __expectString(value);
1212
- return acc;
1213
- }, {});
1214
- };
1215
1065
  const deserializeMetadata = (output) => ({
1216
1066
  httpStatusCode: output.statusCode,
1217
1067
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],