@aws-sdk/client-drs 3.141.0 → 3.142.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, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, strictParseLong as __strictParseLong, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, strictParseLong as __strictParseLong, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { DrsServiceException as __BaseException } from "../models/DrsServiceException";
5
5
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, UninitializedAccountException, ValidationException, } from "../models/models_0";
6
6
  export var serializeAws_restJson1CreateExtendedSourceServerCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -491,7 +491,10 @@ export var serializeAws_restJson1ListStagingAccountsCommand = function (input, c
491
491
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
492
492
  headers = {};
493
493
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/ListStagingAccounts";
494
- query = __assign(__assign({}, (input.maxResults !== undefined && { maxResults: input.maxResults.toString() })), (input.nextToken !== undefined && { nextToken: input.nextToken }));
494
+ query = map({
495
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
496
+ nextToken: [, input.nextToken],
497
+ });
495
498
  return [2, new __HttpRequest({
496
499
  protocol: protocol,
497
500
  hostname: hostname,
@@ -506,7 +509,7 @@ export var serializeAws_restJson1ListStagingAccountsCommand = function (input, c
506
509
  });
507
510
  }); };
508
511
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
509
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
512
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
510
513
  return __generator(this, function (_c) {
511
514
  switch (_c.label) {
512
515
  case 0: return [4, context.endpoint()];
@@ -514,16 +517,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
514
517
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
515
518
  headers = {};
516
519
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
517
- if (input.resourceArn !== undefined) {
518
- labelValue = input.resourceArn;
519
- if (labelValue.length <= 0) {
520
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
521
- }
522
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
523
- }
524
- else {
525
- throw new Error("No value provided for input HTTP label: resourceArn.");
526
- }
520
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
527
521
  return [2, new __HttpRequest({
528
522
  protocol: protocol,
529
523
  hostname: hostname,
@@ -637,7 +631,7 @@ export var serializeAws_restJson1StopFailbackCommand = function (input, context)
637
631
  });
638
632
  }); };
639
633
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
640
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
634
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
641
635
  return __generator(this, function (_c) {
642
636
  switch (_c.label) {
643
637
  case 0: return [4, context.endpoint()];
@@ -647,16 +641,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
647
641
  "content-type": "application/json",
648
642
  };
649
643
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
650
- if (input.resourceArn !== undefined) {
651
- labelValue = input.resourceArn;
652
- if (labelValue.length <= 0) {
653
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
654
- }
655
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
656
- }
657
- else {
658
- throw new Error("No value provided for input HTTP label: resourceArn.");
659
- }
644
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
660
645
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) })));
661
646
  return [2, new __HttpRequest({
662
647
  protocol: protocol,
@@ -697,7 +682,7 @@ export var serializeAws_restJson1TerminateRecoveryInstancesCommand = function (i
697
682
  });
698
683
  }); };
699
684
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
700
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
685
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
701
686
  return __generator(this, function (_c) {
702
687
  switch (_c.label) {
703
688
  case 0: return [4, context.endpoint()];
@@ -705,17 +690,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
705
690
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
706
691
  headers = {};
707
692
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
708
- if (input.resourceArn !== undefined) {
709
- labelValue = input.resourceArn;
710
- if (labelValue.length <= 0) {
711
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
712
- }
713
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
714
- }
715
- else {
716
- throw new Error("No value provided for input HTTP label: resourceArn.");
717
- }
718
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
693
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
694
+ query = map({
695
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
696
+ });
719
697
  return [2, new __HttpRequest({
720
698
  protocol: protocol,
721
699
  hostname: hostname,
@@ -863,24 +841,23 @@ export var deserializeAws_restJson1CreateExtendedSourceServerCommand = function
863
841
  if (output.statusCode !== 201 && output.statusCode >= 300) {
864
842
  return [2, deserializeAws_restJson1CreateExtendedSourceServerCommandError(output, context)];
865
843
  }
866
- contents = {
844
+ contents = map({
867
845
  $metadata: deserializeMetadata(output),
868
- sourceServer: undefined,
869
- };
846
+ });
870
847
  _a = __expectNonNull;
871
848
  _b = __expectObject;
872
849
  return [4, parseBody(output.body, context)];
873
850
  case 1:
874
851
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
875
- if (data.sourceServer !== undefined && data.sourceServer !== null) {
852
+ if (data.sourceServer != null) {
876
853
  contents.sourceServer = deserializeAws_restJson1SourceServer(data.sourceServer, context);
877
854
  }
878
- return [2, Promise.resolve(contents)];
855
+ return [2, contents];
879
856
  }
880
857
  });
881
858
  }); };
882
859
  var deserializeAws_restJson1CreateExtendedSourceServerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
883
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
860
+ var parsedOutput, _a, errorCode, _b, parsedBody;
884
861
  var _c;
885
862
  return __generator(this, function (_d) {
886
863
  switch (_d.label) {
@@ -925,14 +902,14 @@ var deserializeAws_restJson1CreateExtendedSourceServerCommandError = function (o
925
902
  case 15: throw _d.sent();
926
903
  case 16:
927
904
  parsedBody = parsedOutput.body;
928
- $metadata = deserializeMetadata(output);
929
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
930
- response = new __BaseException({
931
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
932
- $fault: "client",
933
- $metadata: $metadata,
905
+ throwDefaultError({
906
+ output: output,
907
+ parsedBody: parsedBody,
908
+ exceptionCtor: __BaseException,
909
+ errorCode: errorCode,
934
910
  });
935
- throw __decorateServiceException(response, parsedBody);
911
+ _d.label = 17;
912
+ case 17: return [2];
936
913
  }
937
914
  });
938
915
  }); };
@@ -944,84 +921,68 @@ export var deserializeAws_restJson1CreateReplicationConfigurationTemplateCommand
944
921
  if (output.statusCode !== 201 && output.statusCode >= 300) {
945
922
  return [2, deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError(output, context)];
946
923
  }
947
- contents = {
924
+ contents = map({
948
925
  $metadata: deserializeMetadata(output),
949
- arn: undefined,
950
- associateDefaultSecurityGroup: undefined,
951
- bandwidthThrottling: undefined,
952
- createPublicIP: undefined,
953
- dataPlaneRouting: undefined,
954
- defaultLargeStagingDiskType: undefined,
955
- ebsEncryption: undefined,
956
- ebsEncryptionKeyArn: undefined,
957
- pitPolicy: undefined,
958
- replicationConfigurationTemplateID: undefined,
959
- replicationServerInstanceType: undefined,
960
- replicationServersSecurityGroupsIDs: undefined,
961
- stagingAreaSubnetId: undefined,
962
- stagingAreaTags: undefined,
963
- tags: undefined,
964
- useDedicatedReplicationServer: undefined,
965
- };
926
+ });
966
927
  _a = __expectNonNull;
967
928
  _b = __expectObject;
968
929
  return [4, parseBody(output.body, context)];
969
930
  case 1:
970
931
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
971
- if (data.arn !== undefined && data.arn !== null) {
932
+ if (data.arn != null) {
972
933
  contents.arn = __expectString(data.arn);
973
934
  }
974
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
935
+ if (data.associateDefaultSecurityGroup != null) {
975
936
  contents.associateDefaultSecurityGroup = __expectBoolean(data.associateDefaultSecurityGroup);
976
937
  }
977
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
938
+ if (data.bandwidthThrottling != null) {
978
939
  contents.bandwidthThrottling = __expectLong(data.bandwidthThrottling);
979
940
  }
980
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
941
+ if (data.createPublicIP != null) {
981
942
  contents.createPublicIP = __expectBoolean(data.createPublicIP);
982
943
  }
983
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
944
+ if (data.dataPlaneRouting != null) {
984
945
  contents.dataPlaneRouting = __expectString(data.dataPlaneRouting);
985
946
  }
986
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
947
+ if (data.defaultLargeStagingDiskType != null) {
987
948
  contents.defaultLargeStagingDiskType = __expectString(data.defaultLargeStagingDiskType);
988
949
  }
989
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
950
+ if (data.ebsEncryption != null) {
990
951
  contents.ebsEncryption = __expectString(data.ebsEncryption);
991
952
  }
992
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
953
+ if (data.ebsEncryptionKeyArn != null) {
993
954
  contents.ebsEncryptionKeyArn = __expectString(data.ebsEncryptionKeyArn);
994
955
  }
995
- if (data.pitPolicy !== undefined && data.pitPolicy !== null) {
956
+ if (data.pitPolicy != null) {
996
957
  contents.pitPolicy = deserializeAws_restJson1PITPolicy(data.pitPolicy, context);
997
958
  }
998
- if (data.replicationConfigurationTemplateID !== undefined && data.replicationConfigurationTemplateID !== null) {
959
+ if (data.replicationConfigurationTemplateID != null) {
999
960
  contents.replicationConfigurationTemplateID = __expectString(data.replicationConfigurationTemplateID);
1000
961
  }
1001
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
962
+ if (data.replicationServerInstanceType != null) {
1002
963
  contents.replicationServerInstanceType = __expectString(data.replicationServerInstanceType);
1003
964
  }
1004
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
965
+ if (data.replicationServersSecurityGroupsIDs != null) {
1005
966
  contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(data.replicationServersSecurityGroupsIDs, context);
1006
967
  }
1007
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
968
+ if (data.stagingAreaSubnetId != null) {
1008
969
  contents.stagingAreaSubnetId = __expectString(data.stagingAreaSubnetId);
1009
970
  }
1010
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
971
+ if (data.stagingAreaTags != null) {
1011
972
  contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
1012
973
  }
1013
- if (data.tags !== undefined && data.tags !== null) {
974
+ if (data.tags != null) {
1014
975
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1015
976
  }
1016
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
977
+ if (data.useDedicatedReplicationServer != null) {
1017
978
  contents.useDedicatedReplicationServer = __expectBoolean(data.useDedicatedReplicationServer);
1018
979
  }
1019
- return [2, Promise.resolve(contents)];
980
+ return [2, contents];
1020
981
  }
1021
982
  });
1022
983
  }); };
1023
984
  var deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1024
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
985
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1025
986
  var _c;
1026
987
  return __generator(this, function (_d) {
1027
988
  switch (_d.label) {
@@ -1062,14 +1023,14 @@ var deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError =
1062
1023
  case 13: throw _d.sent();
1063
1024
  case 14:
1064
1025
  parsedBody = parsedOutput.body;
1065
- $metadata = deserializeMetadata(output);
1066
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1067
- response = new __BaseException({
1068
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1069
- $fault: "client",
1070
- $metadata: $metadata,
1026
+ throwDefaultError({
1027
+ output: output,
1028
+ parsedBody: parsedBody,
1029
+ exceptionCtor: __BaseException,
1030
+ errorCode: errorCode,
1071
1031
  });
1072
- throw __decorateServiceException(response, parsedBody);
1032
+ _d.label = 15;
1033
+ case 15: return [2];
1073
1034
  }
1074
1035
  });
1075
1036
  }); };
@@ -1081,18 +1042,18 @@ export var deserializeAws_restJson1DeleteJobCommand = function (output, context)
1081
1042
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1082
1043
  return [2, deserializeAws_restJson1DeleteJobCommandError(output, context)];
1083
1044
  }
1084
- contents = {
1045
+ contents = map({
1085
1046
  $metadata: deserializeMetadata(output),
1086
- };
1047
+ });
1087
1048
  return [4, collectBody(output.body, context)];
1088
1049
  case 1:
1089
1050
  _a.sent();
1090
- return [2, Promise.resolve(contents)];
1051
+ return [2, contents];
1091
1052
  }
1092
1053
  });
1093
1054
  }); };
1094
1055
  var deserializeAws_restJson1DeleteJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1095
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1056
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1096
1057
  var _c;
1097
1058
  return __generator(this, function (_d) {
1098
1059
  switch (_d.label) {
@@ -1129,14 +1090,14 @@ var deserializeAws_restJson1DeleteJobCommandError = function (output, context) {
1129
1090
  case 11: throw _d.sent();
1130
1091
  case 12:
1131
1092
  parsedBody = parsedOutput.body;
1132
- $metadata = deserializeMetadata(output);
1133
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1134
- response = new __BaseException({
1135
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1136
- $fault: "client",
1137
- $metadata: $metadata,
1093
+ throwDefaultError({
1094
+ output: output,
1095
+ parsedBody: parsedBody,
1096
+ exceptionCtor: __BaseException,
1097
+ errorCode: errorCode,
1138
1098
  });
1139
- throw __decorateServiceException(response, parsedBody);
1099
+ _d.label = 13;
1100
+ case 13: return [2];
1140
1101
  }
1141
1102
  });
1142
1103
  }); };
