@aws-sdk/client-codeartifact 3.52.0 → 3.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1GetDomainPermissionsPolicyCommand = exports.dese
4
4
  exports.deserializeAws_restJson1UpdateRepositoryCommand = exports.deserializeAws_restJson1UpdatePackageVersionsStatusCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1PutRepositoryPermissionsPolicyCommand = exports.deserializeAws_restJson1PutDomainPermissionsPolicyCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListRepositoriesInDomainCommand = exports.deserializeAws_restJson1ListRepositoriesCommand = exports.deserializeAws_restJson1ListPackageVersionsCommand = exports.deserializeAws_restJson1ListPackageVersionDependenciesCommand = exports.deserializeAws_restJson1ListPackageVersionAssetsCommand = exports.deserializeAws_restJson1ListPackagesCommand = exports.deserializeAws_restJson1ListDomainsCommand = exports.deserializeAws_restJson1GetRepositoryPermissionsPolicyCommand = exports.deserializeAws_restJson1GetRepositoryEndpointCommand = exports.deserializeAws_restJson1GetPackageVersionReadmeCommand = exports.deserializeAws_restJson1GetPackageVersionAssetCommand = 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 CodeartifactServiceException_1 = require("../models/CodeartifactServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_restJson1AssociateExternalConnectionCommand = async (input, context) => {
8
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
11
  const headers = {};
@@ -922,75 +924,34 @@ const deserializeAws_restJson1AssociateExternalConnectionCommandError = async (o
922
924
  switch (errorCode) {
923
925
  case "AccessDeniedException":
924
926
  case "com.amazonaws.codeartifact#AccessDeniedException":
925
- response = {
926
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
927
- name: errorCode,
928
- $metadata: deserializeMetadata(output),
929
- };
930
- break;
927
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
931
928
  case "ConflictException":
932
929
  case "com.amazonaws.codeartifact#ConflictException":
933
- response = {
934
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
935
- name: errorCode,
936
- $metadata: deserializeMetadata(output),
937
- };
938
- break;
930
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
939
931
  case "InternalServerException":
940
932
  case "com.amazonaws.codeartifact#InternalServerException":
941
- response = {
942
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
943
- name: errorCode,
944
- $metadata: deserializeMetadata(output),
945
- };
946
- break;
933
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
947
934
  case "ResourceNotFoundException":
948
935
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
949
- response = {
950
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
951
- name: errorCode,
952
- $metadata: deserializeMetadata(output),
953
- };
954
- break;
936
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
955
937
  case "ServiceQuotaExceededException":
956
938
  case "com.amazonaws.codeartifact#ServiceQuotaExceededException":
957
- response = {
958
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
959
- name: errorCode,
960
- $metadata: deserializeMetadata(output),
961
- };
962
- break;
939
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
963
940
  case "ThrottlingException":
964
941
  case "com.amazonaws.codeartifact#ThrottlingException":
965
- response = {
966
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
967
- name: errorCode,
968
- $metadata: deserializeMetadata(output),
969
- };
970
- break;
942
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
971
943
  case "ValidationException":
972
944
  case "com.amazonaws.codeartifact#ValidationException":
973
- response = {
974
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
975
- name: errorCode,
976
- $metadata: deserializeMetadata(output),
977
- };
978
- break;
945
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
979
946
  default:
980
947
  const parsedBody = parsedOutput.body;
981
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
982
- response = {
983
- ...parsedBody,
984
- name: `${errorCode}`,
985
- message: parsedBody.message || parsedBody.Message || errorCode,
948
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
949
+ name: parsedBody.code || parsedBody.Code || errorCode,
986
950
  $fault: "client",
987
951
  $metadata: deserializeMetadata(output),
988
- };
952
+ });
953
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
989
954
  }
990
- const message = response.message || response.Message || errorCode;
991
- response.message = message;
992
- delete response.Message;
993
- return Promise.reject(Object.assign(new Error(message), response));
994
955
  };
995
956
  const deserializeAws_restJson1CopyPackageVersionsCommand = async (output, context) => {
996
957
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1022,75 +983,34 @@ const deserializeAws_restJson1CopyPackageVersionsCommandError = async (output, c
1022
983
  switch (errorCode) {
1023
984
  case "AccessDeniedException":
1024
985
  case "com.amazonaws.codeartifact#AccessDeniedException":
1025
- response = {
1026
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1027
- name: errorCode,
1028
- $metadata: deserializeMetadata(output),
1029
- };
1030
- break;
986
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1031
987
  case "ConflictException":
1032
988
  case "com.amazonaws.codeartifact#ConflictException":
1033
- response = {
1034
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1035
- name: errorCode,
1036
- $metadata: deserializeMetadata(output),
1037
- };
1038
- break;
989
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1039
990
  case "InternalServerException":
1040
991
  case "com.amazonaws.codeartifact#InternalServerException":
1041
- response = {
1042
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1043
- name: errorCode,
1044
- $metadata: deserializeMetadata(output),
1045
- };
1046
- break;
992
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1047
993
  case "ResourceNotFoundException":
1048
994
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1049
- response = {
1050
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1051
- name: errorCode,
1052
- $metadata: deserializeMetadata(output),
1053
- };
1054
- break;
995
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1055
996
  case "ServiceQuotaExceededException":
1056
997
  case "com.amazonaws.codeartifact#ServiceQuotaExceededException":
1057
- response = {
1058
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1059
- name: errorCode,
1060
- $metadata: deserializeMetadata(output),
1061
- };
1062
- break;
998
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1063
999
  case "ThrottlingException":
1064
1000
  case "com.amazonaws.codeartifact#ThrottlingException":
1065
- response = {
1066
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1067
- name: errorCode,
1068
- $metadata: deserializeMetadata(output),
1069
- };
1070
- break;
1001
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1071
1002
  case "ValidationException":
1072
1003
  case "com.amazonaws.codeartifact#ValidationException":
1073
- response = {
1074
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1075
- name: errorCode,
1076
- $metadata: deserializeMetadata(output),
1077
- };
1078
- break;
1004
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1079
1005
  default:
1080
1006
  const parsedBody = parsedOutput.body;
1081
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1082
- response = {
1083
- ...parsedBody,
1084
- name: `${errorCode}`,
1085
- message: parsedBody.message || parsedBody.Message || errorCode,
1007
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1008
+ name: parsedBody.code || parsedBody.Code || errorCode,
1086
1009
  $fault: "client",
1087
1010
  $metadata: deserializeMetadata(output),
1088
- };
1011
+ });
1012
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1089
1013
  }
1090
- const message = response.message || response.Message || errorCode;
1091
- response.message = message;
1092
- delete response.Message;
1093
- return Promise.reject(Object.assign(new Error(message), response));
1094
1014
  };
1095
1015
  const deserializeAws_restJson1CreateDomainCommand = async (output, context) => {
1096
1016
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1118,75 +1038,34 @@ const deserializeAws_restJson1CreateDomainCommandError = async (output, context)
1118
1038
  switch (errorCode) {
1119
1039
  case "AccessDeniedException":
1120
1040
  case "com.amazonaws.codeartifact#AccessDeniedException":
1121
- response = {
1122
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1123
- name: errorCode,
1124
- $metadata: deserializeMetadata(output),
1125
- };
1126
- break;
1041
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1127
1042
  case "ConflictException":
1128
1043
  case "com.amazonaws.codeartifact#ConflictException":
1129
- response = {
1130
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1131
- name: errorCode,
1132
- $metadata: deserializeMetadata(output),
1133
- };
1134
- break;
1044
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1135
1045
  case "InternalServerException":
1136
1046
  case "com.amazonaws.codeartifact#InternalServerException":
1137
- response = {
1138
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1139
- name: errorCode,
1140
- $metadata: deserializeMetadata(output),
1141
- };
1142
- break;
1047
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1143
1048
  case "ResourceNotFoundException":
1144
1049
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1145
- response = {
1146
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1147
- name: errorCode,
1148
- $metadata: deserializeMetadata(output),
1149
- };
1150
- break;
1050
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1151
1051
  case "ServiceQuotaExceededException":
1152
1052
  case "com.amazonaws.codeartifact#ServiceQuotaExceededException":
1153
- response = {
1154
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1155
- name: errorCode,
1156
- $metadata: deserializeMetadata(output),
1157
- };
1158
- break;
1053
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1159
1054
  case "ThrottlingException":
1160
1055
  case "com.amazonaws.codeartifact#ThrottlingException":
1161
- response = {
1162
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1163
- name: errorCode,
1164
- $metadata: deserializeMetadata(output),
1165
- };
1166
- break;
1056
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1167
1057
  case "ValidationException":
1168
1058
  case "com.amazonaws.codeartifact#ValidationException":
1169
- response = {
1170
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1171
- name: errorCode,
1172
- $metadata: deserializeMetadata(output),
1173
- };
1174
- break;
1059
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1175
1060
  default:
1176
1061
  const parsedBody = parsedOutput.body;
1177
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1178
- response = {
1179
- ...parsedBody,
1180
- name: `${errorCode}`,
1181
- message: parsedBody.message || parsedBody.Message || errorCode,
1062
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1063
+ name: parsedBody.code || parsedBody.Code || errorCode,
1182
1064
  $fault: "client",
1183
1065
  $metadata: deserializeMetadata(output),
1184
- };
1066
+ });
1067
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1185
1068
  }
1186
- const message = response.message || response.Message || errorCode;
1187
- response.message = message;
1188
- delete response.Message;
1189
- return Promise.reject(Object.assign(new Error(message), response));
1190
1069
  };
1191
1070
  const deserializeAws_restJson1CreateRepositoryCommand = async (output, context) => {
1192
1071
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1214,75 +1093,34 @@ const deserializeAws_restJson1CreateRepositoryCommandError = async (output, cont
1214
1093
  switch (errorCode) {
1215
1094
  case "AccessDeniedException":
1216
1095
  case "com.amazonaws.codeartifact#AccessDeniedException":
1217
- response = {
1218
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1219
- name: errorCode,
1220
- $metadata: deserializeMetadata(output),
1221
- };
1222
- break;
1096
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1223
1097
  case "ConflictException":
1224
1098
  case "com.amazonaws.codeartifact#ConflictException":
1225
- response = {
1226
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1227
- name: errorCode,
1228
- $metadata: deserializeMetadata(output),
1229
- };
1230
- break;
1099
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1231
1100
  case "InternalServerException":
1232
1101
  case "com.amazonaws.codeartifact#InternalServerException":
1233
- response = {
1234
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1235
- name: errorCode,
1236
- $metadata: deserializeMetadata(output),
1237
- };
1238
- break;
1102
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1239
1103
  case "ResourceNotFoundException":
1240
1104
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1241
- response = {
1242
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1243
- name: errorCode,
1244
- $metadata: deserializeMetadata(output),
1245
- };
1246
- break;
1105
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1247
1106
  case "ServiceQuotaExceededException":
1248
1107
  case "com.amazonaws.codeartifact#ServiceQuotaExceededException":
1249
- response = {
1250
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1251
- name: errorCode,
1252
- $metadata: deserializeMetadata(output),
1253
- };
1254
- break;
1108
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1255
1109
  case "ThrottlingException":
1256
1110
  case "com.amazonaws.codeartifact#ThrottlingException":
1257
- response = {
1258
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1259
- name: errorCode,
1260
- $metadata: deserializeMetadata(output),
1261
- };
1262
- break;
1111
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1263
1112
  case "ValidationException":
1264
1113
  case "com.amazonaws.codeartifact#ValidationException":
1265
- response = {
1266
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1267
- name: errorCode,
1268
- $metadata: deserializeMetadata(output),
1269
- };
1270
- break;
1114
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1271
1115
  default:
1272
1116
  const parsedBody = parsedOutput.body;
1273
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1274
- response = {
1275
- ...parsedBody,
1276
- name: `${errorCode}`,
1277
- message: parsedBody.message || parsedBody.Message || errorCode,
1117
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1118
+ name: parsedBody.code || parsedBody.Code || errorCode,
1278
1119
  $fault: "client",
1279
1120
  $metadata: deserializeMetadata(output),
1280
- };
1121
+ });
1122
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1281
1123
  }
1282
- const message = response.message || response.Message || errorCode;
1283
- response.message = message;
1284
- delete response.Message;
1285
- return Promise.reject(Object.assign(new Error(message), response));
1286
1124
  };
