@aws-sdk/client-ram 3.141.0 → 3.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { IdempotentParameterMismatchException, InvalidClientTokenException, InvalidMaxResultsException, InvalidNextTokenException, InvalidParameterException, InvalidResourceTypeException, InvalidStateTransitionException, MalformedArnException, MissingRequiredParameterException, OperationNotPermittedException, ResourceArnNotFoundException, ResourceShareInvitationAlreadyAcceptedException, ResourceShareInvitationAlreadyRejectedException, ResourceShareInvitationArnNotFoundException, ResourceShareInvitationExpiredException, ResourceShareLimitExceededException, ServerInternalException, ServiceUnavailableException, TagLimitExceededException, TagPolicyViolationException, ThrottlingException, UnknownResourceException, } from "../models/models_0";
5
5
  import { RAMServiceException as __BaseException } from "../models/RAMServiceException";
6
6
  export var serializeAws_restJson1AcceptResourceShareInvitationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -118,7 +118,10 @@ export var serializeAws_restJson1DeleteResourceShareCommand = function (input, c
118
118
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
119
119
  headers = {};
120
120
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/deleteresourceshare";
121
- query = __assign(__assign({}, (input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn })), (input.clientToken !== undefined && { clientToken: input.clientToken }));
121
+ query = map({
122
+ resourceShareArn: [, input.resourceShareArn],
123
+ clientToken: [, input.clientToken],
124
+ });
122
125
  return [2, new __HttpRequest({
123
126
  protocol: protocol,
124
127
  hostname: hostname,
@@ -523,7 +526,9 @@ export var serializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand =
523
526
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
524
527
  headers = {};
525
528
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/promoteresourcesharecreatedfrompolicy";
526
- query = __assign({}, (input.resourceShareArn !== undefined && { resourceShareArn: input.resourceShareArn }));
529
+ query = map({
530
+ resourceShareArn: [, input.resourceShareArn],
531
+ });
527
532
  return [2, new __HttpRequest({
528
533
  protocol: protocol,
529
534
  hostname: hostname,
@@ -641,28 +646,26 @@ export var deserializeAws_restJson1AcceptResourceShareInvitationCommand = functi
641
646
  if (output.statusCode !== 200 && output.statusCode >= 300) {
642
647
  return [2, deserializeAws_restJson1AcceptResourceShareInvitationCommandError(output, context)];
643
648
  }
644
- contents = {
649
+ contents = map({
645
650
  $metadata: deserializeMetadata(output),
646
- clientToken: undefined,
647
- resourceShareInvitation: undefined,
648
- };
651
+ });
649
652
  _a = __expectNonNull;
650
653
  _b = __expectObject;
651
654
  return [4, parseBody(output.body, context)];
652
655
  case 1:
653
656
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
654
- if (data.clientToken !== undefined && data.clientToken !== null) {
657
+ if (data.clientToken != null) {
655
658
  contents.clientToken = __expectString(data.clientToken);
656
659
  }
657
- if (data.resourceShareInvitation !== undefined && data.resourceShareInvitation !== null) {
660
+ if (data.resourceShareInvitation != null) {
658
661
  contents.resourceShareInvitation = deserializeAws_restJson1ResourceShareInvitation(data.resourceShareInvitation, context);
659
662
  }
660
- return [2, Promise.resolve(contents)];
663
+ return [2, contents];
661
664
  }
662
665
  });
663
666
  }); };
664
667
  var deserializeAws_restJson1AcceptResourceShareInvitationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
665
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
668
+ var parsedOutput, _a, errorCode, _b, parsedBody;
666
669
  var _c;
667
670
  return __generator(this, function (_d) {
668
671
  switch (_d.label) {
@@ -719,14 +722,14 @@ var deserializeAws_restJson1AcceptResourceShareInvitationCommandError = function
719
722
  case 21: throw _d.sent();
720
723
  case 22:
721
724
  parsedBody = parsedOutput.body;
722
- $metadata = deserializeMetadata(output);
723
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
724
- response = new __BaseException({
725
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
726
- $fault: "client",
727
- $metadata: $metadata,
725
+ throwDefaultError({
726
+ output: output,
727
+ parsedBody: parsedBody,
728
+ exceptionCtor: __BaseException,
729
+ errorCode: errorCode,
728
730
  });
729
- throw __decorateServiceException(response, parsedBody);
731
+ _d.label = 23;
732
+ case 23: return [2];
730
733
  }
731
734
  });
732
735
  }); };
@@ -738,28 +741,26 @@ export var deserializeAws_restJson1AssociateResourceShareCommand = function (out
738
741
  if (output.statusCode !== 200 && output.statusCode >= 300) {
739
742
  return [2, deserializeAws_restJson1AssociateResourceShareCommandError(output, context)];
740
743
  }
741
- contents = {
744
+ contents = map({
742
745
  $metadata: deserializeMetadata(output),
743
- clientToken: undefined,
744
- resourceShareAssociations: undefined,
745
- };
746
+ });
746
747
  _a = __expectNonNull;
747
748
  _b = __expectObject;
748
749
  return [4, parseBody(output.body, context)];
749
750
  case 1:
750
751
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
751
- if (data.clientToken !== undefined && data.clientToken !== null) {
752
+ if (data.clientToken != null) {
752
753
  contents.clientToken = __expectString(data.clientToken);
753
754
  }
754
- if (data.resourceShareAssociations !== undefined && data.resourceShareAssociations !== null) {
755
+ if (data.resourceShareAssociations != null) {
755
756
  contents.resourceShareAssociations = deserializeAws_restJson1ResourceShareAssociationList(data.resourceShareAssociations, context);
756
757
  }
757
- return [2, Promise.resolve(contents)];
758
+ return [2, contents];
758
759
  }
759
760
  });
760
761
  }); };
761
762
  var deserializeAws_restJson1AssociateResourceShareCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
762
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
763
+ var parsedOutput, _a, errorCode, _b, parsedBody;
763
764
  var _c;
764
765
  return __generator(this, function (_d) {
765
766
  switch (_d.label) {
@@ -820,14 +821,14 @@ var deserializeAws_restJson1AssociateResourceShareCommandError = function (outpu
820
821
  case 23: throw _d.sent();
821
822
  case 24:
822
823
  parsedBody = parsedOutput.body;
823
- $metadata = deserializeMetadata(output);
824
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
825
- response = new __BaseException({
826
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
827
- $fault: "client",
828
- $metadata: $metadata,
824
+ throwDefaultError({
825
+ output: output,
826
+ parsedBody: parsedBody,
827
+ exceptionCtor: __BaseException,
828
+ errorCode: errorCode,
829
829
  });
830
- throw __decorateServiceException(response, parsedBody);
830
+ _d.label = 25;
831
+ case 25: return [2];
831
832
  }
832
833
  });
833
834
  }); };
@@ -839,28 +840,26 @@ export var deserializeAws_restJson1AssociateResourceSharePermissionCommand = fun
839
840
  if (output.statusCode !== 200 && output.statusCode >= 300) {
840
841
  return [2, deserializeAws_restJson1AssociateResourceSharePermissionCommandError(output, context)];
841
842
  }
842
- contents = {
843
+ contents = map({
843
844
  $metadata: deserializeMetadata(output),
844
- clientToken: undefined,
845
- returnValue: undefined,
846
- };
845
+ });
847
846
  _a = __expectNonNull;
848
847
  _b = __expectObject;
849
848
  return [4, parseBody(output.body, context)];
850
849
  case 1:
851
850
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
852
- if (data.clientToken !== undefined && data.clientToken !== null) {
851
+ if (data.clientToken != null) {
853
852
  contents.clientToken = __expectString(data.clientToken);
854
853
  }
855
- if (data.returnValue !== undefined && data.returnValue !== null) {
854
+ if (data.returnValue != null) {
856
855
  contents.returnValue = __expectBoolean(data.returnValue);
857
856
  }
858
- return [2, Promise.resolve(contents)];
857
+ return [2, contents];
859
858
  }
860
859
  });
861
860
  }); };
862
861
  var deserializeAws_restJson1AssociateResourceSharePermissionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
863
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
862
+ var parsedOutput, _a, errorCode, _b, parsedBody;
864
863
  var _c;
865
864
  return __generator(this, function (_d) {
866
865
  switch (_d.label) {
@@ -905,14 +904,14 @@ var deserializeAws_restJson1AssociateResourceSharePermissionCommandError = funct
905
904
  case 15: throw _d.sent();
906
905
  case 16:
907
906
  parsedBody = parsedOutput.body;
908
- $metadata = deserializeMetadata(output);
909
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
910
- response = new __BaseException({
911
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
912
- $fault: "client",
913
- $metadata: $metadata,
907
+ throwDefaultError({
908
+ output: output,
909
+ parsedBody: parsedBody,
910
+ exceptionCtor: __BaseException,
911
+ errorCode: errorCode,
914
912
  });
915
- throw __decorateServiceException(response, parsedBody);
913
+ _d.label = 17;
914
+ case 17: return [2];
916
915
  }
917
916
  });
918
917
  }); };