@@ -1148,18 +1109,18 @@ export var deserializeAws_restJson1DeleteRecoveryInstanceCommand = function (out
1148
1109
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1149
1110
  return [2, deserializeAws_restJson1DeleteRecoveryInstanceCommandError(output, context)];
1150
1111
  }
1151
- contents = {
1112
+ contents = map({
1152
1113
  $metadata: deserializeMetadata(output),
1153
- };
1114
+ });
1154
1115
  return [4, collectBody(output.body, context)];
1155
1116
  case 1:
1156
1117
  _a.sent();
1157
- return [2, Promise.resolve(contents)];
1118
+ return [2, contents];
1158
1119
  }
1159
1120
  });
1160
1121
  }); };
1161
1122
  var deserializeAws_restJson1DeleteRecoveryInstanceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1162
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1123
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1163
1124
  var _c;
1164
1125
  return __generator(this, function (_d) {
1165
1126
  switch (_d.label) {
@@ -1196,14 +1157,14 @@ var deserializeAws_restJson1DeleteRecoveryInstanceCommandError = function (outpu
1196
1157
  case 11: throw _d.sent();
1197
1158
  case 12:
1198
1159
  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,
1160
+ throwDefaultError({
1161
+ output: output,
1162
+ parsedBody: parsedBody,
1163
+ exceptionCtor: __BaseException,
1164
+ errorCode: errorCode,
1205
1165
  });
1206
- throw __decorateServiceException(response, parsedBody);
1166
+ _d.label = 13;
1167
+ case 13: return [2];
1207
1168
  }
1208
1169
  });
1209
1170
  }); };
@@ -1215,18 +1176,18 @@ export var deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommand
1215
1176
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1216
1177
  return [2, deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError(output, context)];
1217
1178
  }
1218
- contents = {
1179
+ contents = map({
1219
1180
  $metadata: deserializeMetadata(output),
1220
- };
1181
+ });
1221
1182
  return [4, collectBody(output.body, context)];
1222
1183
  case 1:
1223
1184
  _a.sent();
1224
- return [2, Promise.resolve(contents)];
1185
+ return [2, contents];
1225
1186
  }
1226
1187
  });
1227
1188
  }); };
1228
1189
  var deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1229
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1190
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1230
1191
  var _c;
1231
1192
  return __generator(this, function (_d) {
1232
1193
  switch (_d.label) {
@@ -1263,14 +1224,14 @@ var deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError =
1263
1224
  case 11: throw _d.sent();
1264
1225
  case 12:
1265
1226
  parsedBody = parsedOutput.body;
1266
- $metadata = deserializeMetadata(output);
1267
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1268
- response = new __BaseException({
1269
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1270
- $fault: "client",
1271
- $metadata: $metadata,
1227
+ throwDefaultError({
1228
+ output: output,
1229
+ parsedBody: parsedBody,
1230
+ exceptionCtor: __BaseException,
1231
+ errorCode: errorCode,
1272
1232
  });
1273
- throw __decorateServiceException(response, parsedBody);
1233
+ _d.label = 13;
1234
+ case 13: return [2];
1274
1235
  }
1275
1236
  });
1276
1237
  }); };
@@ -1282,18 +1243,18 @@ export var deserializeAws_restJson1DeleteSourceServerCommand = function (output,
1282
1243
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1283
1244
  return [2, deserializeAws_restJson1DeleteSourceServerCommandError(output, context)];
1284
1245
  }
1285
- contents = {
1246
+ contents = map({
1286
1247
  $metadata: deserializeMetadata(output),
1287
- };
1248
+ });
1288
1249
  return [4, collectBody(output.body, context)];
1289
1250
  case 1:
1290
1251
  _a.sent();
1291
- return [2, Promise.resolve(contents)];
1252
+ return [2, contents];
1292
1253
  }
1293
1254
  });
1294
1255
  }); };
1295
1256
  var deserializeAws_restJson1DeleteSourceServerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1296
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1257
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1297
1258
  var _c;
1298
1259
  return __generator(this, function (_d) {
1299
1260
  switch (_d.label) {
@@ -1330,14 +1291,14 @@ var deserializeAws_restJson1DeleteSourceServerCommandError = function (output, c
1330
1291
  case 11: throw _d.sent();
1331
1292
  case 12:
1332
1293
  parsedBody = parsedOutput.body;
1333
- $metadata = deserializeMetadata(output);
1334
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1335
- response = new __BaseException({
1336
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1337
- $fault: "client",
1338
- $metadata: $metadata,
1294
+ throwDefaultError({
1295
+ output: output,
1296
+ parsedBody: parsedBody,
1297
+ exceptionCtor: __BaseException,
1298
+ errorCode: errorCode,
1339
1299
  });
1340
- throw __decorateServiceException(response, parsedBody);
1300
+ _d.label = 13;
1301
+ case 13: return [2];
1341
1302
  }
1342
1303
  });
1343
1304
  }); };
@@ -1349,28 +1310,26 @@ export var deserializeAws_restJson1DescribeJobLogItemsCommand = function (output
1349
1310
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1350
1311
  return [2, deserializeAws_restJson1DescribeJobLogItemsCommandError(output, context)];
1351
1312
  }
1352
- contents = {
1313
+ contents = map({
1353
1314
  $metadata: deserializeMetadata(output),
1354
- items: undefined,
1355
- nextToken: undefined,
1356
- };
1315
+ });
1357
1316
  _a = __expectNonNull;
1358
1317
  _b = __expectObject;
1359
1318
  return [4, parseBody(output.body, context)];
1360
1319
  case 1:
1361
1320
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1362
- if (data.items !== undefined && data.items !== null) {
1321
+ if (data.items != null) {
1363
1322
  contents.items = deserializeAws_restJson1JobLogs(data.items, context);
1364
1323
  }
1365
- if (data.nextToken !== undefined && data.nextToken !== null) {
1324
+ if (data.nextToken != null) {
1366
1325
  contents.nextToken = __expectString(data.nextToken);
1367
1326
  }
1368
- return [2, Promise.resolve(contents)];
1327
+ return [2, contents];
1369
1328
  }
1370
1329
  });
1371
1330
  }); };
1372
1331
  var deserializeAws_restJson1DescribeJobLogItemsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1373
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1332
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1374
1333
  var _c;
1375
1334
  return __generator(this, function (_d) {
1376
1335
  switch (_d.label) {
@@ -1403,14 +1362,14 @@ var deserializeAws_restJson1DescribeJobLogItemsCommandError = function (output,
1403
1362
  case 9: throw _d.sent();
1404
1363
  case 10:
1405
1364
  parsedBody = parsedOutput.body;
1406
- $metadata = deserializeMetadata(output);
1407
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1408
- response = new __BaseException({
1409
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1410
- $fault: "client",
1411
- $metadata: $metadata,
1365
+ throwDefaultError({
1366
+ output: output,
1367
+ parsedBody: parsedBody,
1368
+ exceptionCtor: __BaseException,
1369
+ errorCode: errorCode,
1412
1370
  });
1413
- throw __decorateServiceException(response, parsedBody);
1371
+ _d.label = 11;
1372
+ case 11: return [2];
1414
1373
  }
1415
1374
  });
1416
1375
  }); };
@@ -1422,28 +1381,26 @@ export var deserializeAws_restJson1DescribeJobsCommand = function (output, conte
1422
1381
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1423
1382
  return [2, deserializeAws_restJson1DescribeJobsCommandError(output, context)];
1424
1383
  }
1425
- contents = {
1384
+ contents = map({
1426
1385
  $metadata: deserializeMetadata(output),
1427
- items: undefined,
1428
- nextToken: undefined,
1429
- };
1386
+ });
1430
1387
  _a = __expectNonNull;
1431
1388
  _b = __expectObject;
1432
1389
  return [4, parseBody(output.body, context)];
1433
1390
  case 1:
1434
1391
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1435
- if (data.items !== undefined && data.items !== null) {
1392
+ if (data.items != null) {
1436
1393
  contents.items = deserializeAws_restJson1JobsList(data.items, context);
1437
1394
  }
1438
- if (data.nextToken !== undefined && data.nextToken !== null) {
1395
+ if (data.nextToken != null) {
1439
1396
  contents.nextToken = __expectString(data.nextToken);
1440
1397
  }
1441
- return [2, Promise.resolve(contents)];
1398
+ return [2, contents];
1442
1399
  }
1443
1400
  });
1444
1401
  }); };
1445
1402
  var deserializeAws_restJson1DescribeJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1446
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1403
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1447
1404
  var _c;
1448
1405
  return __generator(this, function (_d) {
1449
1406
  switch (_d.label) {
@@ -1476,14 +1433,14 @@ var deserializeAws_restJson1DescribeJobsCommandError = function (output, context
1476
1433
  case 9: throw _d.sent();
1477
1434
  case 10:
1478
1435
  parsedBody = parsedOutput.body;
1479
- $metadata = deserializeMetadata(output);
1480
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1481
- response = new __BaseException({
1482
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1483
- $fault: "client",
1484
- $metadata: $metadata,
1436
+ throwDefaultError({
1437
+ output: output,
1438
+ parsedBody: parsedBody,
1439
+ exceptionCtor: __BaseException,
1440
+ errorCode: errorCode,
1485
1441
  });
1486
- throw __decorateServiceException(response, parsedBody);
1442
+ _d.label = 11;
1443
+ case 11: return [2];
1487
1444
  }
1488
1445
  });
1489
1446
  }); };
@@ -1495,28 +1452,26 @@ export var deserializeAws_restJson1DescribeRecoveryInstancesCommand = function (
1495
1452
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1496
1453
  return [2, deserializeAws_restJson1DescribeRecoveryInstancesCommandError(output, context)];
1497
1454
  }
1498
- contents = {
1455
+ contents = map({
1499
1456
  $metadata: deserializeMetadata(output),
1500
- items: undefined,
1501
- nextToken: undefined,
1502
- };
1457
+ });
1503
1458
  _a = __expectNonNull;
1504
1459
  _b = __expectObject;
1505
1460
  return [4, parseBody(output.body, context)];
1506
1461
  case 1:
1507
1462
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1508
- if (data.items !== undefined && data.items !== null) {
1463
+ if (data.items != null) {
1509
1464
  contents.items = deserializeAws_restJson1DescribeRecoveryInstancesItems(data.items, context);
1510
1465
  }
1511
- if (data.nextToken !== undefined && data.nextToken !== null) {
1466
+ if (data.nextToken != null) {
1512
1467
  contents.nextToken = __expectString(data.nextToken);
1513
1468
  }
1514
- return [2, Promise.resolve(contents)];
1469
+ return [2, contents];
1515
1470
  }
1516
1471
  });
1517
1472
  }); };
1518
1473
  var deserializeAws_restJson1DescribeRecoveryInstancesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1519
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1474
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1520
1475
  var _c;
1521
1476
  return __generator(this, function (_d) {
1522
1477
  switch (_d.label) {
@@ -1549,14 +1504,14 @@ var deserializeAws_restJson1DescribeRecoveryInstancesCommandError = function (ou
1549
1504
  case 9: throw _d.sent();
1550
1505
  case 10:
1551
1506
  parsedBody = parsedOutput.body;
1552
- $metadata = deserializeMetadata(output);
1553
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1554
- response = new __BaseException({
1555
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1556
- $fault: "client",
1557
- $metadata: $metadata,
1507
+ throwDefaultError({
1508
+ output: output,
1509
+ parsedBody: parsedBody,
1510
+ exceptionCtor: __BaseException,
1511
+ errorCode: errorCode,
1558
1512
  });
1559
- throw __decorateServiceException(response, parsedBody);
1513
+ _d.label = 11;
1514
+ case 11: return [2];
1560
1515
  }
1561
1516
  });
1562
1517
  }); };
@@ -1568,28 +1523,26 @@ export var deserializeAws_restJson1DescribeRecoverySnapshotsCommand = function (
1568
1523
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1569
1524
  return [2, deserializeAws_restJson1DescribeRecoverySnapshotsCommandError(output, context)];
1570
1525
  }
1571
- contents = {
1526
+ contents = map({
1572
1527
  $metadata: deserializeMetadata(output),
1573
- items: undefined,
1574
- nextToken: undefined,
1575
- };
1528
+ });
1576
1529
  _a = __expectNonNull;
1577
1530
  _b = __expectObject;
1578
1531
  return [4, parseBody(output.body, context)];
1579
1532
  case 1:
1580
1533
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1581
- if (data.items !== undefined && data.items !== null) {
1534
+ if (data.items != null) {
1582
1535
  contents.items = deserializeAws_restJson1RecoverySnapshotsList(data.items, context);
1583
1536
  }
1584
- if (data.nextToken !== undefined && data.nextToken !== null) {
1537
+ if (data.nextToken != null) {
1585
1538
  contents.nextToken = __expectString(data.nextToken);
1586
1539
  }
1587
- return [2, Promise.resolve(contents)];
1540
+ return [2, contents];
1588
1541
  }
1589
1542
  });