1287
1125
  const deserializeAws_restJson1DeleteDomainCommand = async (output, context) => {
1288
1126
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1310,59 +1148,28 @@ const deserializeAws_restJson1DeleteDomainCommandError = async (output, context)
1310
1148
  switch (errorCode) {
1311
1149
  case "AccessDeniedException":
1312
1150
  case "com.amazonaws.codeartifact#AccessDeniedException":
1313
- response = {
1314
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1315
- name: errorCode,
1316
- $metadata: deserializeMetadata(output),
1317
- };
1318
- break;
1151
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1319
1152
  case "ConflictException":
1320
1153
  case "com.amazonaws.codeartifact#ConflictException":
1321
- response = {
1322
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1323
- name: errorCode,
1324
- $metadata: deserializeMetadata(output),
1325
- };
1326
- break;
1154
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1327
1155
  case "InternalServerException":
1328
1156
  case "com.amazonaws.codeartifact#InternalServerException":
1329
- response = {
1330
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1331
- name: errorCode,
1332
- $metadata: deserializeMetadata(output),
1333
- };
1334
- break;
1157
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1335
1158
  case "ThrottlingException":
1336
1159
  case "com.amazonaws.codeartifact#ThrottlingException":
1337
- response = {
1338
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1339
- name: errorCode,
1340
- $metadata: deserializeMetadata(output),
1341
- };
1342
- break;
1160
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1343
1161
  case "ValidationException":
1344
1162
  case "com.amazonaws.codeartifact#ValidationException":
1345
- response = {
1346
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1347
- name: errorCode,
1348
- $metadata: deserializeMetadata(output),
1349
- };
1350
- break;
1163
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1351
1164
  default:
1352
1165
  const parsedBody = parsedOutput.body;
1353
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1354
- response = {
1355
- ...parsedBody,
1356
- name: `${errorCode}`,
1357
- message: parsedBody.message || parsedBody.Message || errorCode,
1166
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1167
+ name: parsedBody.code || parsedBody.Code || errorCode,
1358
1168
  $fault: "client",
1359
1169
  $metadata: deserializeMetadata(output),
1360
- };
1170
+ });
1171
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1361
1172
  }
1362
- const message = response.message || response.Message || errorCode;
1363
- response.message = message;
1364
- delete response.Message;
1365
- return Promise.reject(Object.assign(new Error(message), response));
1366
1173
  };
1367
1174
  const deserializeAws_restJson1DeleteDomainPermissionsPolicyCommand = async (output, context) => {
1368
1175
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1390,67 +1197,31 @@ const deserializeAws_restJson1DeleteDomainPermissionsPolicyCommandError = async
1390
1197
  switch (errorCode) {
1391
1198
  case "AccessDeniedException":
1392
1199
  case "com.amazonaws.codeartifact#AccessDeniedException":
1393
- response = {
1394
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1395
- name: errorCode,
1396
- $metadata: deserializeMetadata(output),
1397
- };
1398
- break;
1200
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1399
1201
  case "ConflictException":
1400
1202
  case "com.amazonaws.codeartifact#ConflictException":
1401
- response = {
1402
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1403
- name: errorCode,
1404
- $metadata: deserializeMetadata(output),
1405
- };
1406
- break;
1203
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1407
1204
  case "InternalServerException":
1408
1205
  case "com.amazonaws.codeartifact#InternalServerException":
1409
- response = {
1410
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1411
- name: errorCode,
1412
- $metadata: deserializeMetadata(output),
1413
- };
1414
- break;
1206
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1415
1207
  case "ResourceNotFoundException":
1416
1208
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1417
- response = {
1418
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1419
- name: errorCode,
1420
- $metadata: deserializeMetadata(output),
1421
- };
1422
- break;
1209
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1423
1210
  case "ThrottlingException":
1424
1211
  case "com.amazonaws.codeartifact#ThrottlingException":
1425
- response = {
1426
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1427
- name: errorCode,
1428
- $metadata: deserializeMetadata(output),
1429
- };
1430
- break;
1212
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1431
1213
  case "ValidationException":
1432
1214
  case "com.amazonaws.codeartifact#ValidationException":
1433
- response = {
1434
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1435
- name: errorCode,
1436
- $metadata: deserializeMetadata(output),
1437
- };
1438
- break;
1215
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1439
1216
  default:
1440
1217
  const parsedBody = parsedOutput.body;
1441
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1442
- response = {
1443
- ...parsedBody,
1444
- name: `${errorCode}`,
1445
- message: parsedBody.message || parsedBody.Message || errorCode,
1218
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1219
+ name: parsedBody.code || parsedBody.Code || errorCode,
1446
1220
  $fault: "client",
1447
1221
  $metadata: deserializeMetadata(output),
1448
- };
1222
+ });
1223
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1449
1224
  }
1450
- const message = response.message || response.Message || errorCode;
1451
- response.message = message;
1452
- delete response.Message;
1453
- return Promise.reject(Object.assign(new Error(message), response));
1454
1225
  };
1455
1226
  const deserializeAws_restJson1DeletePackageVersionsCommand = async (output, context) => {
1456
1227
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1482,67 +1253,31 @@ const deserializeAws_restJson1DeletePackageVersionsCommandError = async (output,
1482
1253
  switch (errorCode) {
1483
1254
  case "AccessDeniedException":
1484
1255
  case "com.amazonaws.codeartifact#AccessDeniedException":
1485
- response = {
1486
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1487
- name: errorCode,
1488
- $metadata: deserializeMetadata(output),
1489
- };
1490
- break;
1256
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1491
1257
  case "ConflictException":
1492
1258
  case "com.amazonaws.codeartifact#ConflictException":
1493
- response = {
1494
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1495
- name: errorCode,
1496
- $metadata: deserializeMetadata(output),
1497
- };
1498
- break;
1259
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1499
1260
  case "InternalServerException":
1500
1261
  case "com.amazonaws.codeartifact#InternalServerException":
1501
- response = {
1502
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1503
- name: errorCode,
1504
- $metadata: deserializeMetadata(output),
1505
- };
1506
- break;
1262
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1507
1263
  case "ResourceNotFoundException":
1508
1264
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1509
- response = {
1510
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1511
- name: errorCode,
1512
- $metadata: deserializeMetadata(output),
1513
- };
1514
- break;
1265
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1515
1266
  case "ThrottlingException":
1516
1267
  case "com.amazonaws.codeartifact#ThrottlingException":
1517
- response = {
1518
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1519
- name: errorCode,
1520
- $metadata: deserializeMetadata(output),
1521
- };
1522
- break;
1268
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1523
1269
  case "ValidationException":
1524
1270
  case "com.amazonaws.codeartifact#ValidationException":
1525
- response = {
1526
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1527
- name: errorCode,
1528
- $metadata: deserializeMetadata(output),
1529
- };
1530
- break;
1271
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1531
1272
  default:
1532
1273
  const parsedBody = parsedOutput.body;
1533
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1534
- response = {
1535
- ...parsedBody,
1536
- name: `${errorCode}`,
1537
- message: parsedBody.message || parsedBody.Message || errorCode,
1274
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1275
+ name: parsedBody.code || parsedBody.Code || errorCode,
1538
1276
  $fault: "client",
1539
1277
  $metadata: deserializeMetadata(output),
1540
- };
1278
+ });
1279
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1541
1280
  }
1542
- const message = response.message || response.Message || errorCode;
1543
- response.message = message;
1544
- delete response.Message;
1545
- return Promise.reject(Object.assign(new Error(message), response));
1546
1281
  };
1547
1282
  const deserializeAws_restJson1DeleteRepositoryCommand = async (output, context) => {
1548
1283
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1570,67 +1305,31 @@ const deserializeAws_restJson1DeleteRepositoryCommandError = async (output, cont
1570
1305
  switch (errorCode) {
1571
1306
  case "AccessDeniedException":
1572
1307
  case "com.amazonaws.codeartifact#AccessDeniedException":
1573
- response = {
1574
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1575
- name: errorCode,
1576
- $metadata: deserializeMetadata(output),
1577
- };
1578
- break;
1308
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1579
1309
  case "ConflictException":
1580
1310
  case "com.amazonaws.codeartifact#ConflictException":
1581
- response = {
1582
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1583
- name: errorCode,
1584
- $metadata: deserializeMetadata(output),
1585
- };
1586
- break;
1311
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1587
1312
  case "InternalServerException":
1588
1313
  case "com.amazonaws.codeartifact#InternalServerException":
1589
- response = {
1590
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1591
- name: errorCode,
1592
- $metadata: deserializeMetadata(output),
1593
- };
1594
- break;
1314
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1595
1315
  case "ResourceNotFoundException":
1596
1316
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1597
- response = {
1598
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1599
- name: errorCode,
1600
- $metadata: deserializeMetadata(output),
1601
- };
1602
- break;
1317
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1603
1318
  case "ThrottlingException":
1604
1319
  case "com.amazonaws.codeartifact#ThrottlingException":
1605
- response = {
1606
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1607
- name: errorCode,
1608
- $metadata: deserializeMetadata(output),
1609
- };
1610
- break;
1320
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1611
1321
  case "ValidationException":
1612
1322
  case "com.amazonaws.codeartifact#ValidationException":
1613
- response = {
1614
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1615
- name: errorCode,
1616
- $metadata: deserializeMetadata(output),
1617
- };
1618
- break;
1323
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1619
1324
  default:
1620
1325
  const parsedBody = parsedOutput.body;
1621
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1622
- response = {
1623
- ...parsedBody,
1624
- name: `${errorCode}`,
1625
- message: parsedBody.message || parsedBody.Message || errorCode,
1326
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1327
+ name: parsedBody.code || parsedBody.Code || errorCode,
1626
1328
  $fault: "client",
1627
1329
  $metadata: deserializeMetadata(output),
1628
- };
1330
+ });
1331
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1629
1332
  }
1630
- const message = response.message || response.Message || errorCode;
1631
- response.message = message;
1632
- delete response.Message;
1633
- return Promise.reject(Object.assign(new Error(message), response));
1634
1333
  };
1635
1334
  const deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommand = async (output, context) => {
1636
1335
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1658,67 +1357,31 @@ const deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommandError = as
1658
1357
  switch (errorCode) {
1659
1358
  case "AccessDeniedException":
1660
1359
  case "com.amazonaws.codeartifact#AccessDeniedException":
1661
- response = {
1662
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1663
- name: errorCode,
1664
- $metadata: deserializeMetadata(output),
1665
- };
1666
- break;
1360
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1667
1361
  case "ConflictException":
1668
1362
  case "com.amazonaws.codeartifact#ConflictException":
1669
- response = {
1670
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1671
- name: errorCode,
1672
- $metadata: deserializeMetadata(output),
1673
- };
1674
- break;
1363
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1675
1364
  case "InternalServerException":
1676
1365
  case "com.amazonaws.codeartifact#InternalServerException":
1677
- response = {
1678
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1679
- name: errorCode,
1680
- $metadata: deserializeMetadata(output),
1681
- };
1682
- break;
1366
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1683
1367
  case "ResourceNotFoundException":
1684
1368
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1685
- response = {
1686
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1687
- name: errorCode,
1688
- $metadata: deserializeMetadata(output),
1689
- };
1690
- break;
1369
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1691
1370
  case "ThrottlingException":
1692
1371
  case "com.amazonaws.codeartifact#ThrottlingException":
1693
- response = {
1694
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1695
- name: errorCode,
1696
- $metadata: deserializeMetadata(output),
1697
- };
1698
- break;
1372
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1699
1373
  case "ValidationException":
1700
1374
  case "com.amazonaws.codeartifact#ValidationException":
1701
- response = {
1702
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1703
- name: errorCode,
1704
- $metadata: deserializeMetadata(output),
1705
- };
1706
- break;
1375
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1707
1376
  default:
1708
1377
  const parsedBody = parsedOutput.body;
1709
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1710
- response = {
1711
- ...parsedBody,
1712
- name: `${errorCode}`,
1713
- message: parsedBody.message || parsedBody.Message || errorCode,
1378
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1379
+ name: parsedBody.code || parsedBody.Code || errorCode,
1714
1380
  $fault: "client",
1715
1381
  $metadata: deserializeMetadata(output),
1716
- };
1382
+ });
1383
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1717
1384
  }