@@ -924,28 +923,26 @@ export var deserializeAws_restJson1CreateResourceShareCommand = function (output
924
923
  if (output.statusCode !== 200 && output.statusCode >= 300) {
925
924
  return [2, deserializeAws_restJson1CreateResourceShareCommandError(output, context)];
926
925
  }
927
- contents = {
926
+ contents = map({
928
927
  $metadata: deserializeMetadata(output),
929
- clientToken: undefined,
930
- resourceShare: undefined,
931
- };
928
+ });
932
929
  _a = __expectNonNull;
933
930
  _b = __expectObject;
934
931
  return [4, parseBody(output.body, context)];
935
932
  case 1:
936
933
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
937
- if (data.clientToken !== undefined && data.clientToken !== null) {
934
+ if (data.clientToken != null) {
938
935
  contents.clientToken = __expectString(data.clientToken);
939
936
  }
940
- if (data.resourceShare !== undefined && data.resourceShare !== null) {
937
+ if (data.resourceShare != null) {
941
938
  contents.resourceShare = deserializeAws_restJson1ResourceShare(data.resourceShare, context);
942
939
  }
943
- return [2, Promise.resolve(contents)];
940
+ return [2, contents];
944
941
  }
945
942
  });
946
943
  }); };
947
944
  var deserializeAws_restJson1CreateResourceShareCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
948
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
945
+ var parsedOutput, _a, errorCode, _b, parsedBody;
949
946
  var _c;
950
947
  return __generator(this, function (_d) {
951
948
  switch (_d.label) {
@@ -1006,14 +1003,14 @@ var deserializeAws_restJson1CreateResourceShareCommandError = function (output,
1006
1003
  case 23: throw _d.sent();
1007
1004
  case 24:
1008
1005
  parsedBody = parsedOutput.body;
1009
- $metadata = deserializeMetadata(output);
1010
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1011
- response = new __BaseException({
1012
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1013
- $fault: "client",
1014
- $metadata: $metadata,
1006
+ throwDefaultError({
1007
+ output: output,
1008
+ parsedBody: parsedBody,
1009
+ exceptionCtor: __BaseException,
1010
+ errorCode: errorCode,
1015
1011
  });
1016
- throw __decorateServiceException(response, parsedBody);
1012
+ _d.label = 25;
1013
+ case 25: return [2];
1017
1014
  }
1018
1015
  });
1019
1016
  }); };
@@ -1025,28 +1022,26 @@ export var deserializeAws_restJson1DeleteResourceShareCommand = function (output
1025
1022
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1026
1023
  return [2, deserializeAws_restJson1DeleteResourceShareCommandError(output, context)];
1027
1024
  }
1028
- contents = {
1025
+ contents = map({
1029
1026
  $metadata: deserializeMetadata(output),
1030
- clientToken: undefined,
1031
- returnValue: undefined,
1032
- };
1027
+ });
1033
1028
  _a = __expectNonNull;
1034
1029
  _b = __expectObject;
1035
1030
  return [4, parseBody(output.body, context)];
1036
1031
  case 1:
1037
1032
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1038
- if (data.clientToken !== undefined && data.clientToken !== null) {
1033
+ if (data.clientToken != null) {
1039
1034
  contents.clientToken = __expectString(data.clientToken);
1040
1035
  }
1041
- if (data.returnValue !== undefined && data.returnValue !== null) {
1036
+ if (data.returnValue != null) {
1042
1037
  contents.returnValue = __expectBoolean(data.returnValue);
1043
1038
  }
1044
- return [2, Promise.resolve(contents)];
1039
+ return [2, contents];
1045
1040
  }
1046
1041
  });
1047
1042
  }); };
1048
1043
  var deserializeAws_restJson1DeleteResourceShareCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1049
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1044
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1050
1045
  var _c;
1051
1046
  return __generator(this, function (_d) {
1052
1047
  switch (_d.label) {
@@ -1099,14 +1094,14 @@ var deserializeAws_restJson1DeleteResourceShareCommandError = function (output,
1099
1094
  case 19: throw _d.sent();
1100
1095
  case 20:
1101
1096
  parsedBody = parsedOutput.body;
1102
- $metadata = deserializeMetadata(output);
1103
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1104
- response = new __BaseException({
1105
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1106
- $fault: "client",
1107
- $metadata: $metadata,
1097
+ throwDefaultError({
1098
+ output: output,
1099
+ parsedBody: parsedBody,
1100
+ exceptionCtor: __BaseException,
1101
+ errorCode: errorCode,
1108
1102
  });
1109
- throw __decorateServiceException(response, parsedBody);
1103
+ _d.label = 21;
1104
+ case 21: return [2];
1110
1105
  }
1111
1106
  });
1112
1107
  }); };
@@ -1118,28 +1113,26 @@ export var deserializeAws_restJson1DisassociateResourceShareCommand = function (
1118
1113
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1119
1114
  return [2, deserializeAws_restJson1DisassociateResourceShareCommandError(output, context)];
1120
1115
  }
1121
- contents = {
1116
+ contents = map({
1122
1117
  $metadata: deserializeMetadata(output),
1123
- clientToken: undefined,
1124
- resourceShareAssociations: undefined,
1125
- };
1118
+ });
1126
1119
  _a = __expectNonNull;
1127
1120
  _b = __expectObject;
1128
1121
  return [4, parseBody(output.body, context)];
1129
1122
  case 1:
1130
1123
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1131
- if (data.clientToken !== undefined && data.clientToken !== null) {
1124
+ if (data.clientToken != null) {
1132
1125
  contents.clientToken = __expectString(data.clientToken);
1133
1126
  }
1134
- if (data.resourceShareAssociations !== undefined && data.resourceShareAssociations !== null) {
1127
+ if (data.resourceShareAssociations != null) {
1135
1128
  contents.resourceShareAssociations = deserializeAws_restJson1ResourceShareAssociationList(data.resourceShareAssociations, context);
1136
1129
  }
1137
- return [2, Promise.resolve(contents)];
1130
+ return [2, contents];
1138
1131
  }
1139
1132
  });
1140
1133
  }); };
1141
1134
  var deserializeAws_restJson1DisassociateResourceShareCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1142
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1135
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1143
1136
  var _c;
1144
1137
  return __generator(this, function (_d) {
1145
1138
  switch (_d.label) {
@@ -1196,14 +1189,14 @@ var deserializeAws_restJson1DisassociateResourceShareCommandError = function (ou
1196
1189
  case 21: throw _d.sent();
1197
1190
  case 22:
1198
1191
  parsedBody = parsedOutput.body;
1199
- $metadata = deserializeMetadata(output);
1200
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1201
- response = new __BaseException({
1202
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1203
- $fault: "client",
1204
- $metadata: $metadata,
1192
+ throwDefaultError({
1193
+ output: output,
1194
+ parsedBody: parsedBody,
1195
+ exceptionCtor: __BaseException,
1196
+ errorCode: errorCode,
1205
1197
  });
1206
- throw __decorateServiceException(response, parsedBody);
1198
+ _d.label = 23;
1199
+ case 23: return [2];
1207
1200
  }
1208
1201
  });
1209
1202
  }); };
@@ -1215,28 +1208,26 @@ export var deserializeAws_restJson1DisassociateResourceSharePermissionCommand =
1215
1208
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1216
1209
  return [2, deserializeAws_restJson1DisassociateResourceSharePermissionCommandError(output, context)];
1217
1210
  }
1218
- contents = {
1211
+ contents = map({
1219
1212
  $metadata: deserializeMetadata(output),
1220
- clientToken: undefined,
1221
- returnValue: undefined,
1222
- };
1213
+ });
1223
1214
  _a = __expectNonNull;
1224
1215
  _b = __expectObject;
1225
1216
  return [4, parseBody(output.body, context)];
1226
1217
  case 1:
1227
1218
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1228
- if (data.clientToken !== undefined && data.clientToken !== null) {
1219
+ if (data.clientToken != null) {
1229
1220
  contents.clientToken = __expectString(data.clientToken);
1230
1221
  }
1231
- if (data.returnValue !== undefined && data.returnValue !== null) {
1222
+ if (data.returnValue != null) {
1232
1223
  contents.returnValue = __expectBoolean(data.returnValue);
1233
1224
  }
1234
- return [2, Promise.resolve(contents)];
1225
+ return [2, contents];
1235
1226
  }
1236
1227
  });
1237
1228
  }); };
1238
1229
  var deserializeAws_restJson1DisassociateResourceSharePermissionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1239
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1230
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1240
1231
  var _c;
1241
1232
  return __generator(this, function (_d) {
1242
1233
  switch (_d.label) {
@@ -1285,14 +1276,14 @@ var deserializeAws_restJson1DisassociateResourceSharePermissionCommandError = fu
1285
1276
  case 17: throw _d.sent();
1286
1277
  case 18:
1287
1278
  parsedBody = parsedOutput.body;
1288
- $metadata = deserializeMetadata(output);
1289
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1290
- response = new __BaseException({
1291
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1292
- $fault: "client",
1293
- $metadata: $metadata,
1279
+ throwDefaultError({
1280
+ output: output,
1281
+ parsedBody: parsedBody,
1282
+ exceptionCtor: __BaseException,
1283
+ errorCode: errorCode,
1294
1284
  });
1295
- throw __decorateServiceException(response, parsedBody);
1285
+ _d.label = 19;
1286
+ case 19: return [2];
1296
1287
  }
1297
1288
  });
1298
1289
  }); };