1590
1543
  }); };
1591
1544
  var deserializeAws_restJson1DescribeRecoverySnapshotsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1592
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1545
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1593
1546
  var _c;
1594
1547
  return __generator(this, function (_d) {
1595
1548
  switch (_d.label) {
@@ -1626,14 +1579,14 @@ var deserializeAws_restJson1DescribeRecoverySnapshotsCommandError = function (ou
1626
1579
  case 11: throw _d.sent();
1627
1580
  case 12:
1628
1581
  parsedBody = parsedOutput.body;
1629
- $metadata = deserializeMetadata(output);
1630
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1631
- response = new __BaseException({
1632
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1633
- $fault: "client",
1634
- $metadata: $metadata,
1582
+ throwDefaultError({
1583
+ output: output,
1584
+ parsedBody: parsedBody,
1585
+ exceptionCtor: __BaseException,
1586
+ errorCode: errorCode,
1635
1587
  });
1636
- throw __decorateServiceException(response, parsedBody);
1588
+ _d.label = 13;
1589
+ case 13: return [2];
1637
1590
  }
1638
1591
  });
1639
1592
  }); };
@@ -1645,28 +1598,26 @@ export var deserializeAws_restJson1DescribeReplicationConfigurationTemplatesComm
1645
1598
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1646
1599
  return [2, deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandError(output, context)];
1647
1600
  }
1648
- contents = {
1601
+ contents = map({
1649
1602
  $metadata: deserializeMetadata(output),
1650
- items: undefined,
1651
- nextToken: undefined,
1652
- };
1603
+ });
1653
1604
  _a = __expectNonNull;
1654
1605
  _b = __expectObject;
1655
1606
  return [4, parseBody(output.body, context)];
1656
1607
  case 1:
1657
1608
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1658
- if (data.items !== undefined && data.items !== null) {
1609
+ if (data.items != null) {
1659
1610
  contents.items = deserializeAws_restJson1ReplicationConfigurationTemplates(data.items, context);
1660
1611
  }
1661
- if (data.nextToken !== undefined && data.nextToken !== null) {
1612
+ if (data.nextToken != null) {
1662
1613
  contents.nextToken = __expectString(data.nextToken);
1663
1614
  }
1664
- return [2, Promise.resolve(contents)];
1615
+ return [2, contents];
1665
1616
  }
1666
1617
  });
1667
1618
  }); };
1668
1619
  var deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1669
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1620
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1670
1621
  var _c;
1671
1622
  return __generator(this, function (_d) {
1672
1623
  switch (_d.label) {
@@ -1703,14 +1654,14 @@ var deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandErro
1703
1654
  case 11: throw _d.sent();
1704
1655
  case 12:
1705
1656
  parsedBody = parsedOutput.body;
1706
- $metadata = deserializeMetadata(output);
1707
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1708
- response = new __BaseException({
1709
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1710
- $fault: "client",
1711
- $metadata: $metadata,
1657
+ throwDefaultError({
1658
+ output: output,
1659
+ parsedBody: parsedBody,
1660
+ exceptionCtor: __BaseException,
1661
+ errorCode: errorCode,
1712
1662
  });
1713
- throw __decorateServiceException(response, parsedBody);
1663
+ _d.label = 13;
1664
+ case 13: return [2];
1714
1665
  }
1715
1666
  });
1716
1667
  }); };
@@ -1722,28 +1673,26 @@ export var deserializeAws_restJson1DescribeSourceServersCommand = function (outp
1722
1673
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1723
1674
  return [2, deserializeAws_restJson1DescribeSourceServersCommandError(output, context)];
1724
1675
  }
1725
- contents = {
1676
+ contents = map({
1726
1677
  $metadata: deserializeMetadata(output),
1727
- items: undefined,
1728
- nextToken: undefined,
1729
- };
1678
+ });
1730
1679
  _a = __expectNonNull;
1731
1680
  _b = __expectObject;
1732
1681
  return [4, parseBody(output.body, context)];
1733
1682
  case 1:
1734
1683
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1735
- if (data.items !== undefined && data.items !== null) {
1684
+ if (data.items != null) {
1736
1685
  contents.items = deserializeAws_restJson1SourceServersList(data.items, context);
1737
1686
  }
1738
- if (data.nextToken !== undefined && data.nextToken !== null) {
1687
+ if (data.nextToken != null) {
1739
1688
  contents.nextToken = __expectString(data.nextToken);
1740
1689
  }
1741
- return [2, Promise.resolve(contents)];
1690
+ return [2, contents];
1742
1691
  }
1743
1692
  });
1744
1693
  }); };
1745
1694
  var deserializeAws_restJson1DescribeSourceServersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1746
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1695
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1747
1696
  var _c;
1748
1697
  return __generator(this, function (_d) {
1749
1698
  switch (_d.label) {
@@ -1776,14 +1725,14 @@ var deserializeAws_restJson1DescribeSourceServersCommandError = function (output
1776
1725
  case 9: throw _d.sent();
1777
1726
  case 10:
1778
1727
  parsedBody = parsedOutput.body;
1779
- $metadata = deserializeMetadata(output);
1780
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1781
- response = new __BaseException({
1782
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1783
- $fault: "client",
1784
- $metadata: $metadata,
1728
+ throwDefaultError({
1729
+ output: output,
1730
+ parsedBody: parsedBody,
1731
+ exceptionCtor: __BaseException,
1732
+ errorCode: errorCode,
1785
1733
  });
1786
- throw __decorateServiceException(response, parsedBody);
1734
+ _d.label = 11;
1735
+ case 11: return [2];
1787
1736
  }
1788
1737
  });
1789
1738
  }); };
@@ -1795,18 +1744,18 @@ export var deserializeAws_restJson1DisconnectRecoveryInstanceCommand = function
1795
1744
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1796
1745
  return [2, deserializeAws_restJson1DisconnectRecoveryInstanceCommandError(output, context)];
1797
1746
  }
1798
- contents = {
1747
+ contents = map({
1799
1748
  $metadata: deserializeMetadata(output),
1800
- };
1749
+ });
1801
1750
  return [4, collectBody(output.body, context)];
1802
1751
  case 1:
1803
1752
  _a.sent();
1804
- return [2, Promise.resolve(contents)];
1753
+ return [2, contents];
1805
1754
  }
1806
1755
  });
1807
1756
  }); };
1808
1757
  var deserializeAws_restJson1DisconnectRecoveryInstanceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1809
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1758
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1810
1759
  var _c;
1811
1760
  return __generator(this, function (_d) {
1812
1761
  switch (_d.label) {
@@ -1847,14 +1796,14 @@ var deserializeAws_restJson1DisconnectRecoveryInstanceCommandError = function (o
1847
1796
  case 13: throw _d.sent();
1848
1797
  case 14:
1849
1798
  parsedBody = parsedOutput.body;
1850
- $metadata = deserializeMetadata(output);
1851
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1852
- response = new __BaseException({
1853
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1854
- $fault: "client",
1855
- $metadata: $metadata,
1799
+ throwDefaultError({
1800
+ output: output,
1801
+ parsedBody: parsedBody,
1802
+ exceptionCtor: __BaseException,
1803
+ errorCode: errorCode,
1856
1804
  });
1857
- throw __decorateServiceException(response, parsedBody);
1805
+ _d.label = 15;
1806
+ case 15: return [2];
1858
1807
  }
1859
1808
  });
1860
1809
  }); };
@@ -1866,56 +1815,47 @@ export var deserializeAws_restJson1DisconnectSourceServerCommand = function (out
1866
1815
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1867
1816
  return [2, deserializeAws_restJson1DisconnectSourceServerCommandError(output, context)];
1868
1817
  }
1869
- contents = {
1818
+ contents = map({
1870
1819
  $metadata: deserializeMetadata(output),
1871
- arn: undefined,
1872
- dataReplicationInfo: undefined,
1873
- lastLaunchResult: undefined,
1874
- lifeCycle: undefined,
1875
- recoveryInstanceId: undefined,
1876
- sourceProperties: undefined,
1877
- sourceServerID: undefined,
1878
- stagingArea: undefined,
1879
- tags: undefined,
1880
- };
1820
+ });
1881
1821
  _a = __expectNonNull;
1882
1822
  _b = __expectObject;
1883
1823
  return [4, parseBody(output.body, context)];
1884
1824
  case 1:
1885
1825
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1886
- if (data.arn !== undefined && data.arn !== null) {
1826
+ if (data.arn != null) {
1887
1827
  contents.arn = __expectString(data.arn);
1888
1828
  }
1889
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
1829
+ if (data.dataReplicationInfo != null) {
1890
1830
  contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
1891
1831
  }
1892
- if (data.lastLaunchResult !== undefined && data.lastLaunchResult !== null) {
1832
+ if (data.lastLaunchResult != null) {
1893
1833
  contents.lastLaunchResult = __expectString(data.lastLaunchResult);
1894
1834
  }
1895
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
1835
+ if (data.lifeCycle != null) {
1896
1836
  contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
1897
1837
  }
1898
- if (data.recoveryInstanceId !== undefined && data.recoveryInstanceId !== null) {
1838
+ if (data.recoveryInstanceId != null) {
1899
1839
  contents.recoveryInstanceId = __expectString(data.recoveryInstanceId);
1900
1840
  }
1901
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
1841
+ if (data.sourceProperties != null) {
1902
1842
  contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
1903
1843
  }
1904
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1844
+ if (data.sourceServerID != null) {
1905
1845
  contents.sourceServerID = __expectString(data.sourceServerID);
1906
1846
  }
1907
- if (data.stagingArea !== undefined && data.stagingArea !== null) {
1847
+ if (data.stagingArea != null) {
1908
1848
  contents.stagingArea = deserializeAws_restJson1StagingArea(data.stagingArea, context);
1909
1849
  }
1910
- if (data.tags !== undefined && data.tags !== null) {
1850
+ if (data.tags != null) {
1911
1851
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1912
1852
  }
1913
- return [2, Promise.resolve(contents)];
1853
+ return [2, contents];
1914
1854
  }
1915
1855
  });
1916
1856
  }); };
1917
1857
  var deserializeAws_restJson1DisconnectSourceServerCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1918
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1858
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1919
1859
  var _c;
1920
1860
  return __generator(this, function (_d) {
1921
1861
  switch (_d.label) {
@@ -1952,14 +1892,14 @@ var deserializeAws_restJson1DisconnectSourceServerCommandError = function (outpu
1952
1892
  case 11: throw _d.sent();
1953
1893
  case 12:
1954
1894
  parsedBody = parsedOutput.body;
1955
- $metadata = deserializeMetadata(output);
1956
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1957
- response = new __BaseException({
1958
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1959
- $fault: "client",
1960
- $metadata: $metadata,
1895
+ throwDefaultError({
1896
+ output: output,
1897
+ parsedBody: parsedBody,
1898
+ exceptionCtor: __BaseException,
1899
+ errorCode: errorCode,
1961
1900
  });
1962
- throw __decorateServiceException(response, parsedBody);
1901
+ _d.label = 13;
1902
+ case 13: return [2];
1963
1903
  }
1964
1904
  });
1965
1905
  }); };
@@ -1971,36 +1911,32 @@ export var deserializeAws_restJson1GetFailbackReplicationConfigurationCommand =
1971
1911
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1972
1912
  return [2, deserializeAws_restJson1GetFailbackReplicationConfigurationCommandError(output, context)];
1973
1913
  }
1974
- contents = {
1914
+ contents = map({
1975
1915
  $metadata: deserializeMetadata(output),
1976
- bandwidthThrottling: undefined,
1977
- name: undefined,
1978
- recoveryInstanceID: undefined,
1979
- usePrivateIP: undefined,
1980
- };
1916
+ });
1981
1917
  _a = __expectNonNull;
1982
1918
  _b = __expectObject;
1983
1919
  return [4, parseBody(output.body, context)];
1984
1920
  case 1:
1985
1921
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1986
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
1922
+ if (data.bandwidthThrottling != null) {
1987
1923
  contents.bandwidthThrottling = __expectLong(data.bandwidthThrottling);
1988
1924
  }
1989
- if (data.name !== undefined && data.name !== null) {
1925
+ if (data.name != null) {
1990
1926
  contents.name = __expectString(data.name);
1991
1927
  }
1992
- if (data.recoveryInstanceID !== undefined && data.recoveryInstanceID !== null) {
1928
+ if (data.recoveryInstanceID != null) {
1993
1929
  contents.recoveryInstanceID = __expectString(data.recoveryInstanceID);
1994
1930
  }
1995
- if (data.usePrivateIP !== undefined && data.usePrivateIP !== null) {
1931
+ if (data.usePrivateIP != null) {
1996
1932
  contents.usePrivateIP = __expectBoolean(data.usePrivateIP);
1997
1933
  }
1998
- return [2, Promise.resolve(contents)];
1934
+ return [2, contents];
1999
1935
  }
2000
1936
  });