1718
- const message = response.message || response.Message || errorCode;
1719
- response.message = message;
1720
- delete response.Message;
1721
- return Promise.reject(Object.assign(new Error(message), response));
1722
1385
  };
1723
1386
  const deserializeAws_restJson1DescribeDomainCommand = async (output, context) => {
1724
1387
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1746,59 +1409,28 @@ const deserializeAws_restJson1DescribeDomainCommandError = async (output, contex
1746
1409
  switch (errorCode) {
1747
1410
  case "AccessDeniedException":
1748
1411
  case "com.amazonaws.codeartifact#AccessDeniedException":
1749
- response = {
1750
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1751
- name: errorCode,
1752
- $metadata: deserializeMetadata(output),
1753
- };
1754
- break;
1412
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1755
1413
  case "InternalServerException":
1756
1414
  case "com.amazonaws.codeartifact#InternalServerException":
1757
- response = {
1758
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1759
- name: errorCode,
1760
- $metadata: deserializeMetadata(output),
1761
- };
1762
- break;
1415
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1763
1416
  case "ResourceNotFoundException":
1764
1417
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1765
- response = {
1766
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1767
- name: errorCode,
1768
- $metadata: deserializeMetadata(output),
1769
- };
1770
- break;
1418
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1771
1419
  case "ThrottlingException":
1772
1420
  case "com.amazonaws.codeartifact#ThrottlingException":
1773
- response = {
1774
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1775
- name: errorCode,
1776
- $metadata: deserializeMetadata(output),
1777
- };
1778
- break;
1421
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1779
1422
  case "ValidationException":
1780
1423
  case "com.amazonaws.codeartifact#ValidationException":
1781
- response = {
1782
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1783
- name: errorCode,
1784
- $metadata: deserializeMetadata(output),
1785
- };
1786
- break;
1424
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1787
1425
  default:
1788
1426
  const parsedBody = parsedOutput.body;
1789
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1790
- response = {
1791
- ...parsedBody,
1792
- name: `${errorCode}`,
1793
- message: parsedBody.message || parsedBody.Message || errorCode,
1427
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1428
+ name: parsedBody.code || parsedBody.Code || errorCode,
1794
1429
  $fault: "client",
1795
1430
  $metadata: deserializeMetadata(output),
1796
- };
1431
+ });
1432
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1797
1433
  }
1798
- const message = response.message || response.Message || errorCode;
1799
- response.message = message;
1800
- delete response.Message;
1801
- return Promise.reject(Object.assign(new Error(message), response));
1802
1434
  };
1803
1435
  const deserializeAws_restJson1DescribePackageVersionCommand = async (output, context) => {
1804
1436
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1826,67 +1458,31 @@ const deserializeAws_restJson1DescribePackageVersionCommandError = async (output
1826
1458
  switch (errorCode) {
1827
1459
  case "AccessDeniedException":
1828
1460
  case "com.amazonaws.codeartifact#AccessDeniedException":
1829
- response = {
1830
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1831
- name: errorCode,
1832
- $metadata: deserializeMetadata(output),
1833
- };
1834
- break;
1461
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1835
1462
  case "ConflictException":
1836
1463
  case "com.amazonaws.codeartifact#ConflictException":
1837
- response = {
1838
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1839
- name: errorCode,
1840
- $metadata: deserializeMetadata(output),
1841
- };
1842
- break;
1464
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1843
1465
  case "InternalServerException":
1844
1466
  case "com.amazonaws.codeartifact#InternalServerException":
1845
- response = {
1846
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1847
- name: errorCode,
1848
- $metadata: deserializeMetadata(output),
1849
- };
1850
- break;
1467
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1851
1468
  case "ResourceNotFoundException":
1852
1469
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1853
- response = {
1854
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1855
- name: errorCode,
1856
- $metadata: deserializeMetadata(output),
1857
- };
1858
- break;
1470
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1859
1471
  case "ThrottlingException":
1860
1472
  case "com.amazonaws.codeartifact#ThrottlingException":
1861
- response = {
1862
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1863
- name: errorCode,
1864
- $metadata: deserializeMetadata(output),
1865
- };
1866
- break;
1473
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1867
1474
  case "ValidationException":
1868
1475
  case "com.amazonaws.codeartifact#ValidationException":
1869
- response = {
1870
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1871
- name: errorCode,
1872
- $metadata: deserializeMetadata(output),
1873
- };
1874
- break;
1476
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1875
1477
  default:
1876
1478
  const parsedBody = parsedOutput.body;
1877
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1878
- response = {
1879
- ...parsedBody,
1880
- name: `${errorCode}`,
1881
- message: parsedBody.message || parsedBody.Message || errorCode,
1479
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1480
+ name: parsedBody.code || parsedBody.Code || errorCode,
1882
1481
  $fault: "client",
1883
1482
  $metadata: deserializeMetadata(output),
1884
- };
1483
+ });
1484
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1885
1485
  }
1886
- const message = response.message || response.Message || errorCode;
1887
- response.message = message;
1888
- delete response.Message;
1889
- return Promise.reject(Object.assign(new Error(message), response));
1890
1486
  };
1891
1487
  const deserializeAws_restJson1DescribeRepositoryCommand = async (output, context) => {
1892
1488
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1914,59 +1510,28 @@ const deserializeAws_restJson1DescribeRepositoryCommandError = async (output, co
1914
1510
  switch (errorCode) {
1915
1511
  case "AccessDeniedException":
1916
1512
  case "com.amazonaws.codeartifact#AccessDeniedException":
1917
- response = {
1918
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1919
- name: errorCode,
1920
- $metadata: deserializeMetadata(output),
1921
- };
1922
- break;
1513
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1923
1514
  case "InternalServerException":
1924
1515
  case "com.amazonaws.codeartifact#InternalServerException":
1925
- response = {
1926
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1927
- name: errorCode,
1928
- $metadata: deserializeMetadata(output),
1929
- };
1930
- break;
1516
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1931
1517
  case "ResourceNotFoundException":
1932
1518
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
1933
- response = {
1934
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1935
- name: errorCode,
1936
- $metadata: deserializeMetadata(output),
1937
- };
1938
- break;
1519
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1939
1520
  case "ThrottlingException":
1940
1521
  case "com.amazonaws.codeartifact#ThrottlingException":
1941
- response = {
1942
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1943
- name: errorCode,
1944
- $metadata: deserializeMetadata(output),
1945
- };
1946
- break;
1522
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1947
1523
  case "ValidationException":
1948
1524
  case "com.amazonaws.codeartifact#ValidationException":
1949
- response = {
1950
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1951
- name: errorCode,
1952
- $metadata: deserializeMetadata(output),
1953
- };
1954
- break;
1525
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1955
1526
  default:
1956
1527
  const parsedBody = parsedOutput.body;
1957
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1958
- response = {
1959
- ...parsedBody,
1960
- name: `${errorCode}`,
1961
- message: parsedBody.message || parsedBody.Message || errorCode,
1528
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1529
+ name: parsedBody.code || parsedBody.Code || errorCode,
1962
1530
  $fault: "client",
1963
1531
  $metadata: deserializeMetadata(output),
1964
- };
1532
+ });
1533
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1965
1534
  }
1966
- const message = response.message || response.Message || errorCode;
1967
- response.message = message;
1968
- delete response.Message;
1969
- return Promise.reject(Object.assign(new Error(message), response));
1970
1535
  };
1971
1536
  const deserializeAws_restJson1DisassociateExternalConnectionCommand = async (output, context) => {
1972
1537
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1994,75 +1559,34 @@ const deserializeAws_restJson1DisassociateExternalConnectionCommandError = async
1994
1559
  switch (errorCode) {
1995
1560
  case "AccessDeniedException":
1996
1561
  case "com.amazonaws.codeartifact#AccessDeniedException":
1997
- response = {
1998
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1999
- name: errorCode,
2000
- $metadata: deserializeMetadata(output),
2001
- };
2002
- break;
1562
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2003
1563
  case "ConflictException":
2004
1564
  case "com.amazonaws.codeartifact#ConflictException":
2005
- response = {
2006
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2007
- name: errorCode,
2008
- $metadata: deserializeMetadata(output),
2009
- };
2010
- break;
1565
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2011
1566
  case "InternalServerException":
2012
1567
  case "com.amazonaws.codeartifact#InternalServerException":
2013
- response = {
2014
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2015
- name: errorCode,
2016
- $metadata: deserializeMetadata(output),
2017
- };
2018
- break;
1568
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2019
1569
  case "ResourceNotFoundException":
2020
1570
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2021
- response = {
2022
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2023
- name: errorCode,
2024
- $metadata: deserializeMetadata(output),
2025
- };
2026
- break;
1571
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2027
1572
  case "ServiceQuotaExceededException":
2028
1573
  case "com.amazonaws.codeartifact#ServiceQuotaExceededException":
2029
- response = {
2030
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
2031
- name: errorCode,
2032
- $metadata: deserializeMetadata(output),
2033
- };
2034
- break;
1574
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
2035
1575
  case "ThrottlingException":
2036
1576
  case "com.amazonaws.codeartifact#ThrottlingException":
2037
- response = {
2038
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2039
- name: errorCode,
2040
- $metadata: deserializeMetadata(output),
2041
- };
2042
- break;
1577
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2043
1578
  case "ValidationException":
2044
1579
  case "com.amazonaws.codeartifact#ValidationException":
2045
- response = {
2046
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2047
- name: errorCode,
2048
- $metadata: deserializeMetadata(output),
2049
- };
2050
- break;
1580
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2051
1581
  default:
2052
1582
  const parsedBody = parsedOutput.body;
2053
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2054
- response = {
2055
- ...parsedBody,
2056
- name: `${errorCode}`,
2057
- message: parsedBody.message || parsedBody.Message || errorCode,
1583
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1584
+ name: parsedBody.code || parsedBody.Code || errorCode,
2058
1585
  $fault: "client",
2059
1586
  $metadata: deserializeMetadata(output),
2060
- };
1587
+ });
1588
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2061
1589
  }
2062
- const message = response.message || response.Message || errorCode;
2063
- response.message = message;
2064
- delete response.Message;
2065
- return Promise.reject(Object.assign(new Error(message), response));
2066
1590
  };
2067
1591
  const deserializeAws_restJson1DisposePackageVersionsCommand = async (output, context) => {
2068
1592
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2094,67 +1618,31 @@ const deserializeAws_restJson1DisposePackageVersionsCommandError = async (output
2094
1618
  switch (errorCode) {
2095
1619
  case "AccessDeniedException":
2096
1620
  case "com.amazonaws.codeartifact#AccessDeniedException":
2097
- response = {
2098
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2099
- name: errorCode,
2100
- $metadata: deserializeMetadata(output),
2101
- };
2102
- break;
1621
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2103
1622
  case "ConflictException":
2104
1623
  case "com.amazonaws.codeartifact#ConflictException":
2105
- response = {
2106
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2107
- name: errorCode,
2108
- $metadata: deserializeMetadata(output),
2109
- };
2110
- break;
1624
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2111
1625
  case "InternalServerException":
2112
1626
  case "com.amazonaws.codeartifact#InternalServerException":
2113
- response = {
2114
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2115
- name: errorCode,
2116
- $metadata: deserializeMetadata(output),
2117
- };
2118
- break;
1627
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2119
1628
  case "ResourceNotFoundException":
2120
1629
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2121
- response = {
2122
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2123
- name: errorCode,
2124
- $metadata: deserializeMetadata(output),
2125
- };
2126
- break;
1630
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2127
1631
  case "ThrottlingException":
2128
1632
  case "com.amazonaws.codeartifact#ThrottlingException":
2129
- response = {
2130
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2131
- name: errorCode,
2132
- $metadata: deserializeMetadata(output),
2133
- };
2134
- break;
1633
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2135
1634
  case "ValidationException":
2136
1635
  case "com.amazonaws.codeartifact#ValidationException":
2137
- response = {
2138
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2139
- name: errorCode,
2140
- $metadata: deserializeMetadata(output),
2141
- };
2142
- break;
1636
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2143
1637
  default:
2144
1638
  const parsedBody = parsedOutput.body;
2145
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2146
- response = {
2147
- ...parsedBody,
2148
- name: `${errorCode}`,
2149
- message: parsedBody.message || parsedBody.Message || errorCode,
1639
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1640
+ name: parsedBody.code || parsedBody.Code || errorCode,
2150
1641
  $fault: "client",
2151
1642
  $metadata: deserializeMetadata(output),
2152
- };
1643
+ });
1644
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2153
1645
  }
