@aws-sdk/client-appintegrations 3.51.0 → 3.54.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.
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1UpdateEventIntegrationCommand = exports.deserial
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const uuid_1 = require("uuid");
7
+ const AppIntegrationsServiceException_1 = require("../models/AppIntegrationsServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_restJson1CreateDataIntegrationCommand = async (input, context) => {
8
10
  var _a;
9
11
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -483,67 +485,31 @@ const deserializeAws_restJson1CreateDataIntegrationCommandError = async (output,
483
485
  switch (errorCode) {
484
486
  case "AccessDeniedException":
485
487
  case "com.amazonaws.appintegrations#AccessDeniedException":
486
- response = {
487
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
488
- name: errorCode,
489
- $metadata: deserializeMetadata(output),
490
- };
491
- break;
488
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
492
489
  case "DuplicateResourceException":
493
490
  case "com.amazonaws.appintegrations#DuplicateResourceException":
494
- response = {
495
- ...(await deserializeAws_restJson1DuplicateResourceExceptionResponse(parsedOutput, context)),
496
- name: errorCode,
497
- $metadata: deserializeMetadata(output),
498
- };
499
- break;
491
+ throw await deserializeAws_restJson1DuplicateResourceExceptionResponse(parsedOutput, context);
500
492
  case "InternalServiceError":
501
493
  case "com.amazonaws.appintegrations#InternalServiceError":
502
- response = {
503
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
504
- name: errorCode,
505
- $metadata: deserializeMetadata(output),
506
- };
507
- break;
494
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
508
495
  case "InvalidRequestException":
509
496
  case "com.amazonaws.appintegrations#InvalidRequestException":
510
- response = {
511
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
512
- name: errorCode,
513
- $metadata: deserializeMetadata(output),
514
- };
515
- break;
497
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
516
498
  case "ResourceQuotaExceededException":
517
499
  case "com.amazonaws.appintegrations#ResourceQuotaExceededException":
518
- response = {
519
- ...(await deserializeAws_restJson1ResourceQuotaExceededExceptionResponse(parsedOutput, context)),
520
- name: errorCode,
521
- $metadata: deserializeMetadata(output),
522
- };
523
- break;
500
+ throw await deserializeAws_restJson1ResourceQuotaExceededExceptionResponse(parsedOutput, context);
524
501
  case "ThrottlingException":
525
502
  case "com.amazonaws.appintegrations#ThrottlingException":
526
- response = {
527
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
528
- name: errorCode,
529
- $metadata: deserializeMetadata(output),
530
- };
531
- break;
503
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
532
504
  default:
533
505
  const parsedBody = parsedOutput.body;
534
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
535
- response = {
536
- ...parsedBody,
537
- name: `${errorCode}`,
538
- message: parsedBody.message || parsedBody.Message || errorCode,
506
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
507
+ name: parsedBody.code || parsedBody.Code || errorCode,
539
508
  $fault: "client",
540
509
  $metadata: deserializeMetadata(output),
541
- };
510
+ });
511
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
542
512
  }
543
- const message = response.message || response.Message || errorCode;
544
- response.message = message;
545
- delete response.Message;
546
- return Promise.reject(Object.assign(new Error(message), response));
547
513
  };
548
514
  const deserializeAws_restJson1CreateEventIntegrationCommand = async (output, context) => {
549
515
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -571,67 +537,31 @@ const deserializeAws_restJson1CreateEventIntegrationCommandError = async (output
571
537
  switch (errorCode) {
572
538
  case "AccessDeniedException":
573
539
  case "com.amazonaws.appintegrations#AccessDeniedException":
574
- response = {
575
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
576
- name: errorCode,
577
- $metadata: deserializeMetadata(output),
578
- };
579
- break;
540
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
580
541
  case "DuplicateResourceException":
581
542
  case "com.amazonaws.appintegrations#DuplicateResourceException":
582
- response = {
583
- ...(await deserializeAws_restJson1DuplicateResourceExceptionResponse(parsedOutput, context)),
584
- name: errorCode,
585
- $metadata: deserializeMetadata(output),
586
- };
587
- break;
543
+ throw await deserializeAws_restJson1DuplicateResourceExceptionResponse(parsedOutput, context);
588
544
  case "InternalServiceError":
589
545
  case "com.amazonaws.appintegrations#InternalServiceError":
590
- response = {
591
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
592
- name: errorCode,
593
- $metadata: deserializeMetadata(output),
594
- };
595
- break;
546
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
596
547
  case "InvalidRequestException":
597
548
  case "com.amazonaws.appintegrations#InvalidRequestException":
598
- response = {
599
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
600
- name: errorCode,
601
- $metadata: deserializeMetadata(output),
602
- };
603
- break;
549
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
604
550
  case "ResourceQuotaExceededException":
605
551
  case "com.amazonaws.appintegrations#ResourceQuotaExceededException":
606
- response = {
607
- ...(await deserializeAws_restJson1ResourceQuotaExceededExceptionResponse(parsedOutput, context)),
608
- name: errorCode,
609
- $metadata: deserializeMetadata(output),
610
- };
611
- break;
552
+ throw await deserializeAws_restJson1ResourceQuotaExceededExceptionResponse(parsedOutput, context);
612
553
  case "ThrottlingException":
613
554
  case "com.amazonaws.appintegrations#ThrottlingException":
614
- response = {
615
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
616
- name: errorCode,
617
- $metadata: deserializeMetadata(output),
618
- };
619
- break;
555
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
620
556
  default:
621
557
  const parsedBody = parsedOutput.body;
622
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
623
- response = {
624
- ...parsedBody,
625
- name: `${errorCode}`,
626
- message: parsedBody.message || parsedBody.Message || errorCode,
558
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
559
+ name: parsedBody.code || parsedBody.Code || errorCode,
627
560
  $fault: "client",
628
561
  $metadata: deserializeMetadata(output),
629
- };
562
+ });
563
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
630
564
  }