@@ -1304,24 +1295,23 @@ export var deserializeAws_restJson1EnableSharingWithAwsOrganizationCommand = fun
1304
1295
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1305
1296
  return [2, deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError(output, context)];
1306
1297
  }
1307
- contents = {
1298
+ contents = map({
1308
1299
  $metadata: deserializeMetadata(output),
1309
- returnValue: undefined,
1310
- };
1300
+ });
1311
1301
  _a = __expectNonNull;
1312
1302
  _b = __expectObject;
1313
1303
  return [4, parseBody(output.body, context)];
1314
1304
  case 1:
1315
1305
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1316
- if (data.returnValue !== undefined && data.returnValue !== null) {
1306
+ if (data.returnValue != null) {
1317
1307
  contents.returnValue = __expectBoolean(data.returnValue);
1318
1308
  }
1319
- return [2, Promise.resolve(contents)];
1309
+ return [2, contents];
1320
1310
  }
1321
1311
  });
1322
1312
  }); };
1323
1313
  var deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1324
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1314
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1325
1315
  var _c;
1326
1316
  return __generator(this, function (_d) {
1327
1317
  switch (_d.label) {
@@ -1350,14 +1340,14 @@ var deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError = funct
1350
1340
  case 7: throw _d.sent();
1351
1341
  case 8:
1352
1342
  parsedBody = parsedOutput.body;
1353
- $metadata = deserializeMetadata(output);
1354
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1355
- response = new __BaseException({
1356
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1357
- $fault: "client",
1358
- $metadata: $metadata,
1343
+ throwDefaultError({
1344
+ output: output,
1345
+ parsedBody: parsedBody,
1346
+ exceptionCtor: __BaseException,
1347
+ errorCode: errorCode,
1359
1348
  });
1360
- throw __decorateServiceException(response, parsedBody);
1349
+ _d.label = 9;
1350
+ case 9: return [2];
1361
1351
  }
1362
1352
  });
1363
1353
  }); };
@@ -1369,24 +1359,23 @@ export var deserializeAws_restJson1GetPermissionCommand = function (output, cont
1369
1359
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1370
1360
  return [2, deserializeAws_restJson1GetPermissionCommandError(output, context)];
1371
1361
  }
1372
- contents = {
1362
+ contents = map({
1373
1363
  $metadata: deserializeMetadata(output),
1374
- permission: undefined,
1375
- };
1364
+ });
1376
1365
  _a = __expectNonNull;
1377
1366
  _b = __expectObject;
1378
1367
  return [4, parseBody(output.body, context)];
1379
1368
  case 1:
1380
1369
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1381
- if (data.permission !== undefined && data.permission !== null) {
1370
+ if (data.permission != null) {
1382
1371
  contents.permission = deserializeAws_restJson1ResourceSharePermissionDetail(data.permission, context);
1383
1372
  }
1384
- return [2, Promise.resolve(contents)];
1373
+ return [2, contents];
1385
1374
  }
1386
1375
  });
1387
1376
  }); };
1388
1377
  var deserializeAws_restJson1GetPermissionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1389
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1378
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1390
1379
  var _c;
1391
1380
  return __generator(this, function (_d) {
1392
1381
  switch (_d.label) {
@@ -1427,14 +1416,14 @@ var deserializeAws_restJson1GetPermissionCommandError = function (output, contex
1427
1416
  case 13: throw _d.sent();
1428
1417
  case 14:
1429
1418
  parsedBody = parsedOutput.body;
1430
- $metadata = deserializeMetadata(output);
1431
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1432
- response = new __BaseException({
1433
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1434
- $fault: "client",
1435
- $metadata: $metadata,
1419
+ throwDefaultError({
1420
+ output: output,
1421
+ parsedBody: parsedBody,
1422
+ exceptionCtor: __BaseException,
1423
+ errorCode: errorCode,
1436
1424
  });
1437
- throw __decorateServiceException(response, parsedBody);
1425
+ _d.label = 15;
1426
+ case 15: return [2];
1438
1427
  }
1439
1428
  });
1440
1429
  }); };
@@ -1446,28 +1435,26 @@ export var deserializeAws_restJson1GetResourcePoliciesCommand = function (output
1446
1435
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1447
1436
  return [2, deserializeAws_restJson1GetResourcePoliciesCommandError(output, context)];
1448
1437
  }
1449
- contents = {
1438
+ contents = map({
1450
1439
  $metadata: deserializeMetadata(output),
1451
- nextToken: undefined,
1452
- policies: undefined,
1453
- };
1440
+ });
1454
1441
  _a = __expectNonNull;
1455
1442
  _b = __expectObject;
1456
1443
  return [4, parseBody(output.body, context)];
1457
1444
  case 1:
1458
1445
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1459
- if (data.nextToken !== undefined && data.nextToken !== null) {
1446
+ if (data.nextToken != null) {
1460
1447
  contents.nextToken = __expectString(data.nextToken);
1461
1448
  }
1462
- if (data.policies !== undefined && data.policies !== null) {
1449
+ if (data.policies != null) {
1463
1450
  contents.policies = deserializeAws_restJson1PolicyList(data.policies, context);
1464
1451
  }
1465
- return [2, Promise.resolve(contents)];
1452
+ return [2, contents];
1466
1453
  }
1467
1454
  });
1468
1455
  }); };
1469
1456
  var deserializeAws_restJson1GetResourcePoliciesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1470
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1457
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1471
1458
  var _c;
1472
1459
  return __generator(this, function (_d) {
1473
1460
  switch (_d.label) {
@@ -1508,14 +1495,14 @@ var deserializeAws_restJson1GetResourcePoliciesCommandError = function (output,
1508
1495
  case 13: throw _d.sent();
1509
1496
  case 14:
1510
1497
  parsedBody = parsedOutput.body;
1511
- $metadata = deserializeMetadata(output);
1512
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1513
- response = new __BaseException({
1514
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1515
- $fault: "client",
1516
- $metadata: $metadata,
1498
+ throwDefaultError({
1499
+ output: output,
1500
+ parsedBody: parsedBody,
1501
+ exceptionCtor: __BaseException,
1502
+ errorCode: errorCode,
1517
1503
  });
1518
- throw __decorateServiceException(response, parsedBody);
1504
+ _d.label = 15;
1505
+ case 15: return [2];
1519
1506
  }
1520
1507
  });
1521
1508
  }); };
@@ -1527,28 +1514,26 @@ export var deserializeAws_restJson1GetResourceShareAssociationsCommand = functio
1527
1514
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1528
1515
  return [2, deserializeAws_restJson1GetResourceShareAssociationsCommandError(output, context)];
1529
1516
  }
1530
- contents = {
1517
+ contents = map({
1531
1518
  $metadata: deserializeMetadata(output),
1532
- nextToken: undefined,
1533
- resourceShareAssociations: undefined,
1534
- };
1519
+ });
1535
1520
  _a = __expectNonNull;
1536
1521
  _b = __expectObject;
1537
1522
  return [4, parseBody(output.body, context)];
1538
1523
  case 1:
1539
1524
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1540
- if (data.nextToken !== undefined && data.nextToken !== null) {
1525
+ if (data.nextToken != null) {
1541
1526
  contents.nextToken = __expectString(data.nextToken);
1542
1527
  }
1543
- if (data.resourceShareAssociations !== undefined && data.resourceShareAssociations !== null) {
1528
+ if (data.resourceShareAssociations != null) {
1544
1529
  contents.resourceShareAssociations = deserializeAws_restJson1ResourceShareAssociationList(data.resourceShareAssociations, context);
1545
1530
  }
1546
- return [2, Promise.resolve(contents)];
1531
+ return [2, contents];
1547
1532
  }
1548
1533
  });
1549
1534
  }); };
1550
1535
  var deserializeAws_restJson1GetResourceShareAssociationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1551
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1536
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1552
1537
  var _c;
1553
1538
  return __generator(this, function (_d) {
1554
1539
  switch (_d.label) {
@@ -1593,14 +1578,14 @@ var deserializeAws_restJson1GetResourceShareAssociationsCommandError = function
1593
1578
  case 15: throw _d.sent();
1594
1579
  case 16:
1595
1580
  parsedBody = parsedOutput.body;
1596
- $metadata = deserializeMetadata(output);
1597
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1598
- response = new __BaseException({
1599
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1600
- $fault: "client",
1601
- $metadata: $metadata,
1581
+ throwDefaultError({
1582
+ output: output,
1583
+ parsedBody: parsedBody,
1584
+ exceptionCtor: __BaseException,
1585
+ errorCode: errorCode,
1602
1586
  });
1603
- throw __decorateServiceException(response, parsedBody);
1587
+ _d.label = 17;
1588
+ case 17: return [2];
1604
1589
  }
1605
1590
  });
1606
1591
  }); };
@@ -1612,28 +1597,26 @@ export var deserializeAws_restJson1GetResourceShareInvitationsCommand = function
1612
1597
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1613
1598
  return [2, deserializeAws_restJson1GetResourceShareInvitationsCommandError(output, context)];
1614
1599
  }
1615
- contents = {
1600
+ contents = map({
1616
1601
  $metadata: deserializeMetadata(output),
1617
- nextToken: undefined,
1618
- resourceShareInvitations: undefined,
1619
- };
1602
+ });
1620
1603
  _a = __expectNonNull;
1621
1604
  _b = __expectObject;
