@aws-sdk/client-ram 3.137.0 → 3.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -117,10 +117,10 @@ const serializeAws_restJson1DeleteResourceShareCommand = async (input, context)
117
117
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
118
118
  const headers = {};
119
119
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/deleteresourceshare";
120
- const query = {
121
- ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }),
122
- ...(input.clientToken !== undefined && { clientToken: input.clientToken }),
123
- };
120
+ const query = map({
121
+ resourceShareArn: [, input.resourceShareArn],
122
+ clientToken: [, input.clientToken],
123
+ });
124
124
  let body;
125
125
  return new protocol_http_1.HttpRequest({
126
126
  protocol,
@@ -522,9 +522,9 @@ const serializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand = async
522
522
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
523
523
  const headers = {};
524
524
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/promoteresourcesharecreatedfrompolicy";
525
- const query = {
526
- ...(input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }),
527
- };
525
+ const query = map({
526
+ resourceShareArn: [, input.resourceShareArn],
527
+ });
528
528
  let body;
529
529
  return new protocol_http_1.HttpRequest({
530
530
  protocol,
@@ -632,19 +632,17 @@ const deserializeAws_restJson1AcceptResourceShareInvitationCommand = async (outp
632
632
  if (output.statusCode !== 200 && output.statusCode >= 300) {
633
633
  return deserializeAws_restJson1AcceptResourceShareInvitationCommandError(output, context);
634
634
  }
635
- const contents = {
635
+ const contents = map({
636
636
  $metadata: deserializeMetadata(output),
637
- clientToken: undefined,
638
- resourceShareInvitation: undefined,
639
- };
637
+ });
640
638
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
641
- if (data.clientToken !== undefined && data.clientToken !== null) {
639
+ if (data.clientToken != null) {
642
640
  contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
643
641
  }
644
- if (data.resourceShareInvitation !== undefined && data.resourceShareInvitation !== null) {
642
+ if (data.resourceShareInvitation != null) {
645
643
  contents.resourceShareInvitation = deserializeAws_restJson1ResourceShareInvitation(data.resourceShareInvitation, context);
646
644
  }
647
- return Promise.resolve(contents);
645
+ return contents;
648
646
  };
649
647
  exports.deserializeAws_restJson1AcceptResourceShareInvitationCommand = deserializeAws_restJson1AcceptResourceShareInvitationCommand;
650
648
  const deserializeAws_restJson1AcceptResourceShareInvitationCommandError = async (output, context) => {
@@ -652,7 +650,6 @@ const deserializeAws_restJson1AcceptResourceShareInvitationCommandError = async
652
650
  ...output,
653
651
  body: await parseBody(output.body, context),
654
652
  };
655
- let response;
656
653
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
657
654
  switch (errorCode) {
658
655
  case "IdempotentParameterMismatchException":
@@ -687,33 +684,29 @@ const deserializeAws_restJson1AcceptResourceShareInvitationCommandError = async
687
684
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
688
685
  default:
689
686
  const parsedBody = parsedOutput.body;
690
- const $metadata = deserializeMetadata(output);
691
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
692
- response = new RAMServiceException_1.RAMServiceException({
693
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
694
- $fault: "client",
695
- $metadata,
687
+ (0, smithy_client_1.throwDefaultError)({
688
+ output,
689
+ parsedBody,
690
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
691
+ errorCode,
696
692
  });
697
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
698
693
  }
699
694
  };
700
695
  const deserializeAws_restJson1AssociateResourceShareCommand = async (output, context) => {
701
696
  if (output.statusCode !== 200 && output.statusCode >= 300) {
702
697
  return deserializeAws_restJson1AssociateResourceShareCommandError(output, context);
703
698
  }
704
- const contents = {
699
+ const contents = map({
705
700
  $metadata: deserializeMetadata(output),
706
- clientToken: undefined,
707
- resourceShareAssociations: undefined,
708
- };
701
+ });
709
702
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
710
- if (data.clientToken !== undefined && data.clientToken !== null) {
703
+ if (data.clientToken != null) {
711
704
  contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
712
705
  }
713
- if (data.resourceShareAssociations !== undefined && data.resourceShareAssociations !== null) {
706
+ if (data.resourceShareAssociations != null) {
714
707
  contents.resourceShareAssociations = deserializeAws_restJson1ResourceShareAssociationList(data.resourceShareAssociations, context);
715
708
  }
716
- return Promise.resolve(contents);
709
+ return contents;
717
710
  };
718
711
  exports.deserializeAws_restJson1AssociateResourceShareCommand = deserializeAws_restJson1AssociateResourceShareCommand;
719
712
  const deserializeAws_restJson1AssociateResourceShareCommandError = async (output, context) => {
@@ -721,7 +714,6 @@ const deserializeAws_restJson1AssociateResourceShareCommandError = async (output
721
714
  ...output,
722
715
  body: await parseBody(output.body, context),
723
716
  };
724
- let response;
725
717
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
726
718
  switch (errorCode) {
727
719
  case "IdempotentParameterMismatchException":
@@ -759,33 +751,29 @@ const deserializeAws_restJson1AssociateResourceShareCommandError = async (output
759
751
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
760
752
  default:
761
753
  const parsedBody = parsedOutput.body;
762
- const $metadata = deserializeMetadata(output);
763
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
764
- response = new RAMServiceException_1.RAMServiceException({
765
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
766
- $fault: "client",
767
- $metadata,
754
+ (0, smithy_client_1.throwDefaultError)({
755
+ output,
756
+ parsedBody,
757
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
758
+ errorCode,
768
759
  });
769
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
770
760
  }
771
761
  };
772
762
  const deserializeAws_restJson1AssociateResourceSharePermissionCommand = async (output, context) => {
773
763
  if (output.statusCode !== 200 && output.statusCode >= 300) {
774
764
  return deserializeAws_restJson1AssociateResourceSharePermissionCommandError(output, context);
775
765
  }
776
- const contents = {
766
+ const contents = map({
777
767
  $metadata: deserializeMetadata(output),
778
- clientToken: undefined,
779
- returnValue: undefined,
780
- };
768
+ });
781
769
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
782
- if (data.clientToken !== undefined && data.clientToken !== null) {
770
+ if (data.clientToken != null) {
783
771
  contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
784
772
  }
785
- if (data.returnValue !== undefined && data.returnValue !== null) {
773
+ if (data.returnValue != null) {
786
774
  contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
787
775
  }
788
- return Promise.resolve(contents);
776
+ return contents;
789
777
  };
790
778
  exports.deserializeAws_restJson1AssociateResourceSharePermissionCommand = deserializeAws_restJson1AssociateResourceSharePermissionCommand;
791
779
  const deserializeAws_restJson1AssociateResourceSharePermissionCommandError = async (output, context) => {
@@ -793,7 +781,6 @@ const deserializeAws_restJson1AssociateResourceSharePermissionCommandError = asy
793
781
  ...output,
794
782
  body: await parseBody(output.body, context),
795
783
  };
796
- let response;
797
784
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
798
785
  switch (errorCode) {
799
786
  case "InvalidClientTokenException":
@@ -819,33 +806,29 @@ const deserializeAws_restJson1AssociateResourceSharePermissionCommandError = asy
819
806
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
820
807
  default:
821
808
  const parsedBody = parsedOutput.body;
822
- const $metadata = deserializeMetadata(output);
823
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
824
- response = new RAMServiceException_1.RAMServiceException({
825
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
826
- $fault: "client",
827
- $metadata,
809
+ (0, smithy_client_1.throwDefaultError)({
810
+ output,
811
+ parsedBody,
812
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
813
+ errorCode,
828
814
  });
829
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
830
815
  }
831
816
  };
832
817
  const deserializeAws_restJson1CreateResourceShareCommand = async (output, context) => {
833
818
  if (output.statusCode !== 200 && output.statusCode >= 300) {
834
819
  return deserializeAws_restJson1CreateResourceShareCommandError(output, context);
835
820
  }
836
- const contents = {
821
+ const contents = map({
837
822
  $metadata: deserializeMetadata(output),
838
- clientToken: undefined,
839
- resourceShare: undefined,
840
- };
823
+ });
841
824
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
842
- if (data.clientToken !== undefined && data.clientToken !== null) {
825
+ if (data.clientToken != null) {
843
826
  contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
844
827
  }
845
- if (data.resourceShare !== undefined && data.resourceShare !== null) {
828
+ if (data.resourceShare != null) {
846
829
  contents.resourceShare = deserializeAws_restJson1ResourceShare(data.resourceShare, context);
847
830
  }
848
- return Promise.resolve(contents);
831
+ return contents;
849
832
  };
850
833
  exports.deserializeAws_restJson1CreateResourceShareCommand = deserializeAws_restJson1CreateResourceShareCommand;
851
834
  const deserializeAws_restJson1CreateResourceShareCommandError = async (output, context) => {
@@ -853,7 +836,6 @@ const deserializeAws_restJson1CreateResourceShareCommandError = async (output, c
853
836
  ...output,
854
837
  body: await parseBody(output.body, context),
855
838
  };
856
- let response;
857
839
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
858
840
  switch (errorCode) {
859
841
  case "IdempotentParameterMismatchException":
@@ -891,33 +873,29 @@ const deserializeAws_restJson1CreateResourceShareCommandError = async (output, c
891
873
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
892
874
  default:
893
875
  const parsedBody = parsedOutput.body;
894
- const $metadata = deserializeMetadata(output);
895
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
896
- response = new RAMServiceException_1.RAMServiceException({
897
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
898
- $fault: "client",
899
- $metadata,
876
+ (0, smithy_client_1.throwDefaultError)({
877
+ output,
878
+ parsedBody,
879
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
880
+ errorCode,
900
881
  });
901
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
902
882
  }
903
883
  };
904
884
  const deserializeAws_restJson1DeleteResourceShareCommand = async (output, context) => {
905
885
  if (output.statusCode !== 200 && output.statusCode >= 300) {
906
886
  return deserializeAws_restJson1DeleteResourceShareCommandError(output, context);
907
887
  }
908
- const contents = {
888
+ const contents = map({
909
889
  $metadata: deserializeMetadata(output),
910
- clientToken: undefined,
911
- returnValue: undefined,
912
- };
890
+ });
913
891
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
914
- if (data.clientToken !== undefined && data.clientToken !== null) {
892
+ if (data.clientToken != null) {
915
893
  contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
916
894
  }
917
- if (data.returnValue !== undefined && data.returnValue !== null) {
895
+ if (data.returnValue != null) {
918
896
  contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
919
897
  }
920
- return Promise.resolve(contents);
898
+ return contents;
921
899
  };
922
900
  exports.deserializeAws_restJson1DeleteResourceShareCommand = deserializeAws_restJson1DeleteResourceShareCommand;
923
901
  const deserializeAws_restJson1DeleteResourceShareCommandError = async (output, context) => {
@@ -925,7 +903,6 @@ const deserializeAws_restJson1DeleteResourceShareCommandError = async (output, c
925
903
  ...output,
926
904
  body: await parseBody(output.body, context),
927
905
  };
928
- let response;
929
906
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
930
907
  switch (errorCode) {
931
908
  case "IdempotentParameterMismatchException":
@@ -957,33 +934,29 @@ const deserializeAws_restJson1DeleteResourceShareCommandError = async (output, c
957
934
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
958
935
  default:
959
936
  const parsedBody = parsedOutput.body;
960
- const $metadata = deserializeMetadata(output);
961
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
962
- response = new RAMServiceException_1.RAMServiceException({
963
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
964
- $fault: "client",
965
- $metadata,
937
+ (0, smithy_client_1.throwDefaultError)({
938
+ output,
939
+ parsedBody,
940
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
941
+ errorCode,
966
942
  });
967
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
968
943
  }
969
944
  };
970
945
  const deserializeAws_restJson1DisassociateResourceShareCommand = async (output, context) => {
971
946
  if (output.statusCode !== 200 && output.statusCode >= 300) {
972
947
  return deserializeAws_restJson1DisassociateResourceShareCommandError(output, context);
973
948
  }
974
- const contents = {
949
+ const contents = map({
975
950
  $metadata: deserializeMetadata(output),
976
- clientToken: undefined,
977
- resourceShareAssociations: undefined,
978
- };
951
+ });
979
952
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
980
- if (data.clientToken !== undefined && data.clientToken !== null) {
953
+ if (data.clientToken != null) {
981
954
  contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
982
955
  }
983
- if (data.resourceShareAssociations !== undefined && data.resourceShareAssociations !== null) {
956
+ if (data.resourceShareAssociations != null) {
984
957
  contents.resourceShareAssociations = deserializeAws_restJson1ResourceShareAssociationList(data.resourceShareAssociations, context);
985
958
  }
986
- return Promise.resolve(contents);
959
+ return contents;
987
960
  };
988
961
  exports.deserializeAws_restJson1DisassociateResourceShareCommand = deserializeAws_restJson1DisassociateResourceShareCommand;
989
962
  const deserializeAws_restJson1DisassociateResourceShareCommandError = async (output, context) => {
@@ -991,7 +964,6 @@ const deserializeAws_restJson1DisassociateResourceShareCommandError = async (out
991
964
  ...output,
992
965
  body: await parseBody(output.body, context),
993
966
  };
994
- let response;
995
967
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
996
968
  switch (errorCode) {
997
969
  case "IdempotentParameterMismatchException":
@@ -1026,33 +998,29 @@ const deserializeAws_restJson1DisassociateResourceShareCommandError = async (out
1026
998
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1027
999
  default:
1028
1000
  const parsedBody = parsedOutput.body;
1029
- const $metadata = deserializeMetadata(output);
1030
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1031
- response = new RAMServiceException_1.RAMServiceException({
1032
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1033
- $fault: "client",
1034
- $metadata,
1001
+ (0, smithy_client_1.throwDefaultError)({
1002
+ output,
1003
+ parsedBody,
1004
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1005
+ errorCode,
1035
1006
  });
1036
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1037
1007
  }
1038
1008
  };
1039
1009
  const deserializeAws_restJson1DisassociateResourceSharePermissionCommand = async (output, context) => {
1040
1010
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1041
1011
  return deserializeAws_restJson1DisassociateResourceSharePermissionCommandError(output, context);
1042
1012
  }
1043
- const contents = {
1013
+ const contents = map({
1044
1014
  $metadata: deserializeMetadata(output),
1045
- clientToken: undefined,
1046
- returnValue: undefined,
1047
- };
1015
+ });
1048
1016
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1049
- if (data.clientToken !== undefined && data.clientToken !== null) {
1017
+ if (data.clientToken != null) {
1050
1018
  contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
1051
1019
  }
1052
- if (data.returnValue !== undefined && data.returnValue !== null) {
1020
+ if (data.returnValue != null) {
1053
1021
  contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
1054
1022
  }
1055
- return Promise.resolve(contents);
1023
+ return contents;
1056
1024
  };
1057
1025
  exports.deserializeAws_restJson1DisassociateResourceSharePermissionCommand = deserializeAws_restJson1DisassociateResourceSharePermissionCommand;
1058
1026
  const deserializeAws_restJson1DisassociateResourceSharePermissionCommandError = async (output, context) => {
@@ -1060,7 +1028,6 @@ const deserializeAws_restJson1DisassociateResourceSharePermissionCommandError =
1060
1028
  ...output,
1061
1029
  body: await parseBody(output.body, context),
1062
1030
  };
1063
- let response;
1064
1031
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1065
1032
  switch (errorCode) {
1066
1033
  case "InvalidClientTokenException":
@@ -1089,29 +1056,26 @@ const deserializeAws_restJson1DisassociateResourceSharePermissionCommandError =
1089
1056
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1090
1057
  default:
1091
1058
  const parsedBody = parsedOutput.body;
1092
- const $metadata = deserializeMetadata(output);
1093
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1094
- response = new RAMServiceException_1.RAMServiceException({
1095
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1096
- $fault: "client",
1097
- $metadata,
1059
+ (0, smithy_client_1.throwDefaultError)({
1060
+ output,
1061
+ parsedBody,
1062
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1063
+ errorCode,
1098
1064
  });
1099
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1100
1065
  }
1101
1066
  };
1102
1067
  const deserializeAws_restJson1EnableSharingWithAwsOrganizationCommand = async (output, context) => {
1103
1068
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1104
1069
  return deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError(output, context);
1105
1070
  }
1106
- const contents = {
1071
+ const contents = map({
1107
1072
  $metadata: deserializeMetadata(output),
1108
- returnValue: undefined,
1109
- };
1073
+ });
1110
1074
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1111
- if (data.returnValue !== undefined && data.returnValue !== null) {
1075
+ if (data.returnValue != null) {
1112
1076
  contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
1113
1077
  }
1114
- return Promise.resolve(contents);
1078
+ return contents;
1115
1079
  };
1116
1080
  exports.deserializeAws_restJson1EnableSharingWithAwsOrganizationCommand = deserializeAws_restJson1EnableSharingWithAwsOrganizationCommand;
1117
1081
  const deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError = async (output, context) => {
@@ -1119,7 +1083,6 @@ const deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError = asy
1119
1083
  ...output,
1120
1084
  body: await parseBody(output.body, context),
1121
1085
  };
1122
- let response;
1123
1086
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1124
1087
  switch (errorCode) {
1125
1088
  case "OperationNotPermittedException":
@@ -1133,29 +1096,26 @@ const deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError = asy
1133
1096
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1134
1097
  default:
1135
1098
  const parsedBody = parsedOutput.body;
1136
- const $metadata = deserializeMetadata(output);
1137
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1138
- response = new RAMServiceException_1.RAMServiceException({
1139
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1140
- $fault: "client",
1141
- $metadata,
1099
+ (0, smithy_client_1.throwDefaultError)({
1100
+ output,
1101
+ parsedBody,
1102
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1103
+ errorCode,
1142
1104
  });
1143
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1144
1105
  }
1145
1106
  };
1146
1107
  const deserializeAws_restJson1GetPermissionCommand = async (output, context) => {
1147
1108
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1148
1109
  return deserializeAws_restJson1GetPermissionCommandError(output, context);
1149
1110
  }
1150
- const contents = {
1111
+ const contents = map({
1151
1112
  $metadata: deserializeMetadata(output),
1152
- permission: undefined,
1153
- };
1113
+ });
1154
1114
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1155
- if (data.permission !== undefined && data.permission !== null) {
1115
+ if (data.permission != null) {
1156
1116
  contents.permission = deserializeAws_restJson1ResourceSharePermissionDetail(data.permission, context);
1157
1117
  }
1158
- return Promise.resolve(contents);
1118
+ return contents;
1159
1119
  };
1160
1120
  exports.deserializeAws_restJson1GetPermissionCommand = deserializeAws_restJson1GetPermissionCommand;
1161
1121
  const deserializeAws_restJson1GetPermissionCommandError = async (output, context) => {
@@ -1163,7 +1123,6 @@ const deserializeAws_restJson1GetPermissionCommandError = async (output, context
1163
1123
  ...output,
1164
1124
  body: await parseBody(output.body, context),
1165
1125
  };
1166
- let response;
1167
1126
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1168
1127
  switch (errorCode) {
1169
1128
  case "InvalidParameterException":
@@ -1186,33 +1145,29 @@ const deserializeAws_restJson1GetPermissionCommandError = async (output, context
1186
1145
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1187
1146
  default:
1188
1147
  const parsedBody = parsedOutput.body;
1189
- const $metadata = deserializeMetadata(output);
1190
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1191
- response = new RAMServiceException_1.RAMServiceException({
1192
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1193
- $fault: "client",
1194
- $metadata,
1148
+ (0, smithy_client_1.throwDefaultError)({
1149
+ output,
1150
+ parsedBody,
1151
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1152
+ errorCode,
1195
1153
  });
1196
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1197
1154
  }
1198
1155
  };
1199
1156
  const deserializeAws_restJson1GetResourcePoliciesCommand = async (output, context) => {
1200
1157
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1201
1158
  return deserializeAws_restJson1GetResourcePoliciesCommandError(output, context);
1202
1159
  }
1203
- const contents = {
1160
+ const contents = map({
1204
1161
  $metadata: deserializeMetadata(output),
1205
- nextToken: undefined,
1206
- policies: undefined,
1207
- };
1162
+ });
1208
1163
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1209
- if (data.nextToken !== undefined && data.nextToken !== null) {
1164
+ if (data.nextToken != null) {
1210
1165
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1211
1166
  }
1212
- if (data.policies !== undefined && data.policies !== null) {
1167
+ if (data.policies != null) {
1213
1168
  contents.policies = deserializeAws_restJson1PolicyList(data.policies, context);
1214
1169
  }
1215
- return Promise.resolve(contents);
1170
+ return contents;
1216
1171
  };
1217
1172
  exports.deserializeAws_restJson1GetResourcePoliciesCommand = deserializeAws_restJson1GetResourcePoliciesCommand;
1218
1173
  const deserializeAws_restJson1GetResourcePoliciesCommandError = async (output, context) => {
@@ -1220,7 +1175,6 @@ const deserializeAws_restJson1GetResourcePoliciesCommandError = async (output, c
1220
1175
  ...output,
1221
1176
  body: await parseBody(output.body, context),
1222
1177
  };
1223
- let response;
1224
1178
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1225
1179
  switch (errorCode) {
1226
1180
  case "InvalidNextTokenException":
@@ -1243,33 +1197,29 @@ const deserializeAws_restJson1GetResourcePoliciesCommandError = async (output, c
1243
1197
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1244
1198
  default:
1245
1199
  const parsedBody = parsedOutput.body;
1246
- const $metadata = deserializeMetadata(output);
1247
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1248
- response = new RAMServiceException_1.RAMServiceException({
1249
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1250
- $fault: "client",
1251
- $metadata,
1200
+ (0, smithy_client_1.throwDefaultError)({
1201
+ output,
1202
+ parsedBody,
1203
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1204
+ errorCode,
1252
1205
  });
1253
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1254
1206
  }
1255
1207
  };
1256
1208
  const deserializeAws_restJson1GetResourceShareAssociationsCommand = async (output, context) => {
1257
1209
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1258
1210
  return deserializeAws_restJson1GetResourceShareAssociationsCommandError(output, context);
1259
1211
  }
1260
- const contents = {
1212
+ const contents = map({
1261
1213
  $metadata: deserializeMetadata(output),
1262
- nextToken: undefined,
1263
- resourceShareAssociations: undefined,
1264
- };
1214
+ });
1265
1215
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1266
- if (data.nextToken !== undefined && data.nextToken !== null) {
1216
+ if (data.nextToken != null) {
1267
1217
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1268
1218
  }
1269
- if (data.resourceShareAssociations !== undefined && data.resourceShareAssociations !== null) {
1219
+ if (data.resourceShareAssociations != null) {
1270
1220
  contents.resourceShareAssociations = deserializeAws_restJson1ResourceShareAssociationList(data.resourceShareAssociations, context);
1271
1221
  }
1272
- return Promise.resolve(contents);
1222
+ return contents;
1273
1223
  };
1274
1224
  exports.deserializeAws_restJson1GetResourceShareAssociationsCommand = deserializeAws_restJson1GetResourceShareAssociationsCommand;
1275
1225
  const deserializeAws_restJson1GetResourceShareAssociationsCommandError = async (output, context) => {
@@ -1277,7 +1227,6 @@ const deserializeAws_restJson1GetResourceShareAssociationsCommandError = async (
1277
1227
  ...output,
1278
1228
  body: await parseBody(output.body, context),
1279
1229
  };
1280
- let response;
1281
1230
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1282
1231
  switch (errorCode) {
1283
1232
  case "InvalidNextTokenException":
@@ -1303,33 +1252,29 @@ const deserializeAws_restJson1GetResourceShareAssociationsCommandError = async (
1303
1252
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1304
1253
  default:
1305
1254
  const parsedBody = parsedOutput.body;
1306
- const $metadata = deserializeMetadata(output);
1307
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1308
- response = new RAMServiceException_1.RAMServiceException({
1309
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1310
- $fault: "client",
1311
- $metadata,
1255
+ (0, smithy_client_1.throwDefaultError)({
1256
+ output,
1257
+ parsedBody,
1258
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1259
+ errorCode,
1312
1260
  });
1313
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1314
1261
  }
1315
1262
  };
1316
1263
  const deserializeAws_restJson1GetResourceShareInvitationsCommand = async (output, context) => {
1317
1264
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1318
1265
  return deserializeAws_restJson1GetResourceShareInvitationsCommandError(output, context);
1319
1266
  }
1320
- const contents = {
1267
+ const contents = map({
1321
1268
  $metadata: deserializeMetadata(output),
1322
- nextToken: undefined,
1323
- resourceShareInvitations: undefined,
1324
- };
1269
+ });
1325
1270
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1326
- if (data.nextToken !== undefined && data.nextToken !== null) {
1271
+ if (data.nextToken != null) {
1327
1272
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1328
1273
  }
1329
- if (data.resourceShareInvitations !== undefined && data.resourceShareInvitations !== null) {
1274
+ if (data.resourceShareInvitations != null) {
1330
1275
  contents.resourceShareInvitations = deserializeAws_restJson1ResourceShareInvitationList(data.resourceShareInvitations, context);
1331
1276
  }
1332
- return Promise.resolve(contents);
1277
+ return contents;
1333
1278
  };
1334
1279
  exports.deserializeAws_restJson1GetResourceShareInvitationsCommand = deserializeAws_restJson1GetResourceShareInvitationsCommand;
1335
1280
  const deserializeAws_restJson1GetResourceShareInvitationsCommandError = async (output, context) => {
@@ -1337,7 +1282,6 @@ const deserializeAws_restJson1GetResourceShareInvitationsCommandError = async (o
1337
1282
  ...output,
1338
1283
  body: await parseBody(output.body, context),
1339
1284
  };
1340
- let response;
1341
1285
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1342
1286
  switch (errorCode) {
1343
1287
  case "InvalidMaxResultsException":
@@ -1366,33 +1310,29 @@ const deserializeAws_restJson1GetResourceShareInvitationsCommandError = async (o
1366
1310
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1367
1311
  default:
1368
1312
  const parsedBody = parsedOutput.body;
1369
- const $metadata = deserializeMetadata(output);
1370
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1371
- response = new RAMServiceException_1.RAMServiceException({
1372
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1373
- $fault: "client",
1374
- $metadata,
1313
+ (0, smithy_client_1.throwDefaultError)({
1314
+ output,
1315
+ parsedBody,
1316
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1317
+ errorCode,
1375
1318
  });
1376
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1377
1319
  }
1378
1320
  };
1379
1321
  const deserializeAws_restJson1GetResourceSharesCommand = async (output, context) => {
1380
1322
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1381
1323
  return deserializeAws_restJson1GetResourceSharesCommandError(output, context);
1382
1324
  }
1383
- const contents = {
1325
+ const contents = map({
1384
1326
  $metadata: deserializeMetadata(output),
1385
- nextToken: undefined,
1386
- resourceShares: undefined,
1387
- };
1327
+ });
1388
1328
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1389
- if (data.nextToken !== undefined && data.nextToken !== null) {
1329
+ if (data.nextToken != null) {
1390
1330
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1391
1331
  }
1392
- if (data.resourceShares !== undefined && data.resourceShares !== null) {
1332
+ if (data.resourceShares != null) {
1393
1333
  contents.resourceShares = deserializeAws_restJson1ResourceShareList(data.resourceShares, context);
1394
1334
  }
1395
- return Promise.resolve(contents);
1335
+ return contents;
1396
1336
  };
1397
1337
  exports.deserializeAws_restJson1GetResourceSharesCommand = deserializeAws_restJson1GetResourceSharesCommand;
1398
1338
  const deserializeAws_restJson1GetResourceSharesCommandError = async (output, context) => {
@@ -1400,7 +1340,6 @@ const deserializeAws_restJson1GetResourceSharesCommandError = async (output, con
1400
1340
  ...output,
1401
1341
  body: await parseBody(output.body, context),
1402
1342
  };
1403
- let response;
1404
1343
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1405
1344
  switch (errorCode) {
1406
1345
  case "InvalidNextTokenException":
@@ -1423,33 +1362,29 @@ const deserializeAws_restJson1GetResourceSharesCommandError = async (output, con
1423
1362
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1424
1363
  default:
1425
1364
  const parsedBody = parsedOutput.body;
1426
- const $metadata = deserializeMetadata(output);
1427
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1428
- response = new RAMServiceException_1.RAMServiceException({
1429
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1430
- $fault: "client",
1431
- $metadata,
1365
+ (0, smithy_client_1.throwDefaultError)({
1366
+ output,
1367
+ parsedBody,
1368
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1369
+ errorCode,
1432
1370
  });
1433
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1434
1371
  }
1435
1372
  };
1436
1373
  const deserializeAws_restJson1ListPendingInvitationResourcesCommand = async (output, context) => {
1437
1374
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1438
1375
  return deserializeAws_restJson1ListPendingInvitationResourcesCommandError(output, context);
1439
1376
  }
1440
- const contents = {
1377
+ const contents = map({
1441
1378
  $metadata: deserializeMetadata(output),
1442
- nextToken: undefined,
1443
- resources: undefined,
1444
- };
1379
+ });
1445
1380
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1446
- if (data.nextToken !== undefined && data.nextToken !== null) {
1381
+ if (data.nextToken != null) {
1447
1382
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1448
1383
  }
1449
- if (data.resources !== undefined && data.resources !== null) {
1384
+ if (data.resources != null) {
1450
1385
  contents.resources = deserializeAws_restJson1ResourceList(data.resources, context);
1451
1386
  }
1452
- return Promise.resolve(contents);
1387
+ return contents;
1453
1388
  };
1454
1389
  exports.deserializeAws_restJson1ListPendingInvitationResourcesCommand = deserializeAws_restJson1ListPendingInvitationResourcesCommand;
1455
1390
  const deserializeAws_restJson1ListPendingInvitationResourcesCommandError = async (output, context) => {
@@ -1457,7 +1392,6 @@ const deserializeAws_restJson1ListPendingInvitationResourcesCommandError = async
1457
1392
  ...output,
1458
1393
  body: await parseBody(output.body, context),
1459
1394
  };
1460
- let response;
1461
1395
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1462
1396
  switch (errorCode) {
1463
1397
  case "InvalidNextTokenException":
@@ -1489,33 +1423,29 @@ const deserializeAws_restJson1ListPendingInvitationResourcesCommandError = async
1489
1423
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1490
1424
  default:
1491
1425
  const parsedBody = parsedOutput.body;
1492
- const $metadata = deserializeMetadata(output);
1493
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1494
- response = new RAMServiceException_1.RAMServiceException({
1495
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1496
- $fault: "client",
1497
- $metadata,
1426
+ (0, smithy_client_1.throwDefaultError)({
1427
+ output,
1428
+ parsedBody,
1429
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1430
+ errorCode,
1498
1431
  });
1499
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1500
1432
  }
1501
1433
  };
1502
1434
  const deserializeAws_restJson1ListPermissionsCommand = async (output, context) => {
1503
1435
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1504
1436
  return deserializeAws_restJson1ListPermissionsCommandError(output, context);
1505
1437
  }
1506
- const contents = {
1438
+ const contents = map({
1507
1439
  $metadata: deserializeMetadata(output),
1508
- nextToken: undefined,
1509
- permissions: undefined,
1510
- };
1440
+ });
1511
1441
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1512
- if (data.nextToken !== undefined && data.nextToken !== null) {
1442
+ if (data.nextToken != null) {
1513
1443
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1514
1444
  }
1515
- if (data.permissions !== undefined && data.permissions !== null) {
1445
+ if (data.permissions != null) {
1516
1446
  contents.permissions = deserializeAws_restJson1ResourceSharePermissionList(data.permissions, context);
1517
1447
  }
1518
- return Promise.resolve(contents);
1448
+ return contents;
1519
1449
  };
1520
1450
  exports.deserializeAws_restJson1ListPermissionsCommand = deserializeAws_restJson1ListPermissionsCommand;
1521
1451
  const deserializeAws_restJson1ListPermissionsCommandError = async (output, context) => {
@@ -1523,7 +1453,6 @@ const deserializeAws_restJson1ListPermissionsCommandError = async (output, conte
1523
1453
  ...output,
1524
1454
  body: await parseBody(output.body, context),
1525
1455
  };
1526
- let response;
1527
1456
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1528
1457
  switch (errorCode) {
1529
1458
  case "InvalidNextTokenException":
@@ -1543,33 +1472,29 @@ const deserializeAws_restJson1ListPermissionsCommandError = async (output, conte
1543
1472
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1544
1473
  default:
1545
1474
  const parsedBody = parsedOutput.body;
1546
- const $metadata = deserializeMetadata(output);
1547
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1548
- response = new RAMServiceException_1.RAMServiceException({
1549
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1550
- $fault: "client",
1551
- $metadata,
1475
+ (0, smithy_client_1.throwDefaultError)({
1476
+ output,
1477
+ parsedBody,
1478
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1479
+ errorCode,
1552
1480
  });
1553
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1554
1481
  }
1555
1482
  };
1556
1483
  const deserializeAws_restJson1ListPermissionVersionsCommand = async (output, context) => {
1557
1484
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1558
1485
  return deserializeAws_restJson1ListPermissionVersionsCommandError(output, context);
1559
1486
  }
1560
- const contents = {
1487
+ const contents = map({
1561
1488
  $metadata: deserializeMetadata(output),
1562
- nextToken: undefined,
1563
- permissions: undefined,
1564
- };
1489
+ });
1565
1490
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1566
- if (data.nextToken !== undefined && data.nextToken !== null) {
1491
+ if (data.nextToken != null) {
1567
1492
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1568
1493
  }
1569
- if (data.permissions !== undefined && data.permissions !== null) {
1494
+ if (data.permissions != null) {
1570
1495
  contents.permissions = deserializeAws_restJson1ResourceSharePermissionList(data.permissions, context);
1571
1496
  }
1572
- return Promise.resolve(contents);
1497
+ return contents;
1573
1498
  };
1574
1499
  exports.deserializeAws_restJson1ListPermissionVersionsCommand = deserializeAws_restJson1ListPermissionVersionsCommand;
1575
1500
  const deserializeAws_restJson1ListPermissionVersionsCommandError = async (output, context) => {
@@ -1577,7 +1502,6 @@ const deserializeAws_restJson1ListPermissionVersionsCommandError = async (output
1577
1502
  ...output,
1578
1503
  body: await parseBody(output.body, context),
1579
1504
  };
1580
- let response;
1581
1505
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1582
1506
  switch (errorCode) {
1583
1507
  case "InvalidNextTokenException":
@@ -1603,33 +1527,29 @@ const deserializeAws_restJson1ListPermissionVersionsCommandError = async (output
1603
1527
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1604
1528
  default:
1605
1529
  const parsedBody = parsedOutput.body;
1606
- const $metadata = deserializeMetadata(output);
1607
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1608
- response = new RAMServiceException_1.RAMServiceException({
1609
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1610
- $fault: "client",
1611
- $metadata,
1530
+ (0, smithy_client_1.throwDefaultError)({
1531
+ output,
1532
+ parsedBody,
1533
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1534
+ errorCode,
1612
1535
  });
1613
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1614
1536
  }
1615
1537
  };
1616
1538
  const deserializeAws_restJson1ListPrincipalsCommand = async (output, context) => {
1617
1539
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1618
1540
  return deserializeAws_restJson1ListPrincipalsCommandError(output, context);
1619
1541
  }
1620
- const contents = {
1542
+ const contents = map({
1621
1543
  $metadata: deserializeMetadata(output),
1622
- nextToken: undefined,
1623
- principals: undefined,
1624
- };
1544
+ });
1625
1545
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1626
- if (data.nextToken !== undefined && data.nextToken !== null) {
1546
+ if (data.nextToken != null) {
1627
1547
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1628
1548
  }
1629
- if (data.principals !== undefined && data.principals !== null) {
1549
+ if (data.principals != null) {
1630
1550
  contents.principals = deserializeAws_restJson1PrincipalList(data.principals, context);
1631
1551
  }
1632
- return Promise.resolve(contents);
1552
+ return contents;
1633
1553
  };
1634
1554
  exports.deserializeAws_restJson1ListPrincipalsCommand = deserializeAws_restJson1ListPrincipalsCommand;
1635
1555
  const deserializeAws_restJson1ListPrincipalsCommandError = async (output, context) => {
@@ -1637,7 +1557,6 @@ const deserializeAws_restJson1ListPrincipalsCommandError = async (output, contex
1637
1557
  ...output,
1638
1558
  body: await parseBody(output.body, context),
1639
1559
  };
1640
- let response;
1641
1560
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1642
1561
  switch (errorCode) {
1643
1562
  case "InvalidNextTokenException":
@@ -1660,33 +1579,29 @@ const deserializeAws_restJson1ListPrincipalsCommandError = async (output, contex
1660
1579
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1661
1580
  default:
1662
1581
  const parsedBody = parsedOutput.body;
1663
- const $metadata = deserializeMetadata(output);
1664
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1665
- response = new RAMServiceException_1.RAMServiceException({
1666
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1667
- $fault: "client",
1668
- $metadata,
1582
+ (0, smithy_client_1.throwDefaultError)({
1583
+ output,
1584
+ parsedBody,
1585
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1586
+ errorCode,
1669
1587
  });
1670
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1671
1588
  }
1672
1589
  };
1673
1590
  const deserializeAws_restJson1ListResourcesCommand = async (output, context) => {
1674
1591
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1675
1592
  return deserializeAws_restJson1ListResourcesCommandError(output, context);
1676
1593
  }
1677
- const contents = {
1594
+ const contents = map({
1678
1595
  $metadata: deserializeMetadata(output),
1679
- nextToken: undefined,
1680
- resources: undefined,
1681
- };
1596
+ });
1682
1597
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1683
- if (data.nextToken !== undefined && data.nextToken !== null) {
1598
+ if (data.nextToken != null) {
1684
1599
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1685
1600
  }
1686
- if (data.resources !== undefined && data.resources !== null) {
1601
+ if (data.resources != null) {
1687
1602
  contents.resources = deserializeAws_restJson1ResourceList(data.resources, context);
1688
1603
  }
1689
- return Promise.resolve(contents);
1604
+ return contents;
1690
1605
  };
1691
1606
  exports.deserializeAws_restJson1ListResourcesCommand = deserializeAws_restJson1ListResourcesCommand;
1692
1607
  const deserializeAws_restJson1ListResourcesCommandError = async (output, context) => {
@@ -1694,7 +1609,6 @@ const deserializeAws_restJson1ListResourcesCommandError = async (output, context
1694
1609
  ...output,
1695
1610
  body: await parseBody(output.body, context),
1696
1611
  };
1697
- let response;
1698
1612
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1699
1613
  switch (errorCode) {
1700
1614
  case "InvalidNextTokenException":
@@ -1720,33 +1634,29 @@ const deserializeAws_restJson1ListResourcesCommandError = async (output, context
1720
1634
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1721
1635
  default:
1722
1636
  const parsedBody = parsedOutput.body;
1723
- const $metadata = deserializeMetadata(output);
1724
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1725
- response = new RAMServiceException_1.RAMServiceException({
1726
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1727
- $fault: "client",
1728
- $metadata,
1637
+ (0, smithy_client_1.throwDefaultError)({
1638
+ output,
1639
+ parsedBody,
1640
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1641
+ errorCode,
1729
1642
  });
1730
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1731
1643
  }
1732
1644
  };
1733
1645
  const deserializeAws_restJson1ListResourceSharePermissionsCommand = async (output, context) => {
1734
1646
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1735
1647
  return deserializeAws_restJson1ListResourceSharePermissionsCommandError(output, context);
1736
1648
  }
1737
- const contents = {
1649
+ const contents = map({
1738
1650
  $metadata: deserializeMetadata(output),
1739
- nextToken: undefined,
1740
- permissions: undefined,
1741
- };
1651
+ });
1742
1652
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1743
- if (data.nextToken !== undefined && data.nextToken !== null) {
1653
+ if (data.nextToken != null) {
1744
1654
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1745
1655
  }
1746
- if (data.permissions !== undefined && data.permissions !== null) {
1656
+ if (data.permissions != null) {
1747
1657
  contents.permissions = deserializeAws_restJson1ResourceSharePermissionList(data.permissions, context);
1748
1658
  }
1749
- return Promise.resolve(contents);
1659
+ return contents;
1750
1660
  };
1751
1661
  exports.deserializeAws_restJson1ListResourceSharePermissionsCommand = deserializeAws_restJson1ListResourceSharePermissionsCommand;
1752
1662
  const deserializeAws_restJson1ListResourceSharePermissionsCommandError = async (output, context) => {
@@ -1754,7 +1664,6 @@ const deserializeAws_restJson1ListResourceSharePermissionsCommandError = async (
1754
1664
  ...output,
1755
1665
  body: await parseBody(output.body, context),
1756
1666
  };
1757
- let response;
1758
1667
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1759
1668
  switch (errorCode) {
1760
1669
  case "InvalidNextTokenException":
@@ -1780,33 +1689,29 @@ const deserializeAws_restJson1ListResourceSharePermissionsCommandError = async (
1780
1689
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1781
1690
  default:
1782
1691
  const parsedBody = parsedOutput.body;
1783
- const $metadata = deserializeMetadata(output);
1784
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1785
- response = new RAMServiceException_1.RAMServiceException({
1786
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1787
- $fault: "client",
1788
- $metadata,
1692
+ (0, smithy_client_1.throwDefaultError)({
1693
+ output,
1694
+ parsedBody,
1695
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1696
+ errorCode,
1789
1697
  });
1790
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1791
1698
  }
1792
1699
  };
1793
1700
  const deserializeAws_restJson1ListResourceTypesCommand = async (output, context) => {
1794
1701
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1795
1702
  return deserializeAws_restJson1ListResourceTypesCommandError(output, context);
1796
1703
  }
1797
- const contents = {
1704
+ const contents = map({
1798
1705
  $metadata: deserializeMetadata(output),
1799
- nextToken: undefined,
1800
- resourceTypes: undefined,
1801
- };
1706
+ });
1802
1707
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1803
- if (data.nextToken !== undefined && data.nextToken !== null) {
1708
+ if (data.nextToken != null) {
1804
1709
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1805
1710
  }
1806
- if (data.resourceTypes !== undefined && data.resourceTypes !== null) {
1711
+ if (data.resourceTypes != null) {
1807
1712
  contents.resourceTypes = deserializeAws_restJson1ServiceNameAndResourceTypeList(data.resourceTypes, context);
1808
1713
  }
1809
- return Promise.resolve(contents);
1714
+ return contents;
1810
1715
  };
1811
1716
  exports.deserializeAws_restJson1ListResourceTypesCommand = deserializeAws_restJson1ListResourceTypesCommand;
1812
1717
  const deserializeAws_restJson1ListResourceTypesCommandError = async (output, context) => {
@@ -1814,7 +1719,6 @@ const deserializeAws_restJson1ListResourceTypesCommandError = async (output, con
1814
1719
  ...output,
1815
1720
  body: await parseBody(output.body, context),
1816
1721
  };
1817
- let response;
1818
1722
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1819
1723
  switch (errorCode) {
1820
1724
  case "InvalidNextTokenException":
@@ -1831,29 +1735,26 @@ const deserializeAws_restJson1ListResourceTypesCommandError = async (output, con
1831
1735
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1832
1736
  default:
1833
1737
  const parsedBody = parsedOutput.body;
1834
- const $metadata = deserializeMetadata(output);
1835
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1836
- response = new RAMServiceException_1.RAMServiceException({
1837
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1838
- $fault: "client",
1839
- $metadata,
1738
+ (0, smithy_client_1.throwDefaultError)({
1739
+ output,
1740
+ parsedBody,
1741
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1742
+ errorCode,
1840
1743
  });
1841
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1842
1744
  }
1843
1745
  };
1844
1746
  const deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand = async (output, context) => {
1845
1747
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1846
1748
  return deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError(output, context);
1847
1749
  }
1848
- const contents = {
1750
+ const contents = map({
1849
1751
  $metadata: deserializeMetadata(output),
1850
- returnValue: undefined,
1851
- };
1752
+ });
1852
1753
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1853
- if (data.returnValue !== undefined && data.returnValue !== null) {
1754
+ if (data.returnValue != null) {
1854
1755
  contents.returnValue = (0, smithy_client_1.expectBoolean)(data.returnValue);
1855
1756
  }
1856
- return Promise.resolve(contents);
1757
+ return contents;
1857
1758
  };
1858
1759
  exports.deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand = deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand;
1859
1760
  const deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError = async (output, context) => {
@@ -1861,7 +1762,6 @@ const deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError
1861
1762
  ...output,
1862
1763
  body: await parseBody(output.body, context),
1863
1764
  };
1864
- let response;
1865
1765
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1866
1766
  switch (errorCode) {
1867
1767
  case "InvalidParameterException":
@@ -1890,33 +1790,29 @@ const deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError
1890
1790
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
1891
1791
  default:
1892
1792
  const parsedBody = parsedOutput.body;
1893
- const $metadata = deserializeMetadata(output);
1894
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1895
- response = new RAMServiceException_1.RAMServiceException({
1896
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1897
- $fault: "client",
1898
- $metadata,
1793
+ (0, smithy_client_1.throwDefaultError)({
1794
+ output,
1795
+ parsedBody,
1796
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1797
+ errorCode,
1899
1798
  });
1900
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1901
1799
  }
1902
1800
  };
1903
1801
  const deserializeAws_restJson1RejectResourceShareInvitationCommand = async (output, context) => {
1904
1802
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1905
1803
  return deserializeAws_restJson1RejectResourceShareInvitationCommandError(output, context);
1906
1804
  }
1907
- const contents = {
1805
+ const contents = map({
1908
1806
  $metadata: deserializeMetadata(output),
1909
- clientToken: undefined,
1910
- resourceShareInvitation: undefined,
1911
- };
1807
+ });
1912
1808
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1913
- if (data.clientToken !== undefined && data.clientToken !== null) {
1809
+ if (data.clientToken != null) {
1914
1810
  contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
1915
1811
  }
1916
- if (data.resourceShareInvitation !== undefined && data.resourceShareInvitation !== null) {
1812
+ if (data.resourceShareInvitation != null) {
1917
1813
  contents.resourceShareInvitation = deserializeAws_restJson1ResourceShareInvitation(data.resourceShareInvitation, context);
1918
1814
  }
1919
- return Promise.resolve(contents);
1815
+ return contents;
1920
1816
  };
1921
1817
  exports.deserializeAws_restJson1RejectResourceShareInvitationCommand = deserializeAws_restJson1RejectResourceShareInvitationCommand;
1922
1818
  const deserializeAws_restJson1RejectResourceShareInvitationCommandError = async (output, context) => {
@@ -1924,7 +1820,6 @@ const deserializeAws_restJson1RejectResourceShareInvitationCommandError = async
1924
1820
  ...output,
1925
1821
  body: await parseBody(output.body, context),
1926
1822
  };
1927
- let response;
1928
1823
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1929
1824
  switch (errorCode) {
1930
1825
  case "IdempotentParameterMismatchException":
@@ -1959,25 +1854,23 @@ const deserializeAws_restJson1RejectResourceShareInvitationCommandError = async
1959
1854
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1960
1855
  default:
1961
1856
  const parsedBody = parsedOutput.body;
1962
- const $metadata = deserializeMetadata(output);
1963
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1964
- response = new RAMServiceException_1.RAMServiceException({
1965
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1966
- $fault: "client",
1967
- $metadata,
1857
+ (0, smithy_client_1.throwDefaultError)({
1858
+ output,
1859
+ parsedBody,
1860
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1861
+ errorCode,
1968
1862
  });
1969
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1970
1863
  }
1971
1864
  };
1972
1865
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1973
1866
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1974
1867
  return deserializeAws_restJson1TagResourceCommandError(output, context);
1975
1868
  }
1976
- const contents = {
1869
+ const contents = map({
1977
1870
  $metadata: deserializeMetadata(output),
1978
- };
1871
+ });
1979
1872
  await collectBody(output.body, context);
1980
- return Promise.resolve(contents);
1873
+ return contents;
1981
1874
  };
1982
1875
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1983
1876
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -1985,7 +1878,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1985
1878
  ...output,
1986
1879
  body: await parseBody(output.body, context),
1987
1880
  };
1988
- let response;
1989
1881
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1990
1882
  switch (errorCode) {
1991
1883
  case "InvalidParameterException":
@@ -2014,25 +1906,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2014
1906
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
2015
1907
  default:
2016
1908
  const parsedBody = parsedOutput.body;
2017
- const $metadata = deserializeMetadata(output);
2018
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2019
- response = new RAMServiceException_1.RAMServiceException({
2020
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2021
- $fault: "client",
2022
- $metadata,
1909
+ (0, smithy_client_1.throwDefaultError)({
1910
+ output,
1911
+ parsedBody,
1912
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1913
+ errorCode,
2023
1914
  });
2024
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2025
1915
  }
2026
1916
  };
2027
1917
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
2028
1918
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2029
1919
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
2030
1920
  }
2031
- const contents = {
1921
+ const contents = map({
2032
1922
  $metadata: deserializeMetadata(output),
2033
- };
1923
+ });
2034
1924
  await collectBody(output.body, context);
2035
- return Promise.resolve(contents);
1925
+ return contents;
2036
1926
  };
2037
1927
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
2038
1928
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -2040,7 +1930,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2040
1930
  ...output,
2041
1931
  body: await parseBody(output.body, context),
2042
1932
  };
2043
- let response;
2044
1933
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2045
1934
  switch (errorCode) {
2046
1935
  case "InvalidParameterException":
@@ -2054,33 +1943,29 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2054
1943
  throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2055
1944
  default:
2056
1945
  const parsedBody = parsedOutput.body;
2057
- const $metadata = deserializeMetadata(output);
2058
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2059
- response = new RAMServiceException_1.RAMServiceException({
2060
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2061
- $fault: "client",
2062
- $metadata,
1946
+ (0, smithy_client_1.throwDefaultError)({
1947
+ output,
1948
+ parsedBody,
1949
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
1950
+ errorCode,
2063
1951
  });
2064
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2065
1952
  }
2066
1953
  };
2067
1954
  const deserializeAws_restJson1UpdateResourceShareCommand = async (output, context) => {
2068
1955
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2069
1956
  return deserializeAws_restJson1UpdateResourceShareCommandError(output, context);
2070
1957
  }
2071
- const contents = {
1958
+ const contents = map({
2072
1959
  $metadata: deserializeMetadata(output),
2073
- clientToken: undefined,
2074
- resourceShare: undefined,
2075
- };
1960
+ });
2076
1961
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2077
- if (data.clientToken !== undefined && data.clientToken !== null) {
1962
+ if (data.clientToken != null) {
2078
1963
  contents.clientToken = (0, smithy_client_1.expectString)(data.clientToken);
2079
1964
  }
2080
- if (data.resourceShare !== undefined && data.resourceShare !== null) {
1965
+ if (data.resourceShare != null) {
2081
1966
  contents.resourceShare = deserializeAws_restJson1ResourceShare(data.resourceShare, context);
2082
1967
  }
2083
- return Promise.resolve(contents);
1968
+ return contents;
2084
1969
  };
2085
1970
  exports.deserializeAws_restJson1UpdateResourceShareCommand = deserializeAws_restJson1UpdateResourceShareCommand;
2086
1971
  const deserializeAws_restJson1UpdateResourceShareCommandError = async (output, context) => {
@@ -2088,7 +1973,6 @@ const deserializeAws_restJson1UpdateResourceShareCommandError = async (output, c
2088
1973
  ...output,
2089
1974
  body: await parseBody(output.body, context),
2090
1975
  };
2091
- let response;
2092
1976
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2093
1977
  switch (errorCode) {
2094
1978
  case "IdempotentParameterMismatchException":
@@ -2120,20 +2004,19 @@ const deserializeAws_restJson1UpdateResourceShareCommandError = async (output, c
2120
2004
  throw await deserializeAws_restJson1UnknownResourceExceptionResponse(parsedOutput, context);
2121
2005
  default:
2122
2006
  const parsedBody = parsedOutput.body;
2123
- const $metadata = deserializeMetadata(output);
2124
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2125
- response = new RAMServiceException_1.RAMServiceException({
2126
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2127
- $fault: "client",
2128
- $metadata,
2007
+ (0, smithy_client_1.throwDefaultError)({
2008
+ output,
2009
+ parsedBody,
2010
+ exceptionCtor: RAMServiceException_1.RAMServiceException,
2011
+ errorCode,
2129
2012
  });
2130
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2131
2013
  }
2132
2014
  };
2015
+ const map = smithy_client_1.map;
2133
2016
  const deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse = async (parsedOutput, context) => {
2134
- const contents = {};
2017
+ const contents = map({});
2135
2018
  const data = parsedOutput.body;
2136
- if (data.message !== undefined && data.message !== null) {
2019
+ if (data.message != null) {
2137
2020
  contents.message = (0, smithy_client_1.expectString)(data.message);
2138
2021
  }
2139
2022
  const exception = new models_0_1.IdempotentParameterMismatchException({
@@ -2143,9 +2026,9 @@ const deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse = asy
2143
2026
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2144
2027
  };
2145
2028
  const deserializeAws_restJson1InvalidClientTokenExceptionResponse = async (parsedOutput, context) => {
2146
- const contents = {};
2029
+ const contents = map({});
2147
2030
  const data = parsedOutput.body;
2148
- if (data.message !== undefined && data.message !== null) {
2031
+ if (data.message != null) {
2149
2032
  contents.message = (0, smithy_client_1.expectString)(data.message);
2150
2033
  }
2151
2034
  const exception = new models_0_1.InvalidClientTokenException({
@@ -2155,9 +2038,9 @@ const deserializeAws_restJson1InvalidClientTokenExceptionResponse = async (parse
2155
2038
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2156
2039
  };
2157
2040
  const deserializeAws_restJson1InvalidMaxResultsExceptionResponse = async (parsedOutput, context) => {
2158
- const contents = {};
2041
+ const contents = map({});
2159
2042
  const data = parsedOutput.body;
2160
- if (data.message !== undefined && data.message !== null) {
2043
+ if (data.message != null) {
2161
2044
  contents.message = (0, smithy_client_1.expectString)(data.message);
2162
2045
  }
2163
2046
  const exception = new models_0_1.InvalidMaxResultsException({
@@ -2167,9 +2050,9 @@ const deserializeAws_restJson1InvalidMaxResultsExceptionResponse = async (parsed
2167
2050
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2168
2051
  };
2169
2052
  const deserializeAws_restJson1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
2170
- const contents = {};
2053
+ const contents = map({});
2171
2054
  const data = parsedOutput.body;
2172
- if (data.message !== undefined && data.message !== null) {
2055
+ if (data.message != null) {
2173
2056
  contents.message = (0, smithy_client_1.expectString)(data.message);
2174
2057
  }
2175
2058
  const exception = new models_0_1.InvalidNextTokenException({
@@ -2179,9 +2062,9 @@ const deserializeAws_restJson1InvalidNextTokenExceptionResponse = async (parsedO
2179
2062
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2180
2063
  };
2181
2064
  const deserializeAws_restJson1InvalidParameterExceptionResponse = async (parsedOutput, context) => {
2182
- const contents = {};
2065
+ const contents = map({});
2183
2066
  const data = parsedOutput.body;
2184
- if (data.message !== undefined && data.message !== null) {
2067
+ if (data.message != null) {
2185
2068
  contents.message = (0, smithy_client_1.expectString)(data.message);
2186
2069
  }
2187
2070
  const exception = new models_0_1.InvalidParameterException({
@@ -2191,9 +2074,9 @@ const deserializeAws_restJson1InvalidParameterExceptionResponse = async (parsedO
2191
2074
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2192
2075
  };
2193
2076
  const deserializeAws_restJson1InvalidResourceTypeExceptionResponse = async (parsedOutput, context) => {
2194
- const contents = {};
2077
+ const contents = map({});
2195
2078
  const data = parsedOutput.body;
2196
- if (data.message !== undefined && data.message !== null) {
2079
+ if (data.message != null) {
2197
2080
  contents.message = (0, smithy_client_1.expectString)(data.message);
2198
2081
  }
2199
2082
  const exception = new models_0_1.InvalidResourceTypeException({
@@ -2203,9 +2086,9 @@ const deserializeAws_restJson1InvalidResourceTypeExceptionResponse = async (pars
2203
2086
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2204
2087
  };
2205
2088
  const deserializeAws_restJson1InvalidStateTransitionExceptionResponse = async (parsedOutput, context) => {
2206
- const contents = {};
2089
+ const contents = map({});
2207
2090
  const data = parsedOutput.body;
2208
- if (data.message !== undefined && data.message !== null) {
2091
+ if (data.message != null) {
2209
2092
  contents.message = (0, smithy_client_1.expectString)(data.message);
2210
2093
  }
2211
2094
  const exception = new models_0_1.InvalidStateTransitionException({
@@ -2215,9 +2098,9 @@ const deserializeAws_restJson1InvalidStateTransitionExceptionResponse = async (p
2215
2098
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2216
2099
  };
2217
2100
  const deserializeAws_restJson1MalformedArnExceptionResponse = async (parsedOutput, context) => {
2218
- const contents = {};
2101
+ const contents = map({});
2219
2102
  const data = parsedOutput.body;
2220
- if (data.message !== undefined && data.message !== null) {
2103
+ if (data.message != null) {
2221
2104
  contents.message = (0, smithy_client_1.expectString)(data.message);
2222
2105
  }
2223
2106
  const exception = new models_0_1.MalformedArnException({
@@ -2227,9 +2110,9 @@ const deserializeAws_restJson1MalformedArnExceptionResponse = async (parsedOutpu
2227
2110
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2228
2111
  };
2229
2112
  const deserializeAws_restJson1MissingRequiredParameterExceptionResponse = async (parsedOutput, context) => {
2230
- const contents = {};
2113
+ const contents = map({});
2231
2114
  const data = parsedOutput.body;
2232
- if (data.message !== undefined && data.message !== null) {
2115
+ if (data.message != null) {
2233
2116
  contents.message = (0, smithy_client_1.expectString)(data.message);
2234
2117
  }
2235
2118
  const exception = new models_0_1.MissingRequiredParameterException({
@@ -2239,9 +2122,9 @@ const deserializeAws_restJson1MissingRequiredParameterExceptionResponse = async
2239
2122
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2240
2123
  };
2241
2124
  const deserializeAws_restJson1OperationNotPermittedExceptionResponse = async (parsedOutput, context) => {
2242
- const contents = {};
2125
+ const contents = map({});
2243
2126
  const data = parsedOutput.body;
2244
- if (data.message !== undefined && data.message !== null) {
2127
+ if (data.message != null) {
2245
2128
  contents.message = (0, smithy_client_1.expectString)(data.message);
2246
2129
  }
2247
2130
  const exception = new models_0_1.OperationNotPermittedException({
@@ -2251,9 +2134,9 @@ const deserializeAws_restJson1OperationNotPermittedExceptionResponse = async (pa
2251
2134
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2252
2135
  };
2253
2136
  const deserializeAws_restJson1ResourceArnNotFoundExceptionResponse = async (parsedOutput, context) => {
2254
- const contents = {};
2137
+ const contents = map({});
2255
2138
  const data = parsedOutput.body;
2256
- if (data.message !== undefined && data.message !== null) {
2139
+ if (data.message != null) {
2257
2140
  contents.message = (0, smithy_client_1.expectString)(data.message);
2258
2141
  }
2259
2142
  const exception = new models_0_1.ResourceArnNotFoundException({
@@ -2263,9 +2146,9 @@ const deserializeAws_restJson1ResourceArnNotFoundExceptionResponse = async (pars
2263
2146
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2264
2147
  };
2265
2148
  const deserializeAws_restJson1ResourceShareInvitationAlreadyAcceptedExceptionResponse = async (parsedOutput, context) => {
2266
- const contents = {};
2149
+ const contents = map({});
2267
2150
  const data = parsedOutput.body;
2268
- if (data.message !== undefined && data.message !== null) {
2151
+ if (data.message != null) {
2269
2152
  contents.message = (0, smithy_client_1.expectString)(data.message);
2270
2153
  }
2271
2154
  const exception = new models_0_1.ResourceShareInvitationAlreadyAcceptedException({
@@ -2275,9 +2158,9 @@ const deserializeAws_restJson1ResourceShareInvitationAlreadyAcceptedExceptionRes
2275
2158
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2276
2159
  };
2277
2160
  const deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionResponse = async (parsedOutput, context) => {
2278
- const contents = {};
2161
+ const contents = map({});
2279
2162
  const data = parsedOutput.body;
2280
- if (data.message !== undefined && data.message !== null) {
2163
+ if (data.message != null) {
2281
2164
  contents.message = (0, smithy_client_1.expectString)(data.message);
2282
2165
  }
2283
2166
  const exception = new models_0_1.ResourceShareInvitationAlreadyRejectedException({
@@ -2287,9 +2170,9 @@ const deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionRes
2287
2170
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2288
2171
  };
2289
2172
  const deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse = async (parsedOutput, context) => {
2290
- const contents = {};
2173
+ const contents = map({});
2291
2174
  const data = parsedOutput.body;
2292
- if (data.message !== undefined && data.message !== null) {
2175
+ if (data.message != null) {
2293
2176
  contents.message = (0, smithy_client_1.expectString)(data.message);
2294
2177
  }
2295
2178
  const exception = new models_0_1.ResourceShareInvitationArnNotFoundException({
@@ -2299,9 +2182,9 @@ const deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionRespons
2299
2182
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2300
2183
  };
2301
2184
  const deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse = async (parsedOutput, context) => {
2302
- const contents = {};
2185
+ const contents = map({});
2303
2186
  const data = parsedOutput.body;
2304
- if (data.message !== undefined && data.message !== null) {
2187
+ if (data.message != null) {
2305
2188
  contents.message = (0, smithy_client_1.expectString)(data.message);
2306
2189
  }
2307
2190
  const exception = new models_0_1.ResourceShareInvitationExpiredException({
@@ -2311,9 +2194,9 @@ const deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse =
2311
2194
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2312
2195
  };
2313
2196
  const deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse = async (parsedOutput, context) => {
2314
- const contents = {};
2197
+ const contents = map({});
2315
2198
  const data = parsedOutput.body;
2316
- if (data.message !== undefined && data.message !== null) {
2199
+ if (data.message != null) {
2317
2200
  contents.message = (0, smithy_client_1.expectString)(data.message);
2318
2201
  }
2319
2202
  const exception = new models_0_1.ResourceShareLimitExceededException({
@@ -2323,9 +2206,9 @@ const deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse = asyn
2323
2206
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2324
2207
  };
2325
2208
  const deserializeAws_restJson1ServerInternalExceptionResponse = async (parsedOutput, context) => {
2326
- const contents = {};
2209
+ const contents = map({});
2327
2210
  const data = parsedOutput.body;
2328
- if (data.message !== undefined && data.message !== null) {
2211
+ if (data.message != null) {
2329
2212
  contents.message = (0, smithy_client_1.expectString)(data.message);
2330
2213
  }
2331
2214
  const exception = new models_0_1.ServerInternalException({
@@ -2335,9 +2218,9 @@ const deserializeAws_restJson1ServerInternalExceptionResponse = async (parsedOut
2335
2218
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2336
2219
  };
2337
2220
  const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
2338
- const contents = {};
2221
+ const contents = map({});
2339
2222
  const data = parsedOutput.body;
2340
- if (data.message !== undefined && data.message !== null) {
2223
+ if (data.message != null) {
2341
2224
  contents.message = (0, smithy_client_1.expectString)(data.message);
2342
2225
  }
2343
2226
  const exception = new models_0_1.ServiceUnavailableException({
@@ -2347,9 +2230,9 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parse
2347
2230
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2348
2231
  };
2349
2232
  const deserializeAws_restJson1TagLimitExceededExceptionResponse = async (parsedOutput, context) => {
2350
- const contents = {};
2233
+ const contents = map({});
2351
2234
  const data = parsedOutput.body;
2352
- if (data.message !== undefined && data.message !== null) {
2235
+ if (data.message != null) {
2353
2236
  contents.message = (0, smithy_client_1.expectString)(data.message);
2354
2237
  }
2355
2238
  const exception = new models_0_1.TagLimitExceededException({
@@ -2359,9 +2242,9 @@ const deserializeAws_restJson1TagLimitExceededExceptionResponse = async (parsedO
2359
2242
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2360
2243
  };
2361
2244
  const deserializeAws_restJson1TagPolicyViolationExceptionResponse = async (parsedOutput, context) => {
2362
- const contents = {};
2245
+ const contents = map({});
2363
2246
  const data = parsedOutput.body;
2364
- if (data.message !== undefined && data.message !== null) {
2247
+ if (data.message != null) {
2365
2248
  contents.message = (0, smithy_client_1.expectString)(data.message);
2366
2249
  }
2367
2250
  const exception = new models_0_1.TagPolicyViolationException({
@@ -2371,9 +2254,9 @@ const deserializeAws_restJson1TagPolicyViolationExceptionResponse = async (parse
2371
2254
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2372
2255
  };
2373
2256
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
2374
- const contents = {};
2257
+ const contents = map({});
2375
2258
  const data = parsedOutput.body;
2376
- if (data.message !== undefined && data.message !== null) {
2259
+ if (data.message != null) {
2377
2260
  contents.message = (0, smithy_client_1.expectString)(data.message);
2378
2261
  }
2379
2262
  const exception = new models_0_1.ThrottlingException({
@@ -2383,9 +2266,9 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
2383
2266
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2384
2267
  };
2385
2268
  const deserializeAws_restJson1UnknownResourceExceptionResponse = async (parsedOutput, context) => {
2386
- const contents = {};
2269
+ const contents = map({});
2387
2270
  const data = parsedOutput.body;
2388
- if (data.message !== undefined && data.message !== null) {
2271
+ if (data.message != null) {
2389
2272
  contents.message = (0, smithy_client_1.expectString)(data.message);
2390
2273
  }
2391
2274
  const exception = new models_0_1.UnknownResourceException({
@@ -2398,9 +2281,6 @@ const serializeAws_restJson1PermissionArnList = (input, context) => {
2398
2281
  return input
2399
2282
  .filter((e) => e != null)
2400
2283
  .map((entry) => {
2401
- if (entry === null) {
2402
- return null;
2403
- }
2404
2284
  return entry;
2405
2285
  });
2406
2286
  };
@@ -2408,9 +2288,6 @@ const serializeAws_restJson1PrincipalArnOrIdList = (input, context) => {
2408
2288
  return input
2409
2289
  .filter((e) => e != null)
2410
2290
  .map((entry) => {
2411
- if (entry === null) {
2412
- return null;
2413
- }
2414
2291
  return entry;
2415
2292
  });
2416
2293
  };
@@ -2418,9 +2295,6 @@ const serializeAws_restJson1ResourceArnList = (input, context) => {
2418
2295
  return input
2419
2296
  .filter((e) => e != null)
2420
2297
  .map((entry) => {
2421
- if (entry === null) {
2422
- return null;
2423
- }
2424
2298
  return entry;
2425
2299
  });
2426
2300
  };
@@ -2428,9 +2302,6 @@ const serializeAws_restJson1ResourceShareArnList = (input, context) => {
2428
2302
  return input
2429
2303
  .filter((e) => e != null)
2430
2304
  .map((entry) => {
2431
- if (entry === null) {
2432
- return null;
2433
- }
2434
2305
  return entry;
2435
2306
  });
2436
2307
  };
@@ -2438,9 +2309,6 @@ const serializeAws_restJson1ResourceShareInvitationArnList = (input, context) =>
2438
2309
  return input
2439
2310
  .filter((e) => e != null)
2440
2311
  .map((entry) => {
2441
- if (entry === null) {
2442
- return null;
2443
- }
2444
2312
  return entry;
2445
2313
  });
2446
2314
  };
@@ -2460,9 +2328,6 @@ const serializeAws_restJson1TagFilters = (input, context) => {
2460
2328
  return input
2461
2329
  .filter((e) => e != null)
2462
2330
  .map((entry) => {
2463
- if (entry === null) {
2464
- return null;
2465
- }
2466
2331
  return serializeAws_restJson1TagFilter(entry, context);
2467
2332
  });
2468
2333
  };
@@ -2470,9 +2335,6 @@ const serializeAws_restJson1TagKeyList = (input, context) => {
2470
2335
  return input
2471
2336
  .filter((e) => e != null)
2472
2337
  .map((entry) => {
2473
- if (entry === null) {
2474
- return null;
2475
- }
2476
2338
  return entry;
2477
2339
  });
2478
2340
  };
@@ -2480,9 +2342,6 @@ const serializeAws_restJson1TagList = (input, context) => {
2480
2342
  return input
2481
2343
  .filter((e) => e != null)
2482
2344
  .map((entry) => {
2483
- if (entry === null) {
2484
- return null;
2485
- }
2486
2345
  return serializeAws_restJson1Tag(entry, context);
2487
2346
  });
2488
2347
  };
@@ -2490,9 +2349,6 @@ const serializeAws_restJson1TagValueList = (input, context) => {
2490
2349
  return input
2491
2350
  .filter((e) => e != null)
2492
2351
  .map((entry) => {
2493
- if (entry === null) {
2494
- return null;
2495
- }
2496
2352
  return entry;
2497
2353
  });
2498
2354
  };