631
- const message = response.message || response.Message || errorCode;
632
- response.message = message;
633
- delete response.Message;
634
- return Promise.reject(Object.assign(new Error(message), response));
635
565
  };
636
566
  const deserializeAws_restJson1DeleteDataIntegrationCommand = async (output, context) => {
637
567
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -655,59 +585,28 @@ const deserializeAws_restJson1DeleteDataIntegrationCommandError = async (output,
655
585
  switch (errorCode) {
656
586
  case "AccessDeniedException":
657
587
  case "com.amazonaws.appintegrations#AccessDeniedException":
658
- response = {
659
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
660
- name: errorCode,
661
- $metadata: deserializeMetadata(output),
662
- };
663
- break;
588
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
664
589
  case "InternalServiceError":
665
590
  case "com.amazonaws.appintegrations#InternalServiceError":
666
- response = {
667
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
668
- name: errorCode,
669
- $metadata: deserializeMetadata(output),
670
- };
671
- break;
591
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
672
592
  case "InvalidRequestException":
673
593
  case "com.amazonaws.appintegrations#InvalidRequestException":
674
- response = {
675
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
676
- name: errorCode,
677
- $metadata: deserializeMetadata(output),
678
- };
679
- break;
594
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
680
595
  case "ResourceNotFoundException":
681
596
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
682
- response = {
683
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
684
- name: errorCode,
685
- $metadata: deserializeMetadata(output),
686
- };
687
- break;
597
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
688
598
  case "ThrottlingException":
689
599
  case "com.amazonaws.appintegrations#ThrottlingException":
690
- response = {
691
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
692
- name: errorCode,
693
- $metadata: deserializeMetadata(output),
694
- };
695
- break;
600
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
696
601
  default:
697
602
  const parsedBody = parsedOutput.body;
698
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
699
- response = {
700
- ...parsedBody,
701
- name: `${errorCode}`,
702
- message: parsedBody.message || parsedBody.Message || errorCode,
603
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
604
+ name: parsedBody.code || parsedBody.Code || errorCode,
703
605
  $fault: "client",
704
606
  $metadata: deserializeMetadata(output),
705
- };
607
+ });
608
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
706
609
  }
707
- const message = response.message || response.Message || errorCode;
708
- response.message = message;
709
- delete response.Message;
710
- return Promise.reject(Object.assign(new Error(message), response));
711
610
  };
712
611
  const deserializeAws_restJson1DeleteEventIntegrationCommand = async (output, context) => {
713
612
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -731,59 +630,28 @@ const deserializeAws_restJson1DeleteEventIntegrationCommandError = async (output
731
630
  switch (errorCode) {
732
631
  case "AccessDeniedException":
733
632
  case "com.amazonaws.appintegrations#AccessDeniedException":
734
- response = {
735
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
736
- name: errorCode,
737
- $metadata: deserializeMetadata(output),
738
- };
739
- break;
633
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
740
634
  case "InternalServiceError":
741
635
  case "com.amazonaws.appintegrations#InternalServiceError":
742
- response = {
743
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
744
- name: errorCode,
745
- $metadata: deserializeMetadata(output),
746
- };
747
- break;
636
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
748
637
  case "InvalidRequestException":
749
638
  case "com.amazonaws.appintegrations#InvalidRequestException":
750
- response = {
751
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
752
- name: errorCode,
753
- $metadata: deserializeMetadata(output),
754
- };
755
- break;
639
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
756
640
  case "ResourceNotFoundException":
757
641
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
758
- response = {
759
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
760
- name: errorCode,
761
- $metadata: deserializeMetadata(output),
762
- };
763
- break;
642
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
764
643
  case "ThrottlingException":
765
644
  case "com.amazonaws.appintegrations#ThrottlingException":
766
- response = {
767
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
768
- name: errorCode,
769
- $metadata: deserializeMetadata(output),
770
- };
771
- break;
645
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
772
646
  default:
773
647
  const parsedBody = parsedOutput.body;
774
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
775
- response = {
776
- ...parsedBody,
777
- name: `${errorCode}`,
778
- message: parsedBody.message || parsedBody.Message || errorCode,
648
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
649
+ name: parsedBody.code || parsedBody.Code || errorCode,
779
650
  $fault: "client",
780
651
  $metadata: deserializeMetadata(output),
781
- };
652
+ });
653
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
782
654
  }
783
- const message = response.message || response.Message || errorCode;
784
- response.message = message;
785
- delete response.Message;
786
- return Promise.reject(Object.assign(new Error(message), response));
787
655
  };