1622
1605
  return [4, parseBody(output.body, context)];
1623
1606
  case 1:
1624
1607
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1625
- if (data.nextToken !== undefined && data.nextToken !== null) {
1608
+ if (data.nextToken != null) {
1626
1609
  contents.nextToken = __expectString(data.nextToken);
1627
1610
  }
1628
- if (data.resourceShareInvitations !== undefined && data.resourceShareInvitations !== null) {
1611
+ if (data.resourceShareInvitations != null) {
1629
1612
  contents.resourceShareInvitations = deserializeAws_restJson1ResourceShareInvitationList(data.resourceShareInvitations, context);
1630
1613
  }
1631
- return [2, Promise.resolve(contents)];
1614
+ return [2, contents];
1632
1615
  }
1633
1616
  });
1634
1617
  }); };
1635
1618
  var deserializeAws_restJson1GetResourceShareInvitationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1636
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1619
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1637
1620
  var _c;
1638
1621
  return __generator(this, function (_d) {
1639
1622
  switch (_d.label) {
@@ -1682,14 +1665,14 @@ var deserializeAws_restJson1GetResourceShareInvitationsCommandError = function (
1682
1665
  case 17: throw _d.sent();
1683
1666
  case 18:
1684
1667
  parsedBody = parsedOutput.body;
1685
- $metadata = deserializeMetadata(output);
1686
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1687
- response = new __BaseException({
1688
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1689
- $fault: "client",
1690
- $metadata: $metadata,
1668
+ throwDefaultError({
1669
+ output: output,
1670
+ parsedBody: parsedBody,
1671
+ exceptionCtor: __BaseException,
1672
+ errorCode: errorCode,
1691
1673
  });
1692
- throw __decorateServiceException(response, parsedBody);
1674
+ _d.label = 19;
1675
+ case 19: return [2];
1693
1676
  }
1694
1677
  });
1695
1678
  }); };
@@ -1701,28 +1684,26 @@ export var deserializeAws_restJson1GetResourceSharesCommand = function (output,
1701
1684
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1702
1685
  return [2, deserializeAws_restJson1GetResourceSharesCommandError(output, context)];
1703
1686
  }
1704
- contents = {
1687
+ contents = map({
1705
1688
  $metadata: deserializeMetadata(output),
1706
- nextToken: undefined,
1707
- resourceShares: undefined,
1708
- };
1689
+ });
1709
1690
  _a = __expectNonNull;
1710
1691
  _b = __expectObject;
1711
1692
  return [4, parseBody(output.body, context)];
1712
1693
  case 1:
1713
1694
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1714
- if (data.nextToken !== undefined && data.nextToken !== null) {
1695
+ if (data.nextToken != null) {
1715
1696
  contents.nextToken = __expectString(data.nextToken);
1716
1697
  }
1717
- if (data.resourceShares !== undefined && data.resourceShares !== null) {
1698
+ if (data.resourceShares != null) {
1718
1699
  contents.resourceShares = deserializeAws_restJson1ResourceShareList(data.resourceShares, context);
1719
1700
  }
1720
- return [2, Promise.resolve(contents)];
1701
+ return [2, contents];
1721
1702
  }
1722
1703
  });
1723
1704
  }); };
1724
1705
  var deserializeAws_restJson1GetResourceSharesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1725
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1706
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1726
1707
  var _c;
1727
1708
  return __generator(this, function (_d) {
1728
1709
  switch (_d.label) {
@@ -1763,14 +1744,14 @@ var deserializeAws_restJson1GetResourceSharesCommandError = function (output, co
1763
1744
  case 13: throw _d.sent();
1764
1745
  case 14:
1765
1746
  parsedBody = parsedOutput.body;
1766
- $metadata = deserializeMetadata(output);
1767
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1768
- response = new __BaseException({
1769
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1770
- $fault: "client",
1771
- $metadata: $metadata,
1747
+ throwDefaultError({
1748
+ output: output,
1749
+ parsedBody: parsedBody,
1750
+ exceptionCtor: __BaseException,
1751
+ errorCode: errorCode,
1772
1752
  });
1773
- throw __decorateServiceException(response, parsedBody);
1753
+ _d.label = 15;
1754
+ case 15: return [2];
1774
1755
  }
1775
1756
  });
1776
1757
  }); };
@@ -1782,28 +1763,26 @@ export var deserializeAws_restJson1ListPendingInvitationResourcesCommand = funct
1782
1763
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1783
1764
  return [2, deserializeAws_restJson1ListPendingInvitationResourcesCommandError(output, context)];
1784
1765
  }
1785
- contents = {
1766
+ contents = map({
1786
1767
  $metadata: deserializeMetadata(output),
1787
- nextToken: undefined,
1788
- resources: undefined,
1789
- };
1768
+ });
1790
1769
  _a = __expectNonNull;
1791
1770
  _b = __expectObject;
1792
1771
  return [4, parseBody(output.body, context)];
1793
1772
  case 1:
1794
1773
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1795
- if (data.nextToken !== undefined && data.nextToken !== null) {
1774
+ if (data.nextToken != null) {
1796
1775
  contents.nextToken = __expectString(data.nextToken);
1797
1776
  }
1798
- if (data.resources !== undefined && data.resources !== null) {
1777
+ if (data.resources != null) {
1799
1778
  contents.resources = deserializeAws_restJson1ResourceList(data.resources, context);
1800
1779
  }
1801
- return [2, Promise.resolve(contents)];
1780
+ return [2, contents];
1802
1781
  }
1803
1782
  });
1804
1783
  }); };
1805
1784
  var deserializeAws_restJson1ListPendingInvitationResourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1806
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1785
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1807
1786
  var _c;
1808
1787
  return __generator(this, function (_d) {
1809
1788
  switch (_d.label) {
@@ -1856,14 +1835,14 @@ var deserializeAws_restJson1ListPendingInvitationResourcesCommandError = functio
1856
1835
  case 19: throw _d.sent();
1857
1836
  case 20:
1858
1837
  parsedBody = parsedOutput.body;
1859
- $metadata = deserializeMetadata(output);
1860
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1861
- response = new __BaseException({
1862
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1863
- $fault: "client",
1864
- $metadata: $metadata,
1838
+ throwDefaultError({
1839
+ output: output,
1840
+ parsedBody: parsedBody,
1841
+ exceptionCtor: __BaseException,
1842
+ errorCode: errorCode,
1865
1843
  });
1866
- throw __decorateServiceException(response, parsedBody);
1844
+ _d.label = 21;
1845
+ case 21: return [2];
1867
1846
  }
1868
1847
  });
1869
1848
  }); };
@@ -1875,28 +1854,26 @@ export var deserializeAws_restJson1ListPermissionsCommand = function (output, co
1875
1854
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1876
1855
  return [2, deserializeAws_restJson1ListPermissionsCommandError(output, context)];
1877
1856
  }
1878
- contents = {
1857
+ contents = map({
1879
1858
  $metadata: deserializeMetadata(output),
1880
- nextToken: undefined,
1881
- permissions: undefined,
1882
- };
1859
+ });
1883
1860
  _a = __expectNonNull;
1884
1861
  _b = __expectObject;
1885
1862
  return [4, parseBody(output.body, context)];
1886
1863
  case 1:
1887
1864
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1888
- if (data.nextToken !== undefined && data.nextToken !== null) {
1865
+ if (data.nextToken != null) {
1889
1866
  contents.nextToken = __expectString(data.nextToken);
1890
1867
  }
1891
- if (data.permissions !== undefined && data.permissions !== null) {
1868
+ if (data.permissions != null) {
1892
1869
  contents.permissions = deserializeAws_restJson1ResourceSharePermissionList(data.permissions, context);
1893
1870
  }
1894
- return [2, Promise.resolve(contents)];
1871
+ return [2, contents];
1895
1872
  }
1896
1873
  });
1897
1874
  }); };
1898
1875
  var deserializeAws_restJson1ListPermissionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1899
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1876
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1900
1877
  var _c;
1901
1878
  return __generator(this, function (_d) {
1902
1879
  switch (_d.label) {
@@ -1933,14 +1910,14 @@ var deserializeAws_restJson1ListPermissionsCommandError = function (output, cont
1933
1910
  case 11: throw _d.sent();
1934
1911
  case 12:
1935
1912
  parsedBody = parsedOutput.body;
1936
- $metadata = deserializeMetadata(output);
1937
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1938
- response = new __BaseException({
1939
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1940
- $fault: "client",
1941
- $metadata: $metadata,
1913
+ throwDefaultError({
1914
+ output: output,
1915
+ parsedBody: parsedBody,
1916
+ exceptionCtor: __BaseException,
1917
+ errorCode: errorCode,
1942
1918
  });
1943
- throw __decorateServiceException(response, parsedBody);
1919
+ _d.label = 13;
1920
+ case 13: return [2];
1944
1921
  }
1945
1922
  });
1946
1923
  }); };
@@ -1952,28 +1929,26 @@ export var deserializeAws_restJson1ListPermissionVersionsCommand = function (out
1952
1929
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1953
1930
  return [2, deserializeAws_restJson1ListPermissionVersionsCommandError(output, context)];
1954
1931
  }
