@aws-sdk/client-ram 3.52.0 → 3.54.1

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.
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_restJson1UpdateResourceShareCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1RejectResourceShareInvitationCommand = exports.deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand = exports.deserializeAws_restJson1ListResourceTypesCommand = exports.deserializeAws_restJson1ListResourceSharePermissionsCommand = exports.deserializeAws_restJson1ListResourcesCommand = exports.deserializeAws_restJson1ListPrincipalsCommand = exports.deserializeAws_restJson1ListPermissionVersionsCommand = exports.deserializeAws_restJson1ListPermissionsCommand = exports.deserializeAws_restJson1ListPendingInvitationResourcesCommand = exports.deserializeAws_restJson1GetResourceSharesCommand = exports.deserializeAws_restJson1GetResourceShareInvitationsCommand = exports.deserializeAws_restJson1GetResourceShareAssociationsCommand = exports.deserializeAws_restJson1GetResourcePoliciesCommand = exports.deserializeAws_restJson1GetPermissionCommand = exports.deserializeAws_restJson1EnableSharingWithAwsOrganizationCommand = exports.deserializeAws_restJson1DisassociateResourceSharePermissionCommand = exports.deserializeAws_restJson1DisassociateResourceShareCommand = exports.deserializeAws_restJson1DeleteResourceShareCommand = exports.deserializeAws_restJson1CreateResourceShareCommand = exports.deserializeAws_restJson1AssociateResourceSharePermissionCommand = exports.deserializeAws_restJson1AssociateResourceShareCommand = exports.deserializeAws_restJson1AcceptResourceShareInvitationCommand = exports.serializeAws_restJson1UpdateResourceShareCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1RejectResourceShareInvitationCommand = exports.serializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand = exports.serializeAws_restJson1ListResourceTypesCommand = exports.serializeAws_restJson1ListResourceSharePermissionsCommand = exports.serializeAws_restJson1ListResourcesCommand = exports.serializeAws_restJson1ListPrincipalsCommand = exports.serializeAws_restJson1ListPermissionVersionsCommand = exports.serializeAws_restJson1ListPermissionsCommand = exports.serializeAws_restJson1ListPendingInvitationResourcesCommand = exports.serializeAws_restJson1GetResourceSharesCommand = exports.serializeAws_restJson1GetResourceShareInvitationsCommand = exports.serializeAws_restJson1GetResourceShareAssociationsCommand = exports.serializeAws_restJson1GetResourcePoliciesCommand = exports.serializeAws_restJson1GetPermissionCommand = exports.serializeAws_restJson1EnableSharingWithAwsOrganizationCommand = exports.serializeAws_restJson1DisassociateResourceSharePermissionCommand = exports.serializeAws_restJson1DisassociateResourceShareCommand = exports.serializeAws_restJson1DeleteResourceShareCommand = exports.serializeAws_restJson1CreateResourceShareCommand = exports.serializeAws_restJson1AssociateResourceSharePermissionCommand = exports.serializeAws_restJson1AssociateResourceShareCommand = exports.serializeAws_restJson1AcceptResourceShareInvitationCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const RAMServiceException_1 = require("../models/RAMServiceException");
6
8
  const serializeAws_restJson1AcceptResourceShareInvitationCommand = async (input, context) => {
7
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
10
  const headers = {
@@ -697,99 +699,43 @@ const deserializeAws_restJson1AcceptResourceShareInvitationCommandError = async
697
699
  switch (errorCode) {
698
700
  case "IdempotentParameterMismatchException":
699
701
  case "com.amazonaws.ram#IdempotentParameterMismatchException":
700
- response = {
701
- ...(await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
702
- name: errorCode,
703
- $metadata: deserializeMetadata(output),
704
- };
705
- break;
702
+ throw await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
706
703
  case "InvalidClientTokenException":
707
704
  case "com.amazonaws.ram#InvalidClientTokenException":
708
- response = {
709
- ...(await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context)),
710
- name: errorCode,
711
- $metadata: deserializeMetadata(output),
712
- };
713
- break;
705
+ throw await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context);
714
706
  case "MalformedArnException":
715
707
  case "com.amazonaws.ram#MalformedArnException":
716
- response = {
717
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
718
- name: errorCode,
719
- $metadata: deserializeMetadata(output),
720
- };
721
- break;
708
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
722
709
  case "OperationNotPermittedException":
723
710
  case "com.amazonaws.ram#OperationNotPermittedException":
724
- response = {
725
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
726
- name: errorCode,
727
- $metadata: deserializeMetadata(output),
728
- };
729
- break;
711
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
730
712
  case "ResourceShareInvitationAlreadyAcceptedException":
731
713
  case "com.amazonaws.ram#ResourceShareInvitationAlreadyAcceptedException":
732
- response = {
733
- ...(await deserializeAws_restJson1ResourceShareInvitationAlreadyAcceptedExceptionResponse(parsedOutput, context)),
734
- name: errorCode,
735
- $metadata: deserializeMetadata(output),
736
- };
737
- break;
714
+ throw await deserializeAws_restJson1ResourceShareInvitationAlreadyAcceptedExceptionResponse(parsedOutput, context);
738
715
  case "ResourceShareInvitationAlreadyRejectedException":
739
716
  case "com.amazonaws.ram#ResourceShareInvitationAlreadyRejectedException":
740
- response = {
741
- ...(await deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionResponse(parsedOutput, context)),
742
- name: errorCode,
743
- $metadata: deserializeMetadata(output),
744
- };
745
- break;
717
+ throw await deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionResponse(parsedOutput, context);
746
718
  case "ResourceShareInvitationArnNotFoundException":
747
719
  case "com.amazonaws.ram#ResourceShareInvitationArnNotFoundException":
748
- response = {
749
- ...(await deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse(parsedOutput, context)),
750
- name: errorCode,
751
- $metadata: deserializeMetadata(output),
752
- };
753
- break;
720
+ throw await deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse(parsedOutput, context);
754
721
  case "ResourceShareInvitationExpiredException":
755
722
  case "com.amazonaws.ram#ResourceShareInvitationExpiredException":
756
- response = {
757
- ...(await deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse(parsedOutput, context)),
758
- name: errorCode,
759
- $metadata: deserializeMetadata(output),
760
- };
761
- break;
723
+ throw await deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse(parsedOutput, context);
762
724
  case "ServerInternalException":
763
725
  case "com.amazonaws.ram#ServerInternalException":
764
- response = {
765
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
766
- name: errorCode,
767
- $metadata: deserializeMetadata(output),
768
- };
769
- break;
726
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
770
727
  case "ServiceUnavailableException":
771
728
  case "com.amazonaws.ram#ServiceUnavailableException":
772
- response = {
773
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
774
- name: errorCode,
775
- $metadata: deserializeMetadata(output),
776
- };
777
- break;
729
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
778
730
  default:
779
731
  const parsedBody = parsedOutput.body;
780
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
781
- response = {
782
- ...parsedBody,
783
- name: `${errorCode}`,
784
- message: parsedBody.message || parsedBody.Message || errorCode,
732
+ response = new RAMServiceException_1.RAMServiceException({
733
+ name: parsedBody.code || parsedBody.Code || errorCode,
785
734
  $fault: "client",
786
735
  $metadata: deserializeMetadata(output),
787
- };
736
+ });
737
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
788
738
  }
789
- const message = response.message || response.Message || errorCode;
790
- response.message = message;
791
- delete response.Message;
792
- return Promise.reject(Object.assign(new Error(message), response));
793
739
  };
794
740
  const deserializeAws_restJson1AssociateResourceShareCommand = async (output, context) => {
795
741
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -821,107 +767,46 @@ const deserializeAws_restJson1AssociateResourceShareCommandError = async (output
821
767
  switch (errorCode) {
822
768
  case "IdempotentParameterMismatchException":
823
769
  case "com.amazonaws.ram#IdempotentParameterMismatchException":
824
- response = {
825
- ...(await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
826
- name: errorCode,
827
- $metadata: deserializeMetadata(output),
828
- };
829
- break;
770
+ throw await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
830
771
  case "InvalidClientTokenException":
831
772
  case "com.amazonaws.ram#InvalidClientTokenException":
832
- response = {
833
- ...(await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context)),
834
- name: errorCode,
835
- $metadata: deserializeMetadata(output),
836
- };
837
- break;
773
+ throw await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context);
838
774
  case "InvalidParameterException":
839
775
  case "com.amazonaws.ram#InvalidParameterException":
840
- response = {
841
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
842
- name: errorCode,
843
- $metadata: deserializeMetadata(output),
844
- };
845
- break;
776
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
846
777
  case "InvalidStateTransitionException":
847
778
  case "com.amazonaws.ram#InvalidStateTransitionException":
848
- response = {
849
- ...(await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context)),
850
- name: errorCode,
851
- $metadata: deserializeMetadata(output),
852
- };
853
- break;
779
+ throw await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context);
854
780
  case "MalformedArnException":
855
781
  case "com.amazonaws.ram#MalformedArnException":
856
- response = {
857
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
858
- name: errorCode,
859
- $metadata: deserializeMetadata(output),
860
- };
861
- break;
782
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
862
783
  case "OperationNotPermittedException":
863
784
  case "com.amazonaws.ram#OperationNotPermittedException":
864
- response = {
865
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
866
- name: errorCode,
867
- $metadata: deserializeMetadata(output),
868
- };
869
- break;
785
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
870
786
  case "ResourceShareLimitExceededException":
871
787
  case "com.amazonaws.ram#ResourceShareLimitExceededException":
872
- response = {
873
- ...(await deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse(parsedOutput, context)),
874
- name: errorCode,
875
- $metadata: deserializeMetadata(output),
876
- };
877
- break;
788
+ throw await deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse(parsedOutput, context);
878
789
  case "ServerInternalException":
879
790
  case "com.amazonaws.ram#ServerInternalException":
880
- response = {
881
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
882
- name: errorCode,
883
- $metadata: deserializeMetadata(output),
884
- };
885
- break;
791
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
886
792
  case "ServiceUnavailableException":
887
793
  case "com.amazonaws.ram#ServiceUnavailableException":
888
- response = {
889
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
890
- name: errorCode,
891
- $metadata: deserializeMetadata(output),
892
- };
893
- break;
794
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
894
795
  case "ThrottlingException":
895
796
  case "com.amazonaws.ram#ThrottlingException":
896
- response = {
897
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
898
- name: errorCode,
899
- $metadata: deserializeMetadata(output),
900
- };
901
- break;
797
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
902
798
  case "UnknownResourceException":
903
799
  case "com.amazonaws.ram#UnknownResourceException":
904
- response = {
905
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
906
- name: errorCode,
907
- $metadata: deserializeMetadata(output),
908
- };
909
- break;
800
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
910
801
  default:
911
802
  const parsedBody = parsedOutput.body;
912
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
913
- response = {
914
- ...parsedBody,
915
- name: `${errorCode}`,
916
- message: parsedBody.message || parsedBody.Message || errorCode,
803
+ response = new RAMServiceException_1.RAMServiceException({
804
+ name: parsedBody.code || parsedBody.Code || errorCode,
917
805
  $fault: "client",
918
806
  $metadata: deserializeMetadata(output),
919
- };
807
+ });
808
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
920
809
  }
921
- const message = response.message || response.Message || errorCode;
922
- response.message = message;
923
- delete response.Message;
924
- return Promise.reject(Object.assign(new Error(message), response));
925
810
  };
926
811
  const deserializeAws_restJson1AssociateResourceSharePermissionCommand = async (output, context) => {
927
812
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -953,75 +838,34 @@ const deserializeAws_restJson1AssociateResourceSharePermissionCommandError = asy
953
838
  switch (errorCode) {
954
839
  case "InvalidClientTokenException":
955
840
  case "com.amazonaws.ram#InvalidClientTokenException":
956
- response = {
957
- ...(await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context)),
958
- name: errorCode,
959
- $metadata: deserializeMetadata(output),
960
- };
961
- break;
841
+ throw await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context);
962
842
  case "InvalidParameterException":
963
843
  case "com.amazonaws.ram#InvalidParameterException":
964
- response = {
965
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
966
- name: errorCode,
967
- $metadata: deserializeMetadata(output),
968
- };
969
- break;
844
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
970
845
  case "MalformedArnException":
971
846
  case "com.amazonaws.ram#MalformedArnException":
972
- response = {
973
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
974
- name: errorCode,
975
- $metadata: deserializeMetadata(output),
976
- };
977
- break;
847
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
978
848
  case "OperationNotPermittedException":
979
849
  case "com.amazonaws.ram#OperationNotPermittedException":
980
- response = {
981
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
982
- name: errorCode,
983
- $metadata: deserializeMetadata(output),
984
- };
985
- break;
850
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
986
851
  case "ServerInternalException":
987
852
  case "com.amazonaws.ram#ServerInternalException":
988
- response = {
989
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
990
- name: errorCode,
991
- $metadata: deserializeMetadata(output),
992
- };
993
- break;
853
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
994
854
  case "ServiceUnavailableException":
995
855
  case "com.amazonaws.ram#ServiceUnavailableException":
996
- response = {
997
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
998
- name: errorCode,
999
- $metadata: deserializeMetadata(output),
1000
- };
1001
- break;
856
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1002
857
  case "UnknownResourceException":
1003
858
  case "com.amazonaws.ram#UnknownResourceException":
1004
- response = {
1005
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
1006
- name: errorCode,
1007
- $metadata: deserializeMetadata(output),
1008
- };
1009
- break;
859
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1010
860
  default:
1011
861
  const parsedBody = parsedOutput.body;