788
656
  const deserializeAws_restJson1GetDataIntegrationCommand = async (output, context) => {
789
657
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -839,59 +707,28 @@ const deserializeAws_restJson1GetDataIntegrationCommandError = async (output, co
839
707
  switch (errorCode) {
840
708
  case "AccessDeniedException":
841
709
  case "com.amazonaws.appintegrations#AccessDeniedException":
842
- response = {
843
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
844
- name: errorCode,
845
- $metadata: deserializeMetadata(output),
846
- };
847
- break;
710
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
848
711
  case "InternalServiceError":
849
712
  case "com.amazonaws.appintegrations#InternalServiceError":
850
- response = {
851
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
852
- name: errorCode,
853
- $metadata: deserializeMetadata(output),
854
- };
855
- break;
713
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
856
714
  case "InvalidRequestException":
857
715
  case "com.amazonaws.appintegrations#InvalidRequestException":
858
- response = {
859
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
860
- name: errorCode,
861
- $metadata: deserializeMetadata(output),
862
- };
863
- break;
716
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
864
717
  case "ResourceNotFoundException":
865
718
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
866
- response = {
867
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
868
- name: errorCode,
869
- $metadata: deserializeMetadata(output),
870
- };
871
- break;
719
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
872
720
  case "ThrottlingException":
873
721
  case "com.amazonaws.appintegrations#ThrottlingException":
874
- response = {
875
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
876
- name: errorCode,
877
- $metadata: deserializeMetadata(output),
878
- };
879
- break;
722
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
880
723
  default:
881
724
  const parsedBody = parsedOutput.body;
882
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
883
- response = {
884
- ...parsedBody,
885
- name: `${errorCode}`,
886
- message: parsedBody.message || parsedBody.Message || errorCode,
725
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
726
+ name: parsedBody.code || parsedBody.Code || errorCode,
887
727
  $fault: "client",
888
728
  $metadata: deserializeMetadata(output),
889
- };
729
+ });
730
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
890
731
  }
891
- const message = response.message || response.Message || errorCode;
892
- response.message = message;
893
- delete response.Message;
894
- return Promise.reject(Object.assign(new Error(message), response));
895
732
  };
896
733
  const deserializeAws_restJson1GetEventIntegrationCommand = async (output, context) => {
897
734
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -939,59 +776,28 @@ const deserializeAws_restJson1GetEventIntegrationCommandError = async (output, c
939
776
  switch (errorCode) {
940
777
  case "AccessDeniedException":
941
778
  case "com.amazonaws.appintegrations#AccessDeniedException":
942
- response = {
943
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
944
- name: errorCode,
945
- $metadata: deserializeMetadata(output),
946
- };
947
- break;
779
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
948
780
  case "InternalServiceError":
949
781
  case "com.amazonaws.appintegrations#InternalServiceError":
950
- response = {
951
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
952
- name: errorCode,
953
- $metadata: deserializeMetadata(output),
954
- };
955
- break;
782
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
956
783
  case "InvalidRequestException":
957
784
  case "com.amazonaws.appintegrations#InvalidRequestException":
958
- response = {
959
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
960
- name: errorCode,
961
- $metadata: deserializeMetadata(output),
962
- };
963
- break;
785
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
964
786
  case "ResourceNotFoundException":
965
787
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
966
- response = {
967
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
968
- name: errorCode,
969
- $metadata: deserializeMetadata(output),
970
- };
971
- break;
788
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
972
789
  case "ThrottlingException":
973
790
  case "com.amazonaws.appintegrations#ThrottlingException":
974
- response = {
975
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
976
- name: errorCode,
977
- $metadata: deserializeMetadata(output),
978
- };
979
- break;
791
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
980
792
  default:
981
793
  const parsedBody = parsedOutput.body;
982
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
983
- response = {
984
- ...parsedBody,
985
- name: `${errorCode}`,
986
- message: parsedBody.message || parsedBody.Message || errorCode,
794
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
795
+ name: parsedBody.code || parsedBody.Code || errorCode,
987
796
  $fault: "client",
988
797
  $metadata: deserializeMetadata(output),
989
- };
798
+ });
799
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
990
800
  }
991
- const message = response.message || response.Message || errorCode;
992
- response.message = message;
993
- delete response.Message;
994
- return Promise.reject(Object.assign(new Error(message), response));
995
801
  };
996
802
  const deserializeAws_restJson1ListDataIntegrationAssociationsCommand = async (output, context) => {
997
803
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1023,59 +829,28 @@ const deserializeAws_restJson1ListDataIntegrationAssociationsCommandError = asyn
1023
829
  switch (errorCode) {
1024
830
  case "AccessDeniedException":
1025
831
  case "com.amazonaws.appintegrations#AccessDeniedException":
1026
- response = {
1027
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1028
- name: errorCode,
1029
- $metadata: deserializeMetadata(output),
1030
- };
1031
- break;
832
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1032
833
  case "InternalServiceError":
1033
834
  case "com.amazonaws.appintegrations#InternalServiceError":
1034
- response = {
1035
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
1036
- name: errorCode,
1037
- $metadata: deserializeMetadata(output),
1038
- };
1039
- break;
835
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
1040
836
  case "InvalidRequestException":
1041
837
  case "com.amazonaws.appintegrations#InvalidRequestException":
1042
- response = {
1043
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
1044
- name: errorCode,
1045
- $metadata: deserializeMetadata(output),
1046
- };
1047
- break;
838
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1048
839
  case "ResourceNotFoundException":
1049
840
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
1050
- response = {
1051
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1052
- name: errorCode,
1053
- $metadata: deserializeMetadata(output),
1054
- };
1055
- break;
841
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1056
842
  case "ThrottlingException":
1057
843
  case "com.amazonaws.appintegrations#ThrottlingException":
1058
- response = {
1059
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1060
- name: errorCode,
1061
- $metadata: deserializeMetadata(output),
1062
- };
1063
- break;
844
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1064
845
  default:
1065
846
  const parsedBody = parsedOutput.body;
1066
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1067
- response = {
1068
- ...parsedBody,
1069
- name: `${errorCode}`,
1070
- message: parsedBody.message || parsedBody.Message || errorCode,
847
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
848
+ name: parsedBody.code || parsedBody.Code || errorCode,
1071
849
  $fault: "client",
1072
850
  $metadata: deserializeMetadata(output),
1073
- };
851
+ });
852
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1074
853
  }
