@aws-sdk/client-mgn 3.52.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1StartReplicationCommand = exports.deserializeAws
4
4
  exports.deserializeAws_restJson1UpdateSourceServerReplicationTypeCommand = exports.deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommand = exports.deserializeAws_restJson1UpdateReplicationConfigurationCommand = exports.deserializeAws_restJson1UpdateLaunchConfigurationCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TerminateTargetInstancesCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1StartTestCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ const MgnServiceException_1 = require("../models/MgnServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_restJson1ChangeServerLifeCycleStateCommand = async (input, context) => {
8
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
11
  const headers = {
@@ -871,51 +873,25 @@ const deserializeAws_restJson1ChangeServerLifeCycleStateCommandError = async (ou
871
873
  switch (errorCode) {
872
874
  case "ConflictException":
873
875
  case "com.amazonaws.mgn#ConflictException":
874
- response = {
875
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
876
- name: errorCode,
877
- $metadata: deserializeMetadata(output),
878
- };
879
- break;
876
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
880
877
  case "ResourceNotFoundException":
881
878
  case "com.amazonaws.mgn#ResourceNotFoundException":
882
- response = {
883
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
884
- name: errorCode,
885
- $metadata: deserializeMetadata(output),
886
- };
887
- break;
879
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
888
880
  case "UninitializedAccountException":
889
881
  case "com.amazonaws.mgn#UninitializedAccountException":
890
- response = {
891
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
892
- name: errorCode,
893
- $metadata: deserializeMetadata(output),
894
- };
895
- break;
882
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
896
883
  case "ValidationException":
897
884
  case "com.amazonaws.mgn#ValidationException":
898
- response = {
899
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
900
- name: errorCode,
901
- $metadata: deserializeMetadata(output),
902
- };
903
- break;
885
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
904
886
  default:
905
887
  const parsedBody = parsedOutput.body;
906
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
907
- response = {
908
- ...parsedBody,
909
- name: `${errorCode}`,
910
- message: parsedBody.message || parsedBody.Message || errorCode,
888
+ response = new MgnServiceException_1.MgnServiceException({
889
+ name: parsedBody.code || parsedBody.Code || errorCode,
911
890
  $fault: "client",
912
891
  $metadata: deserializeMetadata(output),
913
- };
892
+ });
893
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
914
894
  }
915
- const message = response.message || response.Message || errorCode;
916
- response.message = message;
917
- delete response.Message;
918
- return Promise.reject(Object.assign(new Error(message), response));
919
895
  };
920
896
  const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommand = async (output, context) => {
921
897
  if (output.statusCode !== 201 && output.statusCode >= 300) {
@@ -999,43 +975,22 @@ const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError
999
975
  switch (errorCode) {
1000
976
  case "AccessDeniedException":
1001
977
  case "com.amazonaws.mgn#AccessDeniedException":
1002
- response = {
1003
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1004
- name: errorCode,
1005
- $metadata: deserializeMetadata(output),
1006
- };
1007
- break;
978
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1008
979
  case "UninitializedAccountException":
1009
980
  case "com.amazonaws.mgn#UninitializedAccountException":
1010
- response = {
1011
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1012
- name: errorCode,
1013
- $metadata: deserializeMetadata(output),
1014
- };
1015
- break;
981
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1016
982
  case "ValidationException":
1017
983
  case "com.amazonaws.mgn#ValidationException":
1018
- response = {
1019
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1020
- name: errorCode,
1021
- $metadata: deserializeMetadata(output),
1022
- };
1023
- break;
984
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1024
985
  default:
1025
986
  const parsedBody = parsedOutput.body;
1026
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1027
- response = {
1028
- ...parsedBody,
1029
- name: `${errorCode}`,
1030
- message: parsedBody.message || parsedBody.Message || errorCode,
987
+ response = new MgnServiceException_1.MgnServiceException({
988
+ name: parsedBody.code || parsedBody.Code || errorCode,
1031
989
  $fault: "client",
1032
990
  $metadata: deserializeMetadata(output),
1033
- };
991
+ });
992
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1034
993
  }
1035
- const message = response.message || response.Message || errorCode;
1036
- response.message = message;
1037
- delete response.Message;
1038
- return Promise.reject(Object.assign(new Error(message), response));
1039
994
  };
1040
995
  const deserializeAws_restJson1DeleteJobCommand = async (output, context) => {
1041
996
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1059,43 +1014,22 @@ const deserializeAws_restJson1DeleteJobCommandError = async (output, context) =>
1059
1014
  switch (errorCode) {
1060
1015
  case "ConflictException":
1061
1016
  case "com.amazonaws.mgn#ConflictException":
1062
- response = {
1063
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1064
- name: errorCode,
1065
- $metadata: deserializeMetadata(output),
1066
- };
1067
- break;
1017
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1068
1018
  case "ResourceNotFoundException":
1069
1019
  case "com.amazonaws.mgn#ResourceNotFoundException":
1070
- response = {
1071
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1072
- name: errorCode,
1073
- $metadata: deserializeMetadata(output),
1074
- };
1075
- break;
1020
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1076
1021
  case "UninitializedAccountException":
1077
1022
  case "com.amazonaws.mgn#UninitializedAccountException":
1078
- response = {
1079
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1080
- name: errorCode,
1081
- $metadata: deserializeMetadata(output),
1082
- };
1083
- break;
1023
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1084
1024
  default:
1085
1025
  const parsedBody = parsedOutput.body;
1086
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1087
- response = {
1088
- ...parsedBody,
1089
- name: `${errorCode}`,
1090
- message: parsedBody.message || parsedBody.Message || errorCode,
1026
+ response = new MgnServiceException_1.MgnServiceException({
1027
+ name: parsedBody.code || parsedBody.Code || errorCode,
1091
1028
  $fault: "client",
1092
1029
  $metadata: deserializeMetadata(output),
1093
- };
1030
+ });
1031
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1094
1032
  }
1095
- const message = response.message || response.Message || errorCode;
1096
- response.message = message;
1097
- delete response.Message;
1098
- return Promise.reject(Object.assign(new Error(message), response));
1099
1033
  };
1100
1034
  const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommand = async (output, context) => {
1101
1035
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1119,43 +1053,22 @@ const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError
1119
1053
  switch (errorCode) {
1120
1054
  case "ConflictException":
1121
1055
  case "com.amazonaws.mgn#ConflictException":
1122
- response = {
1123
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1124
- name: errorCode,
1125
- $metadata: deserializeMetadata(output),
1126
- };
1127
- break;
1056
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1128
1057
  case "ResourceNotFoundException":
1129
1058
  case "com.amazonaws.mgn#ResourceNotFoundException":
1130
- response = {
1131
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1132
- name: errorCode,
1133
- $metadata: deserializeMetadata(output),
1134
- };
1135
- break;
1059
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1136
1060
  case "UninitializedAccountException":
1137
1061
  case "com.amazonaws.mgn#UninitializedAccountException":
1138
- response = {
1139
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1140
- name: errorCode,
1141
- $metadata: deserializeMetadata(output),
1142
- };
1143
- break;
1062
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1144
1063
  default:
1145
1064
  const parsedBody = parsedOutput.body;
1146
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1147
- response = {
1148
- ...parsedBody,
1149
- name: `${errorCode}`,
1150
- message: parsedBody.message || parsedBody.Message || errorCode,
1065
+ response = new MgnServiceException_1.MgnServiceException({
1066
+ name: parsedBody.code || parsedBody.Code || errorCode,
1151
1067
  $fault: "client",
1152
1068
  $metadata: deserializeMetadata(output),
1153
- };
1069
+ });
1070
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1154
1071
  }
1155
- const message = response.message || response.Message || errorCode;
1156
- response.message = message;
1157
- delete response.Message;
1158
- return Promise.reject(Object.assign(new Error(message), response));
1159
1072
  };
1160
1073
  const deserializeAws_restJson1DeleteSourceServerCommand = async (output, context) => {
1161
1074
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1179,43 +1092,22 @@ const deserializeAws_restJson1DeleteSourceServerCommandError = async (output, co
1179
1092
  switch (errorCode) {
1180
1093
  case "ConflictException":
1181
1094
  case "com.amazonaws.mgn#ConflictException":
1182
- response = {
1183
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1184
- name: errorCode,
1185
- $metadata: deserializeMetadata(output),
1186
- };
1187
- break;
1095
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1188
1096
  case "ResourceNotFoundException":
1189
1097
  case "com.amazonaws.mgn#ResourceNotFoundException":
1190
- response = {
1191
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1192
- name: errorCode,
1193
- $metadata: deserializeMetadata(output),
1194
- };
1195
- break;
1098
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1196
1099
  case "UninitializedAccountException":
1197
1100
  case "com.amazonaws.mgn#UninitializedAccountException":
1198
- response = {
1199
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1200
- name: errorCode,
1201
- $metadata: deserializeMetadata(output),
1202
- };
1203
- break;
1101
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1204
1102
  default:
1205
1103
  const parsedBody = parsedOutput.body;
1206
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1207
- response = {
1208
- ...parsedBody,
1209
- name: `${errorCode}`,
1210
- message: parsedBody.message || parsedBody.Message || errorCode,
1104
+ response = new MgnServiceException_1.MgnServiceException({
1105
+ name: parsedBody.code || parsedBody.Code || errorCode,
1211
1106
  $fault: "client",
1212
1107
  $metadata: deserializeMetadata(output),
1213
- };
1108
+ });
1109
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1214
1110
  }
1215
- const message = response.message || response.Message || errorCode;
1216
- response.message = message;
1217
- delete response.Message;
1218
- return Promise.reject(Object.assign(new Error(message), response));
1219
1111
  };
1220
1112
  const deserializeAws_restJson1DeleteVcenterClientCommand = async (output, context) => {
1221
1113
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1239,43 +1131,22 @@ const deserializeAws_restJson1DeleteVcenterClientCommandError = async (output, c
1239
1131
  switch (errorCode) {
1240
1132
  case "ResourceNotFoundException":
1241
1133
  case "com.amazonaws.mgn#ResourceNotFoundException":
1242
- response = {
1243
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1244
- name: errorCode,
1245
- $metadata: deserializeMetadata(output),
1246
- };
1247
- break;
1134
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1248
1135
  case "UninitializedAccountException":
1249
1136
  case "com.amazonaws.mgn#UninitializedAccountException":
1250
- response = {
1251
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1252
- name: errorCode,
1253
- $metadata: deserializeMetadata(output),
1254
- };
1255
- break;
1137
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1256
1138
  case "ValidationException":
1257
1139
  case "com.amazonaws.mgn#ValidationException":
1258
- response = {
1259
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1260
- name: errorCode,
1261
- $metadata: deserializeMetadata(output),
1262
- };
1263
- break;
1140
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1264
1141
  default:
1265
1142
  const parsedBody = parsedOutput.body;
1266
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1267
- response = {
1268
- ...parsedBody,
1269
- name: `${errorCode}`,
1270
- message: parsedBody.message || parsedBody.Message || errorCode,
1143
+ response = new MgnServiceException_1.MgnServiceException({
1144
+ name: parsedBody.code || parsedBody.Code || errorCode,
1271
1145
  $fault: "client",
1272
1146
  $metadata: deserializeMetadata(output),
1273
- };
1147
+ });
1148
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1274
1149
  }
1275
- const message = response.message || response.Message || errorCode;
1276
- response.message = message;
1277
- delete response.Message;
1278
- return Promise.reject(Object.assign(new Error(message), response));
1279
1150
  };
1280
1151
  const deserializeAws_restJson1DescribeJobLogItemsCommand = async (output, context) => {
1281
1152
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1307,35 +1178,19 @@ const deserializeAws_restJson1DescribeJobLogItemsCommandError = async (output, c
1307
1178
  switch (errorCode) {
1308
1179
  case "UninitializedAccountException":
1309
1180
  case "com.amazonaws.mgn#UninitializedAccountException":
1310
- response = {
1311
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1312
- name: errorCode,
1313
- $metadata: deserializeMetadata(output),
1314
- };
1315
- break;
1181
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1316
1182
  case "ValidationException":
1317
1183
  case "com.amazonaws.mgn#ValidationException":
1318
- response = {
1319
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1320
- name: errorCode,
1321
- $metadata: deserializeMetadata(output),
1322
- };
1323
- break;
1184
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1324
1185
  default:
1325
1186
  const parsedBody = parsedOutput.body;
1326
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1327
- response = {
1328
- ...parsedBody,
1329
- name: `${errorCode}`,
1330
- message: parsedBody.message || parsedBody.Message || errorCode,
1187
+ response = new MgnServiceException_1.MgnServiceException({
1188
+ name: parsedBody.code || parsedBody.Code || errorCode,
1331
1189
  $fault: "client",
1332
1190
  $metadata: deserializeMetadata(output),
1333
- };
1191
+ });
1192
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1334
1193
  }
1335
- const message = response.message || response.Message || errorCode;
1336
- response.message = message;
1337
- delete response.Message;
1338
- return Promise.reject(Object.assign(new Error(message), response));
1339
1194
  };
1340
1195
  const deserializeAws_restJson1DescribeJobsCommand = async (output, context) => {
1341
1196
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1367,35 +1222,19 @@ const deserializeAws_restJson1DescribeJobsCommandError = async (output, context)
1367
1222
  switch (errorCode) {
1368
1223
  case "UninitializedAccountException":
1369
1224
  case "com.amazonaws.mgn#UninitializedAccountException":
1370
- response = {
1371
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1372
- name: errorCode,
1373
- $metadata: deserializeMetadata(output),
1374
- };
1375
- break;
1225
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1376
1226
  case "ValidationException":
1377
1227
  case "com.amazonaws.mgn#ValidationException":
1378
- response = {
1379
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1380
- name: errorCode,
1381
- $metadata: deserializeMetadata(output),
1382
- };
1383
- break;
1228
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1384
1229
  default:
1385
1230
  const parsedBody = parsedOutput.body;
1386
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1387
- response = {
1388
- ...parsedBody,
1389
- name: `${errorCode}`,
1390
- message: parsedBody.message || parsedBody.Message || errorCode,
1231
+ response = new MgnServiceException_1.MgnServiceException({
1232
+ name: parsedBody.code || parsedBody.Code || errorCode,
1391
1233
  $fault: "client",
1392
1234
  $metadata: deserializeMetadata(output),
1393
- };
1235
+ });
1236
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1394
1237
  }
1395
- const message = response.message || response.Message || errorCode;
1396
- response.message = message;
1397
- delete response.Message;
1398
- return Promise.reject(Object.assign(new Error(message), response));
1399
1238
  };
1400
1239
  const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand = async (output, context) => {
1401
1240
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1427,43 +1266,22 @@ const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandEr
1427
1266
  switch (errorCode) {
1428
1267
  case "ResourceNotFoundException":
1429
1268
  case "com.amazonaws.mgn#ResourceNotFoundException":
1430
- response = {
1431
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1432
- name: errorCode,
1433
- $metadata: deserializeMetadata(output),
1434
- };
1435
- break;
1269
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1436
1270
  case "UninitializedAccountException":
1437
1271
  case "com.amazonaws.mgn#UninitializedAccountException":
1438
- response = {
1439
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1440
- name: errorCode,
1441
- $metadata: deserializeMetadata(output),
1442
- };
1443
- break;
1272
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1444
1273
  case "ValidationException":
1445
1274
  case "com.amazonaws.mgn#ValidationException":
1446
- response = {
1447
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1448
- name: errorCode,
1449
- $metadata: deserializeMetadata(output),
1450
- };
1451
- break;
1275
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1452
1276
  default:
1453
1277
  const parsedBody = parsedOutput.body;
1454
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1455
- response = {
1456
- ...parsedBody,
1457
- name: `${errorCode}`,
1458
- message: parsedBody.message || parsedBody.Message || errorCode,
1278
+ response = new MgnServiceException_1.MgnServiceException({
1279
+ name: parsedBody.code || parsedBody.Code || errorCode,
1459
1280
  $fault: "client",
1460
1281
  $metadata: deserializeMetadata(output),
1461
- };
1282
+ });
1283
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1462
1284
  }
1463
- const message = response.message || response.Message || errorCode;
1464
- response.message = message;
1465
- delete response.Message;
1466
- return Promise.reject(Object.assign(new Error(message), response));
1467
1285
  };
1468
1286
  const deserializeAws_restJson1DescribeSourceServersCommand = async (output, context) => {
1469
1287
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1495,35 +1313,19 @@ const deserializeAws_restJson1DescribeSourceServersCommandError = async (output,
1495
1313
  switch (errorCode) {
1496
1314
  case "UninitializedAccountException":
1497
1315
  case "com.amazonaws.mgn#UninitializedAccountException":
1498
- response = {
1499
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1500
- name: errorCode,
1501
- $metadata: deserializeMetadata(output),
1502
- };
1503
- break;
1316
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1504
1317
  case "ValidationException":
1505
1318
  case "com.amazonaws.mgn#ValidationException":
1506
- response = {
1507
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1508
- name: errorCode,
1509
- $metadata: deserializeMetadata(output),
1510
- };
1511
- break;
1319
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1512
1320
  default:
1513
1321
  const parsedBody = parsedOutput.body;
1514
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1515
- response = {
1516
- ...parsedBody,
1517
- name: `${errorCode}`,
1518
- message: parsedBody.message || parsedBody.Message || errorCode,
1322
+ response = new MgnServiceException_1.MgnServiceException({
1323
+ name: parsedBody.code || parsedBody.Code || errorCode,
1519
1324
  $fault: "client",
1520
1325
  $metadata: deserializeMetadata(output),
1521
- };
1326
+ });
1327
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1522
1328
  }
1523
- const message = response.message || response.Message || errorCode;
1524
- response.message = message;
1525
- delete response.Message;
1526
- return Promise.reject(Object.assign(new Error(message), response));
1527
1329
  };
1528
1330
  const deserializeAws_restJson1DescribeVcenterClientsCommand = async (output, context) => {
1529
1331
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1555,43 +1357,22 @@ const deserializeAws_restJson1DescribeVcenterClientsCommandError = async (output
1555
1357
  switch (errorCode) {
1556
1358
  case "ResourceNotFoundException":
1557
1359
  case "com.amazonaws.mgn#ResourceNotFoundException":
1558
- response = {
1559
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1560
- name: errorCode,
1561
- $metadata: deserializeMetadata(output),
1562
- };
1563
- break;
1360
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1564
1361
  case "UninitializedAccountException":
1565
1362
  case "com.amazonaws.mgn#UninitializedAccountException":
1566
- response = {
1567
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1568
- name: errorCode,
1569
- $metadata: deserializeMetadata(output),
1570
- };
1571
- break;
1363
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1572
1364
  case "ValidationException":
1573
1365
  case "com.amazonaws.mgn#ValidationException":
1574
- response = {
1575
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1576
- name: errorCode,
1577
- $metadata: deserializeMetadata(output),
1578
- };
1579
- break;
1366
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1580
1367
  default:
1581
1368
  const parsedBody = parsedOutput.body;
1582
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1583
- response = {
1584
- ...parsedBody,
1585
- name: `${errorCode}`,
1586
- message: parsedBody.message || parsedBody.Message || errorCode,
1369
+ response = new MgnServiceException_1.MgnServiceException({
1370
+ name: parsedBody.code || parsedBody.Code || errorCode,
1587
1371
  $fault: "client",
1588
1372
  $metadata: deserializeMetadata(output),
1589
- };
1373
+ });
1374
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1590
1375
  }
1591
- const message = response.message || response.Message || errorCode;
1592
- response.message = message;
1593
- delete response.Message;
1594
- return Promise.reject(Object.assign(new Error(message), response));
1595
1376
  };
1596
1377
  const deserializeAws_restJson1DisconnectFromServiceCommand = async (output, context) => {
1597
1378
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1655,43 +1436,22 @@ const deserializeAws_restJson1DisconnectFromServiceCommandError = async (output,
1655
1436
  switch (errorCode) {
1656
1437
  case "ConflictException":
1657
1438
  case "com.amazonaws.mgn#ConflictException":
1658
- response = {
1659
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1660
- name: errorCode,
1661
- $metadata: deserializeMetadata(output),
1662
- };
1663
- break;
1439
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1664
1440
  case "ResourceNotFoundException":
1665
1441
  case "com.amazonaws.mgn#ResourceNotFoundException":
1666
- response = {
1667
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1668
- name: errorCode,
1669
- $metadata: deserializeMetadata(output),
1670
- };
1671
- break;
1442
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1672
1443
  case "UninitializedAccountException":
1673
1444
  case "com.amazonaws.mgn#UninitializedAccountException":
1674
- response = {
1675
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1676
- name: errorCode,
1677
- $metadata: deserializeMetadata(output),
1678
- };
1679
- break;
1445
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1680
1446
  default:
1681
1447
  const parsedBody = parsedOutput.body;
1682
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1683
- response = {
1684
- ...parsedBody,
1685
- name: `${errorCode}`,
1686
- message: parsedBody.message || parsedBody.Message || errorCode,
1448
+ response = new MgnServiceException_1.MgnServiceException({
1449
+ name: parsedBody.code || parsedBody.Code || errorCode,
1687
1450
  $fault: "client",
1688
1451
  $metadata: deserializeMetadata(output),
1689
- };
1452
+ });
1453
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1690
1454
  }
1691
- const message = response.message || response.Message || errorCode;
1692
- response.message = message;
1693
- delete response.Message;
1694
- return Promise.reject(Object.assign(new Error(message), response));
1695
1455
  };
1696
1456
  const deserializeAws_restJson1FinalizeCutoverCommand = async (output, context) => {
1697
1457
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1755,51 +1515,25 @@ const deserializeAws_restJson1FinalizeCutoverCommandError = async (output, conte
1755
1515
  switch (errorCode) {
1756
1516
  case "ConflictException":
1757
1517
  case "com.amazonaws.mgn#ConflictException":
1758
- response = {
1759
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1760
- name: errorCode,
1761
- $metadata: deserializeMetadata(output),
1762
- };
1763
- break;
1518
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1764
1519
  case "ResourceNotFoundException":
1765
1520
  case "com.amazonaws.mgn#ResourceNotFoundException":
1766
- response = {
1767
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1768
- name: errorCode,
1769
- $metadata: deserializeMetadata(output),
1770
- };
1771
- break;
1521
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1772
1522
  case "UninitializedAccountException":
1773
1523
  case "com.amazonaws.mgn#UninitializedAccountException":
1774
- response = {
1775
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1776
- name: errorCode,
1777
- $metadata: deserializeMetadata(output),
1778
- };
1779
- break;
1524
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1780
1525
  case "ValidationException":
1781
1526
  case "com.amazonaws.mgn#ValidationException":
1782
- response = {
1783
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1784
- name: errorCode,
1785
- $metadata: deserializeMetadata(output),
1786
- };
1787
- break;
1527
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1788
1528
  default:
1789
1529
  const parsedBody = parsedOutput.body;
1790
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1791
- response = {
1792
- ...parsedBody,
1793
- name: `${errorCode}`,
1794
- message: parsedBody.message || parsedBody.Message || errorCode,
1530
+ response = new MgnServiceException_1.MgnServiceException({
1531
+ name: parsedBody.code || parsedBody.Code || errorCode,
1795
1532
  $fault: "client",
1796
1533
  $metadata: deserializeMetadata(output),
1797
- };
1534
+ });
1535
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1798
1536
  }
1799
- const message = response.message || response.Message || errorCode;
1800
- response.message = message;
1801
- delete response.Message;
1802
- return Promise.reject(Object.assign(new Error(message), response));
1803
1537
  };
1804
1538
  const deserializeAws_restJson1GetLaunchConfigurationCommand = async (output, context) => {
1805
1539
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1855,35 +1589,19 @@ const deserializeAws_restJson1GetLaunchConfigurationCommandError = async (output
1855
1589
  switch (errorCode) {
1856
1590
  case "ResourceNotFoundException":
1857
1591
  case "com.amazonaws.mgn#ResourceNotFoundException":
1858
- response = {
1859
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1860
- name: errorCode,
1861
- $metadata: deserializeMetadata(output),
1862
- };
1863
- break;
1592
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1864
1593
  case "UninitializedAccountException":
1865
1594
  case "com.amazonaws.mgn#UninitializedAccountException":
1866
- response = {
1867
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1868
- name: errorCode,
1869
- $metadata: deserializeMetadata(output),
1870
- };
1871
- break;
1595
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1872
1596
  default:
1873
1597
  const parsedBody = parsedOutput.body;
1874
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1875
- response = {
1876
- ...parsedBody,
1877
- name: `${errorCode}`,
1878
- message: parsedBody.message || parsedBody.Message || errorCode,
1598
+ response = new MgnServiceException_1.MgnServiceException({
1599
+ name: parsedBody.code || parsedBody.Code || errorCode,
1879
1600
  $fault: "client",
1880
1601
  $metadata: deserializeMetadata(output),
1881
- };
1602
+ });
1603
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1882
1604
  }
1883
- const message = response.message || response.Message || errorCode;
1884
- response.message = message;
1885
- delete response.Message;
1886
- return Promise.reject(Object.assign(new Error(message), response));
1887
1605
  };
1888
1606
  const deserializeAws_restJson1GetReplicationConfigurationCommand = async (output, context) => {
1889
1607
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1967,35 +1685,19 @@ const deserializeAws_restJson1GetReplicationConfigurationCommandError = async (o
1967
1685
  switch (errorCode) {
1968
1686
  case "ResourceNotFoundException":
1969
1687
  case "com.amazonaws.mgn#ResourceNotFoundException":
1970
- response = {
1971
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1972
- name: errorCode,
1973
- $metadata: deserializeMetadata(output),
1974
- };
1975
- break;
1688
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1976
1689
  case "UninitializedAccountException":
1977
1690
  case "com.amazonaws.mgn#UninitializedAccountException":
1978
- response = {
1979
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1980
- name: errorCode,
1981
- $metadata: deserializeMetadata(output),
1982
- };
1983
- break;
1691
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1984
1692
  default:
1985
1693
  const parsedBody = parsedOutput.body;
1986
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1987
- response = {
1988
- ...parsedBody,
1989
- name: `${errorCode}`,
1990
- message: parsedBody.message || parsedBody.Message || errorCode,
1694
+ response = new MgnServiceException_1.MgnServiceException({
1695
+ name: parsedBody.code || parsedBody.Code || errorCode,
1991
1696
  $fault: "client",
1992
1697
  $metadata: deserializeMetadata(output),
1993
- };
1698
+ });
1699
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1994
1700
  }
1995
- const message = response.message || response.Message || errorCode;
1996
- response.message = message;
1997
- delete response.Message;
1998
- return Promise.reject(Object.assign(new Error(message), response));
1999
1701
  };
2000
1702
  const deserializeAws_restJson1InitializeServiceCommand = async (output, context) => {
2001
1703
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -2019,35 +1721,19 @@ const deserializeAws_restJson1InitializeServiceCommandError = async (output, con
2019
1721
  switch (errorCode) {
2020
1722
  case "AccessDeniedException":
2021
1723
  case "com.amazonaws.mgn#AccessDeniedException":
2022
- response = {
2023
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2024
- name: errorCode,
2025
- $metadata: deserializeMetadata(output),
2026
- };
2027
- break;
1724
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2028
1725
  case "ValidationException":
2029
1726
  case "com.amazonaws.mgn#ValidationException":
2030
- response = {
2031
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2032
- name: errorCode,
2033
- $metadata: deserializeMetadata(output),
2034
- };
2035
- break;
1727
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2036
1728
  default:
2037
1729
  const parsedBody = parsedOutput.body;
2038
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2039
- response = {
2040
- ...parsedBody,
2041
- name: `${errorCode}`,
2042
- message: parsedBody.message || parsedBody.Message || errorCode,
1730
+ response = new MgnServiceException_1.MgnServiceException({
1731
+ name: parsedBody.code || parsedBody.Code || errorCode,
2043
1732
  $fault: "client",
2044
1733
  $metadata: deserializeMetadata(output),
2045
- };
1734
+ });
1735
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2046
1736
  }
2047
- const message = response.message || response.Message || errorCode;
2048
- response.message = message;
2049
- delete response.Message;
2050
- return Promise.reject(Object.assign(new Error(message), response));
2051
1737
  };
2052
1738
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2053
1739
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2075,59 +1761,28 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2075
1761
  switch (errorCode) {
2076
1762
  case "AccessDeniedException":
2077
1763
  case "com.amazonaws.mgn#AccessDeniedException":
2078
- response = {
2079
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2080
- name: errorCode,
2081
- $metadata: deserializeMetadata(output),
2082
- };
2083
- break;
1764
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2084
1765
  case "InternalServerException":
2085
1766
  case "com.amazonaws.mgn#InternalServerException":
2086
- response = {
2087
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2088
- name: errorCode,
2089
- $metadata: deserializeMetadata(output),
2090
- };
2091
- break;
1767
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2092
1768
  case "ResourceNotFoundException":
2093
1769
  case "com.amazonaws.mgn#ResourceNotFoundException":
2094
- response = {
2095
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2096
- name: errorCode,
2097
- $metadata: deserializeMetadata(output),
2098
- };
2099
- break;
1770
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2100
1771
  case "ThrottlingException":
2101
1772
  case "com.amazonaws.mgn#ThrottlingException":
2102
- response = {
2103
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2104
- name: errorCode,
2105
- $metadata: deserializeMetadata(output),
2106
- };
2107
- break;
1773
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2108
1774
  case "ValidationException":
2109
1775
  case "com.amazonaws.mgn#ValidationException":
2110
- response = {
2111
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2112
- name: errorCode,
2113
- $metadata: deserializeMetadata(output),
2114
- };
2115
- break;
1776
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2116
1777
  default:
2117
1778
  const parsedBody = parsedOutput.body;
2118
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2119
- response = {
2120
- ...parsedBody,
2121
- name: `${errorCode}`,
2122
- message: parsedBody.message || parsedBody.Message || errorCode,
1779
+ response = new MgnServiceException_1.MgnServiceException({
1780
+ name: parsedBody.code || parsedBody.Code || errorCode,
2123
1781
  $fault: "client",
2124
1782
  $metadata: deserializeMetadata(output),
2125
- };
1783
+ });
1784
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2126
1785
  }
2127
- const message = response.message || response.Message || errorCode;
2128
- response.message = message;
2129
- delete response.Message;
2130
- return Promise.reject(Object.assign(new Error(message), response));
2131
1786
  };
2132
1787
  const deserializeAws_restJson1MarkAsArchivedCommand = async (output, context) => {
2133
1788
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2191,43 +1846,22 @@ const deserializeAws_restJson1MarkAsArchivedCommandError = async (output, contex
2191
1846
  switch (errorCode) {
2192
1847
  case "ConflictException":
2193
1848
  case "com.amazonaws.mgn#ConflictException":
2194
- response = {
2195
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2196
- name: errorCode,
2197
- $metadata: deserializeMetadata(output),
2198
- };
2199
- break;
1849
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2200
1850
  case "ResourceNotFoundException":
2201
1851
  case "com.amazonaws.mgn#ResourceNotFoundException":
2202
- response = {
2203
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2204
- name: errorCode,
2205
- $metadata: deserializeMetadata(output),
2206
- };
2207
- break;
1852
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2208
1853
  case "UninitializedAccountException":
2209
1854
  case "com.amazonaws.mgn#UninitializedAccountException":
2210
- response = {
2211
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2212
- name: errorCode,
2213
- $metadata: deserializeMetadata(output),
2214
- };
2215
- break;
1855
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
2216
1856
  default:
2217
1857
  const parsedBody = parsedOutput.body;
2218
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2219
- response = {
2220
- ...parsedBody,
2221
- name: `${errorCode}`,
2222
- message: parsedBody.message || parsedBody.Message || errorCode,
1858
+ response = new MgnServiceException_1.MgnServiceException({
1859
+ name: parsedBody.code || parsedBody.Code || errorCode,
2223
1860
  $fault: "client",
2224
1861
  $metadata: deserializeMetadata(output),
2225
- };
1862
+ });
1863
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2226
1864
  }
2227
- const message = response.message || response.Message || errorCode;
2228
- response.message = message;
2229
- delete response.Message;
2230
- return Promise.reject(Object.assign(new Error(message), response));
2231
1865
  };
2232
1866
  const deserializeAws_restJson1RetryDataReplicationCommand = async (output, context) => {
2233
1867
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2291,43 +1925,22 @@ const deserializeAws_restJson1RetryDataReplicationCommandError = async (output,
2291
1925
  switch (errorCode) {
2292
1926
  case "ResourceNotFoundException":
2293
1927
  case "com.amazonaws.mgn#ResourceNotFoundException":
2294
- response = {
2295
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2296
- name: errorCode,
2297
- $metadata: deserializeMetadata(output),
2298
- };
2299
- break;
1928
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2300
1929
  case "UninitializedAccountException":
2301
1930
  case "com.amazonaws.mgn#UninitializedAccountException":
2302
- response = {
2303
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2304
- name: errorCode,
2305
- $metadata: deserializeMetadata(output),
2306
- };
2307
- break;
1931
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
2308
1932
  case "ValidationException":
2309
1933
  case "com.amazonaws.mgn#ValidationException":
2310
- response = {
2311
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2312
- name: errorCode,
2313
- $metadata: deserializeMetadata(output),
2314
- };
2315
- break;
1934
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2316
1935
  default:
2317
1936
  const parsedBody = parsedOutput.body;
2318
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2319
- response = {
2320
- ...parsedBody,
2321
- name: `${errorCode}`,
2322
- message: parsedBody.message || parsedBody.Message || errorCode,
1937
+ response = new MgnServiceException_1.MgnServiceException({
1938
+ name: parsedBody.code || parsedBody.Code || errorCode,
2323
1939
  $fault: "client",
2324
1940
  $metadata: deserializeMetadata(output),
2325
- };
1941
+ });
1942
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2326
1943
  }
2327
- const message = response.message || response.Message || errorCode;
2328
- response.message = message;
2329
- delete response.Message;
2330
- return Promise.reject(Object.assign(new Error(message), response));
2331
1944
  };
2332
1945
  const deserializeAws_restJson1StartCutoverCommand = async (output, context) => {
2333
1946
  if (output.statusCode !== 202 && output.statusCode >= 300) {
@@ -2355,43 +1968,22 @@ const deserializeAws_restJson1StartCutoverCommandError = async (output, context)
2355
1968
  switch (errorCode) {
2356
1969
  case "ConflictException":
2357
1970
  case "com.amazonaws.mgn#ConflictException":
2358
- response = {
2359
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2360
- name: errorCode,
2361
- $metadata: deserializeMetadata(output),
2362
- };
2363
- break;
1971
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2364
1972
  case "UninitializedAccountException":
2365
1973
  case "com.amazonaws.mgn#UninitializedAccountException":
2366
- response = {
2367
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2368
- name: errorCode,
2369
- $metadata: deserializeMetadata(output),
2370
- };
2371
- break;
1974
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
2372
1975
  case "ValidationException":
2373
1976
  case "com.amazonaws.mgn#ValidationException":
2374
- response = {
2375
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2376
- name: errorCode,
2377
- $metadata: deserializeMetadata(output),
2378
- };
2379
- break;
1977
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2380
1978
  default:
2381
1979
  const parsedBody = parsedOutput.body;
2382
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2383
- response = {
2384
- ...parsedBody,
2385
- name: `${errorCode}`,
2386
- message: parsedBody.message || parsedBody.Message || errorCode,
1980
+ response = new MgnServiceException_1.MgnServiceException({
1981
+ name: parsedBody.code || parsedBody.Code || errorCode,
2387
1982
  $fault: "client",
2388
1983
  $metadata: deserializeMetadata(output),
2389
- };
1984
+ });
1985
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2390
1986
  }
2391
- const message = response.message || response.Message || errorCode;
2392
- response.message = message;
2393
- delete response.Message;
2394
- return Promise.reject(Object.assign(new Error(message), response));
2395
1987
  };
2396
1988
  const deserializeAws_restJson1StartReplicationCommand = async (output, context) => {
2397
1989
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2455,59 +2047,28 @@ const deserializeAws_restJson1StartReplicationCommandError = async (output, cont
2455
2047
  switch (errorCode) {
2456
2048
  case "ConflictException":
2457
2049
  case "com.amazonaws.mgn#ConflictException":
2458
- response = {
2459
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2460
- name: errorCode,
2461
- $metadata: deserializeMetadata(output),
2462
- };
2463
- break;
2050
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2464
2051
  case "ResourceNotFoundException":
2465
2052
  case "com.amazonaws.mgn#ResourceNotFoundException":
2466
- response = {
2467
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2468
- name: errorCode,
2469
- $metadata: deserializeMetadata(output),
2470
- };
2471
- break;
2053
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2472
2054
  case "ServiceQuotaExceededException":
2473
2055
  case "com.amazonaws.mgn#ServiceQuotaExceededException":
2474
- response = {
2475
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
2476
- name: errorCode,
2477
- $metadata: deserializeMetadata(output),
2478
- };
2479
- break;
2056
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
2480
2057
  case "UninitializedAccountException":
2481
2058
  case "com.amazonaws.mgn#UninitializedAccountException":
2482
- response = {
2483
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2484
- name: errorCode,
2485
- $metadata: deserializeMetadata(output),
2486
- };
2487
- break;
2059
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
2488
2060
  case "ValidationException":
2489
2061
  case "com.amazonaws.mgn#ValidationException":
2490
- response = {
2491
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2492
- name: errorCode,
2493
- $metadata: deserializeMetadata(output),
2494
- };
2495
- break;
2062
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2496
2063
  default:
2497
2064
  const parsedBody = parsedOutput.body;
2498
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2499
- response = {
2500
- ...parsedBody,
2501
- name: `${errorCode}`,
2502
- message: parsedBody.message || parsedBody.Message || errorCode,
2065
+ response = new MgnServiceException_1.MgnServiceException({
2066
+ name: parsedBody.code || parsedBody.Code || errorCode,
2503
2067
  $fault: "client",
2504
2068
  $metadata: deserializeMetadata(output),
2505
- };
2069
+ });
2070
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2506
2071
  }
2507
- const message = response.message || response.Message || errorCode;
2508
- response.message = message;
2509
- delete response.Message;
2510
- return Promise.reject(Object.assign(new Error(message), response));
2511
2072
  };
2512
2073
  const deserializeAws_restJson1StartTestCommand = async (output, context) => {
2513
2074
  if (output.statusCode !== 202 && output.statusCode >= 300) {
@@ -2535,43 +2096,22 @@ const deserializeAws_restJson1StartTestCommandError = async (output, context) =>
2535
2096
  switch (errorCode) {
2536
2097
  case "ConflictException":
2537
2098
  case "com.amazonaws.mgn#ConflictException":
2538
- response = {
2539
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2540
- name: errorCode,
2541
- $metadata: deserializeMetadata(output),
2542
- };
2543
- break;
2099
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2544
2100
  case "UninitializedAccountException":
2545
2101
  case "com.amazonaws.mgn#UninitializedAccountException":
2546
- response = {
2547
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2548
- name: errorCode,
2549
- $metadata: deserializeMetadata(output),
2550
- };
2551
- break;
2102
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
2552
2103
  case "ValidationException":
2553
2104
  case "com.amazonaws.mgn#ValidationException":
2554
- response = {
2555
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2556
- name: errorCode,
2557
- $metadata: deserializeMetadata(output),
2558
- };
2559
- break;
2105
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2560
2106
  default:
2561
2107
  const parsedBody = parsedOutput.body;
2562
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2563
- response = {
2564
- ...parsedBody,
2565
- name: `${errorCode}`,
2566
- message: parsedBody.message || parsedBody.Message || errorCode,
2108
+ response = new MgnServiceException_1.MgnServiceException({
2109
+ name: parsedBody.code || parsedBody.Code || errorCode,
2567
2110
  $fault: "client",
2568
2111
  $metadata: deserializeMetadata(output),
2569
- };
2112
+ });
2113
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2570
2114
  }
2571
- const message = response.message || response.Message || errorCode;
2572
- response.message = message;
2573
- delete response.Message;
2574
- return Promise.reject(Object.assign(new Error(message), response));
2575
2115
  };
2576
2116
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
2577
2117
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2595,59 +2135,28 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2595
2135
  switch (errorCode) {
2596
2136
  case "AccessDeniedException":
2597
2137
  case "com.amazonaws.mgn#AccessDeniedException":
2598
- response = {
2599
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2600
- name: errorCode,
2601
- $metadata: deserializeMetadata(output),
2602
- };
2603
- break;
2138
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2604
2139
  case "InternalServerException":
2605
2140
  case "com.amazonaws.mgn#InternalServerException":
2606
- response = {
2607
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2608
- name: errorCode,
2609
- $metadata: deserializeMetadata(output),
2610
- };
2611
- break;
2141
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2612
2142
  case "ResourceNotFoundException":
2613
2143
  case "com.amazonaws.mgn#ResourceNotFoundException":
2614
- response = {
2615
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2616
- name: errorCode,
2617
- $metadata: deserializeMetadata(output),
2618
- };
2619
- break;
2144
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2620
2145
  case "ThrottlingException":
2621
2146
  case "com.amazonaws.mgn#ThrottlingException":
2622
- response = {
2623
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2624
- name: errorCode,
2625
- $metadata: deserializeMetadata(output),
2626
- };
2627
- break;
2147
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2628
2148
  case "ValidationException":
2629
2149
  case "com.amazonaws.mgn#ValidationException":
2630
- response = {
2631
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2632
- name: errorCode,
2633
- $metadata: deserializeMetadata(output),
2634
- };
2635
- break;
2150
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2636
2151
  default:
2637
2152
  const parsedBody = parsedOutput.body;
2638
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2639
- response = {
2640
- ...parsedBody,
2641
- name: `${errorCode}`,
2642
- message: parsedBody.message || parsedBody.Message || errorCode,
2153
+ response = new MgnServiceException_1.MgnServiceException({
2154
+ name: parsedBody.code || parsedBody.Code || errorCode,
2643
2155
  $fault: "client",
2644
2156
  $metadata: deserializeMetadata(output),
2645
- };
2157
+ });
2158
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2646
2159
  }
2647
- const message = response.message || response.Message || errorCode;
2648
- response.message = message;
2649
- delete response.Message;
2650
- return Promise.reject(Object.assign(new Error(message), response));
2651
2160
  };
2652
2161
  const deserializeAws_restJson1TerminateTargetInstancesCommand = async (output, context) => {
2653
2162
  if (output.statusCode !== 202 && output.statusCode >= 300) {
@@ -2675,43 +2184,22 @@ const deserializeAws_restJson1TerminateTargetInstancesCommandError = async (outp
2675
2184
  switch (errorCode) {
2676
2185
  case "ConflictException":
2677
2186
  case "com.amazonaws.mgn#ConflictException":
2678
- response = {
2679
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2680
- name: errorCode,
2681
- $metadata: deserializeMetadata(output),
2682
- };
2683
- break;
2187
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2684
2188
  case "UninitializedAccountException":
2685
2189
  case "com.amazonaws.mgn#UninitializedAccountException":
2686
- response = {
2687
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2688
- name: errorCode,
2689
- $metadata: deserializeMetadata(output),
2690
- };
2691
- break;
2190
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
2692
2191
  case "ValidationException":
2693
2192
  case "com.amazonaws.mgn#ValidationException":
2694
- response = {
2695
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2696
- name: errorCode,
2697
- $metadata: deserializeMetadata(output),
2698
- };
2699
- break;
2193
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2700
2194
  default:
2701
2195
  const parsedBody = parsedOutput.body;
2702
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2703
- response = {
2704
- ...parsedBody,
2705
- name: `${errorCode}`,
2706
- message: parsedBody.message || parsedBody.Message || errorCode,
2196
+ response = new MgnServiceException_1.MgnServiceException({
2197
+ name: parsedBody.code || parsedBody.Code || errorCode,
2707
2198
  $fault: "client",
2708
2199
  $metadata: deserializeMetadata(output),
2709
- };
2200
+ });
2201
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2710
2202
  }
2711
- const message = response.message || response.Message || errorCode;
2712
- response.message = message;
2713
- delete response.Message;
2714
- return Promise.reject(Object.assign(new Error(message), response));
2715
2203
  };
2716
2204
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
2717
2205
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2735,59 +2223,28 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2735
2223
  switch (errorCode) {
2736
2224
  case "AccessDeniedException":
2737
2225
  case "com.amazonaws.mgn#AccessDeniedException":
2738
- response = {
2739
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2740
- name: errorCode,
2741
- $metadata: deserializeMetadata(output),
2742
- };
2743
- break;
2226
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2744
2227
  case "InternalServerException":
2745
2228
  case "com.amazonaws.mgn#InternalServerException":
2746
- response = {
2747
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2748
- name: errorCode,
2749
- $metadata: deserializeMetadata(output),
2750
- };
2751
- break;
2229
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2752
2230
  case "ResourceNotFoundException":
2753
2231
  case "com.amazonaws.mgn#ResourceNotFoundException":
2754
- response = {
2755
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2756
- name: errorCode,
2757
- $metadata: deserializeMetadata(output),
2758
- };
2759
- break;
2232
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2760
2233
  case "ThrottlingException":
2761
2234
  case "com.amazonaws.mgn#ThrottlingException":
2762
- response = {
2763
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2764
- name: errorCode,
2765
- $metadata: deserializeMetadata(output),
2766
- };
2767
- break;
2235
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2768
2236
  case "ValidationException":
2769
2237
  case "com.amazonaws.mgn#ValidationException":
2770
- response = {
2771
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2772
- name: errorCode,
2773
- $metadata: deserializeMetadata(output),
2774
- };
2775
- break;
2238
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2776
2239
  default:
2777
2240
  const parsedBody = parsedOutput.body;
2778
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2779
- response = {
2780
- ...parsedBody,
2781
- name: `${errorCode}`,
2782
- message: parsedBody.message || parsedBody.Message || errorCode,
2241
+ response = new MgnServiceException_1.MgnServiceException({
2242
+ name: parsedBody.code || parsedBody.Code || errorCode,
2783
2243
  $fault: "client",
2784
2244
  $metadata: deserializeMetadata(output),
2785
- };
2245
+ });
2246
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2786
2247
  }
2787
- const message = response.message || response.Message || errorCode;
2788
- response.message = message;
2789
- delete response.Message;
2790
- return Promise.reject(Object.assign(new Error(message), response));
2791
2248
  };
2792
2249
  const deserializeAws_restJson1UpdateLaunchConfigurationCommand = async (output, context) => {
2793
2250
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2843,51 +2300,25 @@ const deserializeAws_restJson1UpdateLaunchConfigurationCommandError = async (out
2843
2300
  switch (errorCode) {
2844
2301
  case "ConflictException":
2845
2302
  case "com.amazonaws.mgn#ConflictException":
2846
- response = {
2847
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2848
- name: errorCode,
2849
- $metadata: deserializeMetadata(output),
2850
- };
2851
- break;
2303
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2852
2304
  case "ResourceNotFoundException":
2853
2305
  case "com.amazonaws.mgn#ResourceNotFoundException":
2854
- response = {
2855
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2856
- name: errorCode,
2857
- $metadata: deserializeMetadata(output),
2858
- };
2859
- break;
2306
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2860
2307
  case "UninitializedAccountException":
2861
2308
  case "com.amazonaws.mgn#UninitializedAccountException":
2862
- response = {
2863
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2864
- name: errorCode,
2865
- $metadata: deserializeMetadata(output),
2866
- };
2867
- break;
2309
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
2868
2310
  case "ValidationException":
2869
2311
  case "com.amazonaws.mgn#ValidationException":
2870
- response = {
2871
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2872
- name: errorCode,
2873
- $metadata: deserializeMetadata(output),
2874
- };
2875
- break;
2312
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2876
2313
  default:
2877
2314
  const parsedBody = parsedOutput.body;
2878
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2879
- response = {
2880
- ...parsedBody,
2881
- name: `${errorCode}`,
2882
- message: parsedBody.message || parsedBody.Message || errorCode,
2315
+ response = new MgnServiceException_1.MgnServiceException({
2316
+ name: parsedBody.code || parsedBody.Code || errorCode,
2883
2317
  $fault: "client",
2884
2318
  $metadata: deserializeMetadata(output),
2885
- };
2319
+ });
2320
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2886
2321
  }
2887
- const message = response.message || response.Message || errorCode;
2888
- response.message = message;
2889
- delete response.Message;
2890
- return Promise.reject(Object.assign(new Error(message), response));
2891
2322
  };
2892
2323
  const deserializeAws_restJson1UpdateReplicationConfigurationCommand = async (output, context) => {
2893
2324
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2971,59 +2402,28 @@ const deserializeAws_restJson1UpdateReplicationConfigurationCommandError = async
2971
2402
  switch (errorCode) {
2972
2403
  case "AccessDeniedException":
2973
2404
  case "com.amazonaws.mgn#AccessDeniedException":
2974
- response = {
2975
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2976
- name: errorCode,
2977
- $metadata: deserializeMetadata(output),
2978
- };
2979
- break;
2405
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2980
2406
  case "ConflictException":
2981
2407
  case "com.amazonaws.mgn#ConflictException":
2982
- response = {
2983
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2984
- name: errorCode,
2985
- $metadata: deserializeMetadata(output),
2986
- };
2987
- break;
2408
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2988
2409
  case "ResourceNotFoundException":
2989
2410
  case "com.amazonaws.mgn#ResourceNotFoundException":
2990
- response = {
2991
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2992
- name: errorCode,
2993
- $metadata: deserializeMetadata(output),
2994
- };
2995
- break;
2411
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2996
2412
  case "UninitializedAccountException":
2997
2413
  case "com.amazonaws.mgn#UninitializedAccountException":
2998
- response = {
2999
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
3000
- name: errorCode,
3001
- $metadata: deserializeMetadata(output),
3002
- };
3003
- break;
2414
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
3004
2415
  case "ValidationException":
3005
2416
  case "com.amazonaws.mgn#ValidationException":
3006
- response = {
3007
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3008
- name: errorCode,
3009
- $metadata: deserializeMetadata(output),
3010
- };
3011
- break;
2417
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3012
2418
  default:
3013
2419
  const parsedBody = parsedOutput.body;
3014
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3015
- response = {
3016
- ...parsedBody,
3017
- name: `${errorCode}`,
3018
- message: parsedBody.message || parsedBody.Message || errorCode,
2420
+ response = new MgnServiceException_1.MgnServiceException({
2421
+ name: parsedBody.code || parsedBody.Code || errorCode,
3019
2422
  $fault: "client",
3020
2423
  $metadata: deserializeMetadata(output),
3021
- };
2424
+ });
2425
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3022
2426
  }
3023
- const message = response.message || response.Message || errorCode;
3024
- response.message = message;
3025
- delete response.Message;
3026
- return Promise.reject(Object.assign(new Error(message), response));
3027
2427
  };
3028
2428
  const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommand = async (output, context) => {
3029
2429
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3107,51 +2507,25 @@ const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError
3107
2507
  switch (errorCode) {
3108
2508
  case "AccessDeniedException":
3109
2509
  case "com.amazonaws.mgn#AccessDeniedException":
3110
- response = {
3111
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3112
- name: errorCode,
3113
- $metadata: deserializeMetadata(output),
3114
- };
3115
- break;
2510
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3116
2511
  case "ResourceNotFoundException":
3117
2512
  case "com.amazonaws.mgn#ResourceNotFoundException":
3118
- response = {
3119
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3120
- name: errorCode,
3121
- $metadata: deserializeMetadata(output),
3122
- };
3123
- break;
2513
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3124
2514
  case "UninitializedAccountException":
3125
2515
  case "com.amazonaws.mgn#UninitializedAccountException":
3126
- response = {
3127
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
3128
- name: errorCode,
3129
- $metadata: deserializeMetadata(output),
3130
- };
3131
- break;
2516
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
3132
2517
  case "ValidationException":
3133
2518
  case "com.amazonaws.mgn#ValidationException":
3134
- response = {
3135
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3136
- name: errorCode,
3137
- $metadata: deserializeMetadata(output),
3138
- };
3139
- break;
2519
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3140
2520
  default:
3141
2521
  const parsedBody = parsedOutput.body;
3142
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3143
- response = {
3144
- ...parsedBody,
3145
- name: `${errorCode}`,
3146
- message: parsedBody.message || parsedBody.Message || errorCode,
2522
+ response = new MgnServiceException_1.MgnServiceException({
2523
+ name: parsedBody.code || parsedBody.Code || errorCode,
3147
2524
  $fault: "client",
3148
2525
  $metadata: deserializeMetadata(output),
3149
- };
2526
+ });
2527
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3150
2528
  }
3151
- const message = response.message || response.Message || errorCode;
3152
- response.message = message;
3153
- delete response.Message;
3154
- return Promise.reject(Object.assign(new Error(message), response));
3155
2529
  };
3156
2530
  const deserializeAws_restJson1UpdateSourceServerReplicationTypeCommand = async (output, context) => {
3157
2531
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3215,60 +2589,28 @@ const deserializeAws_restJson1UpdateSourceServerReplicationTypeCommandError = as
3215
2589
  switch (errorCode) {
3216
2590
  case "ConflictException":
3217
2591
  case "com.amazonaws.mgn#ConflictException":
3218
- response = {
3219
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
3220
- name: errorCode,
3221
- $metadata: deserializeMetadata(output),
3222
- };
3223
- break;
2592
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3224
2593
  case "ResourceNotFoundException":
3225
2594
  case "com.amazonaws.mgn#ResourceNotFoundException":
3226
- response = {
3227
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3228
- name: errorCode,
3229
- $metadata: deserializeMetadata(output),
3230
- };
3231
- break;
2595
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3232
2596
  case "UninitializedAccountException":
3233
2597
  case "com.amazonaws.mgn#UninitializedAccountException":
3234
- response = {
3235
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
3236
- name: errorCode,
3237
- $metadata: deserializeMetadata(output),
3238
- };
3239
- break;
2598
+ throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
3240
2599
  case "ValidationException":
3241
2600
  case "com.amazonaws.mgn#ValidationException":
3242
- response = {
3243
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3244
- name: errorCode,
3245
- $metadata: deserializeMetadata(output),
3246
- };
3247
- break;
2601
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3248
2602
  default:
3249
2603
  const parsedBody = parsedOutput.body;
3250
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3251
- response = {
3252
- ...parsedBody,
3253
- name: `${errorCode}`,
3254
- message: parsedBody.message || parsedBody.Message || errorCode,
2604
+ response = new MgnServiceException_1.MgnServiceException({
2605
+ name: parsedBody.code || parsedBody.Code || errorCode,
3255
2606
  $fault: "client",
3256
2607
  $metadata: deserializeMetadata(output),
3257
- };
2608
+ });
2609
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3258
2610
  }
3259
- const message = response.message || response.Message || errorCode;
3260
- response.message = message;
3261
- delete response.Message;
3262
- return Promise.reject(Object.assign(new Error(message), response));
3263
2611
  };
3264
2612
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
3265
- const contents = {
3266
- name: "AccessDeniedException",
3267
- $fault: "client",
3268
- $metadata: deserializeMetadata(parsedOutput),
3269
- code: undefined,
3270
- message: undefined,
3271
- };
2613
+ const contents = {};
3272
2614
  const data = parsedOutput.body;
3273
2615
  if (data.code !== undefined && data.code !== null) {
3274
2616
  contents.code = smithy_client_1.expectString(data.code);
@@ -3276,18 +2618,14 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
3276
2618
  if (data.message !== undefined && data.message !== null) {
3277
2619
  contents.message = smithy_client_1.expectString(data.message);
3278
2620
  }
3279
- return contents;
2621
+ const exception = new models_0_1.AccessDeniedException({
2622
+ $metadata: deserializeMetadata(parsedOutput),
2623
+ ...contents,
2624
+ });
2625
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3280
2626
  };
3281
2627
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
3282
- const contents = {
3283
- name: "ConflictException",
3284
- $fault: "client",
3285
- $metadata: deserializeMetadata(parsedOutput),
3286
- code: undefined,
3287
- message: undefined,
3288
- resourceId: undefined,
3289
- resourceType: undefined,
3290
- };
2628
+ const contents = {};
3291
2629
  const data = parsedOutput.body;
3292
2630
  if (data.code !== undefined && data.code !== null) {
3293
2631
  contents.code = smithy_client_1.expectString(data.code);
@@ -3301,16 +2639,14 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
3301
2639
  if (data.resourceType !== undefined && data.resourceType !== null) {
3302
2640
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
3303
2641
  }
3304
- return contents;
2642
+ const exception = new models_0_1.ConflictException({
2643
+ $metadata: deserializeMetadata(parsedOutput),
2644
+ ...contents,
2645
+ });
2646
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3305
2647
  };
3306
2648
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
3307
- const contents = {
3308
- name: "InternalServerException",
3309
- $fault: "server",
3310
- $metadata: deserializeMetadata(parsedOutput),
3311
- message: undefined,
3312
- retryAfterSeconds: undefined,
3313
- };
2649
+ const contents = {};
3314
2650
  if (parsedOutput.headers["retry-after"] !== undefined) {
3315
2651
  contents.retryAfterSeconds = smithy_client_1.strictParseLong(parsedOutput.headers["retry-after"]);
3316
2652
  }
@@ -3318,18 +2654,14 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
3318
2654
  if (data.message !== undefined && data.message !== null) {
3319
2655
  contents.message = smithy_client_1.expectString(data.message);
3320
2656
  }
3321
- return contents;
2657
+ const exception = new models_0_1.InternalServerException({
2658
+ $metadata: deserializeMetadata(parsedOutput),
2659
+ ...contents,
2660
+ });
2661
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3322
2662
  };
3323
2663
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
3324
- const contents = {
3325
- name: "ResourceNotFoundException",
3326
- $fault: "client",
3327
- $metadata: deserializeMetadata(parsedOutput),
3328
- code: undefined,
3329
- message: undefined,
3330
- resourceId: undefined,
3331
- resourceType: undefined,
3332
- };
2664
+ const contents = {};
3333
2665
  const data = parsedOutput.body;
3334
2666
  if (data.code !== undefined && data.code !== null) {
3335
2667
  contents.code = smithy_client_1.expectString(data.code);
@@ -3343,20 +2675,14 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
3343
2675
  if (data.resourceType !== undefined && data.resourceType !== null) {
3344
2676
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
3345
2677
  }
3346
- return contents;
2678
+ const exception = new models_0_1.ResourceNotFoundException({
2679
+ $metadata: deserializeMetadata(parsedOutput),
2680
+ ...contents,
2681
+ });
2682
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3347
2683
  };
3348
2684
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
3349
- const contents = {
3350
- name: "ServiceQuotaExceededException",
3351
- $fault: "client",
3352
- $metadata: deserializeMetadata(parsedOutput),
3353
- code: undefined,
3354
- message: undefined,
3355
- quotaCode: undefined,
3356
- resourceId: undefined,
3357
- resourceType: undefined,
3358
- serviceCode: undefined,
3359
- };
2685
+ const contents = {};
3360
2686
  const data = parsedOutput.body;
3361
2687
  if (data.code !== undefined && data.code !== null) {
3362
2688
  contents.code = smithy_client_1.expectString(data.code);
@@ -3376,18 +2702,14 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
3376
2702
  if (data.serviceCode !== undefined && data.serviceCode !== null) {
3377
2703
  contents.serviceCode = smithy_client_1.expectString(data.serviceCode);
3378
2704
  }
3379
- return contents;
2705
+ const exception = new models_0_1.ServiceQuotaExceededException({
2706
+ $metadata: deserializeMetadata(parsedOutput),
2707
+ ...contents,
2708
+ });
2709
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3380
2710
  };
3381
2711
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
3382
- const contents = {
3383
- name: "ThrottlingException",
3384
- $fault: "client",
3385
- $metadata: deserializeMetadata(parsedOutput),
3386
- message: undefined,
3387
- quotaCode: undefined,
3388
- retryAfterSeconds: undefined,
3389
- serviceCode: undefined,
3390
- };
2712
+ const contents = {};
3391
2713
  if (parsedOutput.headers["retry-after"] !== undefined) {
3392
2714
  contents.retryAfterSeconds = parsedOutput.headers["retry-after"];
3393
2715
  }
@@ -3401,16 +2723,14 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
3401
2723
  if (data.serviceCode !== undefined && data.serviceCode !== null) {
3402
2724
  contents.serviceCode = smithy_client_1.expectString(data.serviceCode);
3403
2725
  }
3404
- return contents;
2726
+ const exception = new models_0_1.ThrottlingException({
2727
+ $metadata: deserializeMetadata(parsedOutput),
2728
+ ...contents,
2729
+ });
2730
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3405
2731
  };
3406
2732
  const deserializeAws_restJson1UninitializedAccountExceptionResponse = async (parsedOutput, context) => {
3407
- const contents = {
3408
- name: "UninitializedAccountException",
3409
- $fault: "client",
3410
- $metadata: deserializeMetadata(parsedOutput),
3411
- code: undefined,
3412
- message: undefined,
3413
- };
2733
+ const contents = {};
3414
2734
  const data = parsedOutput.body;
3415
2735
  if (data.code !== undefined && data.code !== null) {
3416
2736
  contents.code = smithy_client_1.expectString(data.code);
@@ -3418,18 +2738,14 @@ const deserializeAws_restJson1UninitializedAccountExceptionResponse = async (par
3418
2738
  if (data.message !== undefined && data.message !== null) {
3419
2739
  contents.message = smithy_client_1.expectString(data.message);
3420
2740
  }
3421
- return contents;
2741
+ const exception = new models_0_1.UninitializedAccountException({
2742
+ $metadata: deserializeMetadata(parsedOutput),
2743
+ ...contents,
2744
+ });
2745
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3422
2746
  };
3423
2747
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
3424
- const contents = {
3425
- name: "ValidationException",
3426
- $fault: "client",
3427
- $metadata: deserializeMetadata(parsedOutput),
3428
- code: undefined,
3429
- fieldList: undefined,
3430
- message: undefined,
3431
- reason: undefined,
3432
- };
2748
+ const contents = {};
3433
2749
  const data = parsedOutput.body;
3434
2750
  if (data.code !== undefined && data.code !== null) {
3435
2751
  contents.code = smithy_client_1.expectString(data.code);
@@ -3443,7 +2759,11 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
3443
2759
  if (data.reason !== undefined && data.reason !== null) {
3444
2760
  contents.reason = smithy_client_1.expectString(data.reason);
3445
2761
  }
3446
- return contents;
2762
+ const exception = new models_0_1.ValidationException({
2763
+ $metadata: deserializeMetadata(parsedOutput),
2764
+ ...contents,
2765
+ });
2766
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3447
2767
  };
3448
2768
  const serializeAws_restJson1ChangeServerLifeCycleStateSourceServerLifecycle = (input, context) => {
3449
2769
  return {
@@ -3609,7 +2929,7 @@ const deserializeAws_restJson1CPU = (output, context) => {
3609
2929
  };
3610
2930
  };
3611
2931
  const deserializeAws_restJson1Cpus = (output, context) => {
3612
- return (output || [])
2932
+ const retVal = (output || [])
3613
2933
  .filter((e) => e != null)
3614
2934
  .map((entry) => {
3615
2935
  if (entry === null) {
@@ -3617,6 +2937,7 @@ const deserializeAws_restJson1Cpus = (output, context) => {
3617
2937
  }
3618
2938
  return deserializeAws_restJson1CPU(entry, context);
3619
2939
  });
2940
+ return retVal;
3620
2941
  };
3621
2942
  const deserializeAws_restJson1DataReplicationError = (output, context) => {
3622
2943
  return {
@@ -3651,7 +2972,7 @@ const deserializeAws_restJson1DataReplicationInfoReplicatedDisk = (output, conte
3651
2972
  };
3652
2973
  };
3653
2974
  const deserializeAws_restJson1DataReplicationInfoReplicatedDisks = (output, context) => {
3654
- return (output || [])
2975
+ const retVal = (output || [])
3655
2976
  .filter((e) => e != null)
3656
2977
  .map((entry) => {
3657
2978
  if (entry === null) {
@@ -3659,6 +2980,7 @@ const deserializeAws_restJson1DataReplicationInfoReplicatedDisks = (output, cont
3659
2980
  }
3660
2981
  return deserializeAws_restJson1DataReplicationInfoReplicatedDisk(entry, context);
3661
2982
  });
2983
+ return retVal;
3662
2984
  };
3663
2985
  const deserializeAws_restJson1DataReplicationInitiation = (output, context) => {
3664
2986
  return {
@@ -3676,7 +2998,7 @@ const deserializeAws_restJson1DataReplicationInitiationStep = (output, context)
3676
2998
  };
3677
2999
  };
3678
3000
  const deserializeAws_restJson1DataReplicationInitiationSteps = (output, context) => {
3679
- return (output || [])
3001
+ const retVal = (output || [])
3680
3002
  .filter((e) => e != null)
3681
3003
  .map((entry) => {
3682
3004
  if (entry === null) {
@@ -3684,6 +3006,7 @@ const deserializeAws_restJson1DataReplicationInitiationSteps = (output, context)
3684
3006
  }
3685
3007
  return deserializeAws_restJson1DataReplicationInitiationStep(entry, context);
3686
3008
  });
3009
+ return retVal;
3687
3010
  };
3688
3011
  const deserializeAws_restJson1Disk = (output, context) => {
3689
3012
  return {
@@ -3692,7 +3015,7 @@ const deserializeAws_restJson1Disk = (output, context) => {
3692
3015
  };
3693
3016
  };
3694
3017
  const deserializeAws_restJson1Disks = (output, context) => {
3695
- return (output || [])
3018
+ const retVal = (output || [])
3696
3019
  .filter((e) => e != null)
3697
3020
  .map((entry) => {
3698
3021
  if (entry === null) {
@@ -3700,6 +3023,7 @@ const deserializeAws_restJson1Disks = (output, context) => {
3700
3023
  }
3701
3024
  return deserializeAws_restJson1Disk(entry, context);
3702
3025
  });
3026
+ return retVal;
3703
3027
  };
3704
3028
  const deserializeAws_restJson1IdentificationHints = (output, context) => {
3705
3029
  return {
@@ -3711,7 +3035,7 @@ const deserializeAws_restJson1IdentificationHints = (output, context) => {
3711
3035
  };
3712
3036
  };
3713
3037
  const deserializeAws_restJson1IPsList = (output, context) => {
3714
- return (output || [])
3038
+ const retVal = (output || [])
3715
3039
  .filter((e) => e != null)
3716
3040
  .map((entry) => {
3717
3041
  if (entry === null) {
@@ -3719,6 +3043,7 @@ const deserializeAws_restJson1IPsList = (output, context) => {
3719
3043
  }
3720
3044
  return smithy_client_1.expectString(entry);
3721
3045
  });
3046
+ return retVal;
3722
3047
  };
3723
3048
  const deserializeAws_restJson1Job = (output, context) => {
3724
3049
  return {
@@ -3755,7 +3080,7 @@ const deserializeAws_restJson1JobLogEventData = (output, context) => {
3755
3080
  };
3756
3081
  };
3757
3082
  const deserializeAws_restJson1JobLogs = (output, context) => {
3758
- return (output || [])
3083
+ const retVal = (output || [])
3759
3084
  .filter((e) => e != null)
3760
3085
  .map((entry) => {
3761
3086
  if (entry === null) {
@@ -3763,9 +3088,10 @@ const deserializeAws_restJson1JobLogs = (output, context) => {
3763
3088
  }
3764
3089
  return deserializeAws_restJson1JobLog(entry, context);
3765
3090
  });
3091
+ return retVal;
3766
3092
  };
3767
3093
  const deserializeAws_restJson1JobsList = (output, context) => {
3768
- return (output || [])
3094
+ const retVal = (output || [])
3769
3095
  .filter((e) => e != null)
3770
3096
  .map((entry) => {
3771
3097
  if (entry === null) {
@@ -3773,6 +3099,7 @@ const deserializeAws_restJson1JobsList = (output, context) => {
3773
3099
  }
3774
3100
  return deserializeAws_restJson1Job(entry, context);
3775
3101
  });
3102
+ return retVal;
3776
3103
  };
3777
3104
  const deserializeAws_restJson1LaunchedInstance = (output, context) => {
3778
3105
  return {
@@ -3869,7 +3196,7 @@ const deserializeAws_restJson1NetworkInterface = (output, context) => {
3869
3196
  };
3870
3197
  };
3871
3198
  const deserializeAws_restJson1NetworkInterfaces = (output, context) => {
3872
- return (output || [])
3199
+ const retVal = (output || [])
3873
3200
  .filter((e) => e != null)
3874
3201
  .map((entry) => {
3875
3202
  if (entry === null) {
@@ -3877,6 +3204,7 @@ const deserializeAws_restJson1NetworkInterfaces = (output, context) => {
3877
3204
  }
3878
3205
  return deserializeAws_restJson1NetworkInterface(entry, context);
3879
3206
  });
3207
+ return retVal;
3880
3208
  };
3881
3209
  const deserializeAws_restJson1OS = (output, context) => {
3882
3210
  return {
@@ -3890,7 +3218,7 @@ const deserializeAws_restJson1ParticipatingServer = (output, context) => {
3890
3218
  };
3891
3219
  };
3892
3220
  const deserializeAws_restJson1ParticipatingServers = (output, context) => {
3893
- return (output || [])
3221
+ const retVal = (output || [])
3894
3222
  .filter((e) => e != null)
3895
3223
  .map((entry) => {
3896
3224
  if (entry === null) {
@@ -3898,6 +3226,7 @@ const deserializeAws_restJson1ParticipatingServers = (output, context) => {
3898
3226
  }
3899
3227
  return deserializeAws_restJson1ParticipatingServer(entry, context);
3900
3228
  });
3229
+ return retVal;
3901
3230
  };
3902
3231
  const deserializeAws_restJson1ReplicationConfigurationReplicatedDisk = (output, context) => {
3903
3232
  return {
@@ -3908,7 +3237,7 @@ const deserializeAws_restJson1ReplicationConfigurationReplicatedDisk = (output,
3908
3237
  };
3909
3238
  };
3910
3239
  const deserializeAws_restJson1ReplicationConfigurationReplicatedDisks = (output, context) => {
3911
- return (output || [])
3240
+ const retVal = (output || [])
3912
3241
  .filter((e) => e != null)
3913
3242
  .map((entry) => {
3914
3243
  if (entry === null) {
@@ -3916,6 +3245,7 @@ const deserializeAws_restJson1ReplicationConfigurationReplicatedDisks = (output,
3916
3245
  }
3917
3246
  return deserializeAws_restJson1ReplicationConfigurationReplicatedDisk(entry, context);
3918
3247
  });
3248
+ return retVal;
3919
3249
  };
3920
3250
  const deserializeAws_restJson1ReplicationConfigurationTemplate = (output, context) => {
3921
3251
  return {
@@ -3943,7 +3273,7 @@ const deserializeAws_restJson1ReplicationConfigurationTemplate = (output, contex
3943
3273
  };
3944
3274
  };
3945
3275
  const deserializeAws_restJson1ReplicationConfigurationTemplates = (output, context) => {
3946
- return (output || [])
3276
+ const retVal = (output || [])
3947
3277
  .filter((e) => e != null)
3948
3278
  .map((entry) => {
3949
3279
  if (entry === null) {
@@ -3951,9 +3281,10 @@ const deserializeAws_restJson1ReplicationConfigurationTemplates = (output, conte
3951
3281
  }
3952
3282
  return deserializeAws_restJson1ReplicationConfigurationTemplate(entry, context);
3953
3283
  });
3284
+ return retVal;
3954
3285
  };
3955
3286
  const deserializeAws_restJson1ReplicationServersSecurityGroupsIDs = (output, context) => {
3956
- return (output || [])
3287
+ const retVal = (output || [])
3957
3288
  .filter((e) => e != null)
3958
3289
  .map((entry) => {
3959
3290
  if (entry === null) {
@@ -3961,6 +3292,7 @@ const deserializeAws_restJson1ReplicationServersSecurityGroupsIDs = (output, con
3961
3292
  }
3962
3293
  return smithy_client_1.expectString(entry);
3963
3294
  });
3295
+ return retVal;
3964
3296
  };
3965
3297
  const deserializeAws_restJson1SourceProperties = (output, context) => {
3966
3298
  return {
@@ -4007,7 +3339,7 @@ const deserializeAws_restJson1SourceServer = (output, context) => {
4007
3339
  };
4008
3340
  };
4009
3341
  const deserializeAws_restJson1SourceServersList = (output, context) => {
4010
- return (output || [])
3342
+ const retVal = (output || [])
4011
3343
  .filter((e) => e != null)
4012
3344
  .map((entry) => {
4013
3345
  if (entry === null) {
@@ -4015,6 +3347,7 @@ const deserializeAws_restJson1SourceServersList = (output, context) => {
4015
3347
  }
4016
3348
  return deserializeAws_restJson1SourceServer(entry, context);
4017
3349
  });
3350
+ return retVal;
4018
3351
  };
4019
3352
  const deserializeAws_restJson1TagsMap = (output, context) => {
4020
3353
  return Object.entries(output).reduce((acc, [key, value]) => {
@@ -4034,7 +3367,7 @@ const deserializeAws_restJson1ValidationExceptionField = (output, context) => {
4034
3367
  };
4035
3368
  };
4036
3369
  const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) => {
4037
- return (output || [])
3370
+ const retVal = (output || [])
4038
3371
  .filter((e) => e != null)
4039
3372
  .map((entry) => {
4040
3373
  if (entry === null) {
@@ -4042,6 +3375,7 @@ const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) =
4042
3375
  }
4043
3376
  return deserializeAws_restJson1ValidationExceptionField(entry, context);
4044
3377
  });
3378
+ return retVal;
4045
3379
  };
4046
3380
  const deserializeAws_restJson1VcenterClient = (output, context) => {
4047
3381
  return {
@@ -4060,7 +3394,7 @@ const deserializeAws_restJson1VcenterClient = (output, context) => {
4060
3394
  };
4061
3395
  };
4062
3396
  const deserializeAws_restJson1VcenterClientList = (output, context) => {
4063
- return (output || [])
3397
+ const retVal = (output || [])
4064
3398
  .filter((e) => e != null)
4065
3399
  .map((entry) => {
4066
3400
  if (entry === null) {
@@ -4068,6 +3402,7 @@ const deserializeAws_restJson1VcenterClientList = (output, context) => {
4068
3402
  }
4069
3403
  return deserializeAws_restJson1VcenterClient(entry, context);
4070
3404
  });
3405
+ return retVal;
4071
3406
  };
4072
3407
  const deserializeMetadata = (output) => {
4073
3408
  var _a;