1955
- contents = {
1932
+ contents = map({
1956
1933
  $metadata: deserializeMetadata(output),
1957
- nextToken: undefined,
1958
- permissions: undefined,
1959
- };
1934
+ });
1960
1935
  _a = __expectNonNull;
1961
1936
  _b = __expectObject;
1962
1937
  return [4, parseBody(output.body, context)];
1963
1938
  case 1:
1964
1939
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1965
- if (data.nextToken !== undefined && data.nextToken !== null) {
1940
+ if (data.nextToken != null) {
1966
1941
  contents.nextToken = __expectString(data.nextToken);
1967
1942
  }
1968
- if (data.permissions !== undefined && data.permissions !== null) {
1943
+ if (data.permissions != null) {
1969
1944
  contents.permissions = deserializeAws_restJson1ResourceSharePermissionList(data.permissions, context);
1970
1945
  }
1971
- return [2, Promise.resolve(contents)];
1946
+ return [2, contents];
1972
1947
  }
1973
1948
  });
1974
1949
  }); };
1975
1950
  var deserializeAws_restJson1ListPermissionVersionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1976
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1951
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1977
1952
  var _c;
1978
1953
  return __generator(this, function (_d) {
1979
1954
  switch (_d.label) {
@@ -2018,14 +1993,14 @@ var deserializeAws_restJson1ListPermissionVersionsCommandError = function (outpu
2018
1993
  case 15: throw _d.sent();
2019
1994
  case 16:
2020
1995
  parsedBody = parsedOutput.body;
2021
- $metadata = deserializeMetadata(output);
2022
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2023
- response = new __BaseException({
2024
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2025
- $fault: "client",
2026
- $metadata: $metadata,
1996
+ throwDefaultError({
1997
+ output: output,
1998
+ parsedBody: parsedBody,
1999
+ exceptionCtor: __BaseException,
2000
+ errorCode: errorCode,
2027
2001
  });
2028
- throw __decorateServiceException(response, parsedBody);
2002
+ _d.label = 17;
2003
+ case 17: return [2];
2029
2004
  }
2030
2005
  });
2031
2006
  }); };
@@ -2037,28 +2012,26 @@ export var deserializeAws_restJson1ListPrincipalsCommand = function (output, con
2037
2012
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2038
2013
  return [2, deserializeAws_restJson1ListPrincipalsCommandError(output, context)];
2039
2014
  }
2040
- contents = {
2015
+ contents = map({
2041
2016
  $metadata: deserializeMetadata(output),
2042
- nextToken: undefined,
2043
- principals: undefined,
2044
- };
2017
+ });
2045
2018
  _a = __expectNonNull;
2046
2019
  _b = __expectObject;
2047
2020
  return [4, parseBody(output.body, context)];
2048
2021
  case 1:
2049
2022
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2050
- if (data.nextToken !== undefined && data.nextToken !== null) {
2023
+ if (data.nextToken != null) {
2051
2024
  contents.nextToken = __expectString(data.nextToken);
2052
2025
  }
2053
- if (data.principals !== undefined && data.principals !== null) {
2026
+ if (data.principals != null) {
2054
2027
  contents.principals = deserializeAws_restJson1PrincipalList(data.principals, context);
2055
2028
  }
2056
- return [2, Promise.resolve(contents)];
2029
+ return [2, contents];
2057
2030
  }
2058
2031
  });
2059
2032
  }); };
2060
2033
  var deserializeAws_restJson1ListPrincipalsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2061
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2034
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2062
2035
  var _c;
2063
2036
  return __generator(this, function (_d) {
2064
2037
  switch (_d.label) {
@@ -2099,14 +2072,14 @@ var deserializeAws_restJson1ListPrincipalsCommandError = function (output, conte
2099
2072
  case 13: throw _d.sent();
2100
2073
  case 14:
2101
2074
  parsedBody = parsedOutput.body;
2102
- $metadata = deserializeMetadata(output);
2103
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2104
- response = new __BaseException({
2105
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2106
- $fault: "client",
2107
- $metadata: $metadata,
2075
+ throwDefaultError({
2076
+ output: output,
2077
+ parsedBody: parsedBody,
2078
+ exceptionCtor: __BaseException,
2079
+ errorCode: errorCode,
2108
2080
  });
2109
- throw __decorateServiceException(response, parsedBody);
2081
+ _d.label = 15;
2082
+ case 15: return [2];
2110
2083
  }
2111
2084
  });
2112
2085
  }); };
@@ -2118,28 +2091,26 @@ export var deserializeAws_restJson1ListResourcesCommand = function (output, cont
2118
2091
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2119
2092
  return [2, deserializeAws_restJson1ListResourcesCommandError(output, context)];
2120
2093
  }
2121
- contents = {
2094
+ contents = map({
2122
2095
  $metadata: deserializeMetadata(output),
2123
- nextToken: undefined,
2124
- resources: undefined,
2125
- };
2096
+ });
2126
2097
  _a = __expectNonNull;
2127
2098
  _b = __expectObject;
2128
2099
  return [4, parseBody(output.body, context)];
2129
2100
  case 1:
2130
2101
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2131
- if (data.nextToken !== undefined && data.nextToken !== null) {
2102
+ if (data.nextToken != null) {
2132
2103
  contents.nextToken = __expectString(data.nextToken);
2133
2104
  }
2134
- if (data.resources !== undefined && data.resources !== null) {
2105
+ if (data.resources != null) {
2135
2106
  contents.resources = deserializeAws_restJson1ResourceList(data.resources, context);
2136
2107
  }
2137
- return [2, Promise.resolve(contents)];
2108
+ return [2, contents];
2138
2109
  }
2139
2110
  });
2140
2111
  }); };
2141
2112
  var deserializeAws_restJson1ListResourcesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2142
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2113
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2143
2114
  var _c;
2144
2115
  return __generator(this, function (_d) {
2145
2116
  switch (_d.label) {
@@ -2184,14 +2155,14 @@ var deserializeAws_restJson1ListResourcesCommandError = function (output, contex
2184
2155
  case 15: throw _d.sent();
2185
2156
  case 16:
2186
2157
  parsedBody = parsedOutput.body;
2187
- $metadata = deserializeMetadata(output);
2188
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2189
- response = new __BaseException({
2190
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2191
- $fault: "client",
2192
- $metadata: $metadata,
2158
+ throwDefaultError({
2159
+ output: output,
2160
+ parsedBody: parsedBody,
2161
+ exceptionCtor: __BaseException,
2162
+ errorCode: errorCode,
2193
2163
  });
2194
- throw __decorateServiceException(response, parsedBody);
2164
+ _d.label = 17;
2165
+ case 17: return [2];
2195
2166
  }
2196
2167
  });
2197
2168
  }); };
@@ -2203,28 +2174,26 @@ export var deserializeAws_restJson1ListResourceSharePermissionsCommand = functio
2203
2174
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2204
2175
  return [2, deserializeAws_restJson1ListResourceSharePermissionsCommandError(output, context)];
2205
2176
  }
2206
- contents = {
2177
+ contents = map({
2207
2178
  $metadata: deserializeMetadata(output),
2208
- nextToken: undefined,
2209
- permissions: undefined,
2210
- };
2179
+ });
2211
2180
  _a = __expectNonNull;
2212
2181
  _b = __expectObject;
2213
2182
  return [4, parseBody(output.body, context)];
2214
2183
  case 1:
2215
2184
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2216
- if (data.nextToken !== undefined && data.nextToken !== null) {
2185
+ if (data.nextToken != null) {
2217
2186
  contents.nextToken = __expectString(data.nextToken);
2218
2187
  }
2219
- if (data.permissions !== undefined && data.permissions !== null) {
2188
+ if (data.permissions != null) {
2220
2189
  contents.permissions = deserializeAws_restJson1ResourceSharePermissionList(data.permissions, context);
2221
2190
  }
2222
- return [2, Promise.resolve(contents)];
2191
+ return [2, contents];
2223
2192
  }
2224
2193
  });
2225
2194
  }); };
2226
2195
  var deserializeAws_restJson1ListResourceSharePermissionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2227
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2196
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2228
2197
  var _c;
2229
2198
  return __generator(this, function (_d) {
2230
2199
  switch (_d.label) {
@@ -2269,14 +2238,14 @@ var deserializeAws_restJson1ListResourceSharePermissionsCommandError = function
2269
2238
  case 15: throw _d.sent();
2270
2239
  case 16:
2271
2240
  parsedBody = parsedOutput.body;
2272
- $metadata = deserializeMetadata(output);
2273
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2274
- response = new __BaseException({
2275
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2276
- $fault: "client",
2277
- $metadata: $metadata,
2241
+ throwDefaultError({
2242
+ output: output,
2243
+ parsedBody: parsedBody,
2244
+ exceptionCtor: __BaseException,
2245
+ errorCode: errorCode,
2278
2246
  });
2279
- throw __decorateServiceException(response, parsedBody);
2247
+ _d.label = 17;
2248
+ case 17: return [2];
2280
2249
  }
2281
2250
  });
2282
2251
  }); };
@@ -2288,28 +2257,26 @@ export var deserializeAws_restJson1ListResourceTypesCommand = function (output,
2288
2257
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2289
2258
  return [2, deserializeAws_restJson1ListResourceTypesCommandError(output, context)];
2290
2259
  }