2154
- const message = response.message || response.Message || errorCode;
2155
- response.message = message;
2156
- delete response.Message;
2157
- return Promise.reject(Object.assign(new Error(message), response));
2158
1646
  };
2159
1647
  const deserializeAws_restJson1GetAuthorizationTokenCommand = async (output, context) => {
2160
1648
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2186,59 +1674,28 @@ const deserializeAws_restJson1GetAuthorizationTokenCommandError = async (output,
2186
1674
  switch (errorCode) {
2187
1675
  case "AccessDeniedException":
2188
1676
  case "com.amazonaws.codeartifact#AccessDeniedException":
2189
- response = {
2190
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2191
- name: errorCode,
2192
- $metadata: deserializeMetadata(output),
2193
- };
2194
- break;
1677
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2195
1678
  case "InternalServerException":
2196
1679
  case "com.amazonaws.codeartifact#InternalServerException":
2197
- response = {
2198
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2199
- name: errorCode,
2200
- $metadata: deserializeMetadata(output),
2201
- };
2202
- break;
1680
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2203
1681
  case "ResourceNotFoundException":
2204
1682
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2205
- response = {
2206
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2207
- name: errorCode,
2208
- $metadata: deserializeMetadata(output),
2209
- };
2210
- break;
1683
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2211
1684
  case "ThrottlingException":
2212
1685
  case "com.amazonaws.codeartifact#ThrottlingException":
2213
- response = {
2214
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2215
- name: errorCode,
2216
- $metadata: deserializeMetadata(output),
2217
- };
2218
- break;
1686
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2219
1687
  case "ValidationException":
2220
1688
  case "com.amazonaws.codeartifact#ValidationException":
2221
- response = {
2222
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2223
- name: errorCode,
2224
- $metadata: deserializeMetadata(output),
2225
- };
2226
- break;
1689
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2227
1690
  default:
2228
1691
  const parsedBody = parsedOutput.body;
2229
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2230
- response = {
2231
- ...parsedBody,
2232
- name: `${errorCode}`,
2233
- message: parsedBody.message || parsedBody.Message || errorCode,
1692
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1693
+ name: parsedBody.code || parsedBody.Code || errorCode,
2234
1694
  $fault: "client",
2235
1695
  $metadata: deserializeMetadata(output),
2236
- };
1696
+ });
1697
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2237
1698
  }
2238
- const message = response.message || response.Message || errorCode;
2239
- response.message = message;
2240
- delete response.Message;
2241
- return Promise.reject(Object.assign(new Error(message), response));
2242
1699
  };
2243
1700
  const deserializeAws_restJson1GetDomainPermissionsPolicyCommand = async (output, context) => {
2244
1701
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2266,59 +1723,28 @@ const deserializeAws_restJson1GetDomainPermissionsPolicyCommandError = async (ou
2266
1723
  switch (errorCode) {
2267
1724
  case "AccessDeniedException":
2268
1725
  case "com.amazonaws.codeartifact#AccessDeniedException":
2269
- response = {
2270
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2271
- name: errorCode,
2272
- $metadata: deserializeMetadata(output),
2273
- };
2274
- break;
1726
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2275
1727
  case "InternalServerException":
2276
1728
  case "com.amazonaws.codeartifact#InternalServerException":
2277
- response = {
2278
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2279
- name: errorCode,
2280
- $metadata: deserializeMetadata(output),
2281
- };
2282
- break;
1729
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2283
1730
  case "ResourceNotFoundException":
2284
1731
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2285
- response = {
2286
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2287
- name: errorCode,
2288
- $metadata: deserializeMetadata(output),
2289
- };
2290
- break;
1732
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2291
1733
  case "ThrottlingException":
2292
1734
  case "com.amazonaws.codeartifact#ThrottlingException":
2293
- response = {
2294
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2295
- name: errorCode,
2296
- $metadata: deserializeMetadata(output),
2297
- };
2298
- break;
1735
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2299
1736
  case "ValidationException":
2300
1737
  case "com.amazonaws.codeartifact#ValidationException":
2301
- response = {
2302
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2303
- name: errorCode,
2304
- $metadata: deserializeMetadata(output),
2305
- };
2306
- break;
1738
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2307
1739
  default:
2308
1740
  const parsedBody = parsedOutput.body;
2309
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2310
- response = {
2311
- ...parsedBody,
2312
- name: `${errorCode}`,
2313
- message: parsedBody.message || parsedBody.Message || errorCode,
1741
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1742
+ name: parsedBody.code || parsedBody.Code || errorCode,
2314
1743
  $fault: "client",
2315
1744
  $metadata: deserializeMetadata(output),
2316
- };
1745
+ });
1746
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2317
1747
  }
2318
- const message = response.message || response.Message || errorCode;
2319
- response.message = message;
2320
- delete response.Message;
2321
- return Promise.reject(Object.assign(new Error(message), response));
2322
1748
  };
2323
1749
  const deserializeAws_restJson1GetPackageVersionAssetCommand = async (output, context) => {
2324
1750
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2356,67 +1782,31 @@ const deserializeAws_restJson1GetPackageVersionAssetCommandError = async (output
2356
1782
  switch (errorCode) {
2357
1783
  case "AccessDeniedException":
2358
1784
  case "com.amazonaws.codeartifact#AccessDeniedException":
2359
- response = {
2360
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2361
- name: errorCode,
2362
- $metadata: deserializeMetadata(output),
2363
- };
2364
- break;
1785
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2365
1786
  case "ConflictException":
2366
1787
  case "com.amazonaws.codeartifact#ConflictException":
2367
- response = {
2368
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2369
- name: errorCode,
2370
- $metadata: deserializeMetadata(output),
2371
- };
2372
- break;
1788
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2373
1789
  case "InternalServerException":
2374
1790
  case "com.amazonaws.codeartifact#InternalServerException":
2375
- response = {
2376
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2377
- name: errorCode,
2378
- $metadata: deserializeMetadata(output),
2379
- };
2380
- break;
1791
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2381
1792
  case "ResourceNotFoundException":
2382
1793
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2383
- response = {
2384
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2385
- name: errorCode,
2386
- $metadata: deserializeMetadata(output),
2387
- };
2388
- break;
1794
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2389
1795
  case "ThrottlingException":
2390
1796
  case "com.amazonaws.codeartifact#ThrottlingException":
2391
- response = {
2392
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2393
- name: errorCode,
2394
- $metadata: deserializeMetadata(output),
2395
- };
2396
- break;
1797
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2397
1798
  case "ValidationException":
2398
1799
  case "com.amazonaws.codeartifact#ValidationException":
2399
- response = {
2400
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2401
- name: errorCode,
2402
- $metadata: deserializeMetadata(output),
2403
- };
2404
- break;
1800
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2405
1801
  default:
2406
1802
  const parsedBody = parsedOutput.body;
2407
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2408
- response = {
2409
- ...parsedBody,
2410
- name: `${errorCode}`,
2411
- message: parsedBody.message || parsedBody.Message || errorCode,
1803
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1804
+ name: parsedBody.code || parsedBody.Code || errorCode,
2412
1805
  $fault: "client",
2413
1806
  $metadata: deserializeMetadata(output),
2414
- };
1807
+ });
1808
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2415
1809
  }
2416
- const message = response.message || response.Message || errorCode;
2417
- response.message = message;
2418
- delete response.Message;
2419
- return Promise.reject(Object.assign(new Error(message), response));
2420
1810
  };
2421
1811
  const deserializeAws_restJson1GetPackageVersionReadmeCommand = async (output, context) => {
2422
1812
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2464,59 +1854,28 @@ const deserializeAws_restJson1GetPackageVersionReadmeCommandError = async (outpu
2464
1854
  switch (errorCode) {
2465
1855
  case "AccessDeniedException":
2466
1856
  case "com.amazonaws.codeartifact#AccessDeniedException":
2467
- response = {
2468
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2469
- name: errorCode,
2470
- $metadata: deserializeMetadata(output),
2471
- };
2472
- break;
1857
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2473
1858
  case "InternalServerException":
2474
1859
  case "com.amazonaws.codeartifact#InternalServerException":
2475
- response = {
2476
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2477
- name: errorCode,
2478
- $metadata: deserializeMetadata(output),
2479
- };
2480
- break;
1860
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2481
1861
  case "ResourceNotFoundException":
2482
1862
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2483
- response = {
2484
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2485
- name: errorCode,
2486
- $metadata: deserializeMetadata(output),
2487
- };
2488
- break;
1863
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2489
1864
  case "ThrottlingException":
2490
1865
  case "com.amazonaws.codeartifact#ThrottlingException":
2491
- response = {
2492
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2493
- name: errorCode,
2494
- $metadata: deserializeMetadata(output),
2495
- };
2496
- break;
1866
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2497
1867
  case "ValidationException":
2498
1868
  case "com.amazonaws.codeartifact#ValidationException":
2499
- response = {
2500
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2501
- name: errorCode,
2502
- $metadata: deserializeMetadata(output),
2503
- };
2504
- break;
1869
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2505
1870
  default:
2506
1871
  const parsedBody = parsedOutput.body;
2507
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2508
- response = {
2509
- ...parsedBody,
2510
- name: `${errorCode}`,
2511
- message: parsedBody.message || parsedBody.Message || errorCode,
1872
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1873
+ name: parsedBody.code || parsedBody.Code || errorCode,
2512
1874
  $fault: "client",
2513
1875
  $metadata: deserializeMetadata(output),
2514
- };
1876
+ });
1877
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2515
1878
  }
2516
- const message = response.message || response.Message || errorCode;
2517
- response.message = message;
2518
- delete response.Message;
2519
- return Promise.reject(Object.assign(new Error(message), response));
2520
1879
  };
2521
1880
  const deserializeAws_restJson1GetRepositoryEndpointCommand = async (output, context) => {
2522
1881
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2544,59 +1903,28 @@ const deserializeAws_restJson1GetRepositoryEndpointCommandError = async (output,
2544
1903
  switch (errorCode) {
2545
1904
  case "AccessDeniedException":
2546
1905
  case "com.amazonaws.codeartifact#AccessDeniedException":
2547
- response = {
2548
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2549
- name: errorCode,
2550
- $metadata: deserializeMetadata(output),
2551
- };
2552
- break;
1906
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2553
1907
  case "InternalServerException":
2554
1908
  case "com.amazonaws.codeartifact#InternalServerException":
2555
- response = {
2556
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2557
- name: errorCode,
2558
- $metadata: deserializeMetadata(output),
2559
- };
2560
- break;
1909
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2561
1910
  case "ResourceNotFoundException":
2562
1911
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2563
- response = {
2564
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2565
- name: errorCode,
2566
- $metadata: deserializeMetadata(output),
2567
- };
2568
- break;
1912
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2569
1913
  case "ThrottlingException":
2570
1914
  case "com.amazonaws.codeartifact#ThrottlingException":
2571
- response = {
2572
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2573
- name: errorCode,
2574
- $metadata: deserializeMetadata(output),
2575
- };
2576
- break;
1915
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2577
1916
  case "ValidationException":
2578
1917
  case "com.amazonaws.codeartifact#ValidationException":
2579
- response = {
2580
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2581
- name: errorCode,
2582
- $metadata: deserializeMetadata(output),
2583
- };
2584
- break;
1918
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2585
1919
  default:
2586
1920
  const parsedBody = parsedOutput.body;
2587
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2588
- response = {
2589
- ...parsedBody,
2590
- name: `${errorCode}`,
2591
- message: parsedBody.message || parsedBody.Message || errorCode,
1921
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1922
+ name: parsedBody.code || parsedBody.Code || errorCode,
2592
1923
  $fault: "client",
2593
1924
  $metadata: deserializeMetadata(output),
2594
- };
1925
+ });
1926
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2595
1927
  }
2596
- const message = response.message || response.Message || errorCode;
2597
- response.message = message;
2598
- delete response.Message;
2599
- return Promise.reject(Object.assign(new Error(message), response));
2600
1928
  };