2001
1937
  }); };
2002
1938
  var deserializeAws_restJson1GetFailbackReplicationConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2003
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1939
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2004
1940
  var _c;
2005
1941
  return __generator(this, function (_d) {
2006
1942
  switch (_d.label) {
@@ -2033,14 +1969,14 @@ var deserializeAws_restJson1GetFailbackReplicationConfigurationCommandError = fu
2033
1969
  case 9: throw _d.sent();
2034
1970
  case 10:
2035
1971
  parsedBody = parsedOutput.body;
2036
- $metadata = deserializeMetadata(output);
2037
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2038
- response = new __BaseException({
2039
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2040
- $fault: "client",
2041
- $metadata: $metadata,
1972
+ throwDefaultError({
1973
+ output: output,
1974
+ parsedBody: parsedBody,
1975
+ exceptionCtor: __BaseException,
1976
+ errorCode: errorCode,
2042
1977
  });
2043
- throw __decorateServiceException(response, parsedBody);
1978
+ _d.label = 11;
1979
+ case 11: return [2];
2044
1980
  }
2045
1981
  });
2046
1982
  }); };
@@ -2052,52 +1988,44 @@ export var deserializeAws_restJson1GetLaunchConfigurationCommand = function (out
2052
1988
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2053
1989
  return [2, deserializeAws_restJson1GetLaunchConfigurationCommandError(output, context)];
2054
1990
  }
2055
- contents = {
1991
+ contents = map({
2056
1992
  $metadata: deserializeMetadata(output),
2057
- copyPrivateIp: undefined,
2058
- copyTags: undefined,
2059
- ec2LaunchTemplateID: undefined,
2060
- launchDisposition: undefined,
2061
- licensing: undefined,
2062
- name: undefined,
2063
- sourceServerID: undefined,
2064
- targetInstanceTypeRightSizingMethod: undefined,
2065
- };
1993
+ });
2066
1994
  _a = __expectNonNull;
2067
1995
  _b = __expectObject;
2068
1996
  return [4, parseBody(output.body, context)];
2069
1997
  case 1:
2070
1998
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2071
- if (data.copyPrivateIp !== undefined && data.copyPrivateIp !== null) {
1999
+ if (data.copyPrivateIp != null) {
2072
2000
  contents.copyPrivateIp = __expectBoolean(data.copyPrivateIp);
2073
2001
  }
2074
- if (data.copyTags !== undefined && data.copyTags !== null) {
2002
+ if (data.copyTags != null) {
2075
2003
  contents.copyTags = __expectBoolean(data.copyTags);
2076
2004
  }
2077
- if (data.ec2LaunchTemplateID !== undefined && data.ec2LaunchTemplateID !== null) {
2005
+ if (data.ec2LaunchTemplateID != null) {
2078
2006
  contents.ec2LaunchTemplateID = __expectString(data.ec2LaunchTemplateID);
2079
2007
  }
2080
- if (data.launchDisposition !== undefined && data.launchDisposition !== null) {
2008
+ if (data.launchDisposition != null) {
2081
2009
  contents.launchDisposition = __expectString(data.launchDisposition);
2082
2010
  }
2083
- if (data.licensing !== undefined && data.licensing !== null) {
2011
+ if (data.licensing != null) {
2084
2012
  contents.licensing = deserializeAws_restJson1Licensing(data.licensing, context);
2085
2013
  }
2086
- if (data.name !== undefined && data.name !== null) {
2014
+ if (data.name != null) {
2087
2015
  contents.name = __expectString(data.name);
2088
2016
  }
2089
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2017
+ if (data.sourceServerID != null) {
2090
2018
  contents.sourceServerID = __expectString(data.sourceServerID);
2091
2019
  }
2092
- if (data.targetInstanceTypeRightSizingMethod !== undefined && data.targetInstanceTypeRightSizingMethod !== null) {
2020
+ if (data.targetInstanceTypeRightSizingMethod != null) {
2093
2021
  contents.targetInstanceTypeRightSizingMethod = __expectString(data.targetInstanceTypeRightSizingMethod);
2094
2022
  }
2095
- return [2, Promise.resolve(contents)];
2023
+ return [2, contents];
2096
2024
  }
2097
2025
  });
2098
2026
  }); };
2099
2027
  var deserializeAws_restJson1GetLaunchConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2100
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2028
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2101
2029
  var _c;
2102
2030
  return __generator(this, function (_d) {
2103
2031
  switch (_d.label) {
@@ -2130,14 +2058,14 @@ var deserializeAws_restJson1GetLaunchConfigurationCommandError = function (outpu
2130
2058
  case 9: throw _d.sent();
2131
2059
  case 10:
2132
2060
  parsedBody = parsedOutput.body;
2133
- $metadata = deserializeMetadata(output);
2134
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2135
- response = new __BaseException({
2136
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2137
- $fault: "client",
2138
- $metadata: $metadata,
2061
+ throwDefaultError({
2062
+ output: output,
2063
+ parsedBody: parsedBody,
2064
+ exceptionCtor: __BaseException,
2065
+ errorCode: errorCode,
2139
2066
  });
2140
- throw __decorateServiceException(response, parsedBody);
2067
+ _d.label = 11;
2068
+ case 11: return [2];
2141
2069
  }
2142
2070
  });
2143
2071
  }); };
@@ -2149,84 +2077,68 @@ export var deserializeAws_restJson1GetReplicationConfigurationCommand = function
2149
2077
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2150
2078
  return [2, deserializeAws_restJson1GetReplicationConfigurationCommandError(output, context)];
2151
2079
  }
2152
- contents = {
2080
+ contents = map({
2153
2081
  $metadata: deserializeMetadata(output),
2154
- associateDefaultSecurityGroup: undefined,
2155
- bandwidthThrottling: undefined,
2156
- createPublicIP: undefined,
2157
- dataPlaneRouting: undefined,
2158
- defaultLargeStagingDiskType: undefined,
2159
- ebsEncryption: undefined,
2160
- ebsEncryptionKeyArn: undefined,
2161
- name: undefined,
2162
- pitPolicy: undefined,
2163
- replicatedDisks: undefined,
2164
- replicationServerInstanceType: undefined,
2165
- replicationServersSecurityGroupsIDs: undefined,
2166
- sourceServerID: undefined,
2167
- stagingAreaSubnetId: undefined,
2168
- stagingAreaTags: undefined,
2169
- useDedicatedReplicationServer: undefined,
2170
- };
2082
+ });
2171
2083
  _a = __expectNonNull;
2172
2084
  _b = __expectObject;
2173
2085
  return [4, parseBody(output.body, context)];
2174
2086
  case 1:
2175
2087
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2176
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
2088
+ if (data.associateDefaultSecurityGroup != null) {
2177
2089
  contents.associateDefaultSecurityGroup = __expectBoolean(data.associateDefaultSecurityGroup);
2178
2090
  }
2179
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
2091
+ if (data.bandwidthThrottling != null) {
2180
2092
  contents.bandwidthThrottling = __expectLong(data.bandwidthThrottling);
2181
2093
  }
2182
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
2094
+ if (data.createPublicIP != null) {
2183
2095
  contents.createPublicIP = __expectBoolean(data.createPublicIP);
2184
2096
  }
2185
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
2097
+ if (data.dataPlaneRouting != null) {
2186
2098
  contents.dataPlaneRouting = __expectString(data.dataPlaneRouting);
2187
2099
  }
2188
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
2100
+ if (data.defaultLargeStagingDiskType != null) {
2189
2101
  contents.defaultLargeStagingDiskType = __expectString(data.defaultLargeStagingDiskType);
2190
2102
  }
2191
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
2103
+ if (data.ebsEncryption != null) {
2192
2104
  contents.ebsEncryption = __expectString(data.ebsEncryption);
2193
2105
  }
2194
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
2106
+ if (data.ebsEncryptionKeyArn != null) {
2195
2107
  contents.ebsEncryptionKeyArn = __expectString(data.ebsEncryptionKeyArn);
2196
2108
  }
2197
- if (data.name !== undefined && data.name !== null) {
2109
+ if (data.name != null) {
2198
2110
  contents.name = __expectString(data.name);
2199
2111
  }
2200
- if (data.pitPolicy !== undefined && data.pitPolicy !== null) {
2112
+ if (data.pitPolicy != null) {
2201
2113
  contents.pitPolicy = deserializeAws_restJson1PITPolicy(data.pitPolicy, context);
2202
2114
  }
2203
- if (data.replicatedDisks !== undefined && data.replicatedDisks !== null) {
2115
+ if (data.replicatedDisks != null) {
2204
2116
  contents.replicatedDisks = deserializeAws_restJson1ReplicationConfigurationReplicatedDisks(data.replicatedDisks, context);
2205
2117
  }
2206
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
2118
+ if (data.replicationServerInstanceType != null) {
2207
2119
  contents.replicationServerInstanceType = __expectString(data.replicationServerInstanceType);
2208
2120
  }
2209
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
2121
+ if (data.replicationServersSecurityGroupsIDs != null) {
2210
2122
  contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(data.replicationServersSecurityGroupsIDs, context);
2211
2123
  }
2212
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2124
+ if (data.sourceServerID != null) {
2213
2125
  contents.sourceServerID = __expectString(data.sourceServerID);
2214
2126
  }
2215
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
2127
+ if (data.stagingAreaSubnetId != null) {
2216
2128
  contents.stagingAreaSubnetId = __expectString(data.stagingAreaSubnetId);
2217
2129
  }
2218
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
2130
+ if (data.stagingAreaTags != null) {
2219
2131
  contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
2220
2132
  }
2221
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
2133
+ if (data.useDedicatedReplicationServer != null) {
2222
2134
  contents.useDedicatedReplicationServer = __expectBoolean(data.useDedicatedReplicationServer);
2223
2135
  }
2224
- return [2, Promise.resolve(contents)];
2136
+ return [2, contents];
2225
2137
  }
2226
2138
  });
2227
2139
  }); };
2228
2140
  var deserializeAws_restJson1GetReplicationConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2229
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2141
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2230
2142
  var _c;
2231
2143
  return __generator(this, function (_d) {
2232
2144
  switch (_d.label) {
@@ -2263,14 +2175,14 @@ var deserializeAws_restJson1GetReplicationConfigurationCommandError = function (
2263
2175
  case 11: throw _d.sent();
2264
2176
  case 12:
2265
2177
  parsedBody = parsedOutput.body;
2266
- $metadata = deserializeMetadata(output);
2267
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2268
- response = new __BaseException({
2269
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2270
- $fault: "client",
2271
- $metadata: $metadata,
2178
+ throwDefaultError({
2179
+ output: output,
2180
+ parsedBody: parsedBody,
2181
+ exceptionCtor: __BaseException,
2182
+ errorCode: errorCode,
2272
2183
  });
2273
- throw __decorateServiceException(response, parsedBody);
2184
+ _d.label = 13;
2185
+ case 13: return [2];
2274
2186
  }
2275
2187
  });
2276
2188
  }); };
@@ -2282,18 +2194,18 @@ export var deserializeAws_restJson1InitializeServiceCommand = function (output,
2282
2194
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2283
2195
  return [2, deserializeAws_restJson1InitializeServiceCommandError(output, context)];
2284
2196
  }
2285
- contents = {
2197
+ contents = map({
2286
2198
  $metadata: deserializeMetadata(output),
2287
- };
2199
+ });
2288
2200
  return [4, collectBody(output.body, context)];
2289
2201
  case 1:
2290
2202
  _a.sent();
2291
- return [2, Promise.resolve(contents)];
2203
+ return [2, contents];
2292
2204
  }
2293
2205
  });
2294
2206
  }); };
2295
2207
  var deserializeAws_restJson1InitializeServiceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2296
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2208
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2297
2209
  var _c;
2298
2210
  return __generator(this, function (_d) {
2299
2211
  switch (_d.label) {
@@ -2326,14 +2238,14 @@ var deserializeAws_restJson1InitializeServiceCommandError = function (output, co
2326
2238
  case 9: throw _d.sent();
2327
2239
  case 10:
2328
2240
  parsedBody = parsedOutput.body;
2329
- $metadata = deserializeMetadata(output);
2330
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2331
- response = new __BaseException({
2332
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2333
- $fault: "client",
2334
- $metadata: $metadata,
2241
+ throwDefaultError({
2242
+ output: output,
2243
+ parsedBody: parsedBody,
2244
+ exceptionCtor: __BaseException,
2245
+ errorCode: errorCode,
2335
2246
  });
2336
- throw __decorateServiceException(response, parsedBody);
2247
+ _d.label = 11;
2248
+ case 11: return [2];
2337
2249
  }
2338
2250
  });
2339
2251
  }); };