2291
- contents = {
2260
+ contents = map({
2292
2261
  $metadata: deserializeMetadata(output),
2293
- nextToken: undefined,
2294
- resourceTypes: undefined,
2295
- };
2262
+ });
2296
2263
  _a = __expectNonNull;
2297
2264
  _b = __expectObject;
2298
2265
  return [4, parseBody(output.body, context)];
2299
2266
  case 1:
2300
2267
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2301
- if (data.nextToken !== undefined && data.nextToken !== null) {
2268
+ if (data.nextToken != null) {
2302
2269
  contents.nextToken = __expectString(data.nextToken);
2303
2270
  }
2304
- if (data.resourceTypes !== undefined && data.resourceTypes !== null) {
2271
+ if (data.resourceTypes != null) {
2305
2272
  contents.resourceTypes = deserializeAws_restJson1ServiceNameAndResourceTypeList(data.resourceTypes, context);
2306
2273
  }
2307
- return [2, Promise.resolve(contents)];
2274
+ return [2, contents];
2308
2275
  }
2309
2276
  });
2310
2277
  }); };
2311
2278
  var deserializeAws_restJson1ListResourceTypesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2312
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2279
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2313
2280
  var _c;
2314
2281
  return __generator(this, function (_d) {
2315
2282
  switch (_d.label) {
@@ -2342,14 +2309,14 @@ var deserializeAws_restJson1ListResourceTypesCommandError = function (output, co
2342
2309
  case 9: throw _d.sent();
2343
2310
  case 10:
2344
2311
  parsedBody = parsedOutput.body;
2345
- $metadata = deserializeMetadata(output);
2346
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2347
- response = new __BaseException({
2348
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2349
- $fault: "client",
2350
- $metadata: $metadata,
2312
+ throwDefaultError({
2313
+ output: output,
2314
+ parsedBody: parsedBody,
2315
+ exceptionCtor: __BaseException,
2316
+ errorCode: errorCode,
2351
2317
  });
2352
- throw __decorateServiceException(response, parsedBody);
2318
+ _d.label = 11;
2319
+ case 11: return [2];
2353
2320
  }
2354
2321
  });
2355
2322
  }); };
@@ -2361,24 +2328,23 @@ export var deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand
2361
2328
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2362
2329
  return [2, deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError(output, context)];
2363
2330
  }
2364
- contents = {
2331
+ contents = map({
2365
2332
  $metadata: deserializeMetadata(output),
2366
- returnValue: undefined,
2367
- };
2333
+ });
2368
2334
  _a = __expectNonNull;
2369
2335
  _b = __expectObject;
2370
2336
  return [4, parseBody(output.body, context)];
2371
2337
  case 1:
2372
2338
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2373
- if (data.returnValue !== undefined && data.returnValue !== null) {
2339
+ if (data.returnValue != null) {
2374
2340
  contents.returnValue = __expectBoolean(data.returnValue);
2375
2341
  }
2376
- return [2, Promise.resolve(contents)];
2342
+ return [2, contents];
2377
2343
  }
2378
2344
  });
2379
2345
  }); };
2380
2346
  var deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2381
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2347
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2382
2348
  var _c;
2383
2349
  return __generator(this, function (_d) {
2384
2350
  switch (_d.label) {
@@ -2427,14 +2393,14 @@ var deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError =
2427
2393
  case 17: throw _d.sent();
2428
2394
  case 18:
2429
2395
  parsedBody = parsedOutput.body;
2430
- $metadata = deserializeMetadata(output);
2431
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2432
- response = new __BaseException({
2433
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2434
- $fault: "client",
2435
- $metadata: $metadata,
2396
+ throwDefaultError({
2397
+ output: output,
2398
+ parsedBody: parsedBody,
2399
+ exceptionCtor: __BaseException,
2400
+ errorCode: errorCode,
2436
2401
  });
2437
- throw __decorateServiceException(response, parsedBody);
2402
+ _d.label = 19;
2403
+ case 19: return [2];
2438
2404
  }
2439
2405
  });
2440
2406
  }); };
@@ -2446,28 +2412,26 @@ export var deserializeAws_restJson1RejectResourceShareInvitationCommand = functi
2446
2412
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2447
2413
  return [2, deserializeAws_restJson1RejectResourceShareInvitationCommandError(output, context)];
2448
2414
  }
2449
- contents = {
2415
+ contents = map({
2450
2416
  $metadata: deserializeMetadata(output),
2451
- clientToken: undefined,
2452
- resourceShareInvitation: undefined,
2453
- };
2417
+ });
2454
2418
  _a = __expectNonNull;
2455
2419
  _b = __expectObject;
2456
2420
  return [4, parseBody(output.body, context)];
2457
2421
  case 1:
2458
2422
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2459
- if (data.clientToken !== undefined && data.clientToken !== null) {
2423
+ if (data.clientToken != null) {
2460
2424
  contents.clientToken = __expectString(data.clientToken);
2461
2425
  }
2462
- if (data.resourceShareInvitation !== undefined && data.resourceShareInvitation !== null) {
2426
+ if (data.resourceShareInvitation != null) {
2463
2427
  contents.resourceShareInvitation = deserializeAws_restJson1ResourceShareInvitation(data.resourceShareInvitation, context);
2464
2428
  }
2465
- return [2, Promise.resolve(contents)];
2429
+ return [2, contents];
2466
2430
  }
2467
2431
  });
2468
2432
  }); };
2469
2433
  var deserializeAws_restJson1RejectResourceShareInvitationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2470
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2434
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2471
2435
  var _c;
2472
2436
  return __generator(this, function (_d) {
2473
2437
  switch (_d.label) {
@@ -2524,14 +2488,14 @@ var deserializeAws_restJson1RejectResourceShareInvitationCommandError = function
2524
2488
  case 21: throw _d.sent();
2525
2489
  case 22:
2526
2490
  parsedBody = parsedOutput.body;
2527
- $metadata = deserializeMetadata(output);
2528
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2529
- response = new __BaseException({
2530
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2531
- $fault: "client",
2532
- $metadata: $metadata,
2491
+ throwDefaultError({
2492
+ output: output,
2493
+ parsedBody: parsedBody,
2494
+ exceptionCtor: __BaseException,
2495
+ errorCode: errorCode,
2533
2496
  });
2534
- throw __decorateServiceException(response, parsedBody);
2497
+ _d.label = 23;
2498
+ case 23: return [2];
2535
2499
  }
2536
2500
  });
2537
2501
  }); };
@@ -2543,18 +2507,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2543
2507
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2544
2508
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2545
2509
  }
2546
- contents = {
2510
+ contents = map({
2547
2511
  $metadata: deserializeMetadata(output),
2548
- };
2512
+ });
2549
2513
  return [4, collectBody(output.body, context)];
2550
2514
  case 1:
2551
2515
  _a.sent();
2552
- return [2, Promise.resolve(contents)];
2516
+ return [2, contents];
2553
2517
  }
2554
2518
  });
2555
2519
  }); };
2556
2520
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2557
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2521
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2558
2522
  var _c;
2559
2523
  return __generator(this, function (_d) {
2560
2524
  switch (_d.label) {
@@ -2603,14 +2567,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2603
2567
  case 17: throw _d.sent();
2604
2568
  case 18:
2605
2569
  parsedBody = parsedOutput.body;
2606
- $metadata = deserializeMetadata(output);
2607
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2608
- response = new __BaseException({
2609
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2610
- $fault: "client",
2611
- $metadata: $metadata,
2570
+ throwDefaultError({
2571
+ output: output,
2572
+ parsedBody: parsedBody,
2573
+ exceptionCtor: __BaseException,
2574
+ errorCode: errorCode,
2612
2575
  });
2613
- throw __decorateServiceException(response, parsedBody);
2576
+ _d.label = 19;
2577
+ case 19: return [2];
2614
2578
  }
2615
2579
  });
2616
2580
  }); };
@@ -2622,18 +2586,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
2622
2586
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2623
2587
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
2624
2588
  }
2625
- contents = {
2589
+ contents = map({
2626
2590
  $metadata: deserializeMetadata(output),
2627
- };
2591
+ });
2628
2592
  return [4, collectBody(output.body, context)];
2629
2593
  case 1:
2630
2594
  _a.sent();
2631
- return [2, Promise.resolve(contents)];
2595
+ return [2, contents];
2632
2596
  }
2633
2597
  });
2634
2598
  }); };
2635
2599
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2636
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2600
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2637
2601
  var _c;
2638
2602
  return __generator(this, function (_d) {
2639
2603
  switch (_d.label) {
@@ -2662,14 +2626,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
2662
2626
  case 7: throw _d.sent();
2663
2627
  case 8:
2664
2628
  parsedBody = parsedOutput.body;
2665
- $metadata = deserializeMetadata(output);
2666
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2667
- response = new __BaseException({
2668
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2669
- $fault: "client",
2670
- $metadata: $metadata,
2629
+ throwDefaultError({
2630
+ output: output,
2631
+ parsedBody: parsedBody,
2632
+ exceptionCtor: __BaseException,
2633
+ errorCode: errorCode,
2671
2634
  });
2672
- throw __decorateServiceException(response, parsedBody);
2635
+ _d.label = 9;
2636
+ case 9: return [2];
2673
2637
  }
2674
2638
  });
2675
2639
  }); };