1075
- const message = response.message || response.Message || errorCode;
1076
- response.message = message;
1077
- delete response.Message;
1078
- return Promise.reject(Object.assign(new Error(message), response));
1079
854
  };
1080
855
  const deserializeAws_restJson1ListDataIntegrationsCommand = async (output, context) => {
1081
856
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1107,51 +882,25 @@ const deserializeAws_restJson1ListDataIntegrationsCommandError = async (output,
1107
882
  switch (errorCode) {
1108
883
  case "AccessDeniedException":
1109
884
  case "com.amazonaws.appintegrations#AccessDeniedException":
1110
- response = {
1111
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1112
- name: errorCode,
1113
- $metadata: deserializeMetadata(output),
1114
- };
1115
- break;
885
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1116
886
  case "InternalServiceError":
1117
887
  case "com.amazonaws.appintegrations#InternalServiceError":
1118
- response = {
1119
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
1120
- name: errorCode,
1121
- $metadata: deserializeMetadata(output),
1122
- };
1123
- break;
888
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
1124
889
  case "InvalidRequestException":
1125
890
  case "com.amazonaws.appintegrations#InvalidRequestException":
1126
- response = {
1127
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
1128
- name: errorCode,
1129
- $metadata: deserializeMetadata(output),
1130
- };
1131
- break;
891
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1132
892
  case "ThrottlingException":
1133
893
  case "com.amazonaws.appintegrations#ThrottlingException":
1134
- response = {
1135
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1136
- name: errorCode,
1137
- $metadata: deserializeMetadata(output),
1138
- };
1139
- break;
894
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1140
895
  default:
1141
896
  const parsedBody = parsedOutput.body;
1142
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1143
- response = {
1144
- ...parsedBody,
1145
- name: `${errorCode}`,
1146
- message: parsedBody.message || parsedBody.Message || errorCode,
897
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
898
+ name: parsedBody.code || parsedBody.Code || errorCode,
1147
899
  $fault: "client",
1148
900
  $metadata: deserializeMetadata(output),
1149
- };
901
+ });
902
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1150
903
  }
1151
- const message = response.message || response.Message || errorCode;
1152
- response.message = message;
1153
- delete response.Message;
1154
- return Promise.reject(Object.assign(new Error(message), response));
1155
904
  };
1156
905
  const deserializeAws_restJson1ListEventIntegrationAssociationsCommand = async (output, context) => {
1157
906
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1183,59 +932,28 @@ const deserializeAws_restJson1ListEventIntegrationAssociationsCommandError = asy
1183
932
  switch (errorCode) {
1184
933
  case "AccessDeniedException":
1185
934
  case "com.amazonaws.appintegrations#AccessDeniedException":
1186
- response = {
1187
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1188
- name: errorCode,
1189
- $metadata: deserializeMetadata(output),
1190
- };
1191
- break;
935
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1192
936
  case "InternalServiceError":
1193
937
  case "com.amazonaws.appintegrations#InternalServiceError":
1194
- response = {
1195
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
1196
- name: errorCode,
1197
- $metadata: deserializeMetadata(output),
1198
- };
1199
- break;
938
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
1200
939
  case "InvalidRequestException":
1201
940
  case "com.amazonaws.appintegrations#InvalidRequestException":
1202
- response = {
1203
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
1204
- name: errorCode,
1205
- $metadata: deserializeMetadata(output),
1206
- };
1207
- break;
941
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1208
942
  case "ResourceNotFoundException":
1209
943
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
1210
- response = {
1211
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1212
- name: errorCode,
1213
- $metadata: deserializeMetadata(output),
1214
- };
1215
- break;
944
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1216
945
  case "ThrottlingException":
1217
946
  case "com.amazonaws.appintegrations#ThrottlingException":
1218
- response = {
1219
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1220
- name: errorCode,
1221
- $metadata: deserializeMetadata(output),
1222
- };
1223
- break;
947
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1224
948
  default:
1225
949
  const parsedBody = parsedOutput.body;
1226
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1227
- response = {
1228
- ...parsedBody,
1229
- name: `${errorCode}`,
1230
- message: parsedBody.message || parsedBody.Message || errorCode,
950
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
951
+ name: parsedBody.code || parsedBody.Code || errorCode,
1231
952
  $fault: "client",
1232
953
  $metadata: deserializeMetadata(output),
1233
- };
954
+ });
955
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1234
956
  }
1235
- const message = response.message || response.Message || errorCode;
1236
- response.message = message;
1237
- delete response.Message;
1238
- return Promise.reject(Object.assign(new Error(message), response));
1239
957
  };