@@ -2345,28 +2257,26 @@ export var deserializeAws_restJson1ListExtensibleSourceServersCommand = function
2345
2257
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2346
2258
  return [2, deserializeAws_restJson1ListExtensibleSourceServersCommandError(output, context)];
2347
2259
  }
2348
- contents = {
2260
+ contents = map({
2349
2261
  $metadata: deserializeMetadata(output),
2350
- items: undefined,
2351
- nextToken: undefined,
2352
- };
2262
+ });
2353
2263
  _a = __expectNonNull;
2354
2264
  _b = __expectObject;
2355
2265
  return [4, parseBody(output.body, context)];
2356
2266
  case 1:
2357
2267
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2358
- if (data.items !== undefined && data.items !== null) {
2268
+ if (data.items != null) {
2359
2269
  contents.items = deserializeAws_restJson1StagingSourceServersList(data.items, context);
2360
2270
  }
2361
- if (data.nextToken !== undefined && data.nextToken !== null) {
2271
+ if (data.nextToken != null) {
2362
2272
  contents.nextToken = __expectString(data.nextToken);
2363
2273
  }
2364
- return [2, Promise.resolve(contents)];
2274
+ return [2, contents];
2365
2275
  }
2366
2276
  });
2367
2277
  }); };
2368
2278
  var deserializeAws_restJson1ListExtensibleSourceServersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2369
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2279
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2370
2280
  var _c;
2371
2281
  return __generator(this, function (_d) {
2372
2282
  switch (_d.label) {
@@ -2403,14 +2313,14 @@ var deserializeAws_restJson1ListExtensibleSourceServersCommandError = function (
2403
2313
  case 11: throw _d.sent();
2404
2314
  case 12:
2405
2315
  parsedBody = parsedOutput.body;
2406
- $metadata = deserializeMetadata(output);
2407
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2408
- response = new __BaseException({
2409
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2410
- $fault: "client",
2411
- $metadata: $metadata,
2316
+ throwDefaultError({
2317
+ output: output,
2318
+ parsedBody: parsedBody,
2319
+ exceptionCtor: __BaseException,
2320
+ errorCode: errorCode,
2412
2321
  });
2413
- throw __decorateServiceException(response, parsedBody);
2322
+ _d.label = 13;
2323
+ case 13: return [2];
2414
2324
  }
2415
2325
  });
2416
2326
  }); };
@@ -2422,28 +2332,26 @@ export var deserializeAws_restJson1ListStagingAccountsCommand = function (output
2422
2332
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2423
2333
  return [2, deserializeAws_restJson1ListStagingAccountsCommandError(output, context)];
2424
2334
  }
2425
- contents = {
2335
+ contents = map({
2426
2336
  $metadata: deserializeMetadata(output),
2427
- accounts: undefined,
2428
- nextToken: undefined,
2429
- };
2337
+ });
2430
2338
  _a = __expectNonNull;
2431
2339
  _b = __expectObject;
2432
2340
  return [4, parseBody(output.body, context)];
2433
2341
  case 1:
2434
2342
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2435
- if (data.accounts !== undefined && data.accounts !== null) {
2343
+ if (data.accounts != null) {
2436
2344
  contents.accounts = deserializeAws_restJson1Accounts(data.accounts, context);
2437
2345
  }
2438
- if (data.nextToken !== undefined && data.nextToken !== null) {
2346
+ if (data.nextToken != null) {
2439
2347
  contents.nextToken = __expectString(data.nextToken);
2440
2348
  }
2441
- return [2, Promise.resolve(contents)];
2349
+ return [2, contents];
2442
2350
  }
2443
2351
  });
2444
2352
  }); };
2445
2353
  var deserializeAws_restJson1ListStagingAccountsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2446
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2354
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2447
2355
  var _c;
2448
2356
  return __generator(this, function (_d) {
2449
2357
  switch (_d.label) {
@@ -2480,14 +2388,14 @@ var deserializeAws_restJson1ListStagingAccountsCommandError = function (output,
2480
2388
  case 11: throw _d.sent();
2481
2389
  case 12:
2482
2390
  parsedBody = parsedOutput.body;
2483
- $metadata = deserializeMetadata(output);
2484
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2485
- response = new __BaseException({
2486
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2487
- $fault: "client",
2488
- $metadata: $metadata,
2391
+ throwDefaultError({
2392
+ output: output,
2393
+ parsedBody: parsedBody,
2394
+ exceptionCtor: __BaseException,
2395
+ errorCode: errorCode,
2489
2396
  });
2490
- throw __decorateServiceException(response, parsedBody);
2397
+ _d.label = 13;
2398
+ case 13: return [2];
2491
2399
  }
2492
2400
  });
2493
2401
  }); };
@@ -2499,24 +2407,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
2499
2407
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2500
2408
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
2501
2409
  }
2502
- contents = {
2410
+ contents = map({
2503
2411
  $metadata: deserializeMetadata(output),
2504
- tags: undefined,
2505
- };
2412
+ });
2506
2413
  _a = __expectNonNull;
2507
2414
  _b = __expectObject;
2508
2415
  return [4, parseBody(output.body, context)];
2509
2416
  case 1:
2510
2417
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2511
- if (data.tags !== undefined && data.tags !== null) {
2418
+ if (data.tags != null) {
2512
2419
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2513
2420
  }
2514
- return [2, Promise.resolve(contents)];
2421
+ return [2, contents];
2515
2422
  }
2516
2423
  });
2517
2424
  }); };
2518
2425
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2519
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2426
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2520
2427
  var _c;
2521
2428
  return __generator(this, function (_d) {
2522
2429
  switch (_d.label) {
@@ -2553,14 +2460,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
2553
2460
  case 11: throw _d.sent();
2554
2461
  case 12:
2555
2462
  parsedBody = parsedOutput.body;
2556
- $metadata = deserializeMetadata(output);
2557
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2558
- response = new __BaseException({
2559
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2560
- $fault: "client",
2561
- $metadata: $metadata,
2463
+ throwDefaultError({
2464
+ output: output,
2465
+ parsedBody: parsedBody,
2466
+ exceptionCtor: __BaseException,
2467
+ errorCode: errorCode,
2562
2468
  });
2563
- throw __decorateServiceException(response, parsedBody);
2469
+ _d.label = 13;
2470
+ case 13: return [2];
2564
2471
  }
2565
2472
  });
2566
2473
  }); };
@@ -2572,56 +2479,47 @@ export var deserializeAws_restJson1RetryDataReplicationCommand = function (outpu
2572
2479
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2573
2480
  return [2, deserializeAws_restJson1RetryDataReplicationCommandError(output, context)];
2574
2481
  }
2575
- contents = {
2482
+ contents = map({
2576
2483
  $metadata: deserializeMetadata(output),
2577
- arn: undefined,
2578
- dataReplicationInfo: undefined,
2579
- lastLaunchResult: undefined,
2580
- lifeCycle: undefined,
2581
- recoveryInstanceId: undefined,
2582
- sourceProperties: undefined,
2583
- sourceServerID: undefined,
2584
- stagingArea: undefined,
2585
- tags: undefined,
2586
- };
2484
+ });
2587
2485
  _a = __expectNonNull;
2588
2486
  _b = __expectObject;
2589
2487
  return [4, parseBody(output.body, context)];
2590
2488
  case 1:
2591
2489
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2592
- if (data.arn !== undefined && data.arn !== null) {
2490
+ if (data.arn != null) {
2593
2491
  contents.arn = __expectString(data.arn);
2594
2492
  }
2595
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
2493
+ if (data.dataReplicationInfo != null) {
2596
2494
  contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
2597
2495
  }
2598
- if (data.lastLaunchResult !== undefined && data.lastLaunchResult !== null) {
2496
+ if (data.lastLaunchResult != null) {
2599
2497
  contents.lastLaunchResult = __expectString(data.lastLaunchResult);
2600
2498
  }
2601
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
2499
+ if (data.lifeCycle != null) {
2602
2500
  contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
2603
2501
  }
2604
- if (data.recoveryInstanceId !== undefined && data.recoveryInstanceId !== null) {
2502
+ if (data.recoveryInstanceId != null) {
2605
2503
  contents.recoveryInstanceId = __expectString(data.recoveryInstanceId);
2606
2504
  }
2607
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
2505
+ if (data.sourceProperties != null) {
2608
2506
  contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
2609
2507
  }
2610
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2508
+ if (data.sourceServerID != null) {
2611
2509
  contents.sourceServerID = __expectString(data.sourceServerID);
2612
2510
  }
2613
- if (data.stagingArea !== undefined && data.stagingArea !== null) {
2511
+ if (data.stagingArea != null) {
2614
2512
  contents.stagingArea = deserializeAws_restJson1StagingArea(data.stagingArea, context);
2615
2513
  }
2616
- if (data.tags !== undefined && data.tags !== null) {
2514
+ if (data.tags != null) {
2617
2515
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2618
2516
  }
2619
- return [2, Promise.resolve(contents)];
2517
+ return [2, contents];
2620
2518
  }
2621
2519
  });
2622
2520
  }); };
2623
2521
  var deserializeAws_restJson1RetryDataReplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2624
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2522
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2625
2523
  var _c;
2626
2524
  return __generator(this, function (_d) {
2627
2525
  switch (_d.label) {
@@ -2658,14 +2556,14 @@ var deserializeAws_restJson1RetryDataReplicationCommandError = function (output,
2658
2556
  case 11: throw _d.sent();
2659
2557
  case 12:
2660
2558
  parsedBody = parsedOutput.body;
2661
- $metadata = deserializeMetadata(output);
2662
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2663
- response = new __BaseException({
2664
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2665
- $fault: "client",
2666
- $metadata: $metadata,
2559
+ throwDefaultError({
2560
+ output: output,
2561
+ parsedBody: parsedBody,
2562
+ exceptionCtor: __BaseException,
2563
+ errorCode: errorCode,
2667
2564
  });
2668
- throw __decorateServiceException(response, parsedBody);
2565
+ _d.label = 13;
2566
+ case 13: return [2];
2669
2567
  }
2670
2568
  });
2671
2569
  }); };
@@ -2677,24 +2575,23 @@ export var deserializeAws_restJson1StartFailbackLaunchCommand = function (output
2677
2575
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2678
2576
  return [2, deserializeAws_restJson1StartFailbackLaunchCommandError(output, context)];
2679
2577
  }
2680
- contents = {
2578
+ contents = map({
2681
2579
  $metadata: deserializeMetadata(output),
2682
- job: undefined,
2683
- };
2580
+ });
2684
2581
  _a = __expectNonNull;
2685
2582
  _b = __expectObject;
2686
2583
  return [4, parseBody(output.body, context)];
2687
2584
  case 1:
2688
2585
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2689
- if (data.job !== undefined && data.job !== null) {
2586
+ if (data.job != null) {
2690
2587
  contents.job = deserializeAws_restJson1Job(data.job, context);
2691
2588
  }
2692
- return [2, Promise.resolve(contents)];
2589
+ return [2, contents];
2693
2590
  }
2694
2591
  });
2695
2592
  }); };
2696
2593
  var deserializeAws_restJson1StartFailbackLaunchCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2697
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2594
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2698
2595
  var _c;
2699
2596
  return __generator(this, function (_d) {
2700
2597
  switch (_d.label) {
@@ -2735,14 +2632,14 @@ var deserializeAws_restJson1StartFailbackLaunchCommandError = function (output,
2735
2632
  case 13: throw _d.sent();
2736
2633
  case 14:
2737
2634
  parsedBody = parsedOutput.body;
2738
- $metadata = deserializeMetadata(output);
2739
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2740
- response = new __BaseException({
2741
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2742
- $fault: "client",
2743
- $metadata: $metadata,
2635
+ throwDefaultError({
2636
+ output: output,
2637
+ parsedBody: parsedBody,
2638
+ exceptionCtor: __BaseException,
2639
+ errorCode: errorCode,
2744
2640
  });
2745
- throw __decorateServiceException(response, parsedBody);
2641
+ _d.label = 15;
2642
+ case 15: return [2];
2746
2643
  }
2747
2644
  });
2748
2645
  }); };