@@ -2681,28 +2645,26 @@ export var deserializeAws_restJson1UpdateResourceShareCommand = function (output
2681
2645
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2682
2646
  return [2, deserializeAws_restJson1UpdateResourceShareCommandError(output, context)];
2683
2647
  }
2684
- contents = {
2648
+ contents = map({
2685
2649
  $metadata: deserializeMetadata(output),
2686
- clientToken: undefined,
2687
- resourceShare: undefined,
2688
- };
2650
+ });
2689
2651
  _a = __expectNonNull;
2690
2652
  _b = __expectObject;
2691
2653
  return [4, parseBody(output.body, context)];
2692
2654
  case 1:
2693
2655
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2694
- if (data.clientToken !== undefined && data.clientToken !== null) {
2656
+ if (data.clientToken != null) {
2695
2657
  contents.clientToken = __expectString(data.clientToken);
2696
2658
  }
2697
- if (data.resourceShare !== undefined && data.resourceShare !== null) {
2659
+ if (data.resourceShare != null) {
2698
2660
  contents.resourceShare = deserializeAws_restJson1ResourceShare(data.resourceShare, context);
2699
2661
  }
2700
- return [2, Promise.resolve(contents)];
2662
+ return [2, contents];
2701
2663
  }
2702
2664
  });
2703
2665
  }); };
2704
2666
  var deserializeAws_restJson1UpdateResourceShareCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2705
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2667
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2706
2668
  var _c;
2707
2669
  return __generator(this, function (_d) {
2708
2670
  switch (_d.label) {
@@ -2755,23 +2717,24 @@ var deserializeAws_restJson1UpdateResourceShareCommandError = function (output,
2755
2717
  case 19: throw _d.sent();
2756
2718
  case 20:
2757
2719
  parsedBody = parsedOutput.body;
2758
- $metadata = deserializeMetadata(output);
2759
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2760
- response = new __BaseException({
2761
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2762
- $fault: "client",
2763
- $metadata: $metadata,
2720
+ throwDefaultError({
2721
+ output: output,
2722
+ parsedBody: parsedBody,
2723
+ exceptionCtor: __BaseException,
2724
+ errorCode: errorCode,
2764
2725
  });
2765
- throw __decorateServiceException(response, parsedBody);
2726
+ _d.label = 21;
2727
+ case 21: return [2];
2766
2728
  }
2767
2729
  });
2768
2730
  }); };
2731
+ var map = __map;
2769
2732
  var deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2770
2733
  var contents, data, exception;