1240
958
  const deserializeAws_restJson1ListEventIntegrationsCommand = async (output, context) => {
1241
959
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1267,51 +985,25 @@ const deserializeAws_restJson1ListEventIntegrationsCommandError = async (output,
1267
985
  switch (errorCode) {
1268
986
  case "AccessDeniedException":
1269
987
  case "com.amazonaws.appintegrations#AccessDeniedException":
1270
- response = {
1271
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1272
- name: errorCode,
1273
- $metadata: deserializeMetadata(output),
1274
- };
1275
- break;
988
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1276
989
  case "InternalServiceError":
1277
990
  case "com.amazonaws.appintegrations#InternalServiceError":
1278
- response = {
1279
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
1280
- name: errorCode,
1281
- $metadata: deserializeMetadata(output),
1282
- };
1283
- break;
991
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
1284
992
  case "InvalidRequestException":
1285
993
  case "com.amazonaws.appintegrations#InvalidRequestException":
1286
- response = {
1287
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
1288
- name: errorCode,
1289
- $metadata: deserializeMetadata(output),
1290
- };
1291
- break;
994
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1292
995
  case "ThrottlingException":
1293
996
  case "com.amazonaws.appintegrations#ThrottlingException":
1294
- response = {
1295
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1296
- name: errorCode,
1297
- $metadata: deserializeMetadata(output),
1298
- };
1299
- break;
997
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1300
998
  default:
1301
999
  const parsedBody = parsedOutput.body;
1302
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1303
- response = {
1304
- ...parsedBody,
1305
- name: `${errorCode}`,
1306
- message: parsedBody.message || parsedBody.Message || errorCode,
1000
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
1001
+ name: parsedBody.code || parsedBody.Code || errorCode,
1307
1002
  $fault: "client",
1308
1003
  $metadata: deserializeMetadata(output),
1309
- };
1004
+ });
1005
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1310
1006
  }
1311
- const message = response.message || response.Message || errorCode;
1312
- response.message = message;
1313
- delete response.Message;
1314
- return Promise.reject(Object.assign(new Error(message), response));
1315
1007
  };
1316
1008
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1317
1009
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1339,51 +1031,25 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1339
1031
  switch (errorCode) {
1340
1032
  case "InternalServiceError":
1341
1033
  case "com.amazonaws.appintegrations#InternalServiceError":
1342
- response = {
1343
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
1344
- name: errorCode,
1345
- $metadata: deserializeMetadata(output),
1346
- };
1347
- break;
1034
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
1348
1035
  case "InvalidRequestException":
1349
1036
  case "com.amazonaws.appintegrations#InvalidRequestException":
1350
- response = {
1351
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
1352
- name: errorCode,
1353
- $metadata: deserializeMetadata(output),
1354
- };
1355
- break;
1037
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1356
1038
  case "ResourceNotFoundException":
1357
1039
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
1358
- response = {
1359
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1360
- name: errorCode,
1361
- $metadata: deserializeMetadata(output),
1362
- };
1363
- break;
1040
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1364
1041
  case "ThrottlingException":
1365
1042
  case "com.amazonaws.appintegrations#ThrottlingException":
1366
- response = {
1367
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1368
- name: errorCode,
1369
- $metadata: deserializeMetadata(output),
1370
- };
1371
- break;
1043
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1372
1044
  default:
1373
1045
  const parsedBody = parsedOutput.body;
1374
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1375
- response = {
1376
- ...parsedBody,
1377
- name: `${errorCode}`,
1378
- message: parsedBody.message || parsedBody.Message || errorCode,
1046
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
1047
+ name: parsedBody.code || parsedBody.Code || errorCode,
1379
1048
  $fault: "client",
1380
1049
  $metadata: deserializeMetadata(output),
1381
- };
1050
+ });
1051
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1382
1052
  }
1383
- const message = response.message || response.Message || errorCode;
1384
- response.message = message;
1385
- delete response.Message;
1386
- return Promise.reject(Object.assign(new Error(message), response));
1387
1053
  };
1388
1054
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1389
1055
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1407,51 +1073,25 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1407
1073
  switch (errorCode) {
1408
1074
  case "InternalServiceError":
1409
1075
  case "com.amazonaws.appintegrations#InternalServiceError":
1410
- response = {
1411
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
1412
- name: errorCode,
1413
- $metadata: deserializeMetadata(output),
1414
- };
1415
- break;
1076
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
1416
1077
  case "InvalidRequestException":
1417
1078
  case "com.amazonaws.appintegrations#InvalidRequestException":
1418
- response = {
1419
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
1420
- name: errorCode,
1421
- $metadata: deserializeMetadata(output),
1422
- };
1423
- break;
1079
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1424
1080
  case "ResourceNotFoundException":
1425
1081
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
1426
- response = {
1427
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1428
- name: errorCode,
1429
- $metadata: deserializeMetadata(output),
1430
- };
1431
- break;
1082
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1432
1083
  case "ThrottlingException":
1433
1084
  case "com.amazonaws.appintegrations#ThrottlingException":
1434
- response = {
1435
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1436
- name: errorCode,
1437
- $metadata: deserializeMetadata(output),
1438
- };
1439
- break;
1085
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1440
1086
  default:
1441
1087
  const parsedBody = parsedOutput.body;
1442
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1443
- response = {
1444
- ...parsedBody,
1445
- name: `${errorCode}`,
1446
- message: parsedBody.message || parsedBody.Message || errorCode,
1088
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
1089
+ name: parsedBody.code || parsedBody.Code || errorCode,
1447
1090
  $fault: "client",
1448
1091
  $metadata: deserializeMetadata(output),
1449
- };
1092
+ });
1093
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1450
1094
  }