@@ -2754,24 +2651,23 @@ export var deserializeAws_restJson1StartRecoveryCommand = function (output, cont
2754
2651
  if (output.statusCode !== 202 && output.statusCode >= 300) {
2755
2652
  return [2, deserializeAws_restJson1StartRecoveryCommandError(output, context)];
2756
2653
  }
2757
- contents = {
2654
+ contents = map({
2758
2655
  $metadata: deserializeMetadata(output),
2759
- job: undefined,
2760
- };
2656
+ });
2761
2657
  _a = __expectNonNull;
2762
2658
  _b = __expectObject;
2763
2659
  return [4, parseBody(output.body, context)];
2764
2660
  case 1:
2765
2661
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2766
- if (data.job !== undefined && data.job !== null) {
2662
+ if (data.job != null) {
2767
2663
  contents.job = deserializeAws_restJson1Job(data.job, context);
2768
2664
  }
2769
- return [2, Promise.resolve(contents)];
2665
+ return [2, contents];
2770
2666
  }
2771
2667
  });
2772
2668
  }); };
2773
2669
  var deserializeAws_restJson1StartRecoveryCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2774
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2670
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2775
2671
  var _c;
2776
2672
  return __generator(this, function (_d) {
2777
2673
  switch (_d.label) {
@@ -2808,14 +2704,14 @@ var deserializeAws_restJson1StartRecoveryCommandError = function (output, contex
2808
2704
  case 11: throw _d.sent();
2809
2705
  case 12:
2810
2706
  parsedBody = parsedOutput.body;
2811
- $metadata = deserializeMetadata(output);
2812
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2813
- response = new __BaseException({
2814
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2815
- $fault: "client",
2816
- $metadata: $metadata,
2707
+ throwDefaultError({
2708
+ output: output,
2709
+ parsedBody: parsedBody,
2710
+ exceptionCtor: __BaseException,
2711
+ errorCode: errorCode,
2817
2712
  });
2818
- throw __decorateServiceException(response, parsedBody);
2713
+ _d.label = 13;
2714
+ case 13: return [2];
2819
2715
  }
2820
2716
  });
2821
2717
  }); };
@@ -2827,18 +2723,18 @@ export var deserializeAws_restJson1StopFailbackCommand = function (output, conte
2827
2723
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2828
2724
  return [2, deserializeAws_restJson1StopFailbackCommandError(output, context)];
2829
2725
  }
2830
- contents = {
2726
+ contents = map({
2831
2727
  $metadata: deserializeMetadata(output),
2832
- };
2728
+ });
2833
2729
  return [4, collectBody(output.body, context)];
2834
2730
  case 1:
2835
2731
  _a.sent();
2836
- return [2, Promise.resolve(contents)];
2732
+ return [2, contents];
2837
2733
  }
2838
2734
  });
2839
2735
  }); };
2840
2736
  var deserializeAws_restJson1StopFailbackCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2841
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2737
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2842
2738
  var _c;
2843
2739
  return __generator(this, function (_d) {
2844
2740
  switch (_d.label) {
@@ -2871,14 +2767,14 @@ var deserializeAws_restJson1StopFailbackCommandError = function (output, context
2871
2767
  case 9: throw _d.sent();
2872
2768
  case 10:
2873
2769
  parsedBody = parsedOutput.body;
2874
- $metadata = deserializeMetadata(output);
2875
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2876
- response = new __BaseException({
2877
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2878
- $fault: "client",
2879
- $metadata: $metadata,
2770
+ throwDefaultError({
2771
+ output: output,
2772
+ parsedBody: parsedBody,
2773
+ exceptionCtor: __BaseException,
2774
+ errorCode: errorCode,
2880
2775
  });
2881
- throw __decorateServiceException(response, parsedBody);
2776
+ _d.label = 11;
2777
+ case 11: return [2];
2882
2778
  }
2883
2779
  });
2884
2780
  }); };
@@ -2890,18 +2786,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
2890
2786
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2891
2787
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
2892
2788
  }
2893
- contents = {
2789
+ contents = map({
2894
2790
  $metadata: deserializeMetadata(output),
2895
- };
2791
+ });
2896
2792
  return [4, collectBody(output.body, context)];
2897
2793
  case 1:
2898
2794
  _a.sent();
2899
- return [2, Promise.resolve(contents)];
2795
+ return [2, contents];
2900
2796
  }
2901
2797
  });
2902
2798
  }); };
2903
2799
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2904
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2800
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2905
2801
  var _c;
2906
2802
  return __generator(this, function (_d) {
2907
2803
  switch (_d.label) {
@@ -2938,14 +2834,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
2938
2834
  case 11: throw _d.sent();
2939
2835
  case 12:
2940
2836
  parsedBody = parsedOutput.body;
2941
- $metadata = deserializeMetadata(output);
2942
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2943
- response = new __BaseException({
2944
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2945
- $fault: "client",
2946
- $metadata: $metadata,
2837
+ throwDefaultError({
2838
+ output: output,
2839
+ parsedBody: parsedBody,
2840
+ exceptionCtor: __BaseException,
2841
+ errorCode: errorCode,
2947
2842
  });
2948
- throw __decorateServiceException(response, parsedBody);
2843
+ _d.label = 13;
2844
+ case 13: return [2];
2949
2845
  }
2950
2846
  });
2951
2847
  }); };
@@ -2957,24 +2853,23 @@ export var deserializeAws_restJson1TerminateRecoveryInstancesCommand = function
2957
2853
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2958
2854
  return [2, deserializeAws_restJson1TerminateRecoveryInstancesCommandError(output, context)];
2959
2855
  }
2960
- contents = {
2856
+ contents = map({
2961
2857
  $metadata: deserializeMetadata(output),
2962
- job: undefined,
2963
- };
2858
+ });
2964
2859
  _a = __expectNonNull;
2965
2860
  _b = __expectObject;
2966
2861
  return [4, parseBody(output.body, context)];
2967
2862
  case 1:
2968
2863
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
2969
- if (data.job !== undefined && data.job !== null) {
2864
+ if (data.job != null) {
2970
2865
  contents.job = deserializeAws_restJson1Job(data.job, context);
2971
2866
  }
2972
- return [2, Promise.resolve(contents)];
2867
+ return [2, contents];
2973
2868
  }
2974
2869
  });
2975
2870
  }); };
2976
2871
  var deserializeAws_restJson1TerminateRecoveryInstancesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2977
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2872
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2978
2873
  var _c;
2979
2874
  return __generator(this, function (_d) {
2980
2875
  switch (_d.label) {
@@ -3011,14 +2906,14 @@ var deserializeAws_restJson1TerminateRecoveryInstancesCommandError = function (o
3011
2906
  case 11: throw _d.sent();
3012
2907
  case 12:
3013
2908
  parsedBody = parsedOutput.body;
3014
- $metadata = deserializeMetadata(output);
3015
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3016
- response = new __BaseException({
3017
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3018
- $fault: "client",
3019
- $metadata: $metadata,
2909
+ throwDefaultError({
2910
+ output: output,
2911
+ parsedBody: parsedBody,
2912
+ exceptionCtor: __BaseException,
2913
+ errorCode: errorCode,
3020
2914
  });
3021
- throw __decorateServiceException(response, parsedBody);
2915
+ _d.label = 13;
2916
+ case 13: return [2];
3022
2917
  }
3023
2918
  });
3024
2919
  }); };
@@ -3030,18 +2925,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
3030
2925
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3031
2926
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
3032
2927
  }
3033
- contents = {
2928
+ contents = map({
3034
2929
  $metadata: deserializeMetadata(output),
3035
- };
2930
+ });
3036
2931
  return [4, collectBody(output.body, context)];
3037
2932
  case 1:
3038
2933
  _a.sent();
3039
- return [2, Promise.resolve(contents)];
2934
+ return [2, contents];
3040
2935
  }
3041
2936
  });
3042
2937
  }); };
3043
2938
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3044
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2939
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3045
2940
  var _c;
3046
2941
  return __generator(this, function (_d) {
3047
2942
  switch (_d.label) {
@@ -3078,14 +2973,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
3078
2973
  case 11: throw _d.sent();
3079
2974
  case 12:
3080
2975
  parsedBody = parsedOutput.body;
3081
- $metadata = deserializeMetadata(output);
3082
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3083
- response = new __BaseException({
3084
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3085
- $fault: "client",
3086
- $metadata: $metadata,
2976
+ throwDefaultError({
2977
+ output: output,
2978
+ parsedBody: parsedBody,
2979
+ exceptionCtor: __BaseException,
2980
+ errorCode: errorCode,
3087
2981
  });
3088
- throw __decorateServiceException(response, parsedBody);
2982
+ _d.label = 13;
2983
+ case 13: return [2];
3089
2984
  }
3090
2985
  });
3091
2986
  }); };
@@ -3097,18 +2992,18 @@ export var deserializeAws_restJson1UpdateFailbackReplicationConfigurationCommand
3097
2992
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3098
2993
  return [2, deserializeAws_restJson1UpdateFailbackReplicationConfigurationCommandError(output, context)];
3099
2994
  }
3100
- contents = {
2995
+ contents = map({
3101
2996
  $metadata: deserializeMetadata(output),
3102
- };
2997
+ });
3103
2998
  return [4, collectBody(output.body, context)];
3104
2999
  case 1:
3105
3000
  _a.sent();
3106
- return [2, Promise.resolve(contents)];
3001
+ return [2, contents];
3107
3002
  }
3108
3003
  });
3109
3004
  }); };
3110
3005
  var deserializeAws_restJson1UpdateFailbackReplicationConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3111
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3006
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3112
3007
  var _c;
3113
3008
  return __generator(this, function (_d) {
3114
3009
  switch (_d.label) {
@@ -3145,14 +3040,14 @@ var deserializeAws_restJson1UpdateFailbackReplicationConfigurationCommandError =
3145
3040
  case 11: throw _d.sent();
3146
3041
  case 12:
3147
3042
  parsedBody = parsedOutput.body;
3148
- $metadata = deserializeMetadata(output);
3149
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3150
- response = new __BaseException({
3151
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3152
- $fault: "client",
3153
- $metadata: $metadata,
3043
+ throwDefaultError({
3044
+ output: output,
3045
+ parsedBody: parsedBody,
3046
+ exceptionCtor: __BaseException,
3047
+ errorCode: errorCode,
3154
3048
  });
3155
- throw __decorateServiceException(response, parsedBody);
3049
+ _d.label = 13;
3050
+ case 13: return [2];
3156
3051
  }
3157
3052
  });
3158
3053
  }); };
@@ -3164,52 +3059,44 @@ export var deserializeAws_restJson1UpdateLaunchConfigurationCommand = function (
3164
3059
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3165
3060
  return [2, deserializeAws_restJson1UpdateLaunchConfigurationCommandError(output, context)];
3166
3061
  }
3167
- contents = {
3062
+ contents = map({
3168
3063
  $metadata: deserializeMetadata(output),
3169
- copyPrivateIp: undefined,
3170
- copyTags: undefined,
3171
- ec2LaunchTemplateID: undefined,
3172
- launchDisposition: undefined,
3173
- licensing: undefined,
3174
- name: undefined,
3175
- sourceServerID: undefined,
3176
- targetInstanceTypeRightSizingMethod: undefined,
3177
- };
3064
+ });
3178
3065
  _a = __expectNonNull;
3179
3066
  _b = __expectObject;
3180
3067
  return [4, parseBody(output.body, context)];
3181
3068
  case 1:
