@aws-sdk/client-appintegrations 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 { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { AppIntegrationsServiceException as __BaseException } from "../models/AppIntegrationsServiceException";
5
5
  import { AccessDeniedException, DuplicateResourceException, InternalServiceError, InvalidRequestException, ResourceNotFoundException, ResourceQuotaExceededException, ThrottlingException, } from "../models/models_0";
@@ -10,21 +10,17 @@ export const se_CreateDataIntegrationCommand = async (input, context) => {
10
10
  };
11
11
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/dataIntegrations";
12
12
  let body;
13
- body = JSON.stringify({
14
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
15
- ...(input.Description != null && { Description: input.Description }),
16
- ...(input.FileConfiguration != null && {
17
- FileConfiguration: se_FileConfiguration(input.FileConfiguration, context),
18
- }),
19
- ...(input.KmsKey != null && { KmsKey: input.KmsKey }),
20
- ...(input.Name != null && { Name: input.Name }),
21
- ...(input.ObjectConfiguration != null && {
22
- ObjectConfiguration: se_ObjectConfiguration(input.ObjectConfiguration, context),
23
- }),
24
- ...(input.ScheduleConfig != null && { ScheduleConfig: se_ScheduleConfiguration(input.ScheduleConfig, context) }),
25
- ...(input.SourceURI != null && { SourceURI: input.SourceURI }),
26
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
27
- });
13
+ body = JSON.stringify(take(input, {
14
+ ClientToken: (_) => _ ?? generateIdempotencyToken(),
15
+ Description: [],
16
+ FileConfiguration: (_) => _json(_),
17
+ KmsKey: [],
18
+ Name: [],
19
+ ObjectConfiguration: (_) => _json(_),
20
+ ScheduleConfig: (_) => _json(_),
21
+ SourceURI: [],
22
+ Tags: (_) => _json(_),
23
+ }));
28
24
  return new __HttpRequest({
29
25
  protocol,
30
26
  hostname,
@@ -42,14 +38,14 @@ export const se_CreateEventIntegrationCommand = async (input, context) => {
42
38
  };
43
39
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/eventIntegrations";
44
40
  let body;
45
- body = JSON.stringify({
46
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
47
- ...(input.Description != null && { Description: input.Description }),
48
- ...(input.EventBridgeBus != null && { EventBridgeBus: input.EventBridgeBus }),
49
- ...(input.EventFilter != null && { EventFilter: se_EventFilter(input.EventFilter, context) }),
50
- ...(input.Name != null && { Name: input.Name }),
51
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
52
- });
41
+ body = JSON.stringify(take(input, {
42
+ ClientToken: (_) => _ ?? generateIdempotencyToken(),
43
+ Description: [],
44
+ EventBridgeBus: [],
45
+ EventFilter: (_) => _json(_),
46
+ Name: [],
47
+ Tags: (_) => _json(_),
48
+ }));
53
49
  return new __HttpRequest({
54
50
  protocol,
55
51
  hostname,
@@ -233,9 +229,9 @@ export const se_TagResourceCommand = async (input, context) => {
233
229
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
234
230
  resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
235
231
  let body;
236
- body = JSON.stringify({
237
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
238
- });
232
+ body = JSON.stringify(take(input, {
233
+ tags: (_) => _json(_),
234
+ }));
239
235
  return new __HttpRequest({
240
236
  protocol,
241
237
  hostname,
@@ -277,10 +273,10 @@ export const se_UpdateDataIntegrationCommand = async (input, context) => {
277
273
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/dataIntegrations/{Identifier}";
278
274
  resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
279
275
  let body;
280
- body = JSON.stringify({
281
- ...(input.Description != null && { Description: input.Description }),
282
- ...(input.Name != null && { Name: input.Name }),
283
- });
276
+ body = JSON.stringify(take(input, {
277
+ Description: [],
278
+ Name: [],
279
+ }));
284
280
  return new __HttpRequest({
285
281
  protocol,
286
282
  hostname,
@@ -299,9 +295,9 @@ export const se_UpdateEventIntegrationCommand = async (input, context) => {
299
295
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/eventIntegrations/{Name}";
300
296
  resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
301
297
  let body;
302
- body = JSON.stringify({
303
- ...(input.Description != null && { Description: input.Description }),
304
- });
298
+ body = JSON.stringify(take(input, {
299
+ Description: [],
300
+ }));
305
301
  return new __HttpRequest({
306
302
  protocol,
307
303
  hostname,
@@ -320,39 +316,20 @@ export const de_CreateDataIntegrationCommand = async (output, context) => {
320
316
  $metadata: deserializeMetadata(output),
321
317
  });
322
318
  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.ClientToken != null) {
327
- contents.ClientToken = __expectString(data.ClientToken);
328
- }
329
- if (data.Description != null) {
330
- contents.Description = __expectString(data.Description);
331
- }
332
- if (data.FileConfiguration != null) {
333
- contents.FileConfiguration = de_FileConfiguration(data.FileConfiguration, context);
334
- }
335
- if (data.Id != null) {
336
- contents.Id = __expectString(data.Id);
337
- }
338
- if (data.KmsKey != null) {
339
- contents.KmsKey = __expectString(data.KmsKey);
340
- }
341
- if (data.Name != null) {
342
- contents.Name = __expectString(data.Name);
343
- }
344
- if (data.ObjectConfiguration != null) {
345
- contents.ObjectConfiguration = de_ObjectConfiguration(data.ObjectConfiguration, context);
346
- }
347
- if (data.ScheduleConfiguration != null) {
348
- contents.ScheduleConfiguration = de_ScheduleConfiguration(data.ScheduleConfiguration, context);
349
- }
350
- if (data.SourceURI != null) {
351
- contents.SourceURI = __expectString(data.SourceURI);
352
- }
353
- if (data.Tags != null) {
354
- contents.Tags = de_TagMap(data.Tags, context);
355
- }
319
+ const doc = take(data, {
320
+ Arn: __expectString,
321
+ ClientToken: __expectString,
322
+ Description: __expectString,
323
+ FileConfiguration: _json,
324
+ Id: __expectString,
325
+ KmsKey: __expectString,
326
+ Name: __expectString,
327
+ ObjectConfiguration: _json,
328
+ ScheduleConfiguration: _json,
329
+ SourceURI: __expectString,
330
+ Tags: _json,
331
+ });
332
+ Object.assign(contents, doc);
356
333
  return contents;
357
334
  };
358
335
  const de_CreateDataIntegrationCommandError = async (output, context) => {
@@ -382,10 +359,9 @@ const de_CreateDataIntegrationCommandError = async (output, context) => {
382
359
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
383
360
  default:
384
361
  const parsedBody = parsedOutput.body;
385
- throwDefaultError({
362
+ return throwDefaultError({
386
363
  output,
387
364
  parsedBody,
388
- exceptionCtor: __BaseException,
389
365
  errorCode,
390
366
  });
391
367
  }
@@ -398,9 +374,10 @@ export const de_CreateEventIntegrationCommand = async (output, context) => {
398
374
  $metadata: deserializeMetadata(output),
399
375
  });
400
376
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
401
- if (data.EventIntegrationArn != null) {
402
- contents.EventIntegrationArn = __expectString(data.EventIntegrationArn);
403
- }
377
+ const doc = take(data, {
378
+ EventIntegrationArn: __expectString,
379
+ });
380
+ Object.assign(contents, doc);
404
381
  return contents;
405
382
  };
406
383
  const de_CreateEventIntegrationCommandError = async (output, context) => {
@@ -430,10 +407,9 @@ const de_CreateEventIntegrationCommandError = async (output, context) => {
430
407
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
431
408
  default:
432
409
  const parsedBody = parsedOutput.body;
433
- throwDefaultError({
410
+ return throwDefaultError({
434
411
  output,
435
412
  parsedBody,
436
- exceptionCtor: __BaseException,
437
413
  errorCode,
438
414
  });
439
415
  }
@@ -472,10 +448,9 @@ const de_DeleteDataIntegrationCommandError = async (output, context) => {
472
448
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
473
449
  default:
474
450
  const parsedBody = parsedOutput.body;
475
- throwDefaultError({
451
+ return throwDefaultError({
476
452
  output,
477
453
  parsedBody,
478
- exceptionCtor: __BaseException,
479
454
  errorCode,
480
455
  });
481
456
  }
@@ -514,10 +489,9 @@ const de_DeleteEventIntegrationCommandError = async (output, context) => {
514
489
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
515
490
  default:
516
491
  const parsedBody = parsedOutput.body;
517
- throwDefaultError({
492
+ return throwDefaultError({
518
493
  output,
519
494
  parsedBody,
520
- exceptionCtor: __BaseException,
521
495
  errorCode,
522
496
  });
523
497
  }
@@ -530,36 +504,19 @@ export const de_GetDataIntegrationCommand = async (output, context) => {
530
504
  $metadata: deserializeMetadata(output),
531
505
  });
532
506
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
533
- if (data.Arn != null) {
534
- contents.Arn = __expectString(data.Arn);
535
- }
536
- if (data.Description != null) {
537
- contents.Description = __expectString(data.Description);
538
- }
539
- if (data.FileConfiguration != null) {
540
- contents.FileConfiguration = de_FileConfiguration(data.FileConfiguration, context);
541
- }
542
- if (data.Id != null) {
543
- contents.Id = __expectString(data.Id);
544
- }
545
- if (data.KmsKey != null) {
546
- contents.KmsKey = __expectString(data.KmsKey);
547
- }
548
- if (data.Name != null) {
549
- contents.Name = __expectString(data.Name);
550
- }
551
- if (data.ObjectConfiguration != null) {
552
- contents.ObjectConfiguration = de_ObjectConfiguration(data.ObjectConfiguration, context);
553
- }
554
- if (data.ScheduleConfiguration != null) {
555
- contents.ScheduleConfiguration = de_ScheduleConfiguration(data.ScheduleConfiguration, context);
556
- }
557
- if (data.SourceURI != null) {
558
- contents.SourceURI = __expectString(data.SourceURI);
559
- }
560
- if (data.Tags != null) {
561
- contents.Tags = de_TagMap(data.Tags, context);
562
- }
507
+ const doc = take(data, {
508
+ Arn: __expectString,
509
+ Description: __expectString,
510
+ FileConfiguration: _json,
511
+ Id: __expectString,
512
+ KmsKey: __expectString,
513
+ Name: __expectString,
514
+ ObjectConfiguration: _json,
515
+ ScheduleConfiguration: _json,
516
+ SourceURI: __expectString,
517
+ Tags: _json,
518
+ });
519
+ Object.assign(contents, doc);
563
520
  return contents;
564
521
  };
565
522
  const de_GetDataIntegrationCommandError = async (output, context) => {
@@ -586,10 +543,9 @@ const de_GetDataIntegrationCommandError = async (output, context) => {
586
543
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
587
544
  default:
588
545
  const parsedBody = parsedOutput.body;
589
- throwDefaultError({
546
+ return throwDefaultError({
590
547
  output,
591
548
  parsedBody,
592
- exceptionCtor: __BaseException,
593
549
  errorCode,
594
550
  });
595
551
  }
@@ -602,24 +558,15 @@ export const de_GetEventIntegrationCommand = async (output, context) => {
602
558
  $metadata: deserializeMetadata(output),
603
559
  });
604
560
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
605
- if (data.Description != null) {
606
- contents.Description = __expectString(data.Description);
607
- }
608
- if (data.EventBridgeBus != null) {
609
- contents.EventBridgeBus = __expectString(data.EventBridgeBus);
610
- }
611
- if (data.EventFilter != null) {
612
- contents.EventFilter = de_EventFilter(data.EventFilter, context);
613
- }
614
- if (data.EventIntegrationArn != null) {
615
- contents.EventIntegrationArn = __expectString(data.EventIntegrationArn);
616
- }
617
- if (data.Name != null) {
618
- contents.Name = __expectString(data.Name);
619
- }
620
- if (data.Tags != null) {
621
- contents.Tags = de_TagMap(data.Tags, context);
622
- }
561
+ const doc = take(data, {
562
+ Description: __expectString,
563
+ EventBridgeBus: __expectString,
564
+ EventFilter: _json,
565
+ EventIntegrationArn: __expectString,
566
+ Name: __expectString,
567
+ Tags: _json,
568
+ });
569
+ Object.assign(contents, doc);
623
570
  return contents;
624
571
  };
625
572
  const de_GetEventIntegrationCommandError = async (output, context) => {
@@ -646,10 +593,9 @@ const de_GetEventIntegrationCommandError = async (output, context) => {
646
593
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
647
594
  default:
648
595
  const parsedBody = parsedOutput.body;
649
- throwDefaultError({
596
+ return throwDefaultError({
650
597
  output,
651
598
  parsedBody,
652
- exceptionCtor: __BaseException,
653
599
  errorCode,
654
600
  });
655
601
  }
@@ -662,12 +608,11 @@ export const de_ListDataIntegrationAssociationsCommand = async (output, context)
662
608
  $metadata: deserializeMetadata(output),
663
609
  });
664
610
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
665
- if (data.DataIntegrationAssociations != null) {
666
- contents.DataIntegrationAssociations = de_DataIntegrationAssociationsList(data.DataIntegrationAssociations, context);
667
- }
668
- if (data.NextToken != null) {
669
- contents.NextToken = __expectString(data.NextToken);
670
- }
611
+ const doc = take(data, {
612
+ DataIntegrationAssociations: _json,
613
+ NextToken: __expectString,
614
+ });
615
+ Object.assign(contents, doc);
671
616
  return contents;
672
617
  };
673
618
  const de_ListDataIntegrationAssociationsCommandError = async (output, context) => {
@@ -694,10 +639,9 @@ const de_ListDataIntegrationAssociationsCommandError = async (output, context) =
694
639
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
695
640
  default:
696
641
  const parsedBody = parsedOutput.body;
697
- throwDefaultError({
642
+ return throwDefaultError({
698
643
  output,
699
644
  parsedBody,
700
- exceptionCtor: __BaseException,
701
645
  errorCode,
702
646
  });
703
647
  }
@@ -710,12 +654,11 @@ export const de_ListDataIntegrationsCommand = async (output, context) => {
710
654
  $metadata: deserializeMetadata(output),
711
655
  });
712
656
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
713
- if (data.DataIntegrations != null) {
714
- contents.DataIntegrations = de_DataIntegrationsList(data.DataIntegrations, context);
715
- }
716
- if (data.NextToken != null) {
717
- contents.NextToken = __expectString(data.NextToken);
718
- }
657
+ const doc = take(data, {
658
+ DataIntegrations: _json,
659
+ NextToken: __expectString,
660
+ });
661
+ Object.assign(contents, doc);
719
662
  return contents;
720
663
  };
721
664
  const de_ListDataIntegrationsCommandError = async (output, context) => {
@@ -739,10 +682,9 @@ const de_ListDataIntegrationsCommandError = async (output, context) => {
739
682
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
740
683
  default:
741
684
  const parsedBody = parsedOutput.body;
742
- throwDefaultError({
685
+ return throwDefaultError({
743
686
  output,
744
687
  parsedBody,
745
- exceptionCtor: __BaseException,
746
688
  errorCode,
747
689
  });
748
690
  }
@@ -755,12 +697,11 @@ export const de_ListEventIntegrationAssociationsCommand = async (output, context
755
697
  $metadata: deserializeMetadata(output),
756
698
  });
757
699
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
758
- if (data.EventIntegrationAssociations != null) {
759
- contents.EventIntegrationAssociations = de_EventIntegrationAssociationsList(data.EventIntegrationAssociations, context);
760
- }
761
- if (data.NextToken != null) {
762
- contents.NextToken = __expectString(data.NextToken);
763
- }
700
+ const doc = take(data, {
701
+ EventIntegrationAssociations: _json,
702
+ NextToken: __expectString,
703
+ });
704
+ Object.assign(contents, doc);
764
705
  return contents;
765
706
  };
766
707
  const de_ListEventIntegrationAssociationsCommandError = async (output, context) => {
@@ -787,10 +728,9 @@ const de_ListEventIntegrationAssociationsCommandError = async (output, context)
787
728
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
788
729
  default:
789
730
  const parsedBody = parsedOutput.body;
790
- throwDefaultError({
731
+ return throwDefaultError({
791
732
  output,
792
733
  parsedBody,
793
- exceptionCtor: __BaseException,
794
734
  errorCode,
795
735
  });
796
736
  }
@@ -803,12 +743,11 @@ export const de_ListEventIntegrationsCommand = async (output, context) => {
803
743
  $metadata: deserializeMetadata(output),
804
744
  });
805
745
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
806
- if (data.EventIntegrations != null) {
807
- contents.EventIntegrations = de_EventIntegrationsList(data.EventIntegrations, context);
808
- }
809
- if (data.NextToken != null) {
810
- contents.NextToken = __expectString(data.NextToken);
811
- }
746
+ const doc = take(data, {
747
+ EventIntegrations: _json,
748
+ NextToken: __expectString,
749
+ });
750
+ Object.assign(contents, doc);
812
751
  return contents;
813
752
  };
814
753
  const de_ListEventIntegrationsCommandError = async (output, context) => {
@@ -832,10 +771,9 @@ const de_ListEventIntegrationsCommandError = async (output, context) => {
832
771
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
833
772
  default:
834
773
  const parsedBody = parsedOutput.body;
835
- throwDefaultError({
774
+ return throwDefaultError({
836
775
  output,
837
776
  parsedBody,
838
- exceptionCtor: __BaseException,
839
777
  errorCode,
840
778
  });
841
779
  }
@@ -848,9 +786,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
848
786
  $metadata: deserializeMetadata(output),
849
787
  });
850
788
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
851
- if (data.tags != null) {
852
- contents.tags = de_TagMap(data.tags, context);
853
- }
789
+ const doc = take(data, {
790
+ tags: _json,
791
+ });
792
+ Object.assign(contents, doc);
854
793
  return contents;
855
794
  };
856
795
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -874,10 +813,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
874
813
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
875
814
  default:
876
815
  const parsedBody = parsedOutput.body;
877
- throwDefaultError({
816
+ return throwDefaultError({
878
817
  output,
879
818
  parsedBody,
880
- exceptionCtor: __BaseException,
881
819
  errorCode,
882
820
  });
883
821
  }
@@ -913,10 +851,9 @@ const de_TagResourceCommandError = async (output, context) => {
913
851
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
914
852
  default:
915
853
  const parsedBody = parsedOutput.body;
916
- throwDefaultError({
854
+ return throwDefaultError({
917
855
  output,
918
856
  parsedBody,
919
- exceptionCtor: __BaseException,
920
857
  errorCode,
921
858
  });
922
859
  }
@@ -952,10 +889,9 @@ const de_UntagResourceCommandError = async (output, context) => {
952
889
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
953
890
  default:
954
891
  const parsedBody = parsedOutput.body;
955
- throwDefaultError({
892
+ return throwDefaultError({
956
893
  output,
957
894
  parsedBody,
958
- exceptionCtor: __BaseException,
959
895
  errorCode,
960
896
  });
961
897
  }
@@ -994,10 +930,9 @@ const de_UpdateDataIntegrationCommandError = async (output, context) => {
994
930
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
995
931
  default:
996
932
  const parsedBody = parsedOutput.body;
997
- throwDefaultError({
933
+ return throwDefaultError({
998
934
  output,
999
935
  parsedBody,
1000
- exceptionCtor: __BaseException,
1001
936
  errorCode,
1002
937
  });
1003
938
  }
@@ -1036,21 +971,21 @@ const de_UpdateEventIntegrationCommandError = async (output, context) => {
1036
971
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
1037
972
  default:
1038
973
  const parsedBody = parsedOutput.body;
1039
- throwDefaultError({
974
+ return throwDefaultError({
1040
975
  output,
1041
976
  parsedBody,
1042
- exceptionCtor: __BaseException,
1043
977
  errorCode,
1044
978
  });
1045
979
  }
1046
980
  };
1047
- const map = __map;
981
+ const throwDefaultError = withBaseException(__BaseException);
1048
982
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1049
983
  const contents = map({});
1050
984
  const data = parsedOutput.body;
1051
- if (data.Message != null) {
1052
- contents.Message = __expectString(data.Message);
1053
- }
985
+ const doc = take(data, {
986
+ Message: __expectString,
987
+ });
988
+ Object.assign(contents, doc);
1054
989
  const exception = new AccessDeniedException({
1055
990
  $metadata: deserializeMetadata(parsedOutput),
1056
991
  ...contents,
@@ -1060,9 +995,10 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1060
995
  const de_DuplicateResourceExceptionRes = async (parsedOutput, context) => {
1061
996
  const contents = map({});
1062
997
  const data = parsedOutput.body;
1063
- if (data.Message != null) {
1064
- contents.Message = __expectString(data.Message);
1065
- }
998
+ const doc = take(data, {
999
+ Message: __expectString,
1000
+ });
1001
+ Object.assign(contents, doc);
1066
1002
  const exception = new DuplicateResourceException({
1067
1003
  $metadata: deserializeMetadata(parsedOutput),
1068
1004
  ...contents,
@@ -1072,9 +1008,10 @@ const de_DuplicateResourceExceptionRes = async (parsedOutput, context) => {
1072
1008
  const de_InternalServiceErrorRes = async (parsedOutput, context) => {
1073
1009
  const contents = map({});
1074
1010
  const data = parsedOutput.body;
1075
- if (data.Message != null) {
1076
- contents.Message = __expectString(data.Message);
1077
- }
1011
+ const doc = take(data, {
1012
+ Message: __expectString,
1013
+ });
1014
+ Object.assign(contents, doc);
1078
1015
  const exception = new InternalServiceError({
1079
1016
  $metadata: deserializeMetadata(parsedOutput),
1080
1017
  ...contents,
@@ -1084,9 +1021,10 @@ const de_InternalServiceErrorRes = async (parsedOutput, context) => {
1084
1021
  const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
1085
1022
  const contents = map({});
1086
1023
  const data = parsedOutput.body;
1087
- if (data.Message != null) {
1088
- contents.Message = __expectString(data.Message);
1089
- }
1024
+ const doc = take(data, {
1025
+ Message: __expectString,
1026
+ });
1027
+ Object.assign(contents, doc);
1090
1028
  const exception = new InvalidRequestException({
1091
1029
  $metadata: deserializeMetadata(parsedOutput),
1092
1030
  ...contents,
@@ -1096,9 +1034,10 @@ const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
1096
1034
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1097
1035
  const contents = map({});
1098
1036
  const data = parsedOutput.body;
1099
- if (data.Message != null) {
1100
- contents.Message = __expectString(data.Message);
1101
- }
1037
+ const doc = take(data, {
1038
+ Message: __expectString,
1039
+ });
1040
+ Object.assign(contents, doc);
1102
1041
  const exception = new ResourceNotFoundException({
1103
1042
  $metadata: deserializeMetadata(parsedOutput),
1104
1043
  ...contents,
@@ -1108,9 +1047,10 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1108
1047
  const de_ResourceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1109
1048
  const contents = map({});
1110
1049
  const data = parsedOutput.body;
1111
- if (data.Message != null) {
1112
- contents.Message = __expectString(data.Message);
1113
- }
1050
+ const doc = take(data, {
1051
+ Message: __expectString,
1052
+ });
1053
+ Object.assign(contents, doc);
1114
1054
  const exception = new ResourceQuotaExceededException({
1115
1055
  $metadata: deserializeMetadata(parsedOutput),
1116
1056
  ...contents,
@@ -1120,230 +1060,16 @@ const de_ResourceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1120
1060
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1121
1061
  const contents = map({});
1122
1062
  const data = parsedOutput.body;
1123
- if (data.Message != null) {
1124
- contents.Message = __expectString(data.Message);
1125
- }
1063
+ const doc = take(data, {
1064
+ Message: __expectString,
1065
+ });
1066
+ Object.assign(contents, doc);
1126
1067
  const exception = new ThrottlingException({
1127
1068
  $metadata: deserializeMetadata(parsedOutput),
1128
1069
  ...contents,
1129
1070
  });
1130
1071
  return __decorateServiceException(exception, parsedOutput.body);
1131
1072
  };
1132
- const se_EventFilter = (input, context) => {
1133
- return {
1134
- ...(input.Source != null && { Source: input.Source }),
1135
- };
1136
- };
1137
- const se_FieldsList = (input, context) => {
1138
- return input
1139
- .filter((e) => e != null)
1140
- .map((entry) => {
1141
- return entry;
1142
- });
1143
- };
1144
- const se_FieldsMap = (input, context) => {
1145
- return Object.entries(input).reduce((acc, [key, value]) => {
1146
- if (value === null) {
1147
- return acc;
1148
- }
1149
- acc[key] = se_FieldsList(value, context);
1150
- return acc;
1151
- }, {});
1152
- };
1153
- const se_FileConfiguration = (input, context) => {
1154
- return {
1155
- ...(input.Filters != null && { Filters: se_FieldsMap(input.Filters, context) }),
1156
- ...(input.Folders != null && { Folders: se_FolderList(input.Folders, context) }),
1157
- };
1158
- };
1159
- const se_FolderList = (input, context) => {
1160
- return input
1161
- .filter((e) => e != null)
1162
- .map((entry) => {
1163
- return entry;
1164
- });
1165
- };
1166
- const se_ObjectConfiguration = (input, context) => {
1167
- return Object.entries(input).reduce((acc, [key, value]) => {
1168
- if (value === null) {
1169
- return acc;
1170
- }
1171
- acc[key] = se_FieldsMap(value, context);
1172
- return acc;
1173
- }, {});
1174
- };
1175
- const se_ScheduleConfiguration = (input, context) => {
1176
- return {
1177
- ...(input.FirstExecutionFrom != null && { FirstExecutionFrom: input.FirstExecutionFrom }),
1178
- ...(input.Object != null && { Object: input.Object }),
1179
- ...(input.ScheduleExpression != null && { ScheduleExpression: input.ScheduleExpression }),
1180
- };
1181
- };
1182
- const se_TagMap = (input, context) => {
1183
- return Object.entries(input).reduce((acc, [key, value]) => {
1184
- if (value === null) {
1185
- return acc;
1186
- }
1187
- acc[key] = value;
1188
- return acc;
1189
- }, {});
1190
- };
1191
- const de_ClientAssociationMetadata = (output, context) => {
1192
- return Object.entries(output).reduce((acc, [key, value]) => {
1193
- if (value === null) {
1194
- return acc;
1195
- }
1196
- acc[key] = __expectString(value);
1197
- return acc;
1198
- }, {});
1199
- };
1200
- const de_DataIntegrationAssociationsList = (output, context) => {
1201
- const retVal = (output || [])
1202
- .filter((e) => e != null)
1203
- .map((entry) => {
1204
- if (entry === null) {
1205
- return null;
1206
- }
1207
- return de_DataIntegrationAssociationSummary(entry, context);
1208
- });
1209
- return retVal;
1210
- };
1211
- const de_DataIntegrationAssociationSummary = (output, context) => {
1212
- return {
1213
- ClientId: __expectString(output.ClientId),
1214
- DataIntegrationArn: __expectString(output.DataIntegrationArn),
1215
- DataIntegrationAssociationArn: __expectString(output.DataIntegrationAssociationArn),
1216
- };
1217
- };
1218
- const de_DataIntegrationsList = (output, context) => {
1219
- const retVal = (output || [])
1220
- .filter((e) => e != null)
1221
- .map((entry) => {
1222
- if (entry === null) {
1223
- return null;
1224
- }
1225
- return de_DataIntegrationSummary(entry, context);
1226
- });
1227
- return retVal;
1228
- };
1229
- const de_DataIntegrationSummary = (output, context) => {
1230
- return {
1231
- Arn: __expectString(output.Arn),
1232
- Name: __expectString(output.Name),
1233
- SourceURI: __expectString(output.SourceURI),
1234
- };
1235
- };
1236
- const de_EventFilter = (output, context) => {
1237
- return {
1238
- Source: __expectString(output.Source),
1239
- };
1240
- };
1241
- const de_EventIntegration = (output, context) => {
1242
- return {
1243
- Description: __expectString(output.Description),
1244
- EventBridgeBus: __expectString(output.EventBridgeBus),
1245
- EventFilter: output.EventFilter != null ? de_EventFilter(output.EventFilter, context) : undefined,
1246
- EventIntegrationArn: __expectString(output.EventIntegrationArn),
1247
- Name: __expectString(output.Name),
1248
- Tags: output.Tags != null ? de_TagMap(output.Tags, context) : undefined,
1249
- };
1250
- };
1251
- const de_EventIntegrationAssociation = (output, context) => {
1252
- return {
1253
- ClientAssociationMetadata: output.ClientAssociationMetadata != null
1254
- ? de_ClientAssociationMetadata(output.ClientAssociationMetadata, context)
1255
- : undefined,
1256
- ClientId: __expectString(output.ClientId),
1257
- EventBridgeRuleName: __expectString(output.EventBridgeRuleName),
1258
- EventIntegrationAssociationArn: __expectString(output.EventIntegrationAssociationArn),
1259
- EventIntegrationAssociationId: __expectString(output.EventIntegrationAssociationId),
1260
- EventIntegrationName: __expectString(output.EventIntegrationName),
1261
- };
1262
- };
1263
- const de_EventIntegrationAssociationsList = (output, context) => {
1264
- const retVal = (output || [])
1265
- .filter((e) => e != null)
1266
- .map((entry) => {
1267
- if (entry === null) {
1268
- return null;
1269
- }
1270
- return de_EventIntegrationAssociation(entry, context);
1271
- });
1272
- return retVal;
1273
- };
1274
- const de_EventIntegrationsList = (output, context) => {
1275
- const retVal = (output || [])
1276
- .filter((e) => e != null)
1277
- .map((entry) => {
1278
- if (entry === null) {
1279
- return null;
1280
- }
1281
- return de_EventIntegration(entry, context);
1282
- });
1283
- return retVal;
1284
- };
1285
- const de_FieldsList = (output, context) => {
1286
- const retVal = (output || [])
1287
- .filter((e) => e != null)
1288
- .map((entry) => {
1289
- if (entry === null) {
1290
- return null;
1291
- }
1292
- return __expectString(entry);
1293
- });
1294
- return retVal;
1295
- };
1296
- const de_FieldsMap = (output, context) => {
1297
- return Object.entries(output).reduce((acc, [key, value]) => {
1298
- if (value === null) {
1299
- return acc;
1300
- }
1301
- acc[key] = de_FieldsList(value, context);
1302
- return acc;
1303
- }, {});
1304
- };
1305
- const de_FileConfiguration = (output, context) => {
1306
- return {
1307
- Filters: output.Filters != null ? de_FieldsMap(output.Filters, context) : undefined,
1308
- Folders: output.Folders != null ? de_FolderList(output.Folders, context) : undefined,
1309
- };
1310
- };
1311
- const de_FolderList = (output, context) => {
1312
- const retVal = (output || [])
1313
- .filter((e) => e != null)
1314
- .map((entry) => {
1315
- if (entry === null) {
1316
- return null;
1317
- }
1318
- return __expectString(entry);
1319
- });
1320
- return retVal;
1321
- };
1322
- const de_ObjectConfiguration = (output, context) => {
1323
- return Object.entries(output).reduce((acc, [key, value]) => {
1324
- if (value === null) {
1325
- return acc;
1326
- }
1327
- acc[key] = de_FieldsMap(value, context);
1328
- return acc;
1329
- }, {});
1330
- };
1331
- const de_ScheduleConfiguration = (output, context) => {
1332
- return {
1333
- FirstExecutionFrom: __expectString(output.FirstExecutionFrom),
1334
- Object: __expectString(output.Object),
1335
- ScheduleExpression: __expectString(output.ScheduleExpression),
1336
- };
1337
- };
1338
- const de_TagMap = (output, context) => {
1339
- return Object.entries(output).reduce((acc, [key, value]) => {
1340
- if (value === null) {
1341
- return acc;
1342
- }
1343
- acc[key] = __expectString(value);
1344
- return acc;
1345
- }, {});
1346
- };
1347
1073
  const deserializeMetadata = (output) => ({
1348
1074
  httpStatusCode: output.statusCode,
1349
1075
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],