1012
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1013
- response = {
1014
- ...parsedBody,
1015
- name: `${errorCode}`,
1016
- message: parsedBody.message || parsedBody.Message || errorCode,
862
+ response = new RAMServiceException_1.RAMServiceException({
863
+ name: parsedBody.code || parsedBody.Code || errorCode,
1017
864
  $fault: "client",
1018
865
  $metadata: deserializeMetadata(output),
1019
- };
866
+ });
867
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1020
868
  }
1021
- const message = response.message || response.Message || errorCode;
1022
- response.message = message;
1023
- delete response.Message;
1024
- return Promise.reject(Object.assign(new Error(message), response));
1025
869
  };
1026
870
  const deserializeAws_restJson1CreateResourceShareCommand = async (output, context) => {
1027
871
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1053,107 +897,46 @@ const deserializeAws_restJson1CreateResourceShareCommandError = async (output, c
1053
897
  switch (errorCode) {
1054
898
  case "IdempotentParameterMismatchException":
1055
899
  case "com.amazonaws.ram#IdempotentParameterMismatchException":
1056
- response = {
1057
- ...(await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
1058
- name: errorCode,
1059
- $metadata: deserializeMetadata(output),
1060
- };
1061
- break;
900
+ throw await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
1062
901
  case "InvalidClientTokenException":
1063
902
  case "com.amazonaws.ram#InvalidClientTokenException":
1064
- response = {
1065
- ...(await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context)),
1066
- name: errorCode,
1067
- $metadata: deserializeMetadata(output),
1068
- };
1069
- break;
903
+ throw await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context);
1070
904
  case "InvalidParameterException":
1071
905
  case "com.amazonaws.ram#InvalidParameterException":
1072
- response = {
1073
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
1074
- name: errorCode,
1075
- $metadata: deserializeMetadata(output),
1076
- };
1077
- break;
906
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
1078
907
  case "InvalidStateTransitionException":
1079
908
  case "com.amazonaws.ram#InvalidStateTransitionException":
1080
- response = {
1081
- ...(await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context)),
1082
- name: errorCode,
1083
- $metadata: deserializeMetadata(output),
1084
- };
1085
- break;
909
+ throw await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context);
1086
910
  case "MalformedArnException":
1087
911
  case "com.amazonaws.ram#MalformedArnException":
1088
- response = {
1089
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
1090
- name: errorCode,
1091
- $metadata: deserializeMetadata(output),
1092
- };
1093
- break;
912
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
1094
913
  case "OperationNotPermittedException":
1095
914
  case "com.amazonaws.ram#OperationNotPermittedException":
1096
- response = {
1097
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1098
- name: errorCode,
1099
- $metadata: deserializeMetadata(output),
1100
- };
1101
- break;
915
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
1102
916
  case "ResourceShareLimitExceededException":
1103
917
  case "com.amazonaws.ram#ResourceShareLimitExceededException":
1104
- response = {
1105
- ...(await deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse(parsedOutput, context)),
1106
- name: errorCode,
1107
- $metadata: deserializeMetadata(output),
1108
- };
1109
- break;
918
+ throw await deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse(parsedOutput, context);
1110
919
  case "ServerInternalException":
1111
920
  case "com.amazonaws.ram#ServerInternalException":
1112
- response = {
1113
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
1114
- name: errorCode,
1115
- $metadata: deserializeMetadata(output),
1116
- };
1117
- break;
921
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
1118
922
  case "ServiceUnavailableException":
1119
923
  case "com.amazonaws.ram#ServiceUnavailableException":
1120
- response = {
1121
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1122
- name: errorCode,
1123
- $metadata: deserializeMetadata(output),
1124
- };
1125
- break;
924
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1126
925
  case "TagPolicyViolationException":
1127
926
  case "com.amazonaws.ram#TagPolicyViolationException":
1128
- response = {
1129
- ...(await deserializeAws_restJson1TagPolicyViolationExceptionResponse(parsedOutput, context)),
1130
- name: errorCode,
1131
- $metadata: deserializeMetadata(output),
1132
- };
1133
- break;
927
+ throw await deserializeAws_restJson1TagPolicyViolationExceptionResponse(parsedOutput, context);
1134
928
  case "UnknownResourceException":
1135
929
  case "com.amazonaws.ram#UnknownResourceException":
1136
- response = {
1137
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
1138
- name: errorCode,
1139
- $metadata: deserializeMetadata(output),
1140
- };
1141
- break;
930
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1142
931
  default:
1143
932
  const parsedBody = parsedOutput.body;
1144
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1145
- response = {
1146
- ...parsedBody,
1147
- name: `${errorCode}`,
1148
- message: parsedBody.message || parsedBody.Message || errorCode,
933
+ response = new RAMServiceException_1.RAMServiceException({
934
+ name: parsedBody.code || parsedBody.Code || errorCode,
1149
935
  $fault: "client",
1150
936
  $metadata: deserializeMetadata(output),
1151
- };
937
+ });
938
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1152
939
  }
1153
- const message = response.message || response.Message || errorCode;
1154
- response.message = message;
1155
- delete response.Message;
1156
- return Promise.reject(Object.assign(new Error(message), response));
1157
940
  };
1158
941
  const deserializeAws_restJson1DeleteResourceShareCommand = async (output, context) => {
1159
942
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1185,91 +968,40 @@ const deserializeAws_restJson1DeleteResourceShareCommandError = async (output, c
1185
968
  switch (errorCode) {
1186
969
  case "IdempotentParameterMismatchException":
1187
970
  case "com.amazonaws.ram#IdempotentParameterMismatchException":
1188
- response = {
1189
- ...(await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
1190
- name: errorCode,
1191
- $metadata: deserializeMetadata(output),
1192
- };
1193
- break;
971
+ throw await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
1194
972
  case "InvalidClientTokenException":
1195
973
  case "com.amazonaws.ram#InvalidClientTokenException":
1196
- response = {
1197
- ...(await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context)),
1198
- name: errorCode,
1199
- $metadata: deserializeMetadata(output),
1200
- };
1201
- break;
974
+ throw await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context);
1202
975
  case "InvalidParameterException":
1203
976
  case "com.amazonaws.ram#InvalidParameterException":
1204
- response = {
1205
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
1206
- name: errorCode,
1207
- $metadata: deserializeMetadata(output),
1208
- };
1209
- break;
977
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
1210
978
  case "InvalidStateTransitionException":
1211
979
  case "com.amazonaws.ram#InvalidStateTransitionException":
1212
- response = {
1213
- ...(await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context)),
1214
- name: errorCode,
1215
- $metadata: deserializeMetadata(output),
1216
- };
1217
- break;
980
+ throw await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context);
1218
981
  case "MalformedArnException":
1219
982
  case "com.amazonaws.ram#MalformedArnException":
1220
- response = {
1221
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
1222
- name: errorCode,
1223
- $metadata: deserializeMetadata(output),
1224
- };
1225
- break;
983
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
1226
984
  case "OperationNotPermittedException":
1227
985
  case "com.amazonaws.ram#OperationNotPermittedException":
1228
- response = {
1229
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1230
- name: errorCode,
1231
- $metadata: deserializeMetadata(output),
1232
- };
1233
- break;
986
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
1234
987
  case "ServerInternalException":
1235
988
  case "com.amazonaws.ram#ServerInternalException":
1236
- response = {
1237
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
1238
- name: errorCode,
1239
- $metadata: deserializeMetadata(output),
1240
- };
1241
- break;
989
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
1242
990
  case "ServiceUnavailableException":
1243
991
  case "com.amazonaws.ram#ServiceUnavailableException":
1244
- response = {
1245
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1246
- name: errorCode,
1247
- $metadata: deserializeMetadata(output),
1248
- };
1249
- break;
992
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1250
993
  case "UnknownResourceException":
1251
994
  case "com.amazonaws.ram#UnknownResourceException":
1252
- response = {
1253
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
1254
- name: errorCode,
1255
- $metadata: deserializeMetadata(output),
1256
- };
1257
- break;
995
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1258
996
  default:
1259
997
  const parsedBody = parsedOutput.body;
1260
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1261
- response = {
1262
- ...parsedBody,
1263
- name: `${errorCode}`,
1264
- message: parsedBody.message || parsedBody.Message || errorCode,
998
+ response = new RAMServiceException_1.RAMServiceException({
999
+ name: parsedBody.code || parsedBody.Code || errorCode,
1265
1000
  $fault: "client",
1266
1001
  $metadata: deserializeMetadata(output),
1267
- };
1002
+ });
1003
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1268
1004
  }
1269
- const message = response.message || response.Message || errorCode;
1270
- response.message = message;
1271
- delete response.Message;
1272
- return Promise.reject(Object.assign(new Error(message), response));
1273
1005
  };
1274
1006
  const deserializeAws_restJson1DisassociateResourceShareCommand = async (output, context) => {
1275
1007
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1301,99 +1033,43 @@ const deserializeAws_restJson1DisassociateResourceShareCommandError = async (out
1301
1033
  switch (errorCode) {
1302
1034
  case "IdempotentParameterMismatchException":
1303
1035
  case "com.amazonaws.ram#IdempotentParameterMismatchException":
1304
- response = {
1305
- ...(await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
1306
- name: errorCode,
1307
- $metadata: deserializeMetadata(output),
1308
- };
1309
- break;
1036
+ throw await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
1310
1037
  case "InvalidClientTokenException":
1311
1038
  case "com.amazonaws.ram#InvalidClientTokenException":
1312
- response = {
1313
- ...(await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context)),
1314
- name: errorCode,
1315
- $metadata: deserializeMetadata(output),
1316
- };
1317
- break;
1039
+ throw await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context);
1318
1040
  case "InvalidParameterException":
1319
1041
  case "com.amazonaws.ram#InvalidParameterException":
1320
- response = {
1321
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
1322
- name: errorCode,
1323
- $metadata: deserializeMetadata(output),
1324
- };
1325
- break;
1042
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
1326
1043
  case "InvalidStateTransitionException":
1327
1044
  case "com.amazonaws.ram#InvalidStateTransitionException":
1328
- response = {
1329
- ...(await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context)),
1330
- name: errorCode,
1331
- $metadata: deserializeMetadata(output),
1332
- };
1333
- break;
1045
+ throw await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context);
1334
1046
  case "MalformedArnException":
1335
1047
  case "com.amazonaws.ram#MalformedArnException":
1336
- response = {
1337
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
1338
- name: errorCode,
1339
- $metadata: deserializeMetadata(output),
1340
- };
1341
- break;
1048
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
1342
1049
  case "OperationNotPermittedException":
1343
1050
  case "com.amazonaws.ram#OperationNotPermittedException":
1344
- response = {
1345
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1346
- name: errorCode,
1347
- $metadata: deserializeMetadata(output),
1348
- };
1349
- break;
1051
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
1350
1052
  case "ResourceShareLimitExceededException":
1351
1053
  case "com.amazonaws.ram#ResourceShareLimitExceededException":
1352
- response = {
1353
- ...(await deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse(parsedOutput, context)),
1354
- name: errorCode,
1355
- $metadata: deserializeMetadata(output),
1356
- };
1357
- break;
1054
+ throw await deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse(parsedOutput, context);
1358
1055
  case "ServerInternalException":
1359
1056
  case "com.amazonaws.ram#ServerInternalException":
1360
- response = {
1361
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
1362
- name: errorCode,
1363
- $metadata: deserializeMetadata(output),
1364
- };
1365
- break;
1057
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
1366
1058
  case "ServiceUnavailableException":
1367
1059
  case "com.amazonaws.ram#ServiceUnavailableException":
1368
- response = {
1369
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1370
- name: errorCode,
1371
- $metadata: deserializeMetadata(output),
1372
- };
1373
- break;
1060
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1374
1061
  case "UnknownResourceException":
1375
1062
  case "com.amazonaws.ram#UnknownResourceException":
1376
- response = {
1377
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
1378
- name: errorCode,
1379
- $metadata: deserializeMetadata(output),
1380
- };
1381
- break;
1063
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1382
1064
  default:
1383
1065
  const parsedBody = parsedOutput.body;
1384
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1385
- response = {
1386
- ...parsedBody,
1387
- name: `${errorCode}`,
1388
- message: parsedBody.message || parsedBody.Message || errorCode,
1066
+ response = new RAMServiceException_1.RAMServiceException({
1067
+ name: parsedBody.code || parsedBody.Code || errorCode,
1389
1068
  $fault: "client",
1390
1069
  $metadata: deserializeMetadata(output),
1391
- };
1070
+ });
1071
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1392
1072
  }
1393
- const message = response.message || response.Message || errorCode;
1394
- response.message = message;
1395
- delete response.Message;
1396
- return Promise.reject(Object.assign(new Error(message), response));
1397
1073
  };
1398
1074
  const deserializeAws_restJson1DisassociateResourceSharePermissionCommand = async (output, context) => {
1399
1075
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1425,83 +1101,37 @@ const deserializeAws_restJson1DisassociateResourceSharePermissionCommandError =
1425
1101
  switch (errorCode) {
1426
1102
  case "InvalidClientTokenException":
1427
1103
  case "com.amazonaws.ram#InvalidClientTokenException":
1428
- response = {
1429
- ...(await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context)),
1430
- name: errorCode,
1431
- $metadata: deserializeMetadata(output),
1432
- };
1433
- break;
1104
+ throw await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context);
1434
1105
  case "InvalidParameterException":
1435
1106
  case "com.amazonaws.ram#InvalidParameterException":
1436
- response = {
1437
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
1438
- name: errorCode,
1439
- $metadata: deserializeMetadata(output),
1440
- };
1441
- break;
1107
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
1442
1108
  case "InvalidStateTransitionException":
1443
1109
  case "com.amazonaws.ram#InvalidStateTransitionException":