1451
- const message = response.message || response.Message || errorCode;
1452
- response.message = message;
1453
- delete response.Message;
1454
- return Promise.reject(Object.assign(new Error(message), response));
1455
1095
  };
1456
1096
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1457
1097
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1475,51 +1115,25 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1475
1115
  switch (errorCode) {
1476
1116
  case "InternalServiceError":
1477
1117
  case "com.amazonaws.appintegrations#InternalServiceError":
1478
- response = {
1479
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
1480
- name: errorCode,
1481
- $metadata: deserializeMetadata(output),
1482
- };
1483
- break;
1118
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
1484
1119
  case "InvalidRequestException":
1485
1120
  case "com.amazonaws.appintegrations#InvalidRequestException":
1486
- response = {
1487
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
1488
- name: errorCode,
1489
- $metadata: deserializeMetadata(output),
1490
- };
1491
- break;
1121
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1492
1122
  case "ResourceNotFoundException":
1493
1123
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
1494
- response = {
1495
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1496
- name: errorCode,
1497
- $metadata: deserializeMetadata(output),
1498
- };
1499
- break;
1124
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1500
1125
  case "ThrottlingException":
1501
1126
  case "com.amazonaws.appintegrations#ThrottlingException":
1502
- response = {
1503
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1504
- name: errorCode,
1505
- $metadata: deserializeMetadata(output),
1506
- };
1507
- break;
1127
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1508
1128
  default:
1509
1129
  const parsedBody = parsedOutput.body;
1510
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1511
- response = {
1512
- ...parsedBody,
1513
- name: `${errorCode}`,
1514
- message: parsedBody.message || parsedBody.Message || errorCode,
1130
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
1131
+ name: parsedBody.code || parsedBody.Code || errorCode,
1515
1132
  $fault: "client",
1516
1133
  $metadata: deserializeMetadata(output),
1517
- };
1134
+ });
1135
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1518
1136
  }
1519
- const message = response.message || response.Message || errorCode;
1520
- response.message = message;
1521
- delete response.Message;
1522
- return Promise.reject(Object.assign(new Error(message), response));
1523
1137
  };
1524
1138
  const deserializeAws_restJson1UpdateDataIntegrationCommand = async (output, context) => {
1525
1139
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1543,59 +1157,28 @@ const deserializeAws_restJson1UpdateDataIntegrationCommandError = async (output,
1543
1157
  switch (errorCode) {
1544
1158
  case "AccessDeniedException":
1545
1159
  case "com.amazonaws.appintegrations#AccessDeniedException":
1546
- response = {
1547
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1548
- name: errorCode,
1549
- $metadata: deserializeMetadata(output),
1550
- };
1551
- break;
1160
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1552
1161
  case "InternalServiceError":
1553
1162
  case "com.amazonaws.appintegrations#InternalServiceError":
1554
- response = {
1555
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
1556
- name: errorCode,
1557
- $metadata: deserializeMetadata(output),
1558
- };
1559
- break;
1163
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
1560
1164
  case "InvalidRequestException":
1561
1165
  case "com.amazonaws.appintegrations#InvalidRequestException":
1562
- response = {
1563
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
1564
- name: errorCode,
1565
- $metadata: deserializeMetadata(output),
1566
- };
1567
- break;
1166
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1568
1167
  case "ResourceNotFoundException":
1569
1168
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
1570
- response = {
1571
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1572
- name: errorCode,
1573
- $metadata: deserializeMetadata(output),
1574
- };
1575
- break;
1169
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1576
1170
  case "ThrottlingException":
1577
1171
  case "com.amazonaws.appintegrations#ThrottlingException":
1578
- response = {
1579
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1580
- name: errorCode,
1581
- $metadata: deserializeMetadata(output),
1582
- };
1583
- break;
1172
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1584
1173
  default:
1585
1174
  const parsedBody = parsedOutput.body;
1586
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1587
- response = {
1588
- ...parsedBody,
1589
- name: `${errorCode}`,
1590
- message: parsedBody.message || parsedBody.Message || errorCode,
1175
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
1176
+ name: parsedBody.code || parsedBody.Code || errorCode,
1591
1177
  $fault: "client",
1592
1178
  $metadata: deserializeMetadata(output),
1593
- };
1179
+ });
1180
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1594
1181
  }
1595
- const message = response.message || response.Message || errorCode;
1596
- response.message = message;
1597
- delete response.Message;
1598
- return Promise.reject(Object.assign(new Error(message), response));
1599
1182
  };