3182
3069
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3183
- if (data.copyPrivateIp !== undefined && data.copyPrivateIp !== null) {
3070
+ if (data.copyPrivateIp != null) {
3184
3071
  contents.copyPrivateIp = __expectBoolean(data.copyPrivateIp);
3185
3072
  }
3186
- if (data.copyTags !== undefined && data.copyTags !== null) {
3073
+ if (data.copyTags != null) {
3187
3074
  contents.copyTags = __expectBoolean(data.copyTags);
3188
3075
  }
3189
- if (data.ec2LaunchTemplateID !== undefined && data.ec2LaunchTemplateID !== null) {
3076
+ if (data.ec2LaunchTemplateID != null) {
3190
3077
  contents.ec2LaunchTemplateID = __expectString(data.ec2LaunchTemplateID);
3191
3078
  }
3192
- if (data.launchDisposition !== undefined && data.launchDisposition !== null) {
3079
+ if (data.launchDisposition != null) {
3193
3080
  contents.launchDisposition = __expectString(data.launchDisposition);
3194
3081
  }
3195
- if (data.licensing !== undefined && data.licensing !== null) {
3082
+ if (data.licensing != null) {
3196
3083
  contents.licensing = deserializeAws_restJson1Licensing(data.licensing, context);
3197
3084
  }
3198
- if (data.name !== undefined && data.name !== null) {
3085
+ if (data.name != null) {
3199
3086
  contents.name = __expectString(data.name);
3200
3087
  }
3201
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
3088
+ if (data.sourceServerID != null) {
3202
3089
  contents.sourceServerID = __expectString(data.sourceServerID);
3203
3090
  }
3204
- if (data.targetInstanceTypeRightSizingMethod !== undefined && data.targetInstanceTypeRightSizingMethod !== null) {
3091
+ if (data.targetInstanceTypeRightSizingMethod != null) {
3205
3092
  contents.targetInstanceTypeRightSizingMethod = __expectString(data.targetInstanceTypeRightSizingMethod);
3206
3093
  }
3207
- return [2, Promise.resolve(contents)];
3094
+ return [2, contents];
3208
3095
  }
3209
3096
  });
3210
3097
  }); };
3211
3098
  var deserializeAws_restJson1UpdateLaunchConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3212
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3099
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3213
3100
  var _c;
3214
3101
  return __generator(this, function (_d) {
3215
3102
  switch (_d.label) {
@@ -3250,14 +3137,14 @@ var deserializeAws_restJson1UpdateLaunchConfigurationCommandError = function (ou
3250
3137
  case 13: throw _d.sent();
3251
3138
  case 14:
3252
3139
  parsedBody = parsedOutput.body;
3253
- $metadata = deserializeMetadata(output);
3254
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3255
- response = new __BaseException({
3256
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3257
- $fault: "client",
3258
- $metadata: $metadata,
3140
+ throwDefaultError({
3141
+ output: output,
3142
+ parsedBody: parsedBody,
3143
+ exceptionCtor: __BaseException,
3144
+ errorCode: errorCode,
3259
3145
  });
3260
- throw __decorateServiceException(response, parsedBody);
3146
+ _d.label = 15;
3147
+ case 15: return [2];
3261
3148
  }
3262
3149
  });
3263
3150
  }); };
@@ -3269,84 +3156,68 @@ export var deserializeAws_restJson1UpdateReplicationConfigurationCommand = funct
3269
3156
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3270
3157
  return [2, deserializeAws_restJson1UpdateReplicationConfigurationCommandError(output, context)];
3271
3158
  }
3272
- contents = {
3159
+ contents = map({
3273
3160
  $metadata: deserializeMetadata(output),
3274
- associateDefaultSecurityGroup: undefined,
3275
- bandwidthThrottling: undefined,
3276
- createPublicIP: undefined,
3277
- dataPlaneRouting: undefined,
3278
- defaultLargeStagingDiskType: undefined,
3279
- ebsEncryption: undefined,
3280
- ebsEncryptionKeyArn: undefined,
3281
- name: undefined,
3282
- pitPolicy: undefined,
3283
- replicatedDisks: undefined,
3284
- replicationServerInstanceType: undefined,
3285
- replicationServersSecurityGroupsIDs: undefined,
3286
- sourceServerID: undefined,
3287
- stagingAreaSubnetId: undefined,
3288
- stagingAreaTags: undefined,
3289
- useDedicatedReplicationServer: undefined,
3290
- };
3161
+ });
3291
3162
  _a = __expectNonNull;
3292
3163
  _b = __expectObject;
3293
3164
  return [4, parseBody(output.body, context)];
3294
3165
  case 1:
3295
3166
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3296
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
3167
+ if (data.associateDefaultSecurityGroup != null) {
3297
3168
  contents.associateDefaultSecurityGroup = __expectBoolean(data.associateDefaultSecurityGroup);
3298
3169
  }
3299
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
3170
+ if (data.bandwidthThrottling != null) {
3300
3171
  contents.bandwidthThrottling = __expectLong(data.bandwidthThrottling);
3301
3172
  }
3302
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
3173
+ if (data.createPublicIP != null) {
3303
3174
  contents.createPublicIP = __expectBoolean(data.createPublicIP);
3304
3175
  }
3305
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
3176
+ if (data.dataPlaneRouting != null) {
3306
3177
  contents.dataPlaneRouting = __expectString(data.dataPlaneRouting);
3307
3178
  }
3308
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
3179
+ if (data.defaultLargeStagingDiskType != null) {
3309
3180
  contents.defaultLargeStagingDiskType = __expectString(data.defaultLargeStagingDiskType);
3310
3181
  }
3311
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
3182
+ if (data.ebsEncryption != null) {
3312
3183
  contents.ebsEncryption = __expectString(data.ebsEncryption);
3313
3184
  }
3314
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
3185
+ if (data.ebsEncryptionKeyArn != null) {
3315
3186
  contents.ebsEncryptionKeyArn = __expectString(data.ebsEncryptionKeyArn);
3316
3187
  }
3317
- if (data.name !== undefined && data.name !== null) {
3188
+ if (data.name != null) {
3318
3189
  contents.name = __expectString(data.name);
3319
3190
  }
3320
- if (data.pitPolicy !== undefined && data.pitPolicy !== null) {
3191
+ if (data.pitPolicy != null) {
3321
3192
  contents.pitPolicy = deserializeAws_restJson1PITPolicy(data.pitPolicy, context);
3322
3193
  }
3323
- if (data.replicatedDisks !== undefined && data.replicatedDisks !== null) {
3194
+ if (data.replicatedDisks != null) {
3324
3195
  contents.replicatedDisks = deserializeAws_restJson1ReplicationConfigurationReplicatedDisks(data.replicatedDisks, context);
3325
3196
  }
3326
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
3197
+ if (data.replicationServerInstanceType != null) {
3327
3198
  contents.replicationServerInstanceType = __expectString(data.replicationServerInstanceType);
3328
3199
  }
3329
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
3200
+ if (data.replicationServersSecurityGroupsIDs != null) {
3330
3201
  contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(data.replicationServersSecurityGroupsIDs, context);
3331
3202
  }
3332
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
3203
+ if (data.sourceServerID != null) {
3333
3204
  contents.sourceServerID = __expectString(data.sourceServerID);
3334
3205
  }
3335
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
3206
+ if (data.stagingAreaSubnetId != null) {
3336
3207
  contents.stagingAreaSubnetId = __expectString(data.stagingAreaSubnetId);
3337
3208
  }
3338
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
3209
+ if (data.stagingAreaTags != null) {
3339
3210
  contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
3340
3211
  }
3341
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
3212
+ if (data.useDedicatedReplicationServer != null) {
3342
3213
  contents.useDedicatedReplicationServer = __expectBoolean(data.useDedicatedReplicationServer);
3343
3214
  }
3344
- return [2, Promise.resolve(contents)];
3215
+ return [2, contents];
3345
3216
  }
3346
3217
  });
3347
3218
  }); };
3348
3219
  var deserializeAws_restJson1UpdateReplicationConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3349
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3220
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3350
3221
  var _c;
3351
3222
  return __generator(this, function (_d) {
3352
3223
  switch (_d.label) {
@@ -3391,14 +3262,14 @@ var deserializeAws_restJson1UpdateReplicationConfigurationCommandError = functio
3391
3262
  case 15: throw _d.sent();
3392
3263
  case 16:
3393
3264
  parsedBody = parsedOutput.body;
3394
- $metadata = deserializeMetadata(output);
3395
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3396
- response = new __BaseException({
3397
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3398
- $fault: "client",
3399
- $metadata: $metadata,
3265
+ throwDefaultError({
3266
+ output: output,
3267
+ parsedBody: parsedBody,
3268
+ exceptionCtor: __BaseException,
3269
+ errorCode: errorCode,
3400
3270
  });
3401
- throw __decorateServiceException(response, parsedBody);
3271
+ _d.label = 17;
3272
+ case 17: return [2];
3402
3273
  }
3403
3274
  });
3404
3275
  }); };
@@ -3410,84 +3281,68 @@ export var deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommand
3410
3281
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3411
3282
  return [2, deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError(output, context)];
3412
3283
  }
3413
- contents = {
3284
+ contents = map({
3414
3285
  $metadata: deserializeMetadata(output),
3415
- arn: undefined,
3416
- associateDefaultSecurityGroup: undefined,
3417
- bandwidthThrottling: undefined,
3418
- createPublicIP: undefined,
3419
- dataPlaneRouting: undefined,
3420
- defaultLargeStagingDiskType: undefined,
3421
- ebsEncryption: undefined,
3422
- ebsEncryptionKeyArn: undefined,
3423
- pitPolicy: undefined,
3424
- replicationConfigurationTemplateID: undefined,
3425
- replicationServerInstanceType: undefined,
3426
- replicationServersSecurityGroupsIDs: undefined,
3427
- stagingAreaSubnetId: undefined,
3428
- stagingAreaTags: undefined,
3429
- tags: undefined,
3430
- useDedicatedReplicationServer: undefined,
3431
- };
3286
+ });
3432
3287
  _a = __expectNonNull;
3433
3288
  _b = __expectObject;
3434
3289
  return [4, parseBody(output.body, context)];
3435
3290
  case 1:
3436
3291
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3437
- if (data.arn !== undefined && data.arn !== null) {
3292
+ if (data.arn != null) {
3438
3293
  contents.arn = __expectString(data.arn);
3439
3294
  }
3440
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
3295
+ if (data.associateDefaultSecurityGroup != null) {
3441
3296
  contents.associateDefaultSecurityGroup = __expectBoolean(data.associateDefaultSecurityGroup);
3442
3297
  }
3443
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
3298
+ if (data.bandwidthThrottling != null) {
3444
3299
  contents.bandwidthThrottling = __expectLong(data.bandwidthThrottling);
3445
3300
  }
3446
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
3301
+ if (data.createPublicIP != null) {
3447
3302
  contents.createPublicIP = __expectBoolean(data.createPublicIP);
3448
3303
  }
3449
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
3304
+ if (data.dataPlaneRouting != null) {
3450
3305
  contents.dataPlaneRouting = __expectString(data.dataPlaneRouting);
3451
3306
  }
3452
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
3307
+ if (data.defaultLargeStagingDiskType != null) {
3453
3308
  contents.defaultLargeStagingDiskType = __expectString(data.defaultLargeStagingDiskType);
3454
3309
  }
3455
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
3310
+ if (data.ebsEncryption != null) {
3456
3311
  contents.ebsEncryption = __expectString(data.ebsEncryption);
3457
3312
  }
3458
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
3313
+ if (data.ebsEncryptionKeyArn != null) {
3459
3314
  contents.ebsEncryptionKeyArn = __expectString(data.ebsEncryptionKeyArn);
3460
3315
  }
3461
- if (data.pitPolicy !== undefined && data.pitPolicy !== null) {
3316
+ if (data.pitPolicy != null) {
3462
3317
  contents.pitPolicy = deserializeAws_restJson1PITPolicy(data.pitPolicy, context);
3463
3318
  }
3464
- if (data.replicationConfigurationTemplateID !== undefined && data.replicationConfigurationTemplateID !== null) {
3319
+ if (data.replicationConfigurationTemplateID != null) {
3465
3320
  contents.replicationConfigurationTemplateID = __expectString(data.replicationConfigurationTemplateID);
3466
3321
  }
3467
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
3322
+ if (data.replicationServerInstanceType != null) {
3468
3323
  contents.replicationServerInstanceType = __expectString(data.replicationServerInstanceType);
3469
3324
  }
3470
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
3325
+ if (data.replicationServersSecurityGroupsIDs != null) {
3471
3326
  contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(data.replicationServersSecurityGroupsIDs, context);
3472
3327
  }
3473
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
3328
+ if (data.stagingAreaSubnetId != null) {
3474
3329
  contents.stagingAreaSubnetId = __expectString(data.stagingAreaSubnetId);
3475
3330
  }
3476
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
3331
+ if (data.stagingAreaTags != null) {
3477
3332
  contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
3478
3333
  }
3479
- if (data.tags !== undefined && data.tags !== null) {
3334
+ if (data.tags != null) {
3480
3335
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
3481
3336
  }
3482
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
3337
+ if (data.useDedicatedReplicationServer != null) {
3483
3338
  contents.useDedicatedReplicationServer = __expectBoolean(data.useDedicatedReplicationServer);
3484
3339
  }
3485
- return [2, Promise.resolve(contents)];
3340
+ return [2, contents];
3486
3341
  }
3487
3342
  });
3488
3343
  }); };
3489
3344
  var deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3490
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3345
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3491
3346
  var _c;
3492
3347
  return __generator(this, function (_d) {
3493
3348
  switch (_d.label) {
@@ -3528,26 +3383,27 @@ var deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError =
3528
3383
  case 13: throw _d.sent();
3529
3384
  case 14:
3530
3385
  parsedBody = parsedOutput.body;
3531
- $metadata = deserializeMetadata(output);
3532
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3533
- response = new __BaseException({
3534
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3535
- $fault: "client",
3536
- $metadata: $metadata,
3386
+ throwDefaultError({
3387
+ output: output,
3388
+ parsedBody: parsedBody,
3389
+ exceptionCtor: __BaseException,
3390
+ errorCode: errorCode,
3537
3391
  });
3538
- throw __decorateServiceException(response, parsedBody);
3392
+ _d.label = 15;
3393
+ case 15: return [2];
3539
3394
  }
3540
3395
  });
3541
3396
  }); };