1444
- response = {
1445
- ...(await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context)),
1446
- name: errorCode,
1447
- $metadata: deserializeMetadata(output),
1448
- };
1449
- break;
1110
+ throw await deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context);
1450
1111
  case "MalformedArnException":
1451
1112
  case "com.amazonaws.ram#MalformedArnException":
1452
- response = {
1453
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
1454
- name: errorCode,
1455
- $metadata: deserializeMetadata(output),
1456
- };
1457
- break;
1113
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
1458
1114
  case "OperationNotPermittedException":
1459
1115
  case "com.amazonaws.ram#OperationNotPermittedException":
1460
- response = {
1461
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1462
- name: errorCode,
1463
- $metadata: deserializeMetadata(output),
1464
- };
1465
- break;
1116
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
1466
1117
  case "ServerInternalException":
1467
1118
  case "com.amazonaws.ram#ServerInternalException":
1468
- response = {
1469
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
1470
- name: errorCode,
1471
- $metadata: deserializeMetadata(output),
1472
- };
1473
- break;
1119
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
1474
1120
  case "ServiceUnavailableException":
1475
1121
  case "com.amazonaws.ram#ServiceUnavailableException":
1476
- response = {
1477
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1478
- name: errorCode,
1479
- $metadata: deserializeMetadata(output),
1480
- };
1481
- break;
1122
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1482
1123
  case "UnknownResourceException":
1483
1124
  case "com.amazonaws.ram#UnknownResourceException":
1484
- response = {
1485
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
1486
- name: errorCode,
1487
- $metadata: deserializeMetadata(output),
1488
- };
1489
- break;
1125
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1490
1126
  default:
1491
1127
  const parsedBody = parsedOutput.body;
1492
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1493
- response = {
1494
- ...parsedBody,
1495
- name: `${errorCode}`,
1496
- message: parsedBody.message || parsedBody.Message || errorCode,
1128
+ response = new RAMServiceException_1.RAMServiceException({
1129
+ name: parsedBody.code || parsedBody.Code || errorCode,
1497
1130
  $fault: "client",
1498
1131
  $metadata: deserializeMetadata(output),
1499
- };
1132
+ });
1133
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1500
1134
  }
1501
- const message = response.message || response.Message || errorCode;
1502
- response.message = message;
1503
- delete response.Message;
1504
- return Promise.reject(Object.assign(new Error(message), response));
1505
1135
  };
1506
1136
  const deserializeAws_restJson1EnableSharingWithAwsOrganizationCommand = async (output, context) => {
1507
1137
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1529,43 +1159,22 @@ const deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError = asy
1529
1159
  switch (errorCode) {
1530
1160
  case "OperationNotPermittedException":
1531
1161
  case "com.amazonaws.ram#OperationNotPermittedException":
1532
- response = {
1533
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1534
- name: errorCode,
1535
- $metadata: deserializeMetadata(output),
1536
- };
1537
- break;
1162
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
1538
1163
  case "ServerInternalException":
1539
1164
  case "com.amazonaws.ram#ServerInternalException":
1540
- response = {
1541
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
1542
- name: errorCode,
1543
- $metadata: deserializeMetadata(output),
1544
- };
1545
- break;
1165
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
1546
1166
  case "ServiceUnavailableException":
1547
1167
  case "com.amazonaws.ram#ServiceUnavailableException":
1548
- response = {
1549
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1550
- name: errorCode,
1551
- $metadata: deserializeMetadata(output),
1552
- };
1553
- break;
1168
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1554
1169
  default:
1555
1170
  const parsedBody = parsedOutput.body;
1556
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1557
- response = {
1558
- ...parsedBody,
1559
- name: `${errorCode}`,
1560
- message: parsedBody.message || parsedBody.Message || errorCode,
1171
+ response = new RAMServiceException_1.RAMServiceException({
1172
+ name: parsedBody.code || parsedBody.Code || errorCode,
1561
1173
  $fault: "client",
1562
1174
  $metadata: deserializeMetadata(output),
1563
- };
1175
+ });
1176
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1564
1177
  }
1565
- const message = response.message || response.Message || errorCode;
1566
- response.message = message;
1567
- delete response.Message;
1568
- return Promise.reject(Object.assign(new Error(message), response));
1569
1178
  };