2601
1929
  const deserializeAws_restJson1GetRepositoryPermissionsPolicyCommand = async (output, context) => {
2602
1930
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2624,59 +1952,28 @@ const deserializeAws_restJson1GetRepositoryPermissionsPolicyCommandError = async
2624
1952
  switch (errorCode) {
2625
1953
  case "AccessDeniedException":
2626
1954
  case "com.amazonaws.codeartifact#AccessDeniedException":
2627
- response = {
2628
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2629
- name: errorCode,
2630
- $metadata: deserializeMetadata(output),
2631
- };
2632
- break;
1955
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2633
1956
  case "InternalServerException":
2634
1957
  case "com.amazonaws.codeartifact#InternalServerException":
2635
- response = {
2636
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2637
- name: errorCode,
2638
- $metadata: deserializeMetadata(output),
2639
- };
2640
- break;
1958
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2641
1959
  case "ResourceNotFoundException":
2642
1960
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2643
- response = {
2644
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2645
- name: errorCode,
2646
- $metadata: deserializeMetadata(output),
2647
- };
2648
- break;
1961
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2649
1962
  case "ThrottlingException":
2650
1963
  case "com.amazonaws.codeartifact#ThrottlingException":
2651
- response = {
2652
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2653
- name: errorCode,
2654
- $metadata: deserializeMetadata(output),
2655
- };
2656
- break;
1964
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2657
1965
  case "ValidationException":
2658
1966
  case "com.amazonaws.codeartifact#ValidationException":
2659
- response = {
2660
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2661
- name: errorCode,
2662
- $metadata: deserializeMetadata(output),
2663
- };
2664
- break;
1967
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2665
1968
  default:
2666
1969
  const parsedBody = parsedOutput.body;
2667
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2668
- response = {
2669
- ...parsedBody,
2670
- name: `${errorCode}`,
2671
- message: parsedBody.message || parsedBody.Message || errorCode,
1970
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
1971
+ name: parsedBody.code || parsedBody.Code || errorCode,
2672
1972
  $fault: "client",
2673
1973
  $metadata: deserializeMetadata(output),
2674
- };
1974
+ });
1975
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2675
1976
  }
2676
- const message = response.message || response.Message || errorCode;
2677
- response.message = message;
2678
- delete response.Message;
2679
- return Promise.reject(Object.assign(new Error(message), response));
2680
1977
  };
2681
1978
  const deserializeAws_restJson1ListDomainsCommand = async (output, context) => {
2682
1979
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2708,51 +2005,25 @@ const deserializeAws_restJson1ListDomainsCommandError = async (output, context)
2708
2005
  switch (errorCode) {
2709
2006
  case "AccessDeniedException":
2710
2007
  case "com.amazonaws.codeartifact#AccessDeniedException":
2711
- response = {
2712
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2713
- name: errorCode,
2714
- $metadata: deserializeMetadata(output),
2715
- };
2716
- break;
2008
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2717
2009
  case "InternalServerException":
2718
2010
  case "com.amazonaws.codeartifact#InternalServerException":
2719
- response = {
2720
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2721
- name: errorCode,
2722
- $metadata: deserializeMetadata(output),
2723
- };
2724
- break;
2011
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2725
2012
  case "ThrottlingException":
2726
2013
  case "com.amazonaws.codeartifact#ThrottlingException":
2727
- response = {
2728
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2729
- name: errorCode,
2730
- $metadata: deserializeMetadata(output),
2731
- };
2732
- break;
2014
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2733
2015
  case "ValidationException":
2734
2016
  case "com.amazonaws.codeartifact#ValidationException":
2735
- response = {
2736
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2737
- name: errorCode,
2738
- $metadata: deserializeMetadata(output),
2739
- };
2740
- break;
2017
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2741
2018
  default:
2742
2019
  const parsedBody = parsedOutput.body;
2743
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2744
- response = {
2745
- ...parsedBody,
2746
- name: `${errorCode}`,
2747
- message: parsedBody.message || parsedBody.Message || errorCode,
2020
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2021
+ name: parsedBody.code || parsedBody.Code || errorCode,
2748
2022
  $fault: "client",
2749
2023
  $metadata: deserializeMetadata(output),
2750
- };
2024
+ });
2025
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2751
2026
  }
2752
- const message = response.message || response.Message || errorCode;
2753
- response.message = message;
2754
- delete response.Message;
2755
- return Promise.reject(Object.assign(new Error(message), response));
2756
2027
  };
2757
2028
  const deserializeAws_restJson1ListPackagesCommand = async (output, context) => {
2758
2029
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2784,59 +2055,28 @@ const deserializeAws_restJson1ListPackagesCommandError = async (output, context)
2784
2055
  switch (errorCode) {
2785
2056
  case "AccessDeniedException":
2786
2057
  case "com.amazonaws.codeartifact#AccessDeniedException":
2787
- response = {
2788
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2789
- name: errorCode,
2790
- $metadata: deserializeMetadata(output),
2791
- };
2792
- break;
2058
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2793
2059
  case "InternalServerException":
2794
2060
  case "com.amazonaws.codeartifact#InternalServerException":
2795
- response = {
2796
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2797
- name: errorCode,
2798
- $metadata: deserializeMetadata(output),
2799
- };
2800
- break;
2061
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2801
2062
  case "ResourceNotFoundException":
2802
2063
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2803
- response = {
2804
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2805
- name: errorCode,
2806
- $metadata: deserializeMetadata(output),
2807
- };
2808
- break;
2064
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2809
2065
  case "ThrottlingException":
2810
2066
  case "com.amazonaws.codeartifact#ThrottlingException":
2811
- response = {
2812
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2813
- name: errorCode,
2814
- $metadata: deserializeMetadata(output),
2815
- };
2816
- break;
2067
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2817
2068
  case "ValidationException":
2818
2069
  case "com.amazonaws.codeartifact#ValidationException":
2819
- response = {
2820
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2821
- name: errorCode,
2822
- $metadata: deserializeMetadata(output),
2823
- };
2824
- break;
2070
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2825
2071
  default:
2826
2072
  const parsedBody = parsedOutput.body;
2827
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2828
- response = {
2829
- ...parsedBody,
2830
- name: `${errorCode}`,
2831
- message: parsedBody.message || parsedBody.Message || errorCode,
2073
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2074
+ name: parsedBody.code || parsedBody.Code || errorCode,
2832
2075
  $fault: "client",
2833
2076
  $metadata: deserializeMetadata(output),
2834
- };
2077
+ });
2078
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2835
2079
  }
2836
- const message = response.message || response.Message || errorCode;
2837
- response.message = message;
2838
- delete response.Message;
2839
- return Promise.reject(Object.assign(new Error(message), response));
2840
2080
  };
2841
2081
  const deserializeAws_restJson1ListPackageVersionAssetsCommand = async (output, context) => {
2842
2082
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2888,59 +2128,28 @@ const deserializeAws_restJson1ListPackageVersionAssetsCommandError = async (outp
2888
2128
  switch (errorCode) {
2889
2129
  case "AccessDeniedException":
2890
2130
  case "com.amazonaws.codeartifact#AccessDeniedException":
2891
- response = {
2892
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2893
- name: errorCode,
2894
- $metadata: deserializeMetadata(output),
2895
- };
2896
- break;
2131
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2897
2132
  case "InternalServerException":
2898
2133
  case "com.amazonaws.codeartifact#InternalServerException":
2899
- response = {
2900
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2901
- name: errorCode,
2902
- $metadata: deserializeMetadata(output),
2903
- };
2904
- break;
2134
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2905
2135
  case "ResourceNotFoundException":
2906
2136
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
2907
- response = {
2908
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2909
- name: errorCode,
2910
- $metadata: deserializeMetadata(output),
2911
- };
2912
- break;
2137
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2913
2138
  case "ThrottlingException":
2914
2139
  case "com.amazonaws.codeartifact#ThrottlingException":
2915
- response = {
2916
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2917
- name: errorCode,
2918
- $metadata: deserializeMetadata(output),
2919
- };
2920
- break;
2140
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2921
2141
  case "ValidationException":
2922
2142
  case "com.amazonaws.codeartifact#ValidationException":
2923
- response = {
2924
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2925
- name: errorCode,
2926
- $metadata: deserializeMetadata(output),
2927
- };
2928
- break;
2143
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2929
2144
  default:
2930
2145
  const parsedBody = parsedOutput.body;
2931
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2932
- response = {
2933
- ...parsedBody,
2934
- name: `${errorCode}`,
2935
- message: parsedBody.message || parsedBody.Message || errorCode,
2146
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2147
+ name: parsedBody.code || parsedBody.Code || errorCode,
2936
2148
  $fault: "client",
2937
2149
  $metadata: deserializeMetadata(output),
2938
- };
2150
+ });
2151
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2939
2152
  }
2940
- const message = response.message || response.Message || errorCode;
2941
- response.message = message;
2942
- delete response.Message;
2943
- return Promise.reject(Object.assign(new Error(message), response));
2944
2153
  };
2945
2154
  const deserializeAws_restJson1ListPackageVersionDependenciesCommand = async (output, context) => {
2946
2155
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2992,59 +2201,28 @@ const deserializeAws_restJson1ListPackageVersionDependenciesCommandError = async
2992
2201
  switch (errorCode) {
2993
2202
  case "AccessDeniedException":
2994
2203
  case "com.amazonaws.codeartifact#AccessDeniedException":
2995
- response = {
2996
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2997
- name: errorCode,
2998
- $metadata: deserializeMetadata(output),
2999
- };
3000
- break;
2204
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3001
2205
  case "InternalServerException":
3002
2206
  case "com.amazonaws.codeartifact#InternalServerException":
3003
- response = {
3004
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3005
- name: errorCode,
3006
- $metadata: deserializeMetadata(output),
3007
- };
3008
- break;
2207
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3009
2208
  case "ResourceNotFoundException":
3010
2209
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3011
- response = {
3012
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3013
- name: errorCode,
3014
- $metadata: deserializeMetadata(output),
3015
- };
3016
- break;
2210
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3017
2211
  case "ThrottlingException":
3018
2212
  case "com.amazonaws.codeartifact#ThrottlingException":
3019
- response = {
3020
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3021
- name: errorCode,
3022
- $metadata: deserializeMetadata(output),
3023
- };
3024
- break;
2213
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3025
2214
  case "ValidationException":
3026
2215
  case "com.amazonaws.codeartifact#ValidationException":
3027
- response = {
3028
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3029
- name: errorCode,
3030
- $metadata: deserializeMetadata(output),
3031
- };
3032
- break;
2216
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3033
2217
  default:
3034
2218
  const parsedBody = parsedOutput.body;
3035
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3036
- response = {
3037
- ...parsedBody,
3038
- name: `${errorCode}`,
3039
- message: parsedBody.message || parsedBody.Message || errorCode,
2219
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2220
+ name: parsedBody.code || parsedBody.Code || errorCode,
3040
2221
  $fault: "client",
3041
2222
  $metadata: deserializeMetadata(output),
3042
- };
2223
+ });
2224
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3043
2225
  }
3044
- const message = response.message || response.Message || errorCode;
3045
- response.message = message;
3046
- delete response.Message;
3047
- return Promise.reject(Object.assign(new Error(message), response));
3048
2226
  };
3049
2227
  const deserializeAws_restJson1ListPackageVersionsCommand = async (output, context) => {
3050
2228
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3092,59 +2270,28 @@ const deserializeAws_restJson1ListPackageVersionsCommandError = async (output, c
3092
2270
  switch (errorCode) {
3093
2271
  case "AccessDeniedException":
3094
2272
  case "com.amazonaws.codeartifact#AccessDeniedException":
3095
- response = {
3096
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3097
- name: errorCode,
3098
- $metadata: deserializeMetadata(output),
3099
- };
3100
- break;
2273
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3101
2274
  case "InternalServerException":
3102
2275
  case "com.amazonaws.codeartifact#InternalServerException":
3103
- response = {
3104
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3105
- name: errorCode,
3106
- $metadata: deserializeMetadata(output),
3107
- };
3108
- break;
2276
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3109
2277
  case "ResourceNotFoundException":
3110
2278
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3111
- response = {
3112
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3113
- name: errorCode,
3114
- $metadata: deserializeMetadata(output),
3115
- };
3116
- break;
2279
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3117
2280
  case "ThrottlingException":
3118
2281
  case "com.amazonaws.codeartifact#ThrottlingException":
3119
- response = {
3120
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3121
- name: errorCode,
3122
- $metadata: deserializeMetadata(output),
3123
- };
3124
- break;
2282
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3125
2283
  case "ValidationException":
3126
2284
  case "com.amazonaws.codeartifact#ValidationException":
3127
- response = {
3128
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3129
- name: errorCode,
3130
- $metadata: deserializeMetadata(output),
3131
- };
3132
- break;
2285
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3133
2286
  default:
3134
2287
  const parsedBody = parsedOutput.body;
3135
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3136
- response = {
3137
- ...parsedBody,
3138
- name: `${errorCode}`,
3139
- message: parsedBody.message || parsedBody.Message || errorCode,
2288
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2289
+ name: parsedBody.code || parsedBody.Code || errorCode,
3140
2290
  $fault: "client",
3141
2291
  $metadata: deserializeMetadata(output),
3142
- };
2292
+ });
2293
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3143
2294
  }