3397
+ var map = __map;
3542
3398
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3543
3399
  var contents, data, exception;
3544
3400
  return __generator(this, function (_a) {
3545
- contents = {};
3401
+ contents = map({});
3546
3402
  data = parsedOutput.body;
3547
- if (data.code !== undefined && data.code !== null) {
3403
+ if (data.code != null) {
3548
3404
  contents.code = __expectString(data.code);
3549
3405
  }
3550
- if (data.message !== undefined && data.message !== null) {
3406
+ if (data.message != null) {
3551
3407
  contents.message = __expectString(data.message);
3552
3408
  }
3553
3409
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3557,18 +3413,18 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
3557
3413
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3558
3414
  var contents, data, exception;
3559
3415
  return __generator(this, function (_a) {
3560
- contents = {};
3416
+ contents = map({});
3561
3417
  data = parsedOutput.body;
3562
- if (data.code !== undefined && data.code !== null) {
3418
+ if (data.code != null) {
3563
3419
  contents.code = __expectString(data.code);
3564
3420
  }
3565
- if (data.message !== undefined && data.message !== null) {
3421
+ if (data.message != null) {
3566
3422
  contents.message = __expectString(data.message);
3567
3423
  }
3568
- if (data.resourceId !== undefined && data.resourceId !== null) {
3424
+ if (data.resourceId != null) {
3569
3425
  contents.resourceId = __expectString(data.resourceId);
3570
3426
  }
3571
- if (data.resourceType !== undefined && data.resourceType !== null) {
3427
+ if (data.resourceType != null) {
3572
3428
  contents.resourceType = __expectString(data.resourceType);
3573
3429
  }
3574
3430
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3578,12 +3434,14 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
3578
3434
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3579
3435
  var contents, data, exception;
3580
3436
  return __generator(this, function (_a) {
3581
- contents = {};
3582
- if (parsedOutput.headers["retry-after"] !== undefined) {
3583
- contents.retryAfterSeconds = __strictParseLong(parsedOutput.headers["retry-after"]);
3584
- }
3437
+ contents = map({
3438
+ retryAfterSeconds: [
3439
+ function () { return void 0 !== parsedOutput.headers["retry-after"]; },
3440
+ function () { return __strictParseLong(parsedOutput.headers["retry-after"]); },
3441
+ ],
3442
+ });
3585
3443
  data = parsedOutput.body;
3586
- if (data.message !== undefined && data.message !== null) {
3444
+ if (data.message != null) {
3587
3445
  contents.message = __expectString(data.message);
3588
3446
  }
3589
3447
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3593,18 +3451,18 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
3593
3451
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3594
3452
  var contents, data, exception;
3595
3453
  return __generator(this, function (_a) {
3596
- contents = {};
3454
+ contents = map({});
3597
3455
  data = parsedOutput.body;
3598
- if (data.code !== undefined && data.code !== null) {
3456
+ if (data.code != null) {
3599
3457
  contents.code = __expectString(data.code);
3600
3458
  }
3601
- if (data.message !== undefined && data.message !== null) {
3459
+ if (data.message != null) {
3602
3460
  contents.message = __expectString(data.message);
3603
3461
  }
3604
- if (data.resourceId !== undefined && data.resourceId !== null) {
3462
+ if (data.resourceId != null) {
3605
3463
  contents.resourceId = __expectString(data.resourceId);
3606
3464
  }
3607
- if (data.resourceType !== undefined && data.resourceType !== null) {
3465
+ if (data.resourceType != null) {
3608
3466
  contents.resourceType = __expectString(data.resourceType);
3609
3467
  }
3610
3468
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3614,24 +3472,24 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
3614
3472
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3615
3473
  var contents, data, exception;
3616
3474
  return __generator(this, function (_a) {
3617
- contents = {};
3475
+ contents = map({});
3618
3476
  data = parsedOutput.body;
3619
- if (data.code !== undefined && data.code !== null) {
3477
+ if (data.code != null) {
3620
3478
  contents.code = __expectString(data.code);
3621
3479
  }
3622
- if (data.message !== undefined && data.message !== null) {
3480
+ if (data.message != null) {
3623
3481
  contents.message = __expectString(data.message);
3624
3482
  }
3625
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
3483
+ if (data.quotaCode != null) {
3626
3484
  contents.quotaCode = __expectString(data.quotaCode);
3627
3485
  }
3628
- if (data.resourceId !== undefined && data.resourceId !== null) {
3486
+ if (data.resourceId != null) {
3629
3487
  contents.resourceId = __expectString(data.resourceId);
3630
3488
  }
3631
- if (data.resourceType !== undefined && data.resourceType !== null) {
3489
+ if (data.resourceType != null) {
3632
3490
  contents.resourceType = __expectString(data.resourceType);
3633
3491
  }
3634
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
3492
+ if (data.serviceCode != null) {
3635
3493
  contents.serviceCode = __expectString(data.serviceCode);
3636
3494
  }
3637
3495
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3641,18 +3499,17 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
3641
3499
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3642
3500
  var contents, data, exception;
3643
3501
  return __generator(this, function (_a) {
3644
- contents = {};
3645
- if (parsedOutput.headers["retry-after"] !== undefined) {
3646
- contents.retryAfterSeconds = parsedOutput.headers["retry-after"];
3647
- }
3502
+ contents = map({
3503
+ retryAfterSeconds: [, parsedOutput.headers["retry-after"]],
3504
+ });
3648
3505
  data = parsedOutput.body;
3649
- if (data.message !== undefined && data.message !== null) {
3506
+ if (data.message != null) {
3650
3507
  contents.message = __expectString(data.message);
3651
3508
  }
3652
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
3509
+ if (data.quotaCode != null) {
3653
3510
  contents.quotaCode = __expectString(data.quotaCode);
3654
3511
  }
3655
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
3512
+ if (data.serviceCode != null) {
3656
3513
  contents.serviceCode = __expectString(data.serviceCode);
3657
3514
  }
3658
3515
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3662,12 +3519,12 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
3662
3519
  var deserializeAws_restJson1UninitializedAccountExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3663
3520
  var contents, data, exception;
3664
3521
  return __generator(this, function (_a) {
3665
- contents = {};
3522
+ contents = map({});
3666
3523
  data = parsedOutput.body;
3667
- if (data.code !== undefined && data.code !== null) {
3524
+ if (data.code != null) {
3668
3525
  contents.code = __expectString(data.code);
3669
3526
  }
3670
- if (data.message !== undefined && data.message !== null) {
3527
+ if (data.message != null) {
3671
3528
  contents.message = __expectString(data.message);
3672
3529
  }
3673
3530
  exception = new UninitializedAccountException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3677,18 +3534,18 @@ var deserializeAws_restJson1UninitializedAccountExceptionResponse = function (pa
3677
3534
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
3678
3535
  var contents, data, exception;
3679
3536
  return __generator(this, function (_a) {
3680
- contents = {};
3537
+ contents = map({});
3681
3538
  data = parsedOutput.body;
3682
- if (data.code !== undefined && data.code !== null) {
3539
+ if (data.code != null) {
3683
3540
  contents.code = __expectString(data.code);
3684
3541
  }
3685
- if (data.fieldList !== undefined && data.fieldList !== null) {
3542
+ if (data.fieldList != null) {
3686
3543
  contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
3687
3544
  }
3688
- if (data.message !== undefined && data.message !== null) {
3545
+ if (data.message != null) {
3689
3546
  contents.message = __expectString(data.message);
3690
3547
  }
3691
- if (data.reason !== undefined && data.reason !== null) {
3548
+ if (data.reason != null) {
3692
3549
  contents.reason = __expectString(data.reason);
3693
3550
  }
3694
3551
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -3699,9 +3556,6 @@ var serializeAws_restJson1AccountIDs = function (input, context) {
3699
3556
  return input
3700
3557
  .filter(function (e) { return e != null; })
3701
3558
  .map(function (entry) {
3702
- if (entry === null) {
3703
- return null;
3704
- }
3705
3559
  return entry;
3706
3560
  });
3707
3561
  };
@@ -3714,9 +3568,6 @@ var serializeAws_restJson1DescribeJobsRequestFiltersJobIDs = function (input, co
3714
3568
  return input
3715
3569
  .filter(function (e) { return e != null; })
3716
3570
  .map(function (entry) {
3717
- if (entry === null) {
3718
- return null;
3719
- }
3720
3571
  return entry;
3721
3572
  });
3722
3573
  };
@@ -3741,9 +3592,6 @@ var serializeAws_restJson1DescribeSourceServersRequestFiltersIDs = function (inp
3741
3592
  return input
3742
3593
  .filter(function (e) { return e != null; })
3743
3594
  .map(function (entry) {
3744
- if (entry === null) {
3745
- return null;
3746
- }
3747
3595
  return entry;
3748
3596
  });
3749
3597
  };
@@ -3754,9 +3602,6 @@ var serializeAws_restJson1PITPolicy = function (input, context) {
3754
3602
  return input
3755
3603
  .filter(function (e) { return e != null; })
3756
3604
  .map(function (entry) {
3757
- if (entry === null) {
3758
- return null;
3759
- }
3760
3605
  return serializeAws_restJson1PITPolicyRule(entry, context);
3761
3606
  });
3762
3607
  };
@@ -3767,9 +3612,6 @@ var serializeAws_restJson1RecoveryInstanceIDs = function (input, context) {
3767
3612
  return input
3768
3613
  .filter(function (e) { return e != null; })
3769
3614
  .map(function (entry) {
3770
- if (entry === null) {
3771
- return null;
3772
- }
3773
3615
  return entry;
3774
3616
  });
3775
3617
  };
@@ -3777,9 +3619,6 @@ var serializeAws_restJson1RecoveryInstancesForTerminationRequest = function (inp
3777
3619
  return input
3778
3620
  .filter(function (e) { return e != null; })
3779
3621
  .map(function (entry) {
3780
- if (entry === null) {
3781
- return null;
3782
- }
3783
3622
  return entry;
3784
3623
  });
3785
3624
  };
@@ -3790,9 +3629,6 @@ var serializeAws_restJson1ReplicationConfigurationReplicatedDisks = function (in
3790
3629
  return input
3791
3630
  .filter(function (e) { return e != null; })
3792
3631
  .map(function (entry) {
3793
- if (entry === null) {
3794
- return null;
3795
- }
3796
3632
  return serializeAws_restJson1ReplicationConfigurationReplicatedDisk(entry, context);
3797
3633
  });
3798
3634
  };
@@ -3800,9 +3636,6 @@ var serializeAws_restJson1ReplicationConfigurationTemplateIDs = function (input,
3800
3636
  return input
3801
3637
  .filter(function (e) { return e != null; })
3802
3638
  .map(function (entry) {
3803
- if (entry === null) {
3804
- return null;
3805
- }
3806
3639
  return entry;
3807
3640
  });
3808
3641
  };
@@ -3810,9 +3643,6 @@ var serializeAws_restJson1ReplicationServersSecurityGroupsIDs = function (input,
3810
3643
  return input
3811
3644
  .filter(function (e) { return e != null; })
3812
3645
  .map(function (entry) {
3813
- if (entry === null) {
3814
- return null;
3815
- }
3816
3646
  return entry;
3817
3647
  });
3818
3648
  };
@@ -3820,9 +3650,6 @@ var serializeAws_restJson1SourceServerIDs = function (input, context) {
3820
3650
  return input
3821
3651
  .filter(function (e) { return e != null; })
3822
3652
  .map(function (entry) {
3823
- if (entry === null) {
3824
- return null;
3825
- }
3826
3653
  return entry;
3827
3654
  });
3828
3655
  };
@@ -3830,9 +3657,6 @@ var serializeAws_restJson1StartFailbackRequestRecoveryInstanceIDs = function (in
3830
3657
  return input
3831
3658
  .filter(function (e) { return e != null; })
3832
3659
  .map(function (entry) {
3833
- if (entry === null) {
3834
- return null;
3835
- }
3836
3660
  return entry;
3837
3661
  });
3838
3662
  };
@@ -3843,9 +3667,6 @@ var serializeAws_restJson1StartRecoveryRequestSourceServers = function (input, c
3843
3667
  return input
3844
3668
  .filter(function (e) { return e != null; })
3845
3669
  .map(function (entry) {
3846
- if (entry === null) {
3847
- return null;
3848
- }
3849
3670
  return serializeAws_restJson1StartRecoveryRequestSourceServer(entry, context);
3850
3671
  });
3851
3672
  };