1570
1179
  const deserializeAws_restJson1GetPermissionCommand = async (output, context) => {
1571
1180
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1593,67 +1202,31 @@ const deserializeAws_restJson1GetPermissionCommandError = async (output, context
1593
1202
  switch (errorCode) {
1594
1203
  case "InvalidParameterException":
1595
1204
  case "com.amazonaws.ram#InvalidParameterException":
1596
- response = {
1597
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
1598
- name: errorCode,
1599
- $metadata: deserializeMetadata(output),
1600
- };
1601
- break;
1205
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
1602
1206
  case "MalformedArnException":
1603
1207
  case "com.amazonaws.ram#MalformedArnException":
1604
- response = {
1605
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
1606
- name: errorCode,
1607
- $metadata: deserializeMetadata(output),
1608
- };
1609
- break;
1208
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
1610
1209
  case "OperationNotPermittedException":
1611
1210
  case "com.amazonaws.ram#OperationNotPermittedException":
1612
- response = {
1613
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1614
- name: errorCode,
1615
- $metadata: deserializeMetadata(output),
1616
- };
1617
- break;
1211
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
1618
1212
  case "ServerInternalException":
1619
1213
  case "com.amazonaws.ram#ServerInternalException":
1620
- response = {
1621
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
1622
- name: errorCode,
1623
- $metadata: deserializeMetadata(output),
1624
- };
1625
- break;
1214
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
1626
1215
  case "ServiceUnavailableException":
1627
1216
  case "com.amazonaws.ram#ServiceUnavailableException":
1628
- response = {
1629
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1630
- name: errorCode,
1631
- $metadata: deserializeMetadata(output),
1632
- };
1633
- break;
1217
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1634
1218
  case "UnknownResourceException":
1635
1219
  case "com.amazonaws.ram#UnknownResourceException":
1636
- response = {
1637
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
1638
- name: errorCode,
1639
- $metadata: deserializeMetadata(output),
1640
- };
1641
- break;
1220
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1642
1221
  default:
1643
1222
  const parsedBody = parsedOutput.body;
1644
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1645
- response = {
1646
- ...parsedBody,
1647
- name: `${errorCode}`,
1648
- message: parsedBody.message || parsedBody.Message || errorCode,
1223
+ response = new RAMServiceException_1.RAMServiceException({
1224
+ name: parsedBody.code || parsedBody.Code || errorCode,
1649
1225
  $fault: "client",
1650
1226
  $metadata: deserializeMetadata(output),
1651
- };
1227
+ });
1228
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1652
1229
  }
1653
- const message = response.message || response.Message || errorCode;
1654
- response.message = message;
1655
- delete response.Message;
1656
- return Promise.reject(Object.assign(new Error(message), response));
1657
1230
  };
1658
1231
  const deserializeAws_restJson1GetResourcePoliciesCommand = async (output, context) => {
1659
1232
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1685,67 +1258,31 @@ const deserializeAws_restJson1GetResourcePoliciesCommandError = async (output, c
1685
1258
  switch (errorCode) {
1686
1259
  case "InvalidNextTokenException":
1687
1260
  case "com.amazonaws.ram#InvalidNextTokenException":
1688
- response = {
1689
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
1690
- name: errorCode,
1691
- $metadata: deserializeMetadata(output),
1692
- };
1693
- break;
1261
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
1694
1262
  case "InvalidParameterException":
1695
1263
  case "com.amazonaws.ram#InvalidParameterException":
1696
- response = {
1697
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
1698
- name: errorCode,
1699
- $metadata: deserializeMetadata(output),
1700
- };
1701
- break;
1264
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
1702
1265
  case "MalformedArnException":
1703
1266
  case "com.amazonaws.ram#MalformedArnException":
1704
- response = {
1705
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
1706
- name: errorCode,
1707
- $metadata: deserializeMetadata(output),
1708
- };
1709
- break;
1267
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
1710
1268
  case "ResourceArnNotFoundException":
1711
1269
  case "com.amazonaws.ram#ResourceArnNotFoundException":
1712
- response = {
1713
- ...(await deserializeAws_restJson1ResourceArnNotFoundExceptionResponse(parsedOutput, context)),
1714
- name: errorCode,
1715
- $metadata: deserializeMetadata(output),
1716
- };
1717
- break;
1270
+ throw await deserializeAws_restJson1ResourceArnNotFoundExceptionResponse(parsedOutput, context);
1718
1271
  case "ServerInternalException":
1719
1272
  case "com.amazonaws.ram#ServerInternalException":
1720
- response = {
1721
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
1722
- name: errorCode,
1723
- $metadata: deserializeMetadata(output),
1724
- };
1725
- break;
1273
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
1726
1274
  case "ServiceUnavailableException":
1727
1275
  case "com.amazonaws.ram#ServiceUnavailableException":
1728
- response = {
1729
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1730
- name: errorCode,
1731
- $metadata: deserializeMetadata(output),
1732
- };
1733
- break;
1276
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1734
1277
  default:
1735
1278
  const parsedBody = parsedOutput.body;
1736
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1737
- response = {
1738
- ...parsedBody,
1739
- name: `${errorCode}`,
1740
- message: parsedBody.message || parsedBody.Message || errorCode,
1279
+ response = new RAMServiceException_1.RAMServiceException({
1280
+ name: parsedBody.code || parsedBody.Code || errorCode,
1741
1281
  $fault: "client",
1742
1282
  $metadata: deserializeMetadata(output),
1743
- };
1283
+ });
1284
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1744
1285
  }
1745
- const message = response.message || response.Message || errorCode;
1746
- response.message = message;
1747
- delete response.Message;
1748
- return Promise.reject(Object.assign(new Error(message), response));
1749
1286
  };
1750
1287
  const deserializeAws_restJson1GetResourceShareAssociationsCommand = async (output, context) => {
1751
1288
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1777,75 +1314,34 @@ const deserializeAws_restJson1GetResourceShareAssociationsCommandError = async (
1777
1314
  switch (errorCode) {
1778
1315
  case "InvalidNextTokenException":
1779
1316
  case "com.amazonaws.ram#InvalidNextTokenException":
1780
- response = {
1781
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
1782
- name: errorCode,
1783
- $metadata: deserializeMetadata(output),
1784
- };
1785
- break;
1317
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
1786
1318
  case "InvalidParameterException":
1787
1319
  case "com.amazonaws.ram#InvalidParameterException":
1788
- response = {
1789
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
1790
- name: errorCode,
1791
- $metadata: deserializeMetadata(output),
1792
- };
1793
- break;
1320
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
1794
1321
  case "MalformedArnException":
1795
1322
  case "com.amazonaws.ram#MalformedArnException":
1796
- response = {
1797
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
1798
- name: errorCode,
1799
- $metadata: deserializeMetadata(output),
1800
- };
1801
- break;
1323
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
1802
1324
  case "OperationNotPermittedException":
1803
1325
  case "com.amazonaws.ram#OperationNotPermittedException":
1804
- response = {
1805
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1806
- name: errorCode,
1807
- $metadata: deserializeMetadata(output),
1808
- };
1809
- break;
1326
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
1810
1327
  case "ServerInternalException":
1811
1328
  case "com.amazonaws.ram#ServerInternalException":
1812
- response = {
1813
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
1814
- name: errorCode,
1815
- $metadata: deserializeMetadata(output),
1816
- };
1817
- break;
1329
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
1818
1330
  case "ServiceUnavailableException":
1819
1331
  case "com.amazonaws.ram#ServiceUnavailableException":
1820
- response = {
1821
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1822
- name: errorCode,
1823
- $metadata: deserializeMetadata(output),
1824
- };
1825
- break;
1332
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1826
1333
  case "UnknownResourceException":
1827
1334
  case "com.amazonaws.ram#UnknownResourceException":
1828
- response = {
1829
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
1830
- name: errorCode,
1831
- $metadata: deserializeMetadata(output),
1832
- };
1833
- break;
1335
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1834
1336
  default:
1835
1337
  const parsedBody = parsedOutput.body;
1836
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1837
- response = {
1838
- ...parsedBody,
1839
- name: `${errorCode}`,
1840
- message: parsedBody.message || parsedBody.Message || errorCode,
1338
+ response = new RAMServiceException_1.RAMServiceException({
1339
+ name: parsedBody.code || parsedBody.Code || errorCode,
1841
1340
  $fault: "client",
1842
1341
  $metadata: deserializeMetadata(output),
1843
- };
1342
+ });
1343
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1844
1344
  }
1845
- const message = response.message || response.Message || errorCode;
1846
- response.message = message;
1847
- delete response.Message;
1848
- return Promise.reject(Object.assign(new Error(message), response));
1849
1345
  };
1850
1346
  const deserializeAws_restJson1GetResourceShareInvitationsCommand = async (output, context) => {
1851
1347
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1877,83 +1373,37 @@ const deserializeAws_restJson1GetResourceShareInvitationsCommandError = async (o
1877
1373
  switch (errorCode) {
1878
1374
  case "InvalidMaxResultsException":
1879
1375
  case "com.amazonaws.ram#InvalidMaxResultsException":
1880
- response = {
1881
- ...(await deserializeAws_restJson1InvalidMaxResultsExceptionResponse(parsedOutput, context)),
1882
- name: errorCode,
1883
- $metadata: deserializeMetadata(output),
1884
- };
1885
- break;
1376
+ throw await deserializeAws_restJson1InvalidMaxResultsExceptionResponse(parsedOutput, context);
1886
1377
  case "InvalidNextTokenException":
1887
1378
  case "com.amazonaws.ram#InvalidNextTokenException":
1888
- response = {
1889
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
1890
- name: errorCode,
1891
- $metadata: deserializeMetadata(output),
1892
- };
1893
- break;
1379
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
1894
1380
  case "InvalidParameterException":
1895
1381
  case "com.amazonaws.ram#InvalidParameterException":
1896
- response = {
1897
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
1898
- name: errorCode,
1899
- $metadata: deserializeMetadata(output),
1900
- };
1901
- break;
1382
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
1902
1383
  case "MalformedArnException":
1903
1384
  case "com.amazonaws.ram#MalformedArnException":
1904
- response = {
1905
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
1906
- name: errorCode,
1907
- $metadata: deserializeMetadata(output),
1908
- };
1909
- break;
1385
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
1910
1386
  case "ResourceShareInvitationArnNotFoundException":
1911
1387
  case "com.amazonaws.ram#ResourceShareInvitationArnNotFoundException":
1912
- response = {
1913
- ...(await deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse(parsedOutput, context)),
1914
- name: errorCode,
1915
- $metadata: deserializeMetadata(output),
1916
- };
1917
- break;
1388
+ throw await deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse(parsedOutput, context);
1918
1389
  case "ServerInternalException":
1919
1390
  case "com.amazonaws.ram#ServerInternalException":
1920
- response = {
1921
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
1922
- name: errorCode,
1923
- $metadata: deserializeMetadata(output),
1924
- };
1925
- break;
1391
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
1926
1392
  case "ServiceUnavailableException":
1927
1393
  case "com.amazonaws.ram#ServiceUnavailableException":
1928
- response = {
1929
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1930
- name: errorCode,
1931
- $metadata: deserializeMetadata(output),
1932
- };
1933
- break;
1394
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1934
1395
  case "UnknownResourceException":
1935
1396
  case "com.amazonaws.ram#UnknownResourceException":
1936
- response = {
1937
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
1938
- name: errorCode,
1939
- $metadata: deserializeMetadata(output),
1940
- };
1941
- break;
1397
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1942
1398
  default:
1943
1399
  const parsedBody = parsedOutput.body;
1944
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1945
- response = {
1946
- ...parsedBody,
1947
- name: `${errorCode}`,
1948
- message: parsedBody.message || parsedBody.Message || errorCode,
1400
+ response = new RAMServiceException_1.RAMServiceException({
1401
+ name: parsedBody.code || parsedBody.Code || errorCode,
1949
1402
  $fault: "client",
1950
1403
  $metadata: deserializeMetadata(output),
1951
- };
1404
+ });
1405
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1952
1406
  }
1953
- const message = response.message || response.Message || errorCode;
1954
- response.message = message;
1955
- delete response.Message;
1956
- return Promise.reject(Object.assign(new Error(message), response));
1957
1407
  };
1958
1408
  const deserializeAws_restJson1GetResourceSharesCommand = async (output, context) => {
1959
1409
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1985,67 +1435,31 @@ const deserializeAws_restJson1GetResourceSharesCommandError = async (output, con
1985
1435
  switch (errorCode) {
1986
1436
  case "InvalidNextTokenException":
1987
1437
  case "com.amazonaws.ram#InvalidNextTokenException":
1988
- response = {
1989
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
1990
- name: errorCode,
1991
- $metadata: deserializeMetadata(output),
1992
- };
1993
- break;
1438
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
1994
1439
  case "InvalidParameterException":
1995
1440
  case "com.amazonaws.ram#InvalidParameterException":
1996
- response = {
1997
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
1998
- name: errorCode,
1999
- $metadata: deserializeMetadata(output),
2000
- };
2001
- break;
1441
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2002
1442
  case "MalformedArnException":
2003
1443
  case "com.amazonaws.ram#MalformedArnException":
2004
- response = {
2005
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
2006
- name: errorCode,
2007
- $metadata: deserializeMetadata(output),
2008
- };
2009
- break;
1444
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
2010
1445
  case "ServerInternalException":
2011
1446
  case "com.amazonaws.ram#ServerInternalException":
2012
- response = {
2013
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2014
- name: errorCode,
2015
- $metadata: deserializeMetadata(output),
2016
- };
2017
- break;
1447
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2018
1448
  case "ServiceUnavailableException":
2019
1449
  case "com.amazonaws.ram#ServiceUnavailableException":
2020
- response = {
2021
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2022
- name: errorCode,
2023
- $metadata: deserializeMetadata(output),
2024
- };
2025
- break;
1450
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2026
1451
  case "UnknownResourceException":
2027
1452
  case "com.amazonaws.ram#UnknownResourceException":
2028
- response = {
2029
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
2030
- name: errorCode,
2031
- $metadata: deserializeMetadata(output),
2032
- };
2033
- break;
1453
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
2034
1454
  default:
2035
1455
  const parsedBody = parsedOutput.body;
2036
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2037
- response = {
2038
- ...parsedBody,
2039
- name: `${errorCode}`,
2040
- message: parsedBody.message || parsedBody.Message || errorCode,
1456
+ response = new RAMServiceException_1.RAMServiceException({
1457
+ name: parsedBody.code || parsedBody.Code || errorCode,
2041
1458
  $fault: "client",
2042
1459
  $metadata: deserializeMetadata(output),
2043
- };
1460
+ });
1461
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2044
1462
  }
2045
- const message = response.message || response.Message || errorCode;
2046
- response.message = message;
2047
- delete response.Message;
2048
- return Promise.reject(Object.assign(new Error(message), response));
2049
1463
  };
2050
1464
  const deserializeAws_restJson1ListPendingInvitationResourcesCommand = async (output, context) => {
2051
1465
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2077,91 +1491,40 @@ const deserializeAws_restJson1ListPendingInvitationResourcesCommandError = async
2077
1491
  switch (errorCode) {
2078
1492
  case "InvalidNextTokenException":
2079
1493
  case "com.amazonaws.ram#InvalidNextTokenException":
2080
- response = {
2081
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
2082
- name: errorCode,
2083
- $metadata: deserializeMetadata(output),
2084
- };
2085
- break;
1494
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
2086
1495
  case "InvalidParameterException":
2087
1496
  case "com.amazonaws.ram#InvalidParameterException":
2088
- response = {
2089
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
2090
- name: errorCode,
2091
- $metadata: deserializeMetadata(output),
2092
- };
2093
- break;
1497
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2094
1498
  case "MalformedArnException":
2095
1499
  case "com.amazonaws.ram#MalformedArnException":
2096
- response = {
2097
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
2098
- name: errorCode,
2099
- $metadata: deserializeMetadata(output),
2100
- };
2101
- break;
1500
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
2102
1501
  case "MissingRequiredParameterException":
2103
1502
  case "com.amazonaws.ram#MissingRequiredParameterException":
2104
- response = {
2105
- ...(await deserializeAws_restJson1MissingRequiredParameterExceptionResponse(parsedOutput, context)),
2106
- name: errorCode,
2107
- $metadata: deserializeMetadata(output),
2108
- };
2109
- break;
1503
+ throw await deserializeAws_restJson1MissingRequiredParameterExceptionResponse(parsedOutput, context);
2110
1504
  case "ResourceShareInvitationAlreadyRejectedException":
2111
1505
  case "com.amazonaws.ram#ResourceShareInvitationAlreadyRejectedException":
2112
- response = {
2113
- ...(await deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionResponse(parsedOutput, context)),
2114
- name: errorCode,
2115
- $metadata: deserializeMetadata(output),
2116
- };
2117
- break;
1506
+ throw await deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionResponse(parsedOutput, context);
2118
1507
  case "ResourceShareInvitationArnNotFoundException":
2119
1508
  case "com.amazonaws.ram#ResourceShareInvitationArnNotFoundException":
2120
- response = {
2121
- ...(await deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse(parsedOutput, context)),
2122
- name: errorCode,
2123
- $metadata: deserializeMetadata(output),
2124
- };
2125
- break;
1509
+ throw await deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse(parsedOutput, context);
2126
1510
  case "ResourceShareInvitationExpiredException":
2127
1511
  case "com.amazonaws.ram#ResourceShareInvitationExpiredException":
2128
- response = {
2129
- ...(await deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse(parsedOutput, context)),
2130
- name: errorCode,
2131
- $metadata: deserializeMetadata(output),
2132
- };
2133
- break;
1512
+ throw await deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse(parsedOutput, context);
2134
1513
  case "ServerInternalException":
2135
1514
  case "com.amazonaws.ram#ServerInternalException":
2136
- response = {
2137
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2138
- name: errorCode,
2139
- $metadata: deserializeMetadata(output),
2140
- };
2141
- break;
1515
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2142
1516
  case "ServiceUnavailableException":
2143
1517
  case "com.amazonaws.ram#ServiceUnavailableException":
2144
- response = {
2145
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2146
- name: errorCode,
2147
- $metadata: deserializeMetadata(output),
2148
- };
2149
- break;
1518
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2150
1519
  default:
2151
1520
  const parsedBody = parsedOutput.body;
2152
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2153
- response = {
2154
- ...parsedBody,
2155
- name: `${errorCode}`,
2156
- message: parsedBody.message || parsedBody.Message || errorCode,
1521
+ response = new RAMServiceException_1.RAMServiceException({
1522
+ name: parsedBody.code || parsedBody.Code || errorCode,
2157
1523
  $fault: "client",
2158
1524
  $metadata: deserializeMetadata(output),
2159
- };
1525
+ });
1526
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2160
1527
  }
2161
- const message = response.message || response.Message || errorCode;
2162
- response.message = message;
2163
- delete response.Message;
2164
- return Promise.reject(Object.assign(new Error(message), response));
2165
1528
  };
2166
1529
  const deserializeAws_restJson1ListPermissionsCommand = async (output, context) => {
2167
1530
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2193,59 +1556,28 @@ const deserializeAws_restJson1ListPermissionsCommandError = async (output, conte
2193
1556
  switch (errorCode) {
2194
1557
  case "InvalidNextTokenException":
2195
1558
  case "com.amazonaws.ram#InvalidNextTokenException":
2196
- response = {
2197
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
2198
- name: errorCode,
2199
- $metadata: deserializeMetadata(output),
2200
- };
2201
- break;
1559
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
2202
1560
  case "InvalidParameterException":
2203
1561
  case "com.amazonaws.ram#InvalidParameterException":
2204
- response = {
2205
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
2206
- name: errorCode,
2207
- $metadata: deserializeMetadata(output),
2208
- };
2209
- break;
1562
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2210
1563
  case "OperationNotPermittedException":
2211
1564
  case "com.amazonaws.ram#OperationNotPermittedException":
2212
- response = {
2213
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2214
- name: errorCode,
2215
- $metadata: deserializeMetadata(output),
2216
- };
2217
- break;
1565
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
2218
1566
  case "ServerInternalException":
2219
1567
  case "com.amazonaws.ram#ServerInternalException":
2220
- response = {
2221
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2222
- name: errorCode,
2223
- $metadata: deserializeMetadata(output),
2224
- };
2225
- break;
1568
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2226
1569
  case "ServiceUnavailableException":
2227
1570
  case "com.amazonaws.ram#ServiceUnavailableException":
2228
- response = {
2229
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2230
- name: errorCode,
2231
- $metadata: deserializeMetadata(output),
2232
- };
2233
- break;
1571
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2234
1572
  default:
2235
1573
  const parsedBody = parsedOutput.body;
2236
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2237
- response = {
2238
- ...parsedBody,
2239
- name: `${errorCode}`,
2240
- message: parsedBody.message || parsedBody.Message || errorCode,
1574
+ response = new RAMServiceException_1.RAMServiceException({
1575
+ name: parsedBody.code || parsedBody.Code || errorCode,
2241
1576
  $fault: "client",
2242
1577
  $metadata: deserializeMetadata(output),
2243
- };
1578
+ });
1579
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2244
1580
  }
2245
- const message = response.message || response.Message || errorCode;
2246
- response.message = message;
2247
- delete response.Message;
2248
- return Promise.reject(Object.assign(new Error(message), response));
2249
1581
  };
2250
1582
  const deserializeAws_restJson1ListPermissionVersionsCommand = async (output, context) => {
2251
1583
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2277,75 +1609,34 @@ const deserializeAws_restJson1ListPermissionVersionsCommandError = async (output
2277
1609
  switch (errorCode) {
2278
1610
  case "InvalidNextTokenException":
2279
1611
  case "com.amazonaws.ram#InvalidNextTokenException":
2280
- response = {
2281
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
2282
- name: errorCode,
2283
- $metadata: deserializeMetadata(output),
2284
- };
2285
- break;
1612
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
2286
1613
  case "InvalidParameterException":
2287
1614
  case "com.amazonaws.ram#InvalidParameterException":
2288
- response = {
2289
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
2290
- name: errorCode,
2291
- $metadata: deserializeMetadata(output),
2292
- };
2293
- break;
1615
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2294
1616
  case "MalformedArnException":
2295
1617
  case "com.amazonaws.ram#MalformedArnException":
2296
- response = {
2297
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
2298
- name: errorCode,
2299
- $metadata: deserializeMetadata(output),
2300
- };
2301
- break;
1618
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
2302
1619
  case "OperationNotPermittedException":
2303
1620
  case "com.amazonaws.ram#OperationNotPermittedException":
2304
- response = {
2305
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2306
- name: errorCode,
2307
- $metadata: deserializeMetadata(output),
2308
- };
2309
- break;
1621
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
2310
1622
  case "ServerInternalException":
2311
1623
  case "com.amazonaws.ram#ServerInternalException":
2312
- response = {
2313
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2314
- name: errorCode,
2315
- $metadata: deserializeMetadata(output),
2316
- };
2317
- break;
1624
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2318
1625
  case "ServiceUnavailableException":
2319
1626
  case "com.amazonaws.ram#ServiceUnavailableException":
2320
- response = {
2321
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2322
- name: errorCode,
2323
- $metadata: deserializeMetadata(output),
2324
- };
2325
- break;
1627
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2326
1628
  case "UnknownResourceException":
2327
1629
  case "com.amazonaws.ram#UnknownResourceException":
2328
- response = {
2329
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
2330
- name: errorCode,
2331
- $metadata: deserializeMetadata(output),
2332
- };
2333
- break;
1630
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
2334
1631
  default:
2335
1632
  const parsedBody = parsedOutput.body;
2336
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2337
- response = {
2338
- ...parsedBody,
2339
- name: `${errorCode}`,
2340
- message: parsedBody.message || parsedBody.Message || errorCode,
1633
+ response = new RAMServiceException_1.RAMServiceException({
1634
+ name: parsedBody.code || parsedBody.Code || errorCode,
2341
1635
  $fault: "client",
2342
1636
  $metadata: deserializeMetadata(output),
2343
- };
1637
+ });
1638
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2344
1639
  }
2345
- const message = response.message || response.Message || errorCode;
2346
- response.message = message;
2347
- delete response.Message;
2348
- return Promise.reject(Object.assign(new Error(message), response));
2349
1640
  };
2350
1641
  const deserializeAws_restJson1ListPrincipalsCommand = async (output, context) => {
2351
1642
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2377,67 +1668,31 @@ const deserializeAws_restJson1ListPrincipalsCommandError = async (output, contex
2377
1668
  switch (errorCode) {
2378
1669
  case "InvalidNextTokenException":
2379
1670
  case "com.amazonaws.ram#InvalidNextTokenException":
2380
- response = {
2381
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
2382
- name: errorCode,
2383
- $metadata: deserializeMetadata(output),
2384
- };
2385
- break;
1671
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
2386
1672
  case "InvalidParameterException":
2387
1673
  case "com.amazonaws.ram#InvalidParameterException":
2388
- response = {
2389
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
2390
- name: errorCode,
2391
- $metadata: deserializeMetadata(output),
2392
- };
2393
- break;
1674
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2394
1675
  case "MalformedArnException":
2395
1676
  case "com.amazonaws.ram#MalformedArnException":
2396
- response = {
2397
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
2398
- name: errorCode,
2399
- $metadata: deserializeMetadata(output),
2400
- };
2401
- break;
1677
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
2402
1678
  case "ServerInternalException":
2403
1679
  case "com.amazonaws.ram#ServerInternalException":
2404
- response = {
2405
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2406
- name: errorCode,
2407
- $metadata: deserializeMetadata(output),
2408
- };
2409
- break;
1680
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2410
1681
  case "ServiceUnavailableException":
2411
1682
  case "com.amazonaws.ram#ServiceUnavailableException":
2412
- response = {
2413
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2414
- name: errorCode,
2415
- $metadata: deserializeMetadata(output),
2416
- };
2417
- break;
1683
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2418
1684
  case "UnknownResourceException":
2419
1685
  case "com.amazonaws.ram#UnknownResourceException":
2420
- response = {
2421
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
2422
- name: errorCode,
2423
- $metadata: deserializeMetadata(output),
2424
- };
2425
- break;
1686
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
2426
1687
  default:
2427
1688
  const parsedBody = parsedOutput.body;
2428
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2429
- response = {
2430
- ...parsedBody,
2431
- name: `${errorCode}`,
2432
- message: parsedBody.message || parsedBody.Message || errorCode,
1689
+ response = new RAMServiceException_1.RAMServiceException({
1690
+ name: parsedBody.code || parsedBody.Code || errorCode,
2433
1691
  $fault: "client",
2434
1692
  $metadata: deserializeMetadata(output),
2435
- };
1693
+ });
1694
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2436
1695
  }
2437
- const message = response.message || response.Message || errorCode;
2438
- response.message = message;
2439
- delete response.Message;
2440
- return Promise.reject(Object.assign(new Error(message), response));
2441
1696
  };
2442
1697
  const deserializeAws_restJson1ListResourcesCommand = async (output, context) => {
2443
1698
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2469,75 +1724,34 @@ const deserializeAws_restJson1ListResourcesCommandError = async (output, context
2469
1724
  switch (errorCode) {
2470
1725
  case "InvalidNextTokenException":
2471
1726
  case "com.amazonaws.ram#InvalidNextTokenException":
2472
- response = {
2473
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
2474
- name: errorCode,
2475
- $metadata: deserializeMetadata(output),
2476
- };
2477
- break;
1727
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
2478
1728
  case "InvalidParameterException":
2479
1729
  case "com.amazonaws.ram#InvalidParameterException":
2480
- response = {
2481
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
2482
- name: errorCode,
2483
- $metadata: deserializeMetadata(output),
2484
- };
2485
- break;
1730
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2486
1731
  case "InvalidResourceTypeException":
2487
1732
  case "com.amazonaws.ram#InvalidResourceTypeException":
2488
- response = {
2489
- ...(await deserializeAws_restJson1InvalidResourceTypeExceptionResponse(parsedOutput, context)),
2490
- name: errorCode,
2491
- $metadata: deserializeMetadata(output),
2492
- };
2493
- break;
1733
+ throw await deserializeAws_restJson1InvalidResourceTypeExceptionResponse(parsedOutput, context);
2494
1734
  case "MalformedArnException":
2495
1735
  case "com.amazonaws.ram#MalformedArnException":
2496
- response = {
2497
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
2498
- name: errorCode,
2499
- $metadata: deserializeMetadata(output),
2500
- };
2501
- break;
1736
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
2502
1737
  case "ServerInternalException":
2503
1738
  case "com.amazonaws.ram#ServerInternalException":
2504
- response = {
2505
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2506
- name: errorCode,
2507
- $metadata: deserializeMetadata(output),
2508
- };
2509
- break;
1739
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2510
1740
  case "ServiceUnavailableException":
2511
1741
  case "com.amazonaws.ram#ServiceUnavailableException":
2512
- response = {
2513
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2514
- name: errorCode,
2515
- $metadata: deserializeMetadata(output),
2516
- };
2517
- break;
1742
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2518
1743
  case "UnknownResourceException":
2519
1744
  case "com.amazonaws.ram#UnknownResourceException":
2520
- response = {
2521
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
2522
- name: errorCode,
2523
- $metadata: deserializeMetadata(output),
2524
- };
2525
- break;
1745
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
2526
1746
  default:
2527
1747
  const parsedBody = parsedOutput.body;
2528
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2529
- response = {
2530
- ...parsedBody,
2531
- name: `${errorCode}`,
2532
- message: parsedBody.message || parsedBody.Message || errorCode,
1748
+ response = new RAMServiceException_1.RAMServiceException({
1749
+ name: parsedBody.code || parsedBody.Code || errorCode,
2533
1750
  $fault: "client",
2534
1751
  $metadata: deserializeMetadata(output),
2535
- };
1752
+ });
1753
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2536
1754
  }
2537
- const message = response.message || response.Message || errorCode;
2538
- response.message = message;
2539
- delete response.Message;
2540
- return Promise.reject(Object.assign(new Error(message), response));
2541
1755
  };
2542
1756
  const deserializeAws_restJson1ListResourceSharePermissionsCommand = async (output, context) => {
2543
1757
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2569,75 +1783,34 @@ const deserializeAws_restJson1ListResourceSharePermissionsCommandError = async (
2569
1783
  switch (errorCode) {
2570
1784
  case "InvalidNextTokenException":
2571
1785
  case "com.amazonaws.ram#InvalidNextTokenException":
2572
- response = {
2573
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
2574
- name: errorCode,
2575
- $metadata: deserializeMetadata(output),
2576
- };
2577
- break;
1786
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
2578
1787
  case "InvalidParameterException":
2579
1788
  case "com.amazonaws.ram#InvalidParameterException":
2580
- response = {
2581
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
2582
- name: errorCode,
2583
- $metadata: deserializeMetadata(output),
2584
- };
2585
- break;
1789
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2586
1790
  case "MalformedArnException":
2587
1791
  case "com.amazonaws.ram#MalformedArnException":
2588
- response = {
2589
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
2590
- name: errorCode,
2591
- $metadata: deserializeMetadata(output),
2592
- };
2593
- break;
1792
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
2594
1793
  case "OperationNotPermittedException":
2595
1794
  case "com.amazonaws.ram#OperationNotPermittedException":
2596
- response = {
2597
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2598
- name: errorCode,
2599
- $metadata: deserializeMetadata(output),
2600
- };
2601
- break;
1795
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
2602
1796
  case "ServerInternalException":
2603
1797
  case "com.amazonaws.ram#ServerInternalException":
2604
- response = {
2605
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2606
- name: errorCode,
2607
- $metadata: deserializeMetadata(output),
2608
- };
2609
- break;
1798
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2610
1799
  case "ServiceUnavailableException":
2611
1800
  case "com.amazonaws.ram#ServiceUnavailableException":
2612
- response = {
2613
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2614
- name: errorCode,
2615
- $metadata: deserializeMetadata(output),
2616
- };
2617
- break;
1801
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2618
1802
  case "UnknownResourceException":
2619
1803
  case "com.amazonaws.ram#UnknownResourceException":
2620
- response = {
2621
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
2622
- name: errorCode,
2623
- $metadata: deserializeMetadata(output),
2624
- };
2625
- break;
1804
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
2626
1805
  default:
2627
1806
  const parsedBody = parsedOutput.body;
2628
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2629
- response = {
2630
- ...parsedBody,
2631
- name: `${errorCode}`,
2632
- message: parsedBody.message || parsedBody.Message || errorCode,
1807
+ response = new RAMServiceException_1.RAMServiceException({
1808
+ name: parsedBody.code || parsedBody.Code || errorCode,
2633
1809
  $fault: "client",
2634
1810
  $metadata: deserializeMetadata(output),
2635
- };
1811
+ });
1812
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2636
1813
  }
2637
- const message = response.message || response.Message || errorCode;
2638
- response.message = message;
2639
- delete response.Message;
2640
- return Promise.reject(Object.assign(new Error(message), response));
2641
1814
  };
2642
1815
  const deserializeAws_restJson1ListResourceTypesCommand = async (output, context) => {
2643
1816
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2669,51 +1842,25 @@ const deserializeAws_restJson1ListResourceTypesCommandError = async (output, con
2669
1842
  switch (errorCode) {
2670
1843
  case "InvalidNextTokenException":
2671
1844
  case "com.amazonaws.ram#InvalidNextTokenException":
2672
- response = {
2673
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
2674
- name: errorCode,
2675
- $metadata: deserializeMetadata(output),
2676
- };
2677
- break;
1845
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
2678
1846
  case "InvalidParameterException":
2679
1847
  case "com.amazonaws.ram#InvalidParameterException":
2680
- response = {
2681
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
2682
- name: errorCode,
2683
- $metadata: deserializeMetadata(output),
2684
- };
2685
- break;
1848
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2686
1849
  case "ServerInternalException":
2687
1850
  case "com.amazonaws.ram#ServerInternalException":
2688
- response = {
2689
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2690
- name: errorCode,
2691
- $metadata: deserializeMetadata(output),
2692
- };
2693
- break;
1851
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2694
1852
  case "ServiceUnavailableException":
2695
1853
  case "com.amazonaws.ram#ServiceUnavailableException":
2696
- response = {
2697
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2698
- name: errorCode,
2699
- $metadata: deserializeMetadata(output),
2700
- };
2701
- break;
1854
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2702
1855
  default:
2703
1856
  const parsedBody = parsedOutput.body;
2704
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2705
- response = {
2706
- ...parsedBody,
2707
- name: `${errorCode}`,
2708
- message: parsedBody.message || parsedBody.Message || errorCode,
1857
+ response = new RAMServiceException_1.RAMServiceException({
1858
+ name: parsedBody.code || parsedBody.Code || errorCode,
2709
1859
  $fault: "client",
2710
1860
  $metadata: deserializeMetadata(output),
2711
- };
1861
+ });
1862
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2712
1863
  }
2713
- const message = response.message || response.Message || errorCode;
2714
- response.message = message;
2715
- delete response.Message;
2716
- return Promise.reject(Object.assign(new Error(message), response));
2717
1864
  };
2718
1865
  const deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand = async (output, context) => {
2719
1866
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2741,83 +1888,37 @@ const deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError
2741
1888
  switch (errorCode) {
2742
1889
  case "InvalidParameterException":
2743
1890
  case "com.amazonaws.ram#InvalidParameterException":
2744
- response = {
2745
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
2746
- name: errorCode,
2747
- $metadata: deserializeMetadata(output),
2748
- };
2749
- break;
1891
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2750
1892
  case "MalformedArnException":
2751
1893
  case "com.amazonaws.ram#MalformedArnException":
2752
- response = {
2753
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
2754
- name: errorCode,
2755
- $metadata: deserializeMetadata(output),
2756
- };
2757
- break;
1894
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
2758
1895
  case "MissingRequiredParameterException":
2759
1896
  case "com.amazonaws.ram#MissingRequiredParameterException":
2760
- response = {
2761
- ...(await deserializeAws_restJson1MissingRequiredParameterExceptionResponse(parsedOutput, context)),
2762
- name: errorCode,
2763
- $metadata: deserializeMetadata(output),
2764
- };
2765
- break;
1897
+ throw await deserializeAws_restJson1MissingRequiredParameterExceptionResponse(parsedOutput, context);
2766
1898
  case "OperationNotPermittedException":
2767
1899
  case "com.amazonaws.ram#OperationNotPermittedException":
2768
- response = {
2769
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2770
- name: errorCode,
2771
- $metadata: deserializeMetadata(output),
2772
- };
2773
- break;
1900
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
2774
1901
  case "ResourceShareLimitExceededException":
2775
1902
  case "com.amazonaws.ram#ResourceShareLimitExceededException":
2776
- response = {
2777
- ...(await deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse(parsedOutput, context)),
2778
- name: errorCode,
2779
- $metadata: deserializeMetadata(output),
2780
- };
2781
- break;
1903
+ throw await deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse(parsedOutput, context);
2782
1904
  case "ServerInternalException":
2783
1905
  case "com.amazonaws.ram#ServerInternalException":
2784
- response = {
2785
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2786
- name: errorCode,
2787
- $metadata: deserializeMetadata(output),
2788
- };
2789
- break;
1906
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2790
1907
  case "ServiceUnavailableException":
2791
1908
  case "com.amazonaws.ram#ServiceUnavailableException":
2792
- response = {
2793
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2794
- name: errorCode,
2795
- $metadata: deserializeMetadata(output),
2796
- };
2797
- break;
1909
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2798
1910
  case "UnknownResourceException":
2799
1911
  case "com.amazonaws.ram#UnknownResourceException":
2800
- response = {
2801
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
2802
- name: errorCode,
2803
- $metadata: deserializeMetadata(output),
2804
- };
2805
- break;
1912
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
2806
1913
  default:
2807
1914
  const parsedBody = parsedOutput.body;
2808
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2809
- response = {
2810
- ...parsedBody,
2811
- name: `${errorCode}`,
2812
- message: parsedBody.message || parsedBody.Message || errorCode,
1915
+ response = new RAMServiceException_1.RAMServiceException({
1916
+ name: parsedBody.code || parsedBody.Code || errorCode,
2813
1917
  $fault: "client",
2814
1918
  $metadata: deserializeMetadata(output),
2815
- };
1919
+ });
1920
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2816
1921
  }
2817
- const message = response.message || response.Message || errorCode;
2818
- response.message = message;
2819
- delete response.Message;
2820
- return Promise.reject(Object.assign(new Error(message), response));
2821
1922
  };
2822
1923
  const deserializeAws_restJson1RejectResourceShareInvitationCommand = async (output, context) => {
2823
1924
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2849,99 +1950,43 @@ const deserializeAws_restJson1RejectResourceShareInvitationCommandError = async
2849
1950
  switch (errorCode) {
2850
1951
  case "IdempotentParameterMismatchException":
2851
1952
  case "com.amazonaws.ram#IdempotentParameterMismatchException":
2852
- response = {
2853
- ...(await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
2854
- name: errorCode,
2855
- $metadata: deserializeMetadata(output),
2856
- };
2857
- break;
1953
+ throw await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
2858
1954
  case "InvalidClientTokenException":
2859
1955
  case "com.amazonaws.ram#InvalidClientTokenException":
2860
- response = {
2861
- ...(await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context)),
2862
- name: errorCode,
2863
- $metadata: deserializeMetadata(output),
2864
- };
2865
- break;
1956
+ throw await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context);
2866
1957
  case "MalformedArnException":
2867
1958
  case "com.amazonaws.ram#MalformedArnException":
2868
- response = {
2869
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
2870
- name: errorCode,
2871
- $metadata: deserializeMetadata(output),
2872
- };
2873
- break;
1959
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
2874
1960
  case "OperationNotPermittedException":
2875
1961
  case "com.amazonaws.ram#OperationNotPermittedException":
2876
- response = {
2877
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2878
- name: errorCode,
2879
- $metadata: deserializeMetadata(output),
2880
- };
2881
- break;
1962
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
2882
1963
  case "ResourceShareInvitationAlreadyAcceptedException":
2883
1964
  case "com.amazonaws.ram#ResourceShareInvitationAlreadyAcceptedException":
2884
- response = {
2885
- ...(await deserializeAws_restJson1ResourceShareInvitationAlreadyAcceptedExceptionResponse(parsedOutput, context)),
2886
- name: errorCode,
2887
- $metadata: deserializeMetadata(output),
2888
- };
2889
- break;
1965
+ throw await deserializeAws_restJson1ResourceShareInvitationAlreadyAcceptedExceptionResponse(parsedOutput, context);
2890
1966
  case "ResourceShareInvitationAlreadyRejectedException":
2891
1967
  case "com.amazonaws.ram#ResourceShareInvitationAlreadyRejectedException":
2892
- response = {
2893
- ...(await deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionResponse(parsedOutput, context)),
2894
- name: errorCode,
2895
- $metadata: deserializeMetadata(output),
2896
- };
2897
- break;
1968
+ throw await deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionResponse(parsedOutput, context);
2898
1969
  case "ResourceShareInvitationArnNotFoundException":
2899
1970
  case "com.amazonaws.ram#ResourceShareInvitationArnNotFoundException":
2900
- response = {
2901
- ...(await deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse(parsedOutput, context)),
2902
- name: errorCode,
2903
- $metadata: deserializeMetadata(output),
2904
- };
2905
- break;
1971
+ throw await deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse(parsedOutput, context);
2906
1972
  case "ResourceShareInvitationExpiredException":
2907
1973
  case "com.amazonaws.ram#ResourceShareInvitationExpiredException":
2908
- response = {
2909
- ...(await deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse(parsedOutput, context)),
2910
- name: errorCode,
2911
- $metadata: deserializeMetadata(output),
2912
- };
2913
- break;
1974
+ throw await deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse(parsedOutput, context);
2914
1975
  case "ServerInternalException":
2915
1976
  case "com.amazonaws.ram#ServerInternalException":
2916
- response = {
2917
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2918
- name: errorCode,
2919
- $metadata: deserializeMetadata(output),
2920
- };
2921
- break;
1977
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2922
1978
  case "ServiceUnavailableException":
2923
1979
  case "com.amazonaws.ram#ServiceUnavailableException":
2924
- response = {
2925
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2926
- name: errorCode,
2927
- $metadata: deserializeMetadata(output),
2928
- };
2929
- break;
1980
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2930
1981
  default:
2931
1982
  const parsedBody = parsedOutput.body;
2932
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2933
- response = {
2934
- ...parsedBody,
2935
- name: `${errorCode}`,
2936
- message: parsedBody.message || parsedBody.Message || errorCode,
1983
+ response = new RAMServiceException_1.RAMServiceException({
1984
+ name: parsedBody.code || parsedBody.Code || errorCode,
2937
1985
  $fault: "client",
2938
1986
  $metadata: deserializeMetadata(output),
2939
- };
1987
+ });
1988
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2940
1989
  }
2941
- const message = response.message || response.Message || errorCode;
2942
- response.message = message;
2943
- delete response.Message;
2944
- return Promise.reject(Object.assign(new Error(message), response));
2945
1990
  };
2946
1991
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
2947
1992
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2965,83 +2010,37 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2965
2010
  switch (errorCode) {
2966
2011
  case "InvalidParameterException":
2967
2012
  case "com.amazonaws.ram#InvalidParameterException":
2968
- response = {
2969
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
2970
- name: errorCode,
2971
- $metadata: deserializeMetadata(output),
2972
- };
2973
- break;
2013
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
2974
2014
  case "MalformedArnException":
2975
2015
  case "com.amazonaws.ram#MalformedArnException":
2976
- response = {
2977
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
2978
- name: errorCode,
2979
- $metadata: deserializeMetadata(output),
2980
- };
2981
- break;
2016
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
2982
2017
  case "ResourceArnNotFoundException":
2983
2018
  case "com.amazonaws.ram#ResourceArnNotFoundException":
2984
- response = {
2985
- ...(await deserializeAws_restJson1ResourceArnNotFoundExceptionResponse(parsedOutput, context)),
2986
- name: errorCode,
2987
- $metadata: deserializeMetadata(output),
2988
- };
2989
- break;
2019
+ throw await deserializeAws_restJson1ResourceArnNotFoundExceptionResponse(parsedOutput, context);
2990
2020
  case "ServerInternalException":
2991
2021
  case "com.amazonaws.ram#ServerInternalException":
2992
- response = {
2993
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
2994
- name: errorCode,
2995
- $metadata: deserializeMetadata(output),
2996
- };
2997
- break;
2022
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
2998
2023
  case "ServiceUnavailableException":
2999
2024
  case "com.amazonaws.ram#ServiceUnavailableException":
3000
- response = {
3001
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3002
- name: errorCode,
3003
- $metadata: deserializeMetadata(output),
3004
- };
3005
- break;
2025
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3006
2026
  case "TagLimitExceededException":
3007
2027
  case "com.amazonaws.ram#TagLimitExceededException":
3008
- response = {
3009
- ...(await deserializeAws_restJson1TagLimitExceededExceptionResponse(parsedOutput, context)),
3010
- name: errorCode,
3011
- $metadata: deserializeMetadata(output),
3012
- };
3013
- break;
2028
+ throw await deserializeAws_restJson1TagLimitExceededExceptionResponse(parsedOutput, context);
3014
2029
  case "TagPolicyViolationException":
3015
2030
  case "com.amazonaws.ram#TagPolicyViolationException":
3016
- response = {
3017
- ...(await deserializeAws_restJson1TagPolicyViolationExceptionResponse(parsedOutput, context)),
3018
- name: errorCode,
3019
- $metadata: deserializeMetadata(output),
3020
- };
3021
- break;
2031
+ throw await deserializeAws_restJson1TagPolicyViolationExceptionResponse(parsedOutput, context);
3022
2032
  case "UnknownResourceException":
3023
2033
  case "com.amazonaws.ram#UnknownResourceException":
3024
- response = {
3025
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
3026
- name: errorCode,
3027
- $metadata: deserializeMetadata(output),
3028
- };
3029
- break;
2034
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
3030
2035
  default:
3031
2036
  const parsedBody = parsedOutput.body;
3032
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3033
- response = {
3034
- ...parsedBody,
3035
- name: `${errorCode}`,
3036
- message: parsedBody.message || parsedBody.Message || errorCode,
2037
+ response = new RAMServiceException_1.RAMServiceException({
2038
+ name: parsedBody.code || parsedBody.Code || errorCode,
3037
2039
  $fault: "client",
3038
2040
  $metadata: deserializeMetadata(output),
3039
- };
2041
+ });
2042
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3040
2043
  }
3041
- const message = response.message || response.Message || errorCode;
3042
- response.message = message;
3043
- delete response.Message;
3044
- return Promise.reject(Object.assign(new Error(message), response));
3045
2044
  };
3046
2045
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
3047
2046
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3065,43 +2064,22 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3065
2064
  switch (errorCode) {
3066
2065
  case "InvalidParameterException":
3067
2066
  case "com.amazonaws.ram#InvalidParameterException":
3068
- response = {
3069
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
3070
- name: errorCode,
3071
- $metadata: deserializeMetadata(output),
3072
- };
3073
- break;
2067
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
3074
2068
  case "ServerInternalException":
3075
2069
  case "com.amazonaws.ram#ServerInternalException":
3076
- response = {
3077
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
3078
- name: errorCode,
3079
- $metadata: deserializeMetadata(output),
3080
- };
3081
- break;
2070
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
3082
2071
  case "ServiceUnavailableException":
3083
2072
  case "com.amazonaws.ram#ServiceUnavailableException":
3084
- response = {
3085
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3086
- name: errorCode,
3087
- $metadata: deserializeMetadata(output),
3088
- };
3089
- break;
2073
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3090
2074
  default:
3091
2075
  const parsedBody = parsedOutput.body;
3092
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3093
- response = {
3094
- ...parsedBody,
3095
- name: `${errorCode}`,
3096
- message: parsedBody.message || parsedBody.Message || errorCode,
2076
+ response = new RAMServiceException_1.RAMServiceException({
2077
+ name: parsedBody.code || parsedBody.Code || errorCode,
3097
2078
  $fault: "client",
3098
2079
  $metadata: deserializeMetadata(output),
3099
- };
2080
+ });
2081
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3100
2082
  }
3101
- const message = response.message || response.Message || errorCode;
3102
- response.message = message;
3103
- delete response.Message;
3104
- return Promise.reject(Object.assign(new Error(message), response));
3105
2083
  };
3106
2084
  const deserializeAws_restJson1UpdateResourceShareCommand = async (output, context) => {
3107
2085
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3133,377 +2111,304 @@ const deserializeAws_restJson1UpdateResourceShareCommandError = async (output, c
3133
2111
  switch (errorCode) {
3134
2112
  case "IdempotentParameterMismatchException":
3135
2113
  case "com.amazonaws.ram#IdempotentParameterMismatchException":
3136
- response = {
3137
- ...(await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
3138
- name: errorCode,
3139
- $metadata: deserializeMetadata(output),
3140
- };
3141
- break;
2114
+ throw await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse(parsedOutput, context);
3142
2115
  case "InvalidClientTokenException":
3143
2116
  case "com.amazonaws.ram#InvalidClientTokenException":
3144
- response = {
3145
- ...(await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context)),
3146
- name: errorCode,
3147
- $metadata: deserializeMetadata(output),
3148
- };
3149
- break;
2117
+ throw await deserializeAws_restJson1InvalidClientTokenExceptionResponse(parsedOutput, context);
3150
2118
  case "InvalidParameterException":
3151
2119
  case "com.amazonaws.ram#InvalidParameterException":
3152
- response = {
3153
- ...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
3154
- name: errorCode,
3155
- $metadata: deserializeMetadata(output),
3156
- };
3157
- break;
2120
+ throw await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context);
3158
2121
  case "MalformedArnException":
3159
2122
  case "com.amazonaws.ram#MalformedArnException":
3160
- response = {
3161
- ...(await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context)),
3162
- name: errorCode,
3163
- $metadata: deserializeMetadata(output),
3164
- };
3165
- break;
2123
+ throw await deserializeAws_restJson1MalformedArnExceptionResponse(parsedOutput, context);
3166
2124
  case "MissingRequiredParameterException":
3167
2125
  case "com.amazonaws.ram#MissingRequiredParameterException":
3168
- response = {
3169
- ...(await deserializeAws_restJson1MissingRequiredParameterExceptionResponse(parsedOutput, context)),
3170
- name: errorCode,
3171
- $metadata: deserializeMetadata(output),
3172
- };
3173
- break;
2126
+ throw await deserializeAws_restJson1MissingRequiredParameterExceptionResponse(parsedOutput, context);
3174
2127
  case "OperationNotPermittedException":
3175
2128
  case "com.amazonaws.ram#OperationNotPermittedException":
3176
- response = {
3177
- ...(await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context)),
3178
- name: errorCode,
3179
- $metadata: deserializeMetadata(output),
3180
- };
3181
- break;
2129
+ throw await deserializeAws_restJson1OperationNotPermittedExceptionResponse(parsedOutput, context);
3182
2130
  case "ServerInternalException":
3183
2131
  case "com.amazonaws.ram#ServerInternalException":
3184
- response = {
3185
- ...(await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context)),
3186
- name: errorCode,
3187
- $metadata: deserializeMetadata(output),
3188
- };
3189
- break;
2132
+ throw await deserializeAws_restJson1ServerInternalExceptionResponse(parsedOutput, context);
3190
2133
  case "ServiceUnavailableException":
3191
2134
  case "com.amazonaws.ram#ServiceUnavailableException":
3192
- response = {
3193
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3194
- name: errorCode,
3195
- $metadata: deserializeMetadata(output),
3196
- };
3197
- break;
2135
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3198
2136
  case "UnknownResourceException":
3199
2137
  case "com.amazonaws.ram#UnknownResourceException":
3200
- response = {
3201
- ...(await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context)),
3202
- name: errorCode,
3203
- $metadata: deserializeMetadata(output),
3204
- };
3205
- break;
2138
+ throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
3206
2139
  default:
3207
2140
  const parsedBody = parsedOutput.body;
3208
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3209
- response = {
3210
- ...parsedBody,
3211
- name: `${errorCode}`,
3212
- message: parsedBody.message || parsedBody.Message || errorCode,
2141
+ response = new RAMServiceException_1.RAMServiceException({
2142
+ name: parsedBody.code || parsedBody.Code || errorCode,
3213
2143
  $fault: "client",
3214
2144
  $metadata: deserializeMetadata(output),
3215
- };
2145
+ });
2146
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3216
2147
  }
3217
- const message = response.message || response.Message || errorCode;
3218
- response.message = message;
3219
- delete response.Message;
3220
- return Promise.reject(Object.assign(new Error(message), response));
3221
2148
  };
3222
2149
  const deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse = async (parsedOutput, context) => {
3223
- const contents = {
3224
- name: "IdempotentParameterMismatchException",
3225
- $fault: "client",
3226
- $metadata: deserializeMetadata(parsedOutput),
3227
- message: undefined,
3228
- };
2150
+ const contents = {};
3229
2151
  const data = parsedOutput.body;
3230
2152
  if (data.message !== undefined && data.message !== null) {
3231
2153
  contents.message = smithy_client_1.expectString(data.message);
3232
2154
  }
3233
- return contents;
2155
+ const exception = new models_0_1.IdempotentParameterMismatchException({
2156
+ $metadata: deserializeMetadata(parsedOutput),
2157
+ ...contents,
2158
+ });
2159
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3234
2160
  };
3235
2161
  const deserializeAws_restJson1InvalidClientTokenExceptionResponse = async (parsedOutput, context) => {
3236
- const contents = {
3237
- name: "InvalidClientTokenException",
3238
- $fault: "client",
3239
- $metadata: deserializeMetadata(parsedOutput),
3240
- message: undefined,
3241
- };
2162
+ const contents = {};
3242
2163
  const data = parsedOutput.body;
3243
2164
  if (data.message !== undefined && data.message !== null) {
3244
2165
  contents.message = smithy_client_1.expectString(data.message);
3245
2166
  }
3246
- return contents;
2167
+ const exception = new models_0_1.InvalidClientTokenException({
2168
+ $metadata: deserializeMetadata(parsedOutput),
2169
+ ...contents,
2170
+ });
2171
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3247
2172
  };
3248
2173
  const deserializeAws_restJson1InvalidMaxResultsExceptionResponse = async (parsedOutput, context) => {
3249
- const contents = {
3250
- name: "InvalidMaxResultsException",
3251
- $fault: "client",
3252
- $metadata: deserializeMetadata(parsedOutput),
3253
- message: undefined,
3254
- };
2174
+ const contents = {};
3255
2175
  const data = parsedOutput.body;
3256
2176
  if (data.message !== undefined && data.message !== null) {
3257
2177
  contents.message = smithy_client_1.expectString(data.message);
3258
2178
  }
3259
- return contents;
2179
+ const exception = new models_0_1.InvalidMaxResultsException({
2180
+ $metadata: deserializeMetadata(parsedOutput),
2181
+ ...contents,
2182
+ });
2183
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3260
2184
  };
3261
2185
  const deserializeAws_restJson1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
3262
- const contents = {
3263
- name: "InvalidNextTokenException",
3264
- $fault: "client",
3265
- $metadata: deserializeMetadata(parsedOutput),
3266
- message: undefined,
3267
- };
2186
+ const contents = {};
3268
2187
  const data = parsedOutput.body;
3269
2188
  if (data.message !== undefined && data.message !== null) {
3270
2189
  contents.message = smithy_client_1.expectString(data.message);
3271
2190
  }
3272
- return contents;
2191
+ const exception = new models_0_1.InvalidNextTokenException({
2192
+ $metadata: deserializeMetadata(parsedOutput),
2193
+ ...contents,
2194
+ });
2195
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3273
2196
  };
3274
2197
  const deserializeAws_restJson1InvalidParameterExceptionResponse = async (parsedOutput, context) => {
3275
- const contents = {
3276
- name: "InvalidParameterException",
3277
- $fault: "client",
3278
- $metadata: deserializeMetadata(parsedOutput),
3279
- message: undefined,
3280
- };
2198
+ const contents = {};
3281
2199
  const data = parsedOutput.body;
3282
2200
  if (data.message !== undefined && data.message !== null) {
3283
2201
  contents.message = smithy_client_1.expectString(data.message);
3284
2202
  }
3285
- return contents;
2203
+ const exception = new models_0_1.InvalidParameterException({
2204
+ $metadata: deserializeMetadata(parsedOutput),
2205
+ ...contents,
2206
+ });
2207
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3286
2208
  };
3287
2209
  const deserializeAws_restJson1InvalidResourceTypeExceptionResponse = async (parsedOutput, context) => {
3288
- const contents = {
3289
- name: "InvalidResourceTypeException",
3290
- $fault: "client",
3291
- $metadata: deserializeMetadata(parsedOutput),
3292
- message: undefined,
3293
- };
2210
+ const contents = {};
3294
2211
  const data = parsedOutput.body;
3295
2212
  if (data.message !== undefined && data.message !== null) {
3296
2213
  contents.message = smithy_client_1.expectString(data.message);
3297
2214
  }
3298
- return contents;
2215
+ const exception = new models_0_1.InvalidResourceTypeException({
2216
+ $metadata: deserializeMetadata(parsedOutput),
2217
+ ...contents,
2218
+ });
2219
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3299
2220
  };
3300
2221
  const deserializeAws_restJson1InvalidStateTransitionExceptionResponse = async (parsedOutput, context) => {
3301
- const contents = {
3302
- name: "InvalidStateTransitionException",
3303
- $fault: "client",
3304
- $metadata: deserializeMetadata(parsedOutput),
3305
- message: undefined,
3306
- };
2222
+ const contents = {};
3307
2223
  const data = parsedOutput.body;
3308
2224
  if (data.message !== undefined && data.message !== null) {
3309
2225
  contents.message = smithy_client_1.expectString(data.message);
3310
2226
  }
3311
- return contents;
2227
+ const exception = new models_0_1.InvalidStateTransitionException({
2228
+ $metadata: deserializeMetadata(parsedOutput),
2229
+ ...contents,
2230
+ });
2231
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3312
2232
  };
3313
2233
  const deserializeAws_restJson1MalformedArnExceptionResponse = async (parsedOutput, context) => {
3314
- const contents = {
3315
- name: "MalformedArnException",
3316
- $fault: "client",
3317
- $metadata: deserializeMetadata(parsedOutput),
3318
- message: undefined,
3319
- };
2234
+ const contents = {};
3320
2235
  const data = parsedOutput.body;
3321
2236
  if (data.message !== undefined && data.message !== null) {
3322
2237
  contents.message = smithy_client_1.expectString(data.message);
3323
2238
  }
3324
- return contents;
2239
+ const exception = new models_0_1.MalformedArnException({
2240
+ $metadata: deserializeMetadata(parsedOutput),
2241
+ ...contents,
2242
+ });
2243
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3325
2244
  };
3326
2245
  const deserializeAws_restJson1MissingRequiredParameterExceptionResponse = async (parsedOutput, context) => {
3327
- const contents = {
3328
- name: "MissingRequiredParameterException",
3329
- $fault: "client",
3330
- $metadata: deserializeMetadata(parsedOutput),
3331
- message: undefined,
3332
- };
2246
+ const contents = {};
3333
2247
  const data = parsedOutput.body;
3334
2248
  if (data.message !== undefined && data.message !== null) {
3335
2249
  contents.message = smithy_client_1.expectString(data.message);
3336
2250
  }
3337
- return contents;
2251
+ const exception = new models_0_1.MissingRequiredParameterException({
2252
+ $metadata: deserializeMetadata(parsedOutput),
2253
+ ...contents,
2254
+ });
2255
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3338
2256
  };
3339
2257
  const deserializeAws_restJson1OperationNotPermittedExceptionResponse = async (parsedOutput, context) => {
3340
- const contents = {
3341
- name: "OperationNotPermittedException",
3342
- $fault: "client",
3343
- $metadata: deserializeMetadata(parsedOutput),
3344
- message: undefined,
3345
- };
2258
+ const contents = {};
3346
2259
  const data = parsedOutput.body;
3347
2260
  if (data.message !== undefined && data.message !== null) {
3348
2261
  contents.message = smithy_client_1.expectString(data.message);
3349
2262
  }
3350
- return contents;
2263
+ const exception = new models_0_1.OperationNotPermittedException({
2264
+ $metadata: deserializeMetadata(parsedOutput),
2265
+ ...contents,
2266
+ });
2267
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3351
2268
  };
3352
2269
  const deserializeAws_restJson1ResourceArnNotFoundExceptionResponse = async (parsedOutput, context) => {
3353
- const contents = {
3354
- name: "ResourceArnNotFoundException",
3355
- $fault: "client",
3356
- $metadata: deserializeMetadata(parsedOutput),
3357
- message: undefined,
3358
- };
2270
+ const contents = {};
3359
2271
  const data = parsedOutput.body;
3360
2272
  if (data.message !== undefined && data.message !== null) {
3361
2273
  contents.message = smithy_client_1.expectString(data.message);
3362
2274
  }
3363
- return contents;
2275
+ const exception = new models_0_1.ResourceArnNotFoundException({
2276
+ $metadata: deserializeMetadata(parsedOutput),
2277
+ ...contents,
2278
+ });
2279
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3364
2280
  };
3365
2281
  const deserializeAws_restJson1ResourceShareInvitationAlreadyAcceptedExceptionResponse = async (parsedOutput, context) => {
3366
- const contents = {
3367
- name: "ResourceShareInvitationAlreadyAcceptedException",
3368
- $fault: "client",
3369
- $metadata: deserializeMetadata(parsedOutput),
3370
- message: undefined,
3371
- };
2282
+ const contents = {};
3372
2283
  const data = parsedOutput.body;
3373
2284
  if (data.message !== undefined && data.message !== null) {
3374
2285
  contents.message = smithy_client_1.expectString(data.message);
3375
2286
  }
3376
- return contents;
2287
+ const exception = new models_0_1.ResourceShareInvitationAlreadyAcceptedException({
2288
+ $metadata: deserializeMetadata(parsedOutput),
2289
+ ...contents,
2290
+ });
2291
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3377
2292
  };
3378
2293
  const deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionResponse = async (parsedOutput, context) => {
3379
- const contents = {
3380
- name: "ResourceShareInvitationAlreadyRejectedException",
3381
- $fault: "client",
3382
- $metadata: deserializeMetadata(parsedOutput),
3383
- message: undefined,
3384
- };
2294
+ const contents = {};
3385
2295
  const data = parsedOutput.body;
3386
2296
  if (data.message !== undefined && data.message !== null) {
3387
2297
  contents.message = smithy_client_1.expectString(data.message);
3388
2298
  }
3389
- return contents;
2299
+ const exception = new models_0_1.ResourceShareInvitationAlreadyRejectedException({
2300
+ $metadata: deserializeMetadata(parsedOutput),
2301
+ ...contents,
2302
+ });
2303
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3390
2304
  };
3391
2305
  const deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse = async (parsedOutput, context) => {
3392
- const contents = {
3393
- name: "ResourceShareInvitationArnNotFoundException",
3394
- $fault: "client",
3395
- $metadata: deserializeMetadata(parsedOutput),
3396
- message: undefined,
3397
- };
2306
+ const contents = {};
3398
2307
  const data = parsedOutput.body;
3399
2308
  if (data.message !== undefined && data.message !== null) {
3400
2309
  contents.message = smithy_client_1.expectString(data.message);
3401
2310
  }
3402
- return contents;
2311
+ const exception = new models_0_1.ResourceShareInvitationArnNotFoundException({
2312
+ $metadata: deserializeMetadata(parsedOutput),
2313
+ ...contents,
2314
+ });
2315
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3403
2316
  };
3404
2317
  const deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse = async (parsedOutput, context) => {
3405
- const contents = {
3406
- name: "ResourceShareInvitationExpiredException",
3407
- $fault: "client",
3408
- $metadata: deserializeMetadata(parsedOutput),
3409
- message: undefined,
3410
- };
2318
+ const contents = {};
3411
2319
  const data = parsedOutput.body;
3412
2320
  if (data.message !== undefined && data.message !== null) {
3413
2321
  contents.message = smithy_client_1.expectString(data.message);
3414
2322
  }
3415
- return contents;
2323
+ const exception = new models_0_1.ResourceShareInvitationExpiredException({
2324
+ $metadata: deserializeMetadata(parsedOutput),
2325
+ ...contents,
2326
+ });
2327
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3416
2328
  };
3417
2329
  const deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse = async (parsedOutput, context) => {
3418
- const contents = {
3419
- name: "ResourceShareLimitExceededException",
3420
- $fault: "client",
3421
- $metadata: deserializeMetadata(parsedOutput),
3422
- message: undefined,
3423
- };
2330
+ const contents = {};
3424
2331
  const data = parsedOutput.body;
3425
2332
  if (data.message !== undefined && data.message !== null) {
3426
2333
  contents.message = smithy_client_1.expectString(data.message);
3427
2334
  }
3428
- return contents;
2335
+ const exception = new models_0_1.ResourceShareLimitExceededException({
2336
+ $metadata: deserializeMetadata(parsedOutput),
2337
+ ...contents,
2338
+ });
2339
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3429
2340
  };
3430
2341
  const deserializeAws_restJson1ServerInternalExceptionResponse = async (parsedOutput, context) => {
3431
- const contents = {
3432
- name: "ServerInternalException",
3433
- $fault: "server",
3434
- $metadata: deserializeMetadata(parsedOutput),
3435
- message: undefined,
3436
- };
2342
+ const contents = {};
3437
2343
  const data = parsedOutput.body;
3438
2344
  if (data.message !== undefined && data.message !== null) {
3439
2345
  contents.message = smithy_client_1.expectString(data.message);
3440
2346
  }
3441
- return contents;
2347
+ const exception = new models_0_1.ServerInternalException({
2348
+ $metadata: deserializeMetadata(parsedOutput),
2349
+ ...contents,
2350
+ });
2351
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3442
2352
  };
3443
2353
  const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
3444
- const contents = {
3445
- name: "ServiceUnavailableException",
3446
- $fault: "server",
3447
- $metadata: deserializeMetadata(parsedOutput),
3448
- message: undefined,
3449
- };
2354
+ const contents = {};
3450
2355
  const data = parsedOutput.body;
3451
2356
  if (data.message !== undefined && data.message !== null) {
3452
2357
  contents.message = smithy_client_1.expectString(data.message);
3453
2358
  }
3454
- return contents;
2359
+ const exception = new models_0_1.ServiceUnavailableException({
2360
+ $metadata: deserializeMetadata(parsedOutput),
2361
+ ...contents,
2362
+ });
2363
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3455
2364
  };
3456
2365
  const deserializeAws_restJson1TagLimitExceededExceptionResponse = async (parsedOutput, context) => {
3457
- const contents = {
3458
- name: "TagLimitExceededException",
3459
- $fault: "client",
3460
- $metadata: deserializeMetadata(parsedOutput),
3461
- message: undefined,
3462
- };
2366
+ const contents = {};
3463
2367
  const data = parsedOutput.body;
3464
2368
  if (data.message !== undefined && data.message !== null) {
3465
2369
  contents.message = smithy_client_1.expectString(data.message);
3466
2370
  }
3467
- return contents;
2371
+ const exception = new models_0_1.TagLimitExceededException({
2372
+ $metadata: deserializeMetadata(parsedOutput),
2373
+ ...contents,
2374
+ });
2375
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3468
2376
  };
3469
2377
  const deserializeAws_restJson1TagPolicyViolationExceptionResponse = async (parsedOutput, context) => {
3470
- const contents = {
3471
- name: "TagPolicyViolationException",
3472
- $fault: "client",
3473
- $metadata: deserializeMetadata(parsedOutput),
3474
- message: undefined,
3475
- };
2378
+ const contents = {};
3476
2379
  const data = parsedOutput.body;
3477
2380
  if (data.message !== undefined && data.message !== null) {
3478
2381
  contents.message = smithy_client_1.expectString(data.message);
3479
2382
  }
3480
- return contents;
2383
+ const exception = new models_0_1.TagPolicyViolationException({
2384
+ $metadata: deserializeMetadata(parsedOutput),
2385
+ ...contents,
2386
+ });
2387
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3481
2388
  };
3482
2389
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
3483
- const contents = {
3484
- name: "ThrottlingException",
3485
- $fault: "client",
3486
- $metadata: deserializeMetadata(parsedOutput),
3487
- message: undefined,
3488
- };
2390
+ const contents = {};
3489
2391
  const data = parsedOutput.body;
3490
2392
  if (data.message !== undefined && data.message !== null) {
3491
2393
  contents.message = smithy_client_1.expectString(data.message);
3492
2394
  }
3493
- return contents;
2395
+ const exception = new models_0_1.ThrottlingException({
2396
+ $metadata: deserializeMetadata(parsedOutput),
2397
+ ...contents,
2398
+ });
2399
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3494
2400
  };
3495
2401
  const deserializeAws_restJson1UnknownResourceExceptionResponse = async (parsedOutput, context) => {
3496
- const contents = {
3497
- name: "UnknownResourceException",
3498
- $fault: "client",
3499
- $metadata: deserializeMetadata(parsedOutput),
3500
- message: undefined,
3501
- };
2402
+ const contents = {};
3502
2403
  const data = parsedOutput.body;
3503
2404
  if (data.message !== undefined && data.message !== null) {
3504
2405
  contents.message = smithy_client_1.expectString(data.message);
3505
2406
  }
3506
- return contents;
2407
+ const exception = new models_0_1.UnknownResourceException({
2408
+ $metadata: deserializeMetadata(parsedOutput),
2409
+ ...contents,
2410
+ });
2411
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3507
2412
  };
3508
2413
  const serializeAws_restJson1PermissionArnList = (input, context) => {
3509
2414
  return input
@@ -3609,7 +2514,7 @@ const serializeAws_restJson1TagValueList = (input, context) => {
3609
2514
  });
3610
2515
  };