1600
1183
  const deserializeAws_restJson1UpdateEventIntegrationCommand = async (output, context) => {
1601
1184
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1619,150 +1202,112 @@ const deserializeAws_restJson1UpdateEventIntegrationCommandError = async (output
1619
1202
  switch (errorCode) {
1620
1203
  case "AccessDeniedException":
1621
1204
  case "com.amazonaws.appintegrations#AccessDeniedException":
1622
- response = {
1623
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1624
- name: errorCode,
1625
- $metadata: deserializeMetadata(output),
1626
- };
1627
- break;
1205
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1628
1206
  case "InternalServiceError":
1629
1207
  case "com.amazonaws.appintegrations#InternalServiceError":
1630
- response = {
1631
- ...(await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context)),
1632
- name: errorCode,
1633
- $metadata: deserializeMetadata(output),
1634
- };
1635
- break;
1208
+ throw await deserializeAws_restJson1InternalServiceErrorResponse(parsedOutput, context);
1636
1209
  case "InvalidRequestException":
1637
1210
  case "com.amazonaws.appintegrations#InvalidRequestException":
1638
- response = {
1639
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
1640
- name: errorCode,
1641
- $metadata: deserializeMetadata(output),
1642
- };
1643
- break;
1211
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1644
1212
  case "ResourceNotFoundException":
1645
1213
  case "com.amazonaws.appintegrations#ResourceNotFoundException":
1646
- response = {
1647
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1648
- name: errorCode,
1649
- $metadata: deserializeMetadata(output),
1650
- };
1651
- break;
1214
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1652
1215
  case "ThrottlingException":
1653
1216
  case "com.amazonaws.appintegrations#ThrottlingException":
1654
- response = {
1655
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1656
- name: errorCode,
1657
- $metadata: deserializeMetadata(output),
1658
- };
1659
- break;
1217
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1660
1218
  default:
1661
1219
  const parsedBody = parsedOutput.body;
1662
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1663
- response = {
1664
- ...parsedBody,
1665
- name: `${errorCode}`,
1666
- message: parsedBody.message || parsedBody.Message || errorCode,
1220
+ response = new AppIntegrationsServiceException_1.AppIntegrationsServiceException({
1221
+ name: parsedBody.code || parsedBody.Code || errorCode,
1667
1222
  $fault: "client",
1668
1223
  $metadata: deserializeMetadata(output),
1669
- };
1224
+ });
1225
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1670
1226
  }
1671
- const message = response.message || response.Message || errorCode;
1672
- response.message = message;
1673
- delete response.Message;
1674
- return Promise.reject(Object.assign(new Error(message), response));
1675
1227
  };
1676
1228
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1677
- const contents = {
1678
- name: "AccessDeniedException",
1679
- $fault: "client",
1680
- $metadata: deserializeMetadata(parsedOutput),
1681
- Message: undefined,
1682
- };
1229
+ const contents = {};
1683
1230
  const data = parsedOutput.body;
1684
1231
  if (data.Message !== undefined && data.Message !== null) {
1685
1232
  contents.Message = smithy_client_1.expectString(data.Message);
1686
1233
  }
1687
- return contents;
1234
+ const exception = new models_0_1.AccessDeniedException({
1235
+ $metadata: deserializeMetadata(parsedOutput),
1236
+ ...contents,
1237
+ });
1238
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1688
1239
  };
1689
1240
  const deserializeAws_restJson1DuplicateResourceExceptionResponse = async (parsedOutput, context) => {
1690
- const contents = {
1691
- name: "DuplicateResourceException",
1692
- $fault: "client",
1693
- $metadata: deserializeMetadata(parsedOutput),
1694
- Message: undefined,
1695
- };
1241
+ const contents = {};
1696
1242
  const data = parsedOutput.body;
1697
1243
  if (data.Message !== undefined && data.Message !== null) {
1698
1244
  contents.Message = smithy_client_1.expectString(data.Message);
1699
1245
  }
1700
- return contents;
1246
+ const exception = new models_0_1.DuplicateResourceException({
1247
+ $metadata: deserializeMetadata(parsedOutput),
1248
+ ...contents,
1249
+ });
1250
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1701
1251
  };
1702
1252
  const deserializeAws_restJson1InternalServiceErrorResponse = async (parsedOutput, context) => {
1703
- const contents = {
1704
- name: "InternalServiceError",
1705
- $fault: "server",
1706
- $metadata: deserializeMetadata(parsedOutput),
1707
- Message: undefined,
1708
- };
1253
+ const contents = {};
1709
1254
  const data = parsedOutput.body;
1710
1255
  if (data.Message !== undefined && data.Message !== null) {
1711
1256
  contents.Message = smithy_client_1.expectString(data.Message);
1712
1257
  }
1713
- return contents;
1258
+ const exception = new models_0_1.InternalServiceError({
1259
+ $metadata: deserializeMetadata(parsedOutput),
1260
+ ...contents,
1261
+ });
1262
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1714
1263
  };
1715
1264
  const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
1716
- const contents = {
1717
- name: "InvalidRequestException",
1718
- $fault: "client",
1719
- $metadata: deserializeMetadata(parsedOutput),
1720
- Message: undefined,
1721
- };
1265
+ const contents = {};
1722
1266
  const data = parsedOutput.body;
1723
1267
  if (data.Message !== undefined && data.Message !== null) {
1724
1268
  contents.Message = smithy_client_1.expectString(data.Message);
1725
1269
  }
1726
- return contents;
1270
+ const exception = new models_0_1.InvalidRequestException({
1271
+ $metadata: deserializeMetadata(parsedOutput),
1272
+ ...contents,
1273
+ });
1274
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1727
1275
  };
1728
1276
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1729
- const contents = {
1730
- name: "ResourceNotFoundException",
1731
- $fault: "client",
1732
- $metadata: deserializeMetadata(parsedOutput),
1733
- Message: undefined,
1734
- };
1277
+ const contents = {};
1735
1278
  const data = parsedOutput.body;