3144
- const message = response.message || response.Message || errorCode;
3145
- response.message = message;
3146
- delete response.Message;
3147
- return Promise.reject(Object.assign(new Error(message), response));
3148
2295
  };
3149
2296
  const deserializeAws_restJson1ListRepositoriesCommand = async (output, context) => {
3150
2297
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3176,51 +2323,25 @@ const deserializeAws_restJson1ListRepositoriesCommandError = async (output, cont
3176
2323
  switch (errorCode) {
3177
2324
  case "AccessDeniedException":
3178
2325
  case "com.amazonaws.codeartifact#AccessDeniedException":
3179
- response = {
3180
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3181
- name: errorCode,
3182
- $metadata: deserializeMetadata(output),
3183
- };
3184
- break;
2326
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3185
2327
  case "InternalServerException":
3186
2328
  case "com.amazonaws.codeartifact#InternalServerException":
3187
- response = {
3188
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3189
- name: errorCode,
3190
- $metadata: deserializeMetadata(output),
3191
- };
3192
- break;
2329
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3193
2330
  case "ThrottlingException":
3194
2331
  case "com.amazonaws.codeartifact#ThrottlingException":
3195
- response = {
3196
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3197
- name: errorCode,
3198
- $metadata: deserializeMetadata(output),
3199
- };
3200
- break;
2332
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3201
2333
  case "ValidationException":
3202
2334
  case "com.amazonaws.codeartifact#ValidationException":
3203
- response = {
3204
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3205
- name: errorCode,
3206
- $metadata: deserializeMetadata(output),
3207
- };
3208
- break;
2335
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3209
2336
  default:
3210
2337
  const parsedBody = parsedOutput.body;
3211
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3212
- response = {
3213
- ...parsedBody,
3214
- name: `${errorCode}`,
3215
- message: parsedBody.message || parsedBody.Message || errorCode,
2338
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2339
+ name: parsedBody.code || parsedBody.Code || errorCode,
3216
2340
  $fault: "client",
3217
2341
  $metadata: deserializeMetadata(output),
3218
- };
2342
+ });
2343
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3219
2344
  }
3220
- const message = response.message || response.Message || errorCode;
3221
- response.message = message;
3222
- delete response.Message;
3223
- return Promise.reject(Object.assign(new Error(message), response));
3224
2345
  };
3225
2346
  const deserializeAws_restJson1ListRepositoriesInDomainCommand = async (output, context) => {
3226
2347
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3252,59 +2373,28 @@ const deserializeAws_restJson1ListRepositoriesInDomainCommandError = async (outp
3252
2373
  switch (errorCode) {
3253
2374
  case "AccessDeniedException":
3254
2375
  case "com.amazonaws.codeartifact#AccessDeniedException":
3255
- response = {
3256
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3257
- name: errorCode,
3258
- $metadata: deserializeMetadata(output),
3259
- };
3260
- break;
2376
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3261
2377
  case "InternalServerException":
3262
2378
  case "com.amazonaws.codeartifact#InternalServerException":
3263
- response = {
3264
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3265
- name: errorCode,
3266
- $metadata: deserializeMetadata(output),
3267
- };
3268
- break;
2379
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3269
2380
  case "ResourceNotFoundException":
3270
2381
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3271
- response = {
3272
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3273
- name: errorCode,
3274
- $metadata: deserializeMetadata(output),
3275
- };
3276
- break;
2382
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3277
2383
  case "ThrottlingException":
3278
2384
  case "com.amazonaws.codeartifact#ThrottlingException":
3279
- response = {
3280
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3281
- name: errorCode,
3282
- $metadata: deserializeMetadata(output),
3283
- };
3284
- break;
2385
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3285
2386
  case "ValidationException":
3286
2387
  case "com.amazonaws.codeartifact#ValidationException":
3287
- response = {
3288
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3289
- name: errorCode,
3290
- $metadata: deserializeMetadata(output),
3291
- };
3292
- break;
2388
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3293
2389
  default:
3294
2390
  const parsedBody = parsedOutput.body;
3295
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3296
- response = {
3297
- ...parsedBody,
3298
- name: `${errorCode}`,
3299
- message: parsedBody.message || parsedBody.Message || errorCode,
2391
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2392
+ name: parsedBody.code || parsedBody.Code || errorCode,
3300
2393
  $fault: "client",
3301
2394
  $metadata: deserializeMetadata(output),
3302
- };
2395
+ });
2396
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3303
2397
  }
3304
- const message = response.message || response.Message || errorCode;
3305
- response.message = message;
3306
- delete response.Message;
3307
- return Promise.reject(Object.assign(new Error(message), response));
3308
2398
  };
3309
2399
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
3310
2400
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3332,51 +2422,25 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
3332
2422
  switch (errorCode) {
3333
2423
  case "AccessDeniedException":
3334
2424
  case "com.amazonaws.codeartifact#AccessDeniedException":
3335
- response = {
3336
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3337
- name: errorCode,
3338
- $metadata: deserializeMetadata(output),
3339
- };
3340
- break;
2425
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3341
2426
  case "ResourceNotFoundException":
3342
2427
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3343
- response = {
3344
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3345
- name: errorCode,
3346
- $metadata: deserializeMetadata(output),
3347
- };
3348
- break;
2428
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3349
2429
  case "ThrottlingException":
3350
2430
  case "com.amazonaws.codeartifact#ThrottlingException":
3351
- response = {
3352
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3353
- name: errorCode,
3354
- $metadata: deserializeMetadata(output),
3355
- };
3356
- break;
2431
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3357
2432
  case "ValidationException":
3358
2433
  case "com.amazonaws.codeartifact#ValidationException":
3359
- response = {
3360
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3361
- name: errorCode,
3362
- $metadata: deserializeMetadata(output),
3363
- };
3364
- break;
2434
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3365
2435
  default:
3366
2436
  const parsedBody = parsedOutput.body;
3367
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3368
- response = {
3369
- ...parsedBody,
3370
- name: `${errorCode}`,
3371
- message: parsedBody.message || parsedBody.Message || errorCode,
2437
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2438
+ name: parsedBody.code || parsedBody.Code || errorCode,
3372
2439
  $fault: "client",
3373
2440
  $metadata: deserializeMetadata(output),
3374
- };
2441
+ });
2442
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3375
2443
  }
3376
- const message = response.message || response.Message || errorCode;
3377
- response.message = message;
3378
- delete response.Message;
3379
- return Promise.reject(Object.assign(new Error(message), response));
3380
2444
  };
3381
2445
  const deserializeAws_restJson1PutDomainPermissionsPolicyCommand = async (output, context) => {
3382
2446
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3404,75 +2468,34 @@ const deserializeAws_restJson1PutDomainPermissionsPolicyCommandError = async (ou
3404
2468
  switch (errorCode) {
3405
2469
  case "AccessDeniedException":
3406
2470
  case "com.amazonaws.codeartifact#AccessDeniedException":
3407
- response = {
3408
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3409
- name: errorCode,
3410
- $metadata: deserializeMetadata(output),
3411
- };
3412
- break;
2471
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3413
2472
  case "ConflictException":
3414
2473
  case "com.amazonaws.codeartifact#ConflictException":
3415
- response = {
3416
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
3417
- name: errorCode,
3418
- $metadata: deserializeMetadata(output),
3419
- };
3420
- break;
2474
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3421
2475
  case "InternalServerException":
3422
2476
  case "com.amazonaws.codeartifact#InternalServerException":
3423
- response = {
3424
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3425
- name: errorCode,
3426
- $metadata: deserializeMetadata(output),
3427
- };
3428
- break;
2477
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3429
2478
  case "ResourceNotFoundException":
3430
2479
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3431
- response = {
3432
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3433
- name: errorCode,
3434
- $metadata: deserializeMetadata(output),
3435
- };
3436
- break;
2480
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3437
2481
  case "ServiceQuotaExceededException":
3438
2482
  case "com.amazonaws.codeartifact#ServiceQuotaExceededException":
3439
- response = {
3440
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
3441
- name: errorCode,
3442
- $metadata: deserializeMetadata(output),
3443
- };
3444
- break;
2483
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
3445
2484
  case "ThrottlingException":
3446
2485
  case "com.amazonaws.codeartifact#ThrottlingException":
3447
- response = {
3448
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3449
- name: errorCode,
3450
- $metadata: deserializeMetadata(output),
3451
- };
3452
- break;
2486
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3453
2487
  case "ValidationException":
3454
2488
  case "com.amazonaws.codeartifact#ValidationException":
3455
- response = {
3456
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3457
- name: errorCode,
3458
- $metadata: deserializeMetadata(output),
3459
- };
3460
- break;
2489
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3461
2490
  default:
3462
2491
  const parsedBody = parsedOutput.body;
3463
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3464
- response = {
3465
- ...parsedBody,
3466
- name: `${errorCode}`,
3467
- message: parsedBody.message || parsedBody.Message || errorCode,
2492
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2493
+ name: parsedBody.code || parsedBody.Code || errorCode,
3468
2494
  $fault: "client",
3469
2495
  $metadata: deserializeMetadata(output),
3470
- };
2496
+ });
2497
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3471
2498
  }
3472
- const message = response.message || response.Message || errorCode;
3473
- response.message = message;
3474
- delete response.Message;
3475
- return Promise.reject(Object.assign(new Error(message), response));
3476
2499
  };
3477
2500
  const deserializeAws_restJson1PutRepositoryPermissionsPolicyCommand = async (output, context) => {
3478
2501
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3500,75 +2523,34 @@ const deserializeAws_restJson1PutRepositoryPermissionsPolicyCommandError = async
3500
2523
  switch (errorCode) {
3501
2524
  case "AccessDeniedException":
3502
2525
  case "com.amazonaws.codeartifact#AccessDeniedException":
3503
- response = {
3504
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3505
- name: errorCode,
3506
- $metadata: deserializeMetadata(output),
3507
- };
3508
- break;
2526
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3509
2527
  case "ConflictException":
3510
2528
  case "com.amazonaws.codeartifact#ConflictException":
3511
- response = {
3512
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
3513
- name: errorCode,
3514
- $metadata: deserializeMetadata(output),
3515
- };
3516
- break;
2529
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3517
2530
  case "InternalServerException":
3518
2531
  case "com.amazonaws.codeartifact#InternalServerException":
3519
- response = {
3520
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3521
- name: errorCode,
3522
- $metadata: deserializeMetadata(output),
3523
- };
3524
- break;
2532
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3525
2533
  case "ResourceNotFoundException":
3526
2534
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3527
- response = {
3528
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3529
- name: errorCode,
3530
- $metadata: deserializeMetadata(output),
3531
- };
3532
- break;
2535
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3533
2536
  case "ServiceQuotaExceededException":
3534
2537
  case "com.amazonaws.codeartifact#ServiceQuotaExceededException":
3535
- response = {
3536
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
3537
- name: errorCode,
3538
- $metadata: deserializeMetadata(output),
3539
- };
3540
- break;
2538
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
3541
2539
  case "ThrottlingException":
3542
2540
  case "com.amazonaws.codeartifact#ThrottlingException":
3543
- response = {
3544
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3545
- name: errorCode,
3546
- $metadata: deserializeMetadata(output),
3547
- };
3548
- break;
2541
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3549
2542
  case "ValidationException":
3550
2543
  case "com.amazonaws.codeartifact#ValidationException":
3551
- response = {
3552
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3553
- name: errorCode,
3554
- $metadata: deserializeMetadata(output),
3555
- };
3556
- break;
2544
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3557
2545
  default:
3558
2546
  const parsedBody = parsedOutput.body;
3559
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3560
- response = {
3561
- ...parsedBody,
3562
- name: `${errorCode}`,
3563
- message: parsedBody.message || parsedBody.Message || errorCode,
2547
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2548
+ name: parsedBody.code || parsedBody.Code || errorCode,
3564
2549
  $fault: "client",
3565
2550
  $metadata: deserializeMetadata(output),
3566
- };
2551
+ });
2552
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3567
2553
  }