3611
2516
  const deserializeAws_restJson1PolicyList = (output, context) => {
3612
- return (output || [])
2517
+ const retVal = (output || [])
3613
2518
  .filter((e) => e != null)
3614
2519
  .map((entry) => {
3615
2520
  if (entry === null) {
@@ -3617,6 +2522,7 @@ const deserializeAws_restJson1PolicyList = (output, context) => {
3617
2522
  }
3618
2523
  return smithy_client_1.expectString(entry);
3619
2524
  });
2525
+ return retVal;
3620
2526
  };
3621
2527
  const deserializeAws_restJson1Principal = (output, context) => {
3622
2528
  return {
@@ -3632,7 +2538,7 @@ const deserializeAws_restJson1Principal = (output, context) => {
3632
2538
  };
3633
2539
  };
3634
2540
  const deserializeAws_restJson1PrincipalList = (output, context) => {
3635
- return (output || [])
2541
+ const retVal = (output || [])
3636
2542
  .filter((e) => e != null)
3637
2543
  .map((entry) => {
3638
2544
  if (entry === null) {
@@ -3640,6 +2546,7 @@ const deserializeAws_restJson1PrincipalList = (output, context) => {
3640
2546
  }
3641
2547
  return deserializeAws_restJson1Principal(entry, context);
3642
2548
  });
2549
+ return retVal;
3643
2550
  };
3644
2551
  const deserializeAws_restJson1Resource = (output, context) => {
3645
2552
  return {
@@ -3659,7 +2566,7 @@ const deserializeAws_restJson1Resource = (output, context) => {
3659
2566
  };
3660
2567
  };
3661
2568
  const deserializeAws_restJson1ResourceList = (output, context) => {
3662
- return (output || [])
2569
+ const retVal = (output || [])
3663
2570
  .filter((e) => e != null)
3664
2571
  .map((entry) => {
3665
2572
  if (entry === null) {
@@ -3667,6 +2574,7 @@ const deserializeAws_restJson1ResourceList = (output, context) => {
3667
2574
  }
3668
2575
  return deserializeAws_restJson1Resource(entry, context);
3669
2576
  });
2577
+ return retVal;
3670
2578
  };
3671
2579
  const deserializeAws_restJson1ResourceShare = (output, context) => {
3672
2580
  return {
@@ -3706,7 +2614,7 @@ const deserializeAws_restJson1ResourceShareAssociation = (output, context) => {
3706
2614
  };
3707
2615
  };
3708
2616
  const deserializeAws_restJson1ResourceShareAssociationList = (output, context) => {
3709
- return (output || [])
2617
+ const retVal = (output || [])
3710
2618
  .filter((e) => e != null)
3711
2619
  .map((entry) => {
3712
2620
  if (entry === null) {
@@ -3714,6 +2622,7 @@ const deserializeAws_restJson1ResourceShareAssociationList = (output, context) =
3714
2622
  }
3715
2623
  return deserializeAws_restJson1ResourceShareAssociation(entry, context);
3716
2624
  });
2625
+ return retVal;
3717
2626
  };
3718
2627
  const deserializeAws_restJson1ResourceShareInvitation = (output, context) => {
3719
2628
  return {
@@ -3733,7 +2642,7 @@ const deserializeAws_restJson1ResourceShareInvitation = (output, context) => {
3733
2642
  };
3734
2643
  };
3735
2644
  const deserializeAws_restJson1ResourceShareInvitationList = (output, context) => {
3736
- return (output || [])
2645
+ const retVal = (output || [])
3737
2646
  .filter((e) => e != null)
3738
2647
  .map((entry) => {
3739
2648
  if (entry === null) {
@@ -3741,9 +2650,10 @@ const deserializeAws_restJson1ResourceShareInvitationList = (output, context) =>
3741
2650
  }
3742
2651
  return deserializeAws_restJson1ResourceShareInvitation(entry, context);
3743
2652
  });
2653
+ return retVal;
3744
2654
  };
3745
2655
  const deserializeAws_restJson1ResourceShareList = (output, context) => {
3746
- return (output || [])
2656
+ const retVal = (output || [])
3747
2657
  .filter((e) => e != null)
3748
2658
  .map((entry) => {
3749
2659
  if (entry === null) {
@@ -3751,6 +2661,7 @@ const deserializeAws_restJson1ResourceShareList = (output, context) => {
3751
2661
  }
3752
2662
  return deserializeAws_restJson1ResourceShare(entry, context);
3753
2663
  });
2664
+ return retVal;
3754
2665
  };
3755
2666
  const deserializeAws_restJson1ResourceSharePermissionDetail = (output, context) => {
3756
2667
  return {
@@ -3770,7 +2681,7 @@ const deserializeAws_restJson1ResourceSharePermissionDetail = (output, context)
3770
2681
  };
3771
2682
  };
3772
2683
  const deserializeAws_restJson1ResourceSharePermissionList = (output, context) => {
3773
- return (output || [])
2684
+ const retVal = (output || [])
3774
2685
  .filter((e) => e != null)
3775
2686
  .map((entry) => {
3776
2687
  if (entry === null) {
@@ -3778,6 +2689,7 @@ const deserializeAws_restJson1ResourceSharePermissionList = (output, context) =>
3778
2689
  }
3779
2690
  return deserializeAws_restJson1ResourceSharePermissionSummary(entry, context);
3780
2691
  });
2692
+ return retVal;
3781
2693
  };
3782
2694
  const deserializeAws_restJson1ResourceSharePermissionSummary = (output, context) => {
3783
2695
  return {
@@ -3804,7 +2716,7 @@ const deserializeAws_restJson1ServiceNameAndResourceType = (output, context) =>
3804
2716
  };
3805
2717
  };
3806
2718
  const deserializeAws_restJson1ServiceNameAndResourceTypeList = (output, context) => {
3807
- return (output || [])
2719
+ const retVal = (output || [])
3808
2720
  .filter((e) => e != null)
3809
2721
  .map((entry) => {
3810
2722
  if (entry === null) {
@@ -3812,6 +2724,7 @@ const deserializeAws_restJson1ServiceNameAndResourceTypeList = (output, context)
3812
2724
  }
3813
2725
  return deserializeAws_restJson1ServiceNameAndResourceType(entry, context);
3814
2726
  });
2727
+ return retVal;
3815
2728
  };
3816
2729
  const deserializeAws_restJson1Tag = (output, context) => {
3817
2730
  return {
@@ -3820,7 +2733,7 @@ const deserializeAws_restJson1Tag = (output, context) => {
3820
2733
  };
3821
2734
  };
3822
2735
  const deserializeAws_restJson1TagList = (output, context) => {
3823
- return (output || [])
2736
+ const retVal = (output || [])
3824
2737
  .filter((e) => e != null)
3825
2738
  .map((entry) => {
3826
2739
  if (entry === null) {
@@ -3828,6 +2741,7 @@ const deserializeAws_restJson1TagList = (output, context) => {
3828
2741
  }
3829
2742
  return deserializeAws_restJson1Tag(entry, context);
3830
2743
  });
2744
+ return retVal;
3831
2745
  };
3832
2746
  const deserializeMetadata = (output) => {
3833
2747
  var _a;