2771
2734
  return __generator(this, function (_a) {
2772
- contents = {};
2735
+ contents = map({});
2773
2736
  data = parsedOutput.body;
2774
- if (data.message !== undefined && data.message !== null) {
2737
+ if (data.message != null) {
2775
2738
  contents.message = __expectString(data.message);
2776
2739
  }
2777
2740
  exception = new IdempotentParameterMismatchException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2781,9 +2744,9 @@ var deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse = funct
2781
2744
  var deserializeAws_restJson1InvalidClientTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2782
2745
  var contents, data, exception;
2783
2746
  return __generator(this, function (_a) {
2784
- contents = {};
2747
+ contents = map({});
2785
2748
  data = parsedOutput.body;
2786
- if (data.message !== undefined && data.message !== null) {
2749
+ if (data.message != null) {
2787
2750
  contents.message = __expectString(data.message);
2788
2751
  }
2789
2752
  exception = new InvalidClientTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2793,9 +2756,9 @@ var deserializeAws_restJson1InvalidClientTokenExceptionResponse = function (pars
2793
2756
  var deserializeAws_restJson1InvalidMaxResultsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2794
2757
  var contents, data, exception;
2795
2758
  return __generator(this, function (_a) {
2796
- contents = {};
2759
+ contents = map({});
2797
2760
  data = parsedOutput.body;
2798
- if (data.message !== undefined && data.message !== null) {
2761
+ if (data.message != null) {
2799
2762
  contents.message = __expectString(data.message);
2800
2763
  }
2801
2764
  exception = new InvalidMaxResultsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2805,9 +2768,9 @@ var deserializeAws_restJson1InvalidMaxResultsExceptionResponse = function (parse
2805
2768
  var deserializeAws_restJson1InvalidNextTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2806
2769
  var contents, data, exception;
2807
2770
  return __generator(this, function (_a) {
2808
- contents = {};
2771
+ contents = map({});
2809
2772
  data = parsedOutput.body;
2810
- if (data.message !== undefined && data.message !== null) {
2773
+ if (data.message != null) {
2811
2774
  contents.message = __expectString(data.message);
2812
2775
  }
2813
2776
  exception = new InvalidNextTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2817,9 +2780,9 @@ var deserializeAws_restJson1InvalidNextTokenExceptionResponse = function (parsed
2817
2780
  var deserializeAws_restJson1InvalidParameterExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2818
2781
  var contents, data, exception;
2819
2782
  return __generator(this, function (_a) {
2820
- contents = {};
2783
+ contents = map({});
2821
2784
  data = parsedOutput.body;
2822
- if (data.message !== undefined && data.message !== null) {
2785
+ if (data.message != null) {
2823
2786
  contents.message = __expectString(data.message);
2824
2787
  }
2825
2788
  exception = new InvalidParameterException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2829,9 +2792,9 @@ var deserializeAws_restJson1InvalidParameterExceptionResponse = function (parsed
2829
2792
  var deserializeAws_restJson1InvalidResourceTypeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2830
2793
  var contents, data, exception;
2831
2794
  return __generator(this, function (_a) {
2832
- contents = {};
2795
+ contents = map({});
2833
2796
  data = parsedOutput.body;
2834
- if (data.message !== undefined && data.message !== null) {
2797
+ if (data.message != null) {
2835
2798
  contents.message = __expectString(data.message);
2836
2799
  }
2837
2800
  exception = new InvalidResourceTypeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2841,9 +2804,9 @@ var deserializeAws_restJson1InvalidResourceTypeExceptionResponse = function (par
2841
2804
  var deserializeAws_restJson1InvalidStateTransitionExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2842
2805
  var contents, data, exception;
2843
2806
  return __generator(this, function (_a) {
2844
- contents = {};
2807
+ contents = map({});
2845
2808
  data = parsedOutput.body;
2846
- if (data.message !== undefined && data.message !== null) {
2809
+ if (data.message != null) {
2847
2810
  contents.message = __expectString(data.message);
2848
2811
  }
2849
2812
  exception = new InvalidStateTransitionException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2853,9 +2816,9 @@ var deserializeAws_restJson1InvalidStateTransitionExceptionResponse = function (
2853
2816
  var deserializeAws_restJson1MalformedArnExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2854
2817
  var contents, data, exception;
2855
2818
  return __generator(this, function (_a) {
2856
- contents = {};
2819
+ contents = map({});
2857
2820
  data = parsedOutput.body;
2858
- if (data.message !== undefined && data.message !== null) {
2821
+ if (data.message != null) {
2859
2822
  contents.message = __expectString(data.message);
2860
2823
  }
2861
2824
  exception = new MalformedArnException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2865,9 +2828,9 @@ var deserializeAws_restJson1MalformedArnExceptionResponse = function (parsedOutp
2865
2828
  var deserializeAws_restJson1MissingRequiredParameterExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2866
2829
  var contents, data, exception;
2867
2830
  return __generator(this, function (_a) {
2868
- contents = {};
2831
+ contents = map({});
2869
2832
  data = parsedOutput.body;
2870
- if (data.message !== undefined && data.message !== null) {
2833
+ if (data.message != null) {
2871
2834
  contents.message = __expectString(data.message);
2872
2835
  }
2873
2836
  exception = new MissingRequiredParameterException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2877,9 +2840,9 @@ var deserializeAws_restJson1MissingRequiredParameterExceptionResponse = function
2877
2840
  var deserializeAws_restJson1OperationNotPermittedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2878
2841
  var contents, data, exception;
2879
2842
  return __generator(this, function (_a) {
2880
- contents = {};
2843
+ contents = map({});
2881
2844
  data = parsedOutput.body;
2882
- if (data.message !== undefined && data.message !== null) {
2845
+ if (data.message != null) {
2883
2846
  contents.message = __expectString(data.message);
2884
2847
  }
2885
2848
  exception = new OperationNotPermittedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2889,9 +2852,9 @@ var deserializeAws_restJson1OperationNotPermittedExceptionResponse = function (p
2889
2852
  var deserializeAws_restJson1ResourceArnNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2890
2853
  var contents, data, exception;
2891
2854
  return __generator(this, function (_a) {
2892
- contents = {};
2855
+ contents = map({});
2893
2856
  data = parsedOutput.body;
2894
- if (data.message !== undefined && data.message !== null) {
2857
+ if (data.message != null) {
2895
2858
  contents.message = __expectString(data.message);
2896
2859
  }
2897
2860
  exception = new ResourceArnNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2901,9 +2864,9 @@ var deserializeAws_restJson1ResourceArnNotFoundExceptionResponse = function (par
2901
2864
  var deserializeAws_restJson1ResourceShareInvitationAlreadyAcceptedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2902
2865
  var contents, data, exception;
2903
2866
  return __generator(this, function (_a) {
2904
- contents = {};
2867
+ contents = map({});
2905
2868
  data = parsedOutput.body;
2906
- if (data.message !== undefined && data.message !== null) {
2869
+ if (data.message != null) {
2907
2870
  contents.message = __expectString(data.message);
2908
2871
  }
2909
2872
  exception = new ResourceShareInvitationAlreadyAcceptedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2913,9 +2876,9 @@ var deserializeAws_restJson1ResourceShareInvitationAlreadyAcceptedExceptionRespo
2913
2876
  var deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2914
2877
  var contents, data, exception;
2915
2878
  return __generator(this, function (_a) {
2916
- contents = {};
2879
+ contents = map({});
2917
2880
  data = parsedOutput.body;
2918
- if (data.message !== undefined && data.message !== null) {
2881
+ if (data.message != null) {
2919
2882
  contents.message = __expectString(data.message);
2920
2883
  }
2921
2884
  exception = new ResourceShareInvitationAlreadyRejectedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2925,9 +2888,9 @@ var deserializeAws_restJson1ResourceShareInvitationAlreadyRejectedExceptionRespo
2925
2888
  var deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2926
2889
  var contents, data, exception;
2927
2890
  return __generator(this, function (_a) {
2928
- contents = {};
2891
+ contents = map({});
2929
2892
  data = parsedOutput.body;
2930
- if (data.message !== undefined && data.message !== null) {
2893
+ if (data.message != null) {
2931
2894
  contents.message = __expectString(data.message);
2932
2895
  }
2933
2896
  exception = new ResourceShareInvitationArnNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2937,9 +2900,9 @@ var deserializeAws_restJson1ResourceShareInvitationArnNotFoundExceptionResponse
2937
2900
  var deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2938
2901
  var contents, data, exception;
2939
2902
  return __generator(this, function (_a) {
2940
- contents = {};
2903
+ contents = map({});
2941
2904
  data = parsedOutput.body;
2942
- if (data.message !== undefined && data.message !== null) {
2905
+ if (data.message != null) {
2943
2906
  contents.message = __expectString(data.message);
2944
2907
  }
2945
2908
  exception = new ResourceShareInvitationExpiredException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2949,9 +2912,9 @@ var deserializeAws_restJson1ResourceShareInvitationExpiredExceptionResponse = fu
2949
2912
  var deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2950
2913
  var contents, data, exception;
2951
2914
  return __generator(this, function (_a) {
2952
- contents = {};
2915
+ contents = map({});
2953
2916
  data = parsedOutput.body;
2954
- if (data.message !== undefined && data.message !== null) {
2917
+ if (data.message != null) {
2955
2918
  contents.message = __expectString(data.message);
2956
2919
  }
2957
2920
  exception = new ResourceShareLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2961,9 +2924,9 @@ var deserializeAws_restJson1ResourceShareLimitExceededExceptionResponse = functi
2961
2924
  var deserializeAws_restJson1ServerInternalExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2962
2925
  var contents, data, exception;
2963
2926
  return __generator(this, function (_a) {
2964
- contents = {};
2927
+ contents = map({});
2965
2928
  data = parsedOutput.body;
2966
- if (data.message !== undefined && data.message !== null) {
2929
+ if (data.message != null) {
2967
2930
  contents.message = __expectString(data.message);
2968
2931
  }
2969
2932
  exception = new ServerInternalException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2973,9 +2936,9 @@ var deserializeAws_restJson1ServerInternalExceptionResponse = function (parsedOu
2973
2936
  var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2974
2937
  var contents, data, exception;
2975
2938
  return __generator(this, function (_a) {
2976
- contents = {};
2939
+ contents = map({});
2977
2940
  data = parsedOutput.body;
2978
- if (data.message !== undefined && data.message !== null) {
2941
+ if (data.message != null) {
2979
2942
  contents.message = __expectString(data.message);
2980
2943
  }
2981
2944
  exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2985,9 +2948,9 @@ var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (pars
2985
2948
  var deserializeAws_restJson1TagLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2986
2949
  var contents, data, exception;
2987
2950
  return __generator(this, function (_a) {
2988
- contents = {};
2951
+ contents = map({});
2989
2952
  data = parsedOutput.body;
2990
- if (data.message !== undefined && data.message !== null) {
2953
+ if (data.message != null) {
2991
2954
  contents.message = __expectString(data.message);
2992
2955
  }
2993
2956
  exception = new TagLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2997,9 +2960,9 @@ var deserializeAws_restJson1TagLimitExceededExceptionResponse = function (parsed
2997
2960
  var deserializeAws_restJson1TagPolicyViolationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2998
2961
  var contents, data, exception;
2999
2962
  return __generator(this, function (_a) {
3000
- contents = {};
2963
+ contents = map({});
3001
2964
  data = parsedOutput.body;
3002
- if (data.message !== undefined && data.message !== null) {
2965
+ if (data.message != null) {
3003
2966
  contents.message = __expectString(data.message);
3004
2967
  }
3005
2968
  exception = new TagPolicyViolationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3009,9 +2972,9 @@ var deserializeAws_restJson1TagPolicyViolationExceptionResponse = function (pars
3009
2972
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3010
2973
  var contents, data, exception;
3011
2974
  return __generator(this, function (_a) {
3012
- contents = {};
2975
+ contents = map({});
3013
2976
  data = parsedOutput.body;
3014
- if (data.message !== undefined && data.message !== null) {
2977
+ if (data.message != null) {
3015
2978
  contents.message = __expectString(data.message);
3016
2979
  }
3017
2980
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3021,9 +2984,9 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
3021
2984
  var deserializeAws_restJson1UnknownResourceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3022
2985
  var contents, data, exception;
3023
2986
  return __generator(this, function (_a) {
3024
- contents = {};
2987
+ contents = map({});
3025
2988
  data = parsedOutput.body;
3026
- if (data.message !== undefined && data.message !== null) {
2989
+ if (data.message != null) {
3027
2990
  contents.message = __expectString(data.message);
3028
2991
  }
3029
2992
  exception = new UnknownResourceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3034,9 +2997,6 @@ var serializeAws_restJson1PermissionArnList = function (input, context) {
3034
2997
  return input
3035
2998
  .filter(function (e) { return e != null; })
3036
2999
  .map(function (entry) {
3037
- if (entry === null) {
3038
- return null;
3039
- }
3040
3000
  return entry;
3041
3001
  });
3042
3002
  };
@@ -3044,9 +3004,6 @@ var serializeAws_restJson1PrincipalArnOrIdList = function (input, context) {
3044
3004
  return input
3045
3005
  .filter(function (e) { return e != null; })
3046
3006
  .map(function (entry) {
3047
- if (entry === null) {
3048
- return null;
3049
- }
3050
3007
  return entry;
3051
3008
  });
3052
3009
  };
@@ -3054,9 +3011,6 @@ var serializeAws_restJson1ResourceArnList = function (input, context) {
3054
3011
  return input
3055
3012
  .filter(function (e) { return e != null; })
3056
3013
  .map(function (entry) {
3057
- if (entry === null) {
3058
- return null;
3059
- }
3060
3014
  return entry;
3061
3015
  });
3062
3016
  };
@@ -3064,9 +3018,6 @@ var serializeAws_restJson1ResourceShareArnList = function (input, context) {
3064
3018
  return input
3065
3019
  .filter(function (e) { return e != null; })
3066
3020
  .map(function (entry) {
3067
- if (entry === null) {
3068
- return null;
3069
- }
3070
3021
  return entry;
3071
3022
  });
3072
3023
  };
@@ -3074,9 +3025,6 @@ var serializeAws_restJson1ResourceShareInvitationArnList = function (input, cont
3074
3025
  return input
3075
3026
  .filter(function (e) { return e != null; })
3076
3027
  .map(function (entry) {
3077
- if (entry === null) {
3078
- return null;
3079
- }
3080
3028
  return entry;
3081
3029
  });
3082
3030
  };
@@ -3090,9 +3038,6 @@ var serializeAws_restJson1TagFilters = function (input, context) {
3090
3038
  return input
3091
3039
  .filter(function (e) { return e != null; })
3092
3040
  .map(function (entry) {
3093
- if (entry === null) {
3094
- return null;
3095
- }
3096
3041
  return serializeAws_restJson1TagFilter(entry, context);
3097
3042
  });
3098
3043
  };
@@ -3100,9 +3045,6 @@ var serializeAws_restJson1TagKeyList = function (input, context) {
3100
3045
  return input
3101
3046
  .filter(function (e) { return e != null; })
3102
3047
  .map(function (entry) {
3103
- if (entry === null) {
3104
- return null;
3105
- }
3106
3048
  return entry;
3107
3049
  });
3108
3050
  };
@@ -3110,9 +3052,6 @@ var serializeAws_restJson1TagList = function (input, context) {
3110
3052
  return input
3111
3053
  .filter(function (e) { return e != null; })
3112
3054
  .map(function (entry) {
3113
- if (entry === null) {
3114
- return null;
3115
- }
3116
3055
  return serializeAws_restJson1Tag(entry, context);
3117
3056
  });
3118
3057
  };
@@ -3120,9 +3059,6 @@ var serializeAws_restJson1TagValueList = function (input, context) {
3120
3059
  return input
3121
3060
  .filter(function (e) { return e != null; })
3122
3061
  .map(function (entry) {
3123
- if (entry === null) {
3124
- return null;
3125
- }
3126
3062
  return entry;
3127
3063
  });
3128
3064
  };