3568
- const message = response.message || response.Message || errorCode;
3569
- response.message = message;
3570
- delete response.Message;
3571
- return Promise.reject(Object.assign(new Error(message), response));
3572
2554
  };
3573
2555
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
3574
2556
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3592,59 +2574,28 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
3592
2574
  switch (errorCode) {
3593
2575
  case "AccessDeniedException":
3594
2576
  case "com.amazonaws.codeartifact#AccessDeniedException":
3595
- response = {
3596
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3597
- name: errorCode,
3598
- $metadata: deserializeMetadata(output),
3599
- };
3600
- break;
2577
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3601
2578
  case "ResourceNotFoundException":
3602
2579
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3603
- response = {
3604
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3605
- name: errorCode,
3606
- $metadata: deserializeMetadata(output),
3607
- };
3608
- break;
2580
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3609
2581
  case "ServiceQuotaExceededException":
3610
2582
  case "com.amazonaws.codeartifact#ServiceQuotaExceededException":
3611
- response = {
3612
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
3613
- name: errorCode,
3614
- $metadata: deserializeMetadata(output),
3615
- };
3616
- break;
2583
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
3617
2584
  case "ThrottlingException":
3618
2585
  case "com.amazonaws.codeartifact#ThrottlingException":
3619
- response = {
3620
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3621
- name: errorCode,
3622
- $metadata: deserializeMetadata(output),
3623
- };
3624
- break;
2586
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3625
2587
  case "ValidationException":
3626
2588
  case "com.amazonaws.codeartifact#ValidationException":
3627
- response = {
3628
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3629
- name: errorCode,
3630
- $metadata: deserializeMetadata(output),
3631
- };
3632
- break;
2589
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3633
2590
  default:
3634
2591
  const parsedBody = parsedOutput.body;
3635
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3636
- response = {
3637
- ...parsedBody,
3638
- name: `${errorCode}`,
3639
- message: parsedBody.message || parsedBody.Message || errorCode,
2592
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2593
+ name: parsedBody.code || parsedBody.Code || errorCode,
3640
2594
  $fault: "client",
3641
2595
  $metadata: deserializeMetadata(output),
3642
- };
2596
+ });
2597
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3643
2598
  }
3644
- const message = response.message || response.Message || errorCode;
3645
- response.message = message;
3646
- delete response.Message;
3647
- return Promise.reject(Object.assign(new Error(message), response));
3648
2599
  };
3649
2600
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
3650
2601
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3668,51 +2619,25 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3668
2619
  switch (errorCode) {
3669
2620
  case "AccessDeniedException":
3670
2621
  case "com.amazonaws.codeartifact#AccessDeniedException":
3671
- response = {
3672
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3673
- name: errorCode,
3674
- $metadata: deserializeMetadata(output),
3675
- };
3676
- break;
2622
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3677
2623
  case "ResourceNotFoundException":
3678
2624
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3679
- response = {
3680
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3681
- name: errorCode,
3682
- $metadata: deserializeMetadata(output),
3683
- };
3684
- break;
2625
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3685
2626
  case "ThrottlingException":
3686
2627
  case "com.amazonaws.codeartifact#ThrottlingException":
3687
- response = {
3688
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3689
- name: errorCode,
3690
- $metadata: deserializeMetadata(output),
3691
- };
3692
- break;
2628
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3693
2629
  case "ValidationException":
3694
2630
  case "com.amazonaws.codeartifact#ValidationException":
3695
- response = {
3696
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3697
- name: errorCode,
3698
- $metadata: deserializeMetadata(output),
3699
- };
3700
- break;
2631
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3701
2632
  default:
3702
2633
  const parsedBody = parsedOutput.body;
3703
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3704
- response = {
3705
- ...parsedBody,
3706
- name: `${errorCode}`,
3707
- message: parsedBody.message || parsedBody.Message || errorCode,
2634
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2635
+ name: parsedBody.code || parsedBody.Code || errorCode,
3708
2636
  $fault: "client",
3709
2637
  $metadata: deserializeMetadata(output),
3710
- };
2638
+ });
2639
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3711
2640
  }
3712
- const message = response.message || response.Message || errorCode;
3713
- response.message = message;
3714
- delete response.Message;
3715
- return Promise.reject(Object.assign(new Error(message), response));
3716
2641
  };
3717
2642
  const deserializeAws_restJson1UpdatePackageVersionsStatusCommand = async (output, context) => {
3718
2643
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3744,67 +2669,31 @@ const deserializeAws_restJson1UpdatePackageVersionsStatusCommandError = async (o
3744
2669
  switch (errorCode) {
3745
2670
  case "AccessDeniedException":
3746
2671
  case "com.amazonaws.codeartifact#AccessDeniedException":
3747
- response = {
3748
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3749
- name: errorCode,
3750
- $metadata: deserializeMetadata(output),
3751
- };
3752
- break;
2672
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3753
2673
  case "ConflictException":
3754
2674
  case "com.amazonaws.codeartifact#ConflictException":
3755
- response = {
3756
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
3757
- name: errorCode,
3758
- $metadata: deserializeMetadata(output),
3759
- };
3760
- break;
2675
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3761
2676
  case "InternalServerException":
3762
2677
  case "com.amazonaws.codeartifact#InternalServerException":
3763
- response = {
3764
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3765
- name: errorCode,
3766
- $metadata: deserializeMetadata(output),
3767
- };
3768
- break;
2678
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3769
2679
  case "ResourceNotFoundException":
3770
2680
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3771
- response = {
3772
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3773
- name: errorCode,
3774
- $metadata: deserializeMetadata(output),
3775
- };
3776
- break;
2681
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3777
2682
  case "ThrottlingException":
3778
2683
  case "com.amazonaws.codeartifact#ThrottlingException":
3779
- response = {
3780
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3781
- name: errorCode,
3782
- $metadata: deserializeMetadata(output),
3783
- };
3784
- break;
2684
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3785
2685
  case "ValidationException":
3786
2686
  case "com.amazonaws.codeartifact#ValidationException":
3787
- response = {
3788
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3789
- name: errorCode,
3790
- $metadata: deserializeMetadata(output),
3791
- };
3792
- break;
2687
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3793
2688
  default:
3794
2689
  const parsedBody = parsedOutput.body;
3795
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3796
- response = {
3797
- ...parsedBody,
3798
- name: `${errorCode}`,
3799
- message: parsedBody.message || parsedBody.Message || errorCode,
2690
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2691
+ name: parsedBody.code || parsedBody.Code || errorCode,
3800
2692
  $fault: "client",
3801
2693
  $metadata: deserializeMetadata(output),
3802
- };
2694
+ });
2695
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3803
2696
  }
3804
- const message = response.message || response.Message || errorCode;
3805
- response.message = message;
3806
- delete response.Message;
3807
- return Promise.reject(Object.assign(new Error(message), response));
3808
2697
  };
3809
2698
  const deserializeAws_restJson1UpdateRepositoryCommand = async (output, context) => {
3810
2699
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3832,98 +2721,49 @@ const deserializeAws_restJson1UpdateRepositoryCommandError = async (output, cont
3832
2721
  switch (errorCode) {
3833
2722
  case "AccessDeniedException":
3834
2723
  case "com.amazonaws.codeartifact#AccessDeniedException":
3835
- response = {
3836
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3837
- name: errorCode,
3838
- $metadata: deserializeMetadata(output),
3839
- };
3840
- break;
2724
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3841
2725
  case "ConflictException":
3842
2726
  case "com.amazonaws.codeartifact#ConflictException":
3843
- response = {
3844
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
3845
- name: errorCode,
3846
- $metadata: deserializeMetadata(output),
3847
- };
3848
- break;
2727
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3849
2728
  case "InternalServerException":
3850
2729
  case "com.amazonaws.codeartifact#InternalServerException":
3851
- response = {
3852
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3853
- name: errorCode,
3854
- $metadata: deserializeMetadata(output),
3855
- };
3856
- break;
2730
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3857
2731
  case "ResourceNotFoundException":
3858
2732
  case "com.amazonaws.codeartifact#ResourceNotFoundException":
3859
- response = {
3860
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3861
- name: errorCode,
3862
- $metadata: deserializeMetadata(output),
3863
- };
3864
- break;
2733
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3865
2734
  case "ServiceQuotaExceededException":
3866
2735
  case "com.amazonaws.codeartifact#ServiceQuotaExceededException":
3867
- response = {
3868
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
3869
- name: errorCode,
3870
- $metadata: deserializeMetadata(output),
3871
- };
3872
- break;
2736
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
3873
2737
  case "ThrottlingException":
3874
2738
  case "com.amazonaws.codeartifact#ThrottlingException":
3875
- response = {
3876
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3877
- name: errorCode,
3878
- $metadata: deserializeMetadata(output),
3879
- };
3880
- break;
2739
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3881
2740
  case "ValidationException":
3882
2741
  case "com.amazonaws.codeartifact#ValidationException":
3883
- response = {
3884
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3885
- name: errorCode,
3886
- $metadata: deserializeMetadata(output),
3887
- };
3888
- break;
2742
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3889
2743
  default:
3890
2744
  const parsedBody = parsedOutput.body;
3891
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3892
- response = {
3893
- ...parsedBody,
3894
- name: `${errorCode}`,
3895
- message: parsedBody.message || parsedBody.Message || errorCode,
2745
+ response = new CodeartifactServiceException_1.CodeartifactServiceException({
2746
+ name: parsedBody.code || parsedBody.Code || errorCode,
3896
2747
  $fault: "client",
3897
2748
  $metadata: deserializeMetadata(output),
3898
- };
2749
+ });
2750
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3899
2751
  }
3900
- const message = response.message || response.Message || errorCode;
3901
- response.message = message;
3902
- delete response.Message;
3903
- return Promise.reject(Object.assign(new Error(message), response));
3904
2752
  };
3905
2753
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
3906
- const contents = {
3907
- name: "AccessDeniedException",
3908
- $fault: "client",
3909
- $metadata: deserializeMetadata(parsedOutput),
3910
- message: undefined,
3911
- };
2754
+ const contents = {};
3912
2755
  const data = parsedOutput.body;
3913
2756
  if (data.message !== undefined && data.message !== null) {
3914
2757
  contents.message = smithy_client_1.expectString(data.message);
3915
2758
  }
3916
- return contents;
2759
+ const exception = new models_0_1.AccessDeniedException({
2760
+ $metadata: deserializeMetadata(parsedOutput),
2761
+ ...contents,
2762
+ });
2763
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3917
2764
  };
3918
2765
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
3919
- const contents = {
3920
- name: "ConflictException",
3921
- $fault: "client",
3922
- $metadata: deserializeMetadata(parsedOutput),
3923
- message: undefined,
3924
- resourceId: undefined,
3925
- resourceType: undefined,
3926
- };
2766
+ const contents = {};
3927
2767
  const data = parsedOutput.body;
3928
2768
  if (data.message !== undefined && data.message !== null) {
3929
2769
  contents.message = smithy_client_1.expectString(data.message);
@@ -3934,30 +2774,26 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
3934
2774
  if (data.resourceType !== undefined && data.resourceType !== null) {
3935
2775
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
3936
2776
  }
3937
- return contents;
2777
+ const exception = new models_0_1.ConflictException({
2778
+ $metadata: deserializeMetadata(parsedOutput),
2779
+ ...contents,
2780
+ });
2781
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3938
2782
  };
3939
2783
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
3940
- const contents = {
3941
- name: "InternalServerException",
3942
- $fault: "server",
3943
- $metadata: deserializeMetadata(parsedOutput),
3944
- message: undefined,
3945
- };
2784
+ const contents = {};
3946
2785
  const data = parsedOutput.body;
3947
2786
  if (data.message !== undefined && data.message !== null) {
3948
2787
  contents.message = smithy_client_1.expectString(data.message);
3949
2788
  }
3950
- return contents;
2789
+ const exception = new models_0_1.InternalServerException({
2790
+ $metadata: deserializeMetadata(parsedOutput),
2791
+ ...contents,
2792
+ });
2793
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3951
2794
  };