1736
1279
  if (data.Message !== undefined && data.Message !== null) {
1737
1280
  contents.Message = smithy_client_1.expectString(data.Message);
1738
1281
  }
1739
- return contents;
1282
+ const exception = new models_0_1.ResourceNotFoundException({
1283
+ $metadata: deserializeMetadata(parsedOutput),
1284
+ ...contents,
1285
+ });
1286
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1740
1287
  };
1741
1288
  const deserializeAws_restJson1ResourceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1742
- const contents = {
1743
- name: "ResourceQuotaExceededException",
1744
- $fault: "client",
1745
- $metadata: deserializeMetadata(parsedOutput),
1746
- Message: undefined,
1747
- };
1289
+ const contents = {};
1748
1290
  const data = parsedOutput.body;
1749
1291
  if (data.Message !== undefined && data.Message !== null) {
1750
1292
  contents.Message = smithy_client_1.expectString(data.Message);
1751
1293
  }
1752
- return contents;
1294
+ const exception = new models_0_1.ResourceQuotaExceededException({
1295
+ $metadata: deserializeMetadata(parsedOutput),
1296
+ ...contents,
1297
+ });
1298
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1753
1299
  };
1754
1300
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1755
- const contents = {
1756
- name: "ThrottlingException",
1757
- $fault: "client",
1758
- $metadata: deserializeMetadata(parsedOutput),
1759
- Message: undefined,
1760
- };
1301
+ const contents = {};
1761
1302
  const data = parsedOutput.body;
1762
1303
  if (data.Message !== undefined && data.Message !== null) {
1763
1304
  contents.Message = smithy_client_1.expectString(data.Message);
1764
1305
  }
1765
- return contents;
1306
+ const exception = new models_0_1.ThrottlingException({
1307
+ $metadata: deserializeMetadata(parsedOutput),
1308
+ ...contents,
1309
+ });
1310
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1766
1311
  };
1767
1312
  const serializeAws_restJson1EventFilter = (input, context) => {
1768
1313
  return {
@@ -1801,7 +1346,7 @@ const deserializeAws_restJson1ClientAssociationMetadata = (output, context) => {
1801
1346
  }, {});
1802
1347
  };
1803
1348
  const deserializeAws_restJson1DataIntegrationAssociationsList = (output, context) => {
1804
- return (output || [])
1349
+ const retVal = (output || [])
1805
1350
  .filter((e) => e != null)
1806
1351
  .map((entry) => {
1807
1352
  if (entry === null) {
@@ -1809,6 +1354,7 @@ const deserializeAws_restJson1DataIntegrationAssociationsList = (output, context
1809
1354
  }
1810
1355
  return deserializeAws_restJson1DataIntegrationAssociationSummary(entry, context);
1811
1356
  });
1357
+ return retVal;
1812
1358
  };
1813
1359
  const deserializeAws_restJson1DataIntegrationAssociationSummary = (output, context) => {
1814
1360
  return {
@@ -1818,7 +1364,7 @@ const deserializeAws_restJson1DataIntegrationAssociationSummary = (output, conte
1818
1364
  };
1819
1365
  };
1820
1366
  const deserializeAws_restJson1DataIntegrationsList = (output, context) => {
1821
- return (output || [])
1367
+ const retVal = (output || [])
1822
1368
  .filter((e) => e != null)
1823
1369
  .map((entry) => {
1824
1370
  if (entry === null) {
@@ -1826,6 +1372,7 @@ const deserializeAws_restJson1DataIntegrationsList = (output, context) => {
1826
1372
  }
1827
1373
  return deserializeAws_restJson1DataIntegrationSummary(entry, context);
1828
1374
  });
1375
+ return retVal;
1829
1376
  };
1830
1377
  const deserializeAws_restJson1DataIntegrationSummary = (output, context) => {
1831
1378
  return {
@@ -1866,7 +1413,7 @@ const deserializeAws_restJson1EventIntegrationAssociation = (output, context) =>
1866
1413
  };
1867
1414
  };
1868
1415
  const deserializeAws_restJson1EventIntegrationAssociationsList = (output, context) => {
1869
- return (output || [])
1416
+ const retVal = (output || [])
1870
1417
  .filter((e) => e != null)
1871
1418
  .map((entry) => {
1872
1419
  if (entry === null) {
@@ -1874,9 +1421,10 @@ const deserializeAws_restJson1EventIntegrationAssociationsList = (output, contex
1874
1421
  }
1875
1422
  return deserializeAws_restJson1EventIntegrationAssociation(entry, context);
1876
1423
  });
1424
+ return retVal;
1877
1425
  };
1878
1426
  const deserializeAws_restJson1EventIntegrationsList = (output, context) => {
1879
- return (output || [])
1427
+ const retVal = (output || [])
1880
1428
  .filter((e) => e != null)
1881
1429
  .map((entry) => {
1882
1430
  if (entry === null) {
@@ -1884,6 +1432,7 @@ const deserializeAws_restJson1EventIntegrationsList = (output, context) => {
1884
1432
  }
1885
1433
  return deserializeAws_restJson1EventIntegration(entry, context);
1886
1434
  });
1435
+ return retVal;
1887
1436
  };
1888
1437
  const deserializeAws_restJson1ScheduleConfiguration = (output, context) => {
1889
1438
  return {