3952
2795
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
3953
- const contents = {
3954
- name: "ResourceNotFoundException",
3955
- $fault: "client",
3956
- $metadata: deserializeMetadata(parsedOutput),
3957
- message: undefined,
3958
- resourceId: undefined,
3959
- resourceType: undefined,
3960
- };
2796
+ const contents = {};
3961
2797
  const data = parsedOutput.body;
3962
2798
  if (data.message !== undefined && data.message !== null) {
3963
2799
  contents.message = smithy_client_1.expectString(data.message);
@@ -3968,17 +2804,14 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
3968
2804
  if (data.resourceType !== undefined && data.resourceType !== null) {
3969
2805
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
3970
2806
  }
3971
- return contents;
2807
+ const exception = new models_0_1.ResourceNotFoundException({
2808
+ $metadata: deserializeMetadata(parsedOutput),
2809
+ ...contents,
2810
+ });
2811
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3972
2812
  };
3973
2813
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
3974
- const contents = {
3975
- name: "ServiceQuotaExceededException",
3976
- $fault: "client",
3977
- $metadata: deserializeMetadata(parsedOutput),
3978
- message: undefined,
3979
- resourceId: undefined,
3980
- resourceType: undefined,
3981
- };
2814
+ const contents = {};
3982
2815
  const data = parsedOutput.body;
3983
2816
  if (data.message !== undefined && data.message !== null) {
3984
2817
  contents.message = smithy_client_1.expectString(data.message);
@@ -3989,16 +2822,14 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
3989
2822
  if (data.resourceType !== undefined && data.resourceType !== null) {
3990
2823
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
3991
2824
  }
3992
- return contents;
2825
+ const exception = new models_0_1.ServiceQuotaExceededException({
2826
+ $metadata: deserializeMetadata(parsedOutput),
2827
+ ...contents,
2828
+ });
2829
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3993
2830
  };
3994
2831
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
3995
- const contents = {
3996
- name: "ThrottlingException",
3997
- $fault: "client",
3998
- $metadata: deserializeMetadata(parsedOutput),
3999
- message: undefined,
4000
- retryAfterSeconds: undefined,
4001
- };
2832
+ const contents = {};
4002
2833
  if (parsedOutput.headers["retry-after"] !== undefined) {
4003
2834
  contents.retryAfterSeconds = smithy_client_1.strictParseInt32(parsedOutput.headers["retry-after"]);
4004
2835
  }
@@ -4006,16 +2837,14 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
4006
2837
  if (data.message !== undefined && data.message !== null) {
4007
2838
  contents.message = smithy_client_1.expectString(data.message);
4008
2839
  }
4009
- return contents;
2840
+ const exception = new models_0_1.ThrottlingException({
2841
+ $metadata: deserializeMetadata(parsedOutput),
2842
+ ...contents,
2843
+ });
2844
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4010
2845
  };
4011
2846
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
4012
- const contents = {
4013
- name: "ValidationException",
4014
- $fault: "client",
4015
- $metadata: deserializeMetadata(parsedOutput),
4016
- message: undefined,
4017
- reason: undefined,
4018
- };
2847
+ const contents = {};
4019
2848
  const data = parsedOutput.body;
4020
2849
  if (data.message !== undefined && data.message !== null) {
4021
2850
  contents.message = smithy_client_1.expectString(data.message);
@@ -4023,7 +2852,11 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
4023
2852
  if (data.reason !== undefined && data.reason !== null) {
4024
2853
  contents.reason = smithy_client_1.expectString(data.reason);
4025
2854
  }
4026
- return contents;
2855
+ const exception = new models_0_1.ValidationException({
2856
+ $metadata: deserializeMetadata(parsedOutput),
2857
+ ...contents,
2858
+ });
2859
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4027
2860
  };
4028
2861
  const serializeAws_restJson1PackageVersionList = (input, context) => {
4029
2862
  return input
@@ -4109,7 +2942,7 @@ const deserializeAws_restJson1AssetSummary = (output, context) => {
4109
2942
  };
4110
2943
  };
4111
2944
  const deserializeAws_restJson1AssetSummaryList = (output, context) => {
4112
- return (output || [])
2945
+ const retVal = (output || [])
4113
2946
  .filter((e) => e != null)
4114
2947
  .map((entry) => {
4115
2948
  if (entry === null) {
@@ -4117,6 +2950,7 @@ const deserializeAws_restJson1AssetSummaryList = (output, context) => {
4117
2950
  }
4118
2951
  return deserializeAws_restJson1AssetSummary(entry, context);
4119
2952
  });
2953
+ return retVal;
4120
2954
  };
4121
2955
  const deserializeAws_restJson1DomainDescription = (output, context) => {
4122
2956
  return {
@@ -4146,7 +2980,7 @@ const deserializeAws_restJson1DomainSummary = (output, context) => {
4146
2980
  };
4147
2981
  };
4148
2982
  const deserializeAws_restJson1DomainSummaryList = (output, context) => {
4149
- return (output || [])
2983
+ const retVal = (output || [])
4150
2984
  .filter((e) => e != null)
4151
2985
  .map((entry) => {
4152
2986
  if (entry === null) {
@@ -4154,6 +2988,7 @@ const deserializeAws_restJson1DomainSummaryList = (output, context) => {
4154
2988
  }
4155
2989
  return deserializeAws_restJson1DomainSummary(entry, context);
4156
2990
  });
2991
+ return retVal;
4157
2992
  };
4158
2993
  const deserializeAws_restJson1LicenseInfo = (output, context) => {
4159
2994
  return {
@@ -4162,7 +2997,7 @@ const deserializeAws_restJson1LicenseInfo = (output, context) => {
4162
2997
  };
4163
2998
  };
4164
2999
  const deserializeAws_restJson1LicenseInfoList = (output, context) => {
4165
- return (output || [])
3000
+ const retVal = (output || [])
4166
3001
  .filter((e) => e != null)
4167
3002
  .map((entry) => {
4168
3003
  if (entry === null) {
@@ -4170,6 +3005,7 @@ const deserializeAws_restJson1LicenseInfoList = (output, context) => {
4170
3005
  }
4171
3006
  return deserializeAws_restJson1LicenseInfo(entry, context);
4172
3007
  });
3008
+ return retVal;
4173
3009
  };
4174
3010
  const deserializeAws_restJson1PackageDependency = (output, context) => {
4175
3011
  return {
@@ -4180,7 +3016,7 @@ const deserializeAws_restJson1PackageDependency = (output, context) => {
4180
3016
  };
4181
3017
  };
4182
3018
  const deserializeAws_restJson1PackageDependencyList = (output, context) => {
4183
- return (output || [])
3019
+ const retVal = (output || [])
4184
3020
  .filter((e) => e != null)
4185
3021
  .map((entry) => {
4186
3022
  if (entry === null) {
@@ -4188,6 +3024,7 @@ const deserializeAws_restJson1PackageDependencyList = (output, context) => {
4188
3024
  }
4189
3025
  return deserializeAws_restJson1PackageDependency(entry, context);
4190
3026
  });
3027
+ return retVal;
4191
3028
  };
4192
3029
  const deserializeAws_restJson1PackageSummary = (output, context) => {
4193
3030
  return {
@@ -4197,7 +3034,7 @@ const deserializeAws_restJson1PackageSummary = (output, context) => {
4197
3034
  };
4198
3035
  };
4199
3036
  const deserializeAws_restJson1PackageSummaryList = (output, context) => {
4200
- return (output || [])
3037
+ const retVal = (output || [])
4201
3038
  .filter((e) => e != null)
4202
3039
  .map((entry) => {
4203
3040
  if (entry === null) {
@@ -4205,6 +3042,7 @@ const deserializeAws_restJson1PackageSummaryList = (output, context) => {
4205
3042
  }
4206
3043
  return deserializeAws_restJson1PackageSummary(entry, context);
4207
3044
  });
3045
+ return retVal;
4208
3046
  };
4209
3047
  const deserializeAws_restJson1PackageVersionDescription = (output, context) => {
4210
3048
  return {
@@ -4251,7 +3089,7 @@ const deserializeAws_restJson1PackageVersionSummary = (output, context) => {
4251
3089
  };
4252
3090
  };
4253
3091
  const deserializeAws_restJson1PackageVersionSummaryList = (output, context) => {
4254
- return (output || [])
3092
+ const retVal = (output || [])
4255
3093
  .filter((e) => e != null)
4256
3094
  .map((entry) => {
4257
3095
  if (entry === null) {
@@ -4259,6 +3097,7 @@ const deserializeAws_restJson1PackageVersionSummaryList = (output, context) => {
4259
3097
  }
4260
3098
  return deserializeAws_restJson1PackageVersionSummary(entry, context);
4261
3099
  });
3100
+ return retVal;
4262
3101
  };
4263
3102
  const deserializeAws_restJson1RepositoryDescription = (output, context) => {
4264
3103
  return {
@@ -4284,7 +3123,7 @@ const deserializeAws_restJson1RepositoryExternalConnectionInfo = (output, contex
4284
3123
  };
4285
3124
  };
4286
3125
  const deserializeAws_restJson1RepositoryExternalConnectionInfoList = (output, context) => {
4287
- return (output || [])
3126
+ const retVal = (output || [])
4288
3127
  .filter((e) => e != null)
4289
3128
  .map((entry) => {
4290
3129
  if (entry === null) {
@@ -4292,6 +3131,7 @@ const deserializeAws_restJson1RepositoryExternalConnectionInfoList = (output, co
4292
3131
  }
4293
3132
  return deserializeAws_restJson1RepositoryExternalConnectionInfo(entry, context);
4294
3133
  });
3134
+ return retVal;
4295
3135
  };
4296
3136
  const deserializeAws_restJson1RepositorySummary = (output, context) => {
4297
3137
  return {
@@ -4304,7 +3144,7 @@ const deserializeAws_restJson1RepositorySummary = (output, context) => {
4304
3144
  };
4305
3145
  };
4306
3146
  const deserializeAws_restJson1RepositorySummaryList = (output, context) => {
4307
- return (output || [])
3147
+ const retVal = (output || [])
4308
3148
  .filter((e) => e != null)
4309
3149
  .map((entry) => {
4310
3150
  if (entry === null) {
@@ -4312,6 +3152,7 @@ const deserializeAws_restJson1RepositorySummaryList = (output, context) => {
4312
3152
  }
4313
3153
  return deserializeAws_restJson1RepositorySummary(entry, context);
4314
3154
  });
3155
+ return retVal;
4315
3156
  };
4316
3157
  const deserializeAws_restJson1ResourcePolicy = (output, context) => {
4317
3158
  return {
@@ -4344,7 +3185,7 @@ const deserializeAws_restJson1Tag = (output, context) => {
4344
3185
  };
4345
3186
  };
4346
3187
  const deserializeAws_restJson1TagList = (output, context) => {
4347
- return (output || [])
3188
+ const retVal = (output || [])
4348
3189
  .filter((e) => e != null)
4349
3190
  .map((entry) => {
4350
3191
  if (entry === null) {
@@ -4352,6 +3193,7 @@ const deserializeAws_restJson1TagList = (output, context) => {
4352
3193
  }
4353
3194
  return deserializeAws_restJson1Tag(entry, context);
4354
3195
  });
3196
+ return retVal;
4355
3197
  };
4356
3198
  const deserializeAws_restJson1UpstreamRepositoryInfo = (output, context) => {
4357
3199
  return {
@@ -4359,7 +3201,7 @@ const deserializeAws_restJson1UpstreamRepositoryInfo = (output, context) => {
4359
3201
  };
4360
3202
  };
4361
3203
  const deserializeAws_restJson1UpstreamRepositoryInfoList = (output, context) => {
4362
- return (output || [])
3204
+ const retVal = (output || [])
4363
3205
  .filter((e) => e != null)
4364
3206
  .map((entry) => {
4365
3207
  if (entry === null) {
@@ -4367,6 +3209,7 @@ const deserializeAws_restJson1UpstreamRepositoryInfoList = (output, context) =>
4367
3209
  }
4368
3210
  return deserializeAws_restJson1UpstreamRepositoryInfo(entry, context);
4369
3211
  });
3212
+ return retVal;
4370
3213
  };
4371
3214
  const deserializeMetadata = (output) => {
4372
3215
  var _a;