@aws-sdk/client-schemas 3.50.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist-cjs/index.js +3 -0
  3. package/dist-cjs/models/SchemasServiceException.js +11 -0
  4. package/dist-cjs/models/models_0.js +153 -2
  5. package/dist-cjs/protocols/Aws_restJson1.js +373 -1446
  6. package/dist-es/index.js +1 -0
  7. package/dist-es/models/SchemasServiceException.js +12 -0
  8. package/dist-es/models/models_0.js +142 -1
  9. package/dist-es/protocols/Aws_restJson1.js +777 -1581
  10. package/dist-types/index.d.ts +1 -0
  11. package/dist-types/models/SchemasServiceException.d.ts +10 -0
  12. package/dist-types/models/models_0.d.ts +72 -32
  13. package/dist-types/ts3.4/Schemas.d.ts +159 -0
  14. package/dist-types/ts3.4/SchemasClient.d.ts +104 -0
  15. package/dist-types/ts3.4/commands/CreateDiscovererCommand.d.ts +17 -0
  16. package/dist-types/ts3.4/commands/CreateRegistryCommand.d.ts +17 -0
  17. package/dist-types/ts3.4/commands/CreateSchemaCommand.d.ts +17 -0
  18. package/dist-types/ts3.4/commands/DeleteDiscovererCommand.d.ts +17 -0
  19. package/dist-types/ts3.4/commands/DeleteRegistryCommand.d.ts +17 -0
  20. package/dist-types/ts3.4/commands/DeleteResourcePolicyCommand.d.ts +17 -0
  21. package/dist-types/ts3.4/commands/DeleteSchemaCommand.d.ts +17 -0
  22. package/dist-types/ts3.4/commands/DeleteSchemaVersionCommand.d.ts +17 -0
  23. package/dist-types/ts3.4/commands/DescribeCodeBindingCommand.d.ts +17 -0
  24. package/dist-types/ts3.4/commands/DescribeDiscovererCommand.d.ts +17 -0
  25. package/dist-types/ts3.4/commands/DescribeRegistryCommand.d.ts +17 -0
  26. package/dist-types/ts3.4/commands/DescribeSchemaCommand.d.ts +17 -0
  27. package/dist-types/ts3.4/commands/ExportSchemaCommand.d.ts +16 -0
  28. package/dist-types/ts3.4/commands/GetCodeBindingSourceCommand.d.ts +17 -0
  29. package/dist-types/ts3.4/commands/GetDiscoveredSchemaCommand.d.ts +17 -0
  30. package/dist-types/ts3.4/commands/GetResourcePolicyCommand.d.ts +17 -0
  31. package/dist-types/ts3.4/commands/ListDiscoverersCommand.d.ts +17 -0
  32. package/dist-types/ts3.4/commands/ListRegistriesCommand.d.ts +17 -0
  33. package/dist-types/ts3.4/commands/ListSchemaVersionsCommand.d.ts +17 -0
  34. package/dist-types/ts3.4/commands/ListSchemasCommand.d.ts +17 -0
  35. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  36. package/dist-types/ts3.4/commands/PutCodeBindingCommand.d.ts +17 -0
  37. package/dist-types/ts3.4/commands/PutResourcePolicyCommand.d.ts +17 -0
  38. package/dist-types/ts3.4/commands/SearchSchemasCommand.d.ts +17 -0
  39. package/dist-types/ts3.4/commands/StartDiscovererCommand.d.ts +17 -0
  40. package/dist-types/ts3.4/commands/StopDiscovererCommand.d.ts +17 -0
  41. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  42. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  43. package/dist-types/ts3.4/commands/UpdateDiscovererCommand.d.ts +17 -0
  44. package/dist-types/ts3.4/commands/UpdateRegistryCommand.d.ts +17 -0
  45. package/dist-types/ts3.4/commands/UpdateSchemaCommand.d.ts +17 -0
  46. package/dist-types/ts3.4/commands/index.d.ts +31 -0
  47. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  48. package/dist-types/ts3.4/index.d.ts +7 -0
  49. package/dist-types/ts3.4/models/SchemasServiceException.d.ts +6 -0
  50. package/dist-types/ts3.4/models/index.d.ts +1 -0
  51. package/dist-types/ts3.4/models/models_0.d.ts +913 -0
  52. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  53. package/dist-types/ts3.4/pagination/ListDiscoverersPaginator.d.ts +4 -0
  54. package/dist-types/ts3.4/pagination/ListRegistriesPaginator.d.ts +4 -0
  55. package/dist-types/ts3.4/pagination/ListSchemaVersionsPaginator.d.ts +4 -0
  56. package/dist-types/ts3.4/pagination/ListSchemasPaginator.d.ts +4 -0
  57. package/dist-types/ts3.4/pagination/SearchSchemasPaginator.d.ts +4 -0
  58. package/dist-types/ts3.4/pagination/index.d.ts +6 -0
  59. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +95 -0
  60. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  61. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  62. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  63. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  64. package/dist-types/ts3.4/waiters/index.d.ts +1 -0
  65. package/dist-types/ts3.4/waiters/waitForCodeBindingExists.d.ts +7 -0
  66. package/package.json +34 -34
@@ -5,6 +5,8 @@ exports.deserializeAws_restJson1UpdateSchemaCommand = exports.deserializeAws_res
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const uuid_1 = require("uuid");
8
+ const models_0_1 = require("../models/models_0");
9
+ const SchemasServiceException_1 = require("../models/SchemasServiceException");
8
10
  const serializeAws_restJson1CreateDiscovererCommand = async (input, context) => {
9
11
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
12
  const headers = {
@@ -1073,67 +1075,31 @@ const deserializeAws_restJson1CreateDiscovererCommandError = async (output, cont
1073
1075
  switch (errorCode) {
1074
1076
  case "BadRequestException":
1075
1077
  case "com.amazonaws.schemas#BadRequestException":
1076
- response = {
1077
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1078
- name: errorCode,
1079
- $metadata: deserializeMetadata(output),
1080
- };
1081
- break;
1078
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1082
1079
  case "ConflictException":
1083
1080
  case "com.amazonaws.schemas#ConflictException":
1084
- response = {
1085
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1086
- name: errorCode,
1087
- $metadata: deserializeMetadata(output),
1088
- };
1089
- break;
1081
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1090
1082
  case "ForbiddenException":
1091
1083
  case "com.amazonaws.schemas#ForbiddenException":
1092
- response = {
1093
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1094
- name: errorCode,
1095
- $metadata: deserializeMetadata(output),
1096
- };
1097
- break;
1084
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1098
1085
  case "InternalServerErrorException":
1099
1086
  case "com.amazonaws.schemas#InternalServerErrorException":
1100
- response = {
1101
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1102
- name: errorCode,
1103
- $metadata: deserializeMetadata(output),
1104
- };
1105
- break;
1087
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1106
1088
  case "ServiceUnavailableException":
1107
1089
  case "com.amazonaws.schemas#ServiceUnavailableException":
1108
- response = {
1109
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1110
- name: errorCode,
1111
- $metadata: deserializeMetadata(output),
1112
- };
1113
- break;
1090
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1114
1091
  case "UnauthorizedException":
1115
1092
  case "com.amazonaws.schemas#UnauthorizedException":
1116
- response = {
1117
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1118
- name: errorCode,
1119
- $metadata: deserializeMetadata(output),
1120
- };
1121
- break;
1093
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1122
1094
  default:
1123
1095
  const parsedBody = parsedOutput.body;
1124
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1125
- response = {
1126
- ...parsedBody,
1127
- name: `${errorCode}`,
1128
- message: parsedBody.message || parsedBody.Message || errorCode,
1096
+ response = new SchemasServiceException_1.SchemasServiceException({
1097
+ name: parsedBody.code || parsedBody.Code || errorCode,
1129
1098
  $fault: "client",
1130
1099
  $metadata: deserializeMetadata(output),
1131
- };
1100
+ });
1101
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1132
1102
  }
1133
- const message = response.message || response.Message || errorCode;
1134
- response.message = message;
1135
- delete response.Message;
1136
- return Promise.reject(Object.assign(new Error(message), response));
1137
1103
  };
1138
1104
  const deserializeAws_restJson1CreateRegistryCommand = async (output, context) => {
1139
1105
  if (output.statusCode !== 201 && output.statusCode >= 300) {
@@ -1173,67 +1139,31 @@ const deserializeAws_restJson1CreateRegistryCommandError = async (output, contex
1173
1139
  switch (errorCode) {
1174
1140
  case "BadRequestException":
1175
1141
  case "com.amazonaws.schemas#BadRequestException":
1176
- response = {
1177
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1178
- name: errorCode,
1179
- $metadata: deserializeMetadata(output),
1180
- };
1181
- break;
1142
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1182
1143
  case "ConflictException":
1183
1144
  case "com.amazonaws.schemas#ConflictException":
1184
- response = {
1185
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1186
- name: errorCode,
1187
- $metadata: deserializeMetadata(output),
1188
- };
1189
- break;
1145
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1190
1146
  case "ForbiddenException":
1191
1147
  case "com.amazonaws.schemas#ForbiddenException":
1192
- response = {
1193
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1194
- name: errorCode,
1195
- $metadata: deserializeMetadata(output),
1196
- };
1197
- break;
1148
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1198
1149
  case "InternalServerErrorException":
1199
1150
  case "com.amazonaws.schemas#InternalServerErrorException":
1200
- response = {
1201
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1202
- name: errorCode,
1203
- $metadata: deserializeMetadata(output),
1204
- };
1205
- break;
1151
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1206
1152
  case "ServiceUnavailableException":
1207
1153
  case "com.amazonaws.schemas#ServiceUnavailableException":
1208
- response = {
1209
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1210
- name: errorCode,
1211
- $metadata: deserializeMetadata(output),
1212
- };
1213
- break;
1154
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1214
1155
  case "UnauthorizedException":
1215
1156
  case "com.amazonaws.schemas#UnauthorizedException":
1216
- response = {
1217
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1218
- name: errorCode,
1219
- $metadata: deserializeMetadata(output),
1220
- };
1221
- break;
1157
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1222
1158
  default:
1223
1159
  const parsedBody = parsedOutput.body;
1224
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1225
- response = {
1226
- ...parsedBody,
1227
- name: `${errorCode}`,
1228
- message: parsedBody.message || parsedBody.Message || errorCode,
1160
+ response = new SchemasServiceException_1.SchemasServiceException({
1161
+ name: parsedBody.code || parsedBody.Code || errorCode,
1229
1162
  $fault: "client",
1230
1163
  $metadata: deserializeMetadata(output),
1231
- };
1164
+ });
1165
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1232
1166
  }
1233
- const message = response.message || response.Message || errorCode;
1234
- response.message = message;
1235
- delete response.Message;
1236
- return Promise.reject(Object.assign(new Error(message), response));
1237
1167
  };
1238
1168
  const deserializeAws_restJson1CreateSchemaCommand = async (output, context) => {
1239
1169
  if (output.statusCode !== 201 && output.statusCode >= 300) {
@@ -1289,51 +1219,25 @@ const deserializeAws_restJson1CreateSchemaCommandError = async (output, context)
1289
1219
  switch (errorCode) {
1290
1220
  case "BadRequestException":
1291
1221
  case "com.amazonaws.schemas#BadRequestException":
1292
- response = {
1293
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1294
- name: errorCode,
1295
- $metadata: deserializeMetadata(output),
1296
- };
1297
- break;
1222
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1298
1223
  case "ForbiddenException":
1299
1224
  case "com.amazonaws.schemas#ForbiddenException":
1300
- response = {
1301
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1302
- name: errorCode,
1303
- $metadata: deserializeMetadata(output),
1304
- };
1305
- break;
1225
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1306
1226
  case "InternalServerErrorException":
1307
1227
  case "com.amazonaws.schemas#InternalServerErrorException":
1308
- response = {
1309
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1310
- name: errorCode,
1311
- $metadata: deserializeMetadata(output),
1312
- };
1313
- break;
1228
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1314
1229
  case "ServiceUnavailableException":
1315
1230
  case "com.amazonaws.schemas#ServiceUnavailableException":
1316
- response = {
1317
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1318
- name: errorCode,
1319
- $metadata: deserializeMetadata(output),
1320
- };
1321
- break;
1231
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1322
1232
  default:
1323
1233
  const parsedBody = parsedOutput.body;
1324
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1325
- response = {
1326
- ...parsedBody,
1327
- name: `${errorCode}`,
1328
- message: parsedBody.message || parsedBody.Message || errorCode,
1234
+ response = new SchemasServiceException_1.SchemasServiceException({
1235
+ name: parsedBody.code || parsedBody.Code || errorCode,
1329
1236
  $fault: "client",
1330
1237
  $metadata: deserializeMetadata(output),
1331
- };
1238
+ });
1239
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1332
1240
  }
1333
- const message = response.message || response.Message || errorCode;
1334
- response.message = message;
1335
- delete response.Message;
1336
- return Promise.reject(Object.assign(new Error(message), response));
1337
1241
  };
1338
1242
  const deserializeAws_restJson1DeleteDiscovererCommand = async (output, context) => {
1339
1243
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1357,67 +1261,31 @@ const deserializeAws_restJson1DeleteDiscovererCommandError = async (output, cont
1357
1261
  switch (errorCode) {
1358
1262
  case "BadRequestException":
1359
1263
  case "com.amazonaws.schemas#BadRequestException":
1360
- response = {
1361
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1362
- name: errorCode,
1363
- $metadata: deserializeMetadata(output),
1364
- };
1365
- break;
1264
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1366
1265
  case "ForbiddenException":
1367
1266
  case "com.amazonaws.schemas#ForbiddenException":
1368
- response = {
1369
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1370
- name: errorCode,
1371
- $metadata: deserializeMetadata(output),
1372
- };
1373
- break;
1267
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1374
1268
  case "InternalServerErrorException":
1375
1269
  case "com.amazonaws.schemas#InternalServerErrorException":
1376
- response = {
1377
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1378
- name: errorCode,
1379
- $metadata: deserializeMetadata(output),
1380
- };
1381
- break;
1270
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1382
1271
  case "NotFoundException":
1383
1272
  case "com.amazonaws.schemas#NotFoundException":
1384
- response = {
1385
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1386
- name: errorCode,
1387
- $metadata: deserializeMetadata(output),
1388
- };
1389
- break;
1273
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1390
1274
  case "ServiceUnavailableException":
1391
1275
  case "com.amazonaws.schemas#ServiceUnavailableException":
1392
- response = {
1393
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1394
- name: errorCode,
1395
- $metadata: deserializeMetadata(output),
1396
- };
1397
- break;
1276
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1398
1277
  case "UnauthorizedException":
1399
1278
  case "com.amazonaws.schemas#UnauthorizedException":
1400
- response = {
1401
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1402
- name: errorCode,
1403
- $metadata: deserializeMetadata(output),
1404
- };
1405
- break;
1279
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1406
1280
  default:
1407
1281
  const parsedBody = parsedOutput.body;
1408
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1409
- response = {
1410
- ...parsedBody,
1411
- name: `${errorCode}`,
1412
- message: parsedBody.message || parsedBody.Message || errorCode,
1282
+ response = new SchemasServiceException_1.SchemasServiceException({
1283
+ name: parsedBody.code || parsedBody.Code || errorCode,
1413
1284
  $fault: "client",
1414
1285
  $metadata: deserializeMetadata(output),
1415
- };
1286
+ });
1287
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1416
1288
  }
1417
- const message = response.message || response.Message || errorCode;
1418
- response.message = message;
1419
- delete response.Message;
1420
- return Promise.reject(Object.assign(new Error(message), response));
1421
1289
  };
1422
1290
  const deserializeAws_restJson1DeleteRegistryCommand = async (output, context) => {
1423
1291
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1441,67 +1309,31 @@ const deserializeAws_restJson1DeleteRegistryCommandError = async (output, contex
1441
1309
  switch (errorCode) {
1442
1310
  case "BadRequestException":
1443
1311
  case "com.amazonaws.schemas#BadRequestException":
1444
- response = {
1445
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1446
- name: errorCode,
1447
- $metadata: deserializeMetadata(output),
1448
- };
1449
- break;
1312
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1450
1313
  case "ForbiddenException":
1451
1314
  case "com.amazonaws.schemas#ForbiddenException":
1452
- response = {
1453
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1454
- name: errorCode,
1455
- $metadata: deserializeMetadata(output),
1456
- };
1457
- break;
1315
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1458
1316
  case "InternalServerErrorException":
1459
1317
  case "com.amazonaws.schemas#InternalServerErrorException":
1460
- response = {
1461
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1462
- name: errorCode,
1463
- $metadata: deserializeMetadata(output),
1464
- };
1465
- break;
1318
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1466
1319
  case "NotFoundException":
1467
1320
  case "com.amazonaws.schemas#NotFoundException":
1468
- response = {
1469
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1470
- name: errorCode,
1471
- $metadata: deserializeMetadata(output),
1472
- };
1473
- break;
1321
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1474
1322
  case "ServiceUnavailableException":
1475
1323
  case "com.amazonaws.schemas#ServiceUnavailableException":
1476
- response = {
1477
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1478
- name: errorCode,
1479
- $metadata: deserializeMetadata(output),
1480
- };
1481
- break;
1324
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1482
1325
  case "UnauthorizedException":
1483
1326
  case "com.amazonaws.schemas#UnauthorizedException":
1484
- response = {
1485
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1486
- name: errorCode,
1487
- $metadata: deserializeMetadata(output),
1488
- };
1489
- break;
1327
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1490
1328
  default:
1491
1329
  const parsedBody = parsedOutput.body;
1492
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1493
- response = {
1494
- ...parsedBody,
1495
- name: `${errorCode}`,
1496
- message: parsedBody.message || parsedBody.Message || errorCode,
1330
+ response = new SchemasServiceException_1.SchemasServiceException({
1331
+ name: parsedBody.code || parsedBody.Code || errorCode,
1497
1332
  $fault: "client",
1498
1333
  $metadata: deserializeMetadata(output),
1499
- };
1334
+ });
1335
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1500
1336
  }
1501
- const message = response.message || response.Message || errorCode;
1502
- response.message = message;
1503
- delete response.Message;
1504
- return Promise.reject(Object.assign(new Error(message), response));
1505
1337
  };
1506
1338
  const deserializeAws_restJson1DeleteResourcePolicyCommand = async (output, context) => {
1507
1339
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1525,67 +1357,31 @@ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async (output,
1525
1357
  switch (errorCode) {
1526
1358
  case "BadRequestException":
1527
1359
  case "com.amazonaws.schemas#BadRequestException":
1528
- response = {
1529
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1530
- name: errorCode,
1531
- $metadata: deserializeMetadata(output),
1532
- };
1533
- break;
1360
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1534
1361
  case "ForbiddenException":
1535
1362
  case "com.amazonaws.schemas#ForbiddenException":
1536
- response = {
1537
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1538
- name: errorCode,
1539
- $metadata: deserializeMetadata(output),
1540
- };
1541
- break;
1363
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1542
1364
  case "InternalServerErrorException":
1543
1365
  case "com.amazonaws.schemas#InternalServerErrorException":
1544
- response = {
1545
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1546
- name: errorCode,
1547
- $metadata: deserializeMetadata(output),
1548
- };
1549
- break;
1366
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1550
1367
  case "NotFoundException":
1551
1368
  case "com.amazonaws.schemas#NotFoundException":
1552
- response = {
1553
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1554
- name: errorCode,
1555
- $metadata: deserializeMetadata(output),
1556
- };
1557
- break;
1369
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1558
1370
  case "ServiceUnavailableException":
1559
1371
  case "com.amazonaws.schemas#ServiceUnavailableException":
1560
- response = {
1561
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1562
- name: errorCode,
1563
- $metadata: deserializeMetadata(output),
1564
- };
1565
- break;
1372
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1566
1373
  case "UnauthorizedException":
1567
1374
  case "com.amazonaws.schemas#UnauthorizedException":
1568
- response = {
1569
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1570
- name: errorCode,
1571
- $metadata: deserializeMetadata(output),
1572
- };
1573
- break;
1375
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1574
1376
  default:
1575
1377
  const parsedBody = parsedOutput.body;
1576
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1577
- response = {
1578
- ...parsedBody,
1579
- name: `${errorCode}`,
1580
- message: parsedBody.message || parsedBody.Message || errorCode,
1378
+ response = new SchemasServiceException_1.SchemasServiceException({
1379
+ name: parsedBody.code || parsedBody.Code || errorCode,
1581
1380
  $fault: "client",
1582
1381
  $metadata: deserializeMetadata(output),
1583
- };
1382
+ });
1383
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1584
1384
  }
1585
- const message = response.message || response.Message || errorCode;
1586
- response.message = message;
1587
- delete response.Message;
1588
- return Promise.reject(Object.assign(new Error(message), response));
1589
1385
  };
1590
1386
  const deserializeAws_restJson1DeleteSchemaCommand = async (output, context) => {
1591
1387
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1609,67 +1405,31 @@ const deserializeAws_restJson1DeleteSchemaCommandError = async (output, context)
1609
1405
  switch (errorCode) {
1610
1406
  case "BadRequestException":
1611
1407
  case "com.amazonaws.schemas#BadRequestException":
1612
- response = {
1613
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1614
- name: errorCode,
1615
- $metadata: deserializeMetadata(output),
1616
- };
1617
- break;
1408
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1618
1409
  case "ForbiddenException":
1619
1410
  case "com.amazonaws.schemas#ForbiddenException":
1620
- response = {
1621
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1622
- name: errorCode,
1623
- $metadata: deserializeMetadata(output),
1624
- };
1625
- break;
1411
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1626
1412
  case "InternalServerErrorException":
1627
1413
  case "com.amazonaws.schemas#InternalServerErrorException":
1628
- response = {
1629
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1630
- name: errorCode,
1631
- $metadata: deserializeMetadata(output),
1632
- };
1633
- break;
1414
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1634
1415
  case "NotFoundException":
1635
1416
  case "com.amazonaws.schemas#NotFoundException":
1636
- response = {
1637
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1638
- name: errorCode,
1639
- $metadata: deserializeMetadata(output),
1640
- };
1641
- break;
1417
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1642
1418
  case "ServiceUnavailableException":
1643
1419
  case "com.amazonaws.schemas#ServiceUnavailableException":
1644
- response = {
1645
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1646
- name: errorCode,
1647
- $metadata: deserializeMetadata(output),
1648
- };
1649
- break;
1420
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1650
1421
  case "UnauthorizedException":
1651
1422
  case "com.amazonaws.schemas#UnauthorizedException":
1652
- response = {
1653
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1654
- name: errorCode,
1655
- $metadata: deserializeMetadata(output),
1656
- };
1657
- break;
1423
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1658
1424
  default:
1659
1425
  const parsedBody = parsedOutput.body;
1660
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1661
- response = {
1662
- ...parsedBody,
1663
- name: `${errorCode}`,
1664
- message: parsedBody.message || parsedBody.Message || errorCode,
1426
+ response = new SchemasServiceException_1.SchemasServiceException({
1427
+ name: parsedBody.code || parsedBody.Code || errorCode,
1665
1428
  $fault: "client",
1666
1429
  $metadata: deserializeMetadata(output),
1667
- };
1430
+ });
1431
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1668
1432
  }
1669
- const message = response.message || response.Message || errorCode;
1670
- response.message = message;
1671
- delete response.Message;
1672
- return Promise.reject(Object.assign(new Error(message), response));
1673
1433
  };
1674
1434
  const deserializeAws_restJson1DeleteSchemaVersionCommand = async (output, context) => {
1675
1435
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -1693,67 +1453,31 @@ const deserializeAws_restJson1DeleteSchemaVersionCommandError = async (output, c
1693
1453
  switch (errorCode) {
1694
1454
  case "BadRequestException":
1695
1455
  case "com.amazonaws.schemas#BadRequestException":
1696
- response = {
1697
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1698
- name: errorCode,
1699
- $metadata: deserializeMetadata(output),
1700
- };
1701
- break;
1456
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1702
1457
  case "ForbiddenException":
1703
1458
  case "com.amazonaws.schemas#ForbiddenException":
1704
- response = {
1705
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1706
- name: errorCode,
1707
- $metadata: deserializeMetadata(output),
1708
- };
1709
- break;
1459
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1710
1460
  case "InternalServerErrorException":
1711
1461
  case "com.amazonaws.schemas#InternalServerErrorException":
1712
- response = {
1713
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1714
- name: errorCode,
1715
- $metadata: deserializeMetadata(output),
1716
- };
1717
- break;
1462
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1718
1463
  case "NotFoundException":
1719
1464
  case "com.amazonaws.schemas#NotFoundException":
1720
- response = {
1721
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1722
- name: errorCode,
1723
- $metadata: deserializeMetadata(output),
1724
- };
1725
- break;
1465
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1726
1466
  case "ServiceUnavailableException":
1727
1467
  case "com.amazonaws.schemas#ServiceUnavailableException":
1728
- response = {
1729
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1730
- name: errorCode,
1731
- $metadata: deserializeMetadata(output),
1732
- };
1733
- break;
1468
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1734
1469
  case "UnauthorizedException":
1735
1470
  case "com.amazonaws.schemas#UnauthorizedException":
1736
- response = {
1737
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1738
- name: errorCode,
1739
- $metadata: deserializeMetadata(output),
1740
- };
1741
- break;
1471
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1742
1472
  default:
1743
1473
  const parsedBody = parsedOutput.body;
1744
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1745
- response = {
1746
- ...parsedBody,
1747
- name: `${errorCode}`,
1748
- message: parsedBody.message || parsedBody.Message || errorCode,
1474
+ response = new SchemasServiceException_1.SchemasServiceException({
1475
+ name: parsedBody.code || parsedBody.Code || errorCode,
1749
1476
  $fault: "client",
1750
1477
  $metadata: deserializeMetadata(output),
1751
- };
1478
+ });
1479
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1752
1480
  }
1753
- const message = response.message || response.Message || errorCode;
1754
- response.message = message;
1755
- delete response.Message;
1756
- return Promise.reject(Object.assign(new Error(message), response));
1757
1481
  };
1758
1482
  const deserializeAws_restJson1DescribeCodeBindingCommand = async (output, context) => {
1759
1483
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1793,67 +1517,31 @@ const deserializeAws_restJson1DescribeCodeBindingCommandError = async (output, c
1793
1517
  switch (errorCode) {
1794
1518
  case "BadRequestException":
1795
1519
  case "com.amazonaws.schemas#BadRequestException":
1796
- response = {
1797
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1798
- name: errorCode,
1799
- $metadata: deserializeMetadata(output),
1800
- };
1801
- break;
1520
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1802
1521
  case "ForbiddenException":
1803
1522
  case "com.amazonaws.schemas#ForbiddenException":
1804
- response = {
1805
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1806
- name: errorCode,
1807
- $metadata: deserializeMetadata(output),
1808
- };
1809
- break;
1523
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1810
1524
  case "InternalServerErrorException":
1811
1525
  case "com.amazonaws.schemas#InternalServerErrorException":
1812
- response = {
1813
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1814
- name: errorCode,
1815
- $metadata: deserializeMetadata(output),
1816
- };
1817
- break;
1526
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1818
1527
  case "NotFoundException":
1819
1528
  case "com.amazonaws.schemas#NotFoundException":
1820
- response = {
1821
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1822
- name: errorCode,
1823
- $metadata: deserializeMetadata(output),
1824
- };
1825
- break;
1529
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1826
1530
  case "TooManyRequestsException":
1827
1531
  case "com.amazonaws.schemas#TooManyRequestsException":
1828
- response = {
1829
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1830
- name: errorCode,
1831
- $metadata: deserializeMetadata(output),
1832
- };
1833
- break;
1532
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1834
1533
  case "UnauthorizedException":
1835
1534
  case "com.amazonaws.schemas#UnauthorizedException":
1836
- response = {
1837
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1838
- name: errorCode,
1839
- $metadata: deserializeMetadata(output),
1840
- };
1841
- break;
1535
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1842
1536
  default:
1843
1537
  const parsedBody = parsedOutput.body;
1844
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1845
- response = {
1846
- ...parsedBody,
1847
- name: `${errorCode}`,
1848
- message: parsedBody.message || parsedBody.Message || errorCode,
1538
+ response = new SchemasServiceException_1.SchemasServiceException({
1539
+ name: parsedBody.code || parsedBody.Code || errorCode,
1849
1540
  $fault: "client",
1850
1541
  $metadata: deserializeMetadata(output),
1851
- };
1542
+ });
1543
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1852
1544
  }
1853
- const message = response.message || response.Message || errorCode;
1854
- response.message = message;
1855
- delete response.Message;
1856
- return Promise.reject(Object.assign(new Error(message), response));
1857
1545
  };
1858
1546
  const deserializeAws_restJson1DescribeDiscovererCommand = async (output, context) => {
1859
1547
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1905,67 +1593,31 @@ const deserializeAws_restJson1DescribeDiscovererCommandError = async (output, co
1905
1593
  switch (errorCode) {
1906
1594
  case "BadRequestException":
1907
1595
  case "com.amazonaws.schemas#BadRequestException":
1908
- response = {
1909
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1910
- name: errorCode,
1911
- $metadata: deserializeMetadata(output),
1912
- };
1913
- break;
1596
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1914
1597
  case "ForbiddenException":
1915
1598
  case "com.amazonaws.schemas#ForbiddenException":
1916
- response = {
1917
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1918
- name: errorCode,
1919
- $metadata: deserializeMetadata(output),
1920
- };
1921
- break;
1599
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1922
1600
  case "InternalServerErrorException":
1923
1601
  case "com.amazonaws.schemas#InternalServerErrorException":
1924
- response = {
1925
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1926
- name: errorCode,
1927
- $metadata: deserializeMetadata(output),
1928
- };
1929
- break;
1602
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1930
1603
  case "NotFoundException":
1931
1604
  case "com.amazonaws.schemas#NotFoundException":
1932
- response = {
1933
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1934
- name: errorCode,
1935
- $metadata: deserializeMetadata(output),
1936
- };
1937
- break;
1605
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1938
1606
  case "ServiceUnavailableException":
1939
1607
  case "com.amazonaws.schemas#ServiceUnavailableException":
1940
- response = {
1941
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
1942
- name: errorCode,
1943
- $metadata: deserializeMetadata(output),
1944
- };
1945
- break;
1608
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
1946
1609
  case "UnauthorizedException":
1947
1610
  case "com.amazonaws.schemas#UnauthorizedException":
1948
- response = {
1949
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1950
- name: errorCode,
1951
- $metadata: deserializeMetadata(output),
1952
- };
1953
- break;
1611
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1954
1612
  default:
1955
1613
  const parsedBody = parsedOutput.body;
1956
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1957
- response = {
1958
- ...parsedBody,
1959
- name: `${errorCode}`,
1960
- message: parsedBody.message || parsedBody.Message || errorCode,
1614
+ response = new SchemasServiceException_1.SchemasServiceException({
1615
+ name: parsedBody.code || parsedBody.Code || errorCode,
1961
1616
  $fault: "client",
1962
1617
  $metadata: deserializeMetadata(output),
1963
- };
1618
+ });
1619
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1964
1620
  }
1965
- const message = response.message || response.Message || errorCode;
1966
- response.message = message;
1967
- delete response.Message;
1968
- return Promise.reject(Object.assign(new Error(message), response));
1969
1621
  };
1970
1622
  const deserializeAws_restJson1DescribeRegistryCommand = async (output, context) => {
1971
1623
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2005,67 +1657,31 @@ const deserializeAws_restJson1DescribeRegistryCommandError = async (output, cont
2005
1657
  switch (errorCode) {
2006
1658
  case "BadRequestException":
2007
1659
  case "com.amazonaws.schemas#BadRequestException":
2008
- response = {
2009
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2010
- name: errorCode,
2011
- $metadata: deserializeMetadata(output),
2012
- };
2013
- break;
1660
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2014
1661
  case "ForbiddenException":
2015
1662
  case "com.amazonaws.schemas#ForbiddenException":
2016
- response = {
2017
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2018
- name: errorCode,
2019
- $metadata: deserializeMetadata(output),
2020
- };
2021
- break;
1663
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2022
1664
  case "InternalServerErrorException":
2023
1665
  case "com.amazonaws.schemas#InternalServerErrorException":
2024
- response = {
2025
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2026
- name: errorCode,
2027
- $metadata: deserializeMetadata(output),
2028
- };
2029
- break;
1666
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2030
1667
  case "NotFoundException":
2031
1668
  case "com.amazonaws.schemas#NotFoundException":
2032
- response = {
2033
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2034
- name: errorCode,
2035
- $metadata: deserializeMetadata(output),
2036
- };
2037
- break;
1669
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2038
1670
  case "ServiceUnavailableException":
2039
1671
  case "com.amazonaws.schemas#ServiceUnavailableException":
2040
- response = {
2041
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2042
- name: errorCode,
2043
- $metadata: deserializeMetadata(output),
2044
- };
2045
- break;
1672
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2046
1673
  case "UnauthorizedException":
2047
1674
  case "com.amazonaws.schemas#UnauthorizedException":
2048
- response = {
2049
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2050
- name: errorCode,
2051
- $metadata: deserializeMetadata(output),
2052
- };
2053
- break;
1675
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2054
1676
  default:
2055
1677
  const parsedBody = parsedOutput.body;
2056
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2057
- response = {
2058
- ...parsedBody,
2059
- name: `${errorCode}`,
2060
- message: parsedBody.message || parsedBody.Message || errorCode,
1678
+ response = new SchemasServiceException_1.SchemasServiceException({
1679
+ name: parsedBody.code || parsedBody.Code || errorCode,
2061
1680
  $fault: "client",
2062
1681
  $metadata: deserializeMetadata(output),
2063
- };
1682
+ });
1683
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2064
1684
  }
2065
- const message = response.message || response.Message || errorCode;
2066
- response.message = message;
2067
- delete response.Message;
2068
- return Promise.reject(Object.assign(new Error(message), response));
2069
1685
  };
2070
1686
  const deserializeAws_restJson1DescribeSchemaCommand = async (output, context) => {
2071
1687
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2125,67 +1741,31 @@ const deserializeAws_restJson1DescribeSchemaCommandError = async (output, contex
2125
1741
  switch (errorCode) {
2126
1742
  case "BadRequestException":
2127
1743
  case "com.amazonaws.schemas#BadRequestException":
2128
- response = {
2129
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2130
- name: errorCode,
2131
- $metadata: deserializeMetadata(output),
2132
- };
2133
- break;
1744
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2134
1745
  case "ForbiddenException":
2135
1746
  case "com.amazonaws.schemas#ForbiddenException":
2136
- response = {
2137
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2138
- name: errorCode,
2139
- $metadata: deserializeMetadata(output),
2140
- };
2141
- break;
1747
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2142
1748
  case "InternalServerErrorException":
2143
1749
  case "com.amazonaws.schemas#InternalServerErrorException":
2144
- response = {
2145
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2146
- name: errorCode,
2147
- $metadata: deserializeMetadata(output),
2148
- };
2149
- break;
1750
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2150
1751
  case "NotFoundException":
2151
1752
  case "com.amazonaws.schemas#NotFoundException":
2152
- response = {
2153
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2154
- name: errorCode,
2155
- $metadata: deserializeMetadata(output),
2156
- };
2157
- break;
1753
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2158
1754
  case "ServiceUnavailableException":
2159
1755
  case "com.amazonaws.schemas#ServiceUnavailableException":
2160
- response = {
2161
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2162
- name: errorCode,
2163
- $metadata: deserializeMetadata(output),
2164
- };
2165
- break;
1756
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2166
1757
  case "UnauthorizedException":
2167
1758
  case "com.amazonaws.schemas#UnauthorizedException":
2168
- response = {
2169
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2170
- name: errorCode,
2171
- $metadata: deserializeMetadata(output),
2172
- };
2173
- break;
1759
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2174
1760
  default:
2175
1761
  const parsedBody = parsedOutput.body;
2176
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2177
- response = {
2178
- ...parsedBody,
2179
- name: `${errorCode}`,
2180
- message: parsedBody.message || parsedBody.Message || errorCode,
1762
+ response = new SchemasServiceException_1.SchemasServiceException({
1763
+ name: parsedBody.code || parsedBody.Code || errorCode,
2181
1764
  $fault: "client",
2182
1765
  $metadata: deserializeMetadata(output),
2183
- };
1766
+ });
1767
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2184
1768
  }
2185
- const message = response.message || response.Message || errorCode;
2186
- response.message = message;
2187
- delete response.Message;
2188
- return Promise.reject(Object.assign(new Error(message), response));
2189
1769
  };
2190
1770
  const deserializeAws_restJson1ExportSchemaCommand = async (output, context) => {
2191
1771
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2229,75 +1809,34 @@ const deserializeAws_restJson1ExportSchemaCommandError = async (output, context)
2229
1809
  switch (errorCode) {
2230
1810
  case "BadRequestException":
2231
1811
  case "com.amazonaws.schemas#BadRequestException":
2232
- response = {
2233
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2234
- name: errorCode,
2235
- $metadata: deserializeMetadata(output),
2236
- };
2237
- break;
1812
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2238
1813
  case "ForbiddenException":
2239
1814
  case "com.amazonaws.schemas#ForbiddenException":
2240
- response = {
2241
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2242
- name: errorCode,
2243
- $metadata: deserializeMetadata(output),
2244
- };
2245
- break;
1815
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2246
1816
  case "InternalServerErrorException":
2247
1817
  case "com.amazonaws.schemas#InternalServerErrorException":
2248
- response = {
2249
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2250
- name: errorCode,
2251
- $metadata: deserializeMetadata(output),
2252
- };
2253
- break;
1818
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2254
1819
  case "NotFoundException":
2255
1820
  case "com.amazonaws.schemas#NotFoundException":
2256
- response = {
2257
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2258
- name: errorCode,
2259
- $metadata: deserializeMetadata(output),
2260
- };
2261
- break;
1821
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2262
1822
  case "ServiceUnavailableException":
2263
1823
  case "com.amazonaws.schemas#ServiceUnavailableException":
2264
- response = {
2265
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2266
- name: errorCode,
2267
- $metadata: deserializeMetadata(output),
2268
- };
2269
- break;
1824
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2270
1825
  case "TooManyRequestsException":
2271
1826
  case "com.amazonaws.schemas#TooManyRequestsException":
2272
- response = {
2273
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2274
- name: errorCode,
2275
- $metadata: deserializeMetadata(output),
2276
- };
2277
- break;
1827
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2278
1828
  case "UnauthorizedException":
2279
1829
  case "com.amazonaws.schemas#UnauthorizedException":
2280
- response = {
2281
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2282
- name: errorCode,
2283
- $metadata: deserializeMetadata(output),
2284
- };
2285
- break;
1830
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2286
1831
  default:
2287
1832
  const parsedBody = parsedOutput.body;
2288
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2289
- response = {
2290
- ...parsedBody,
2291
- name: `${errorCode}`,
2292
- message: parsedBody.message || parsedBody.Message || errorCode,
1833
+ response = new SchemasServiceException_1.SchemasServiceException({
1834
+ name: parsedBody.code || parsedBody.Code || errorCode,
2293
1835
  $fault: "client",
2294
1836
  $metadata: deserializeMetadata(output),
2295
- };
1837
+ });
1838
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2296
1839
  }
2297
- const message = response.message || response.Message || errorCode;
2298
- response.message = message;
2299
- delete response.Message;
2300
- return Promise.reject(Object.assign(new Error(message), response));
2301
1840
  };
2302
1841
  const deserializeAws_restJson1GetCodeBindingSourceCommand = async (output, context) => {
2303
1842
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2323,67 +1862,31 @@ const deserializeAws_restJson1GetCodeBindingSourceCommandError = async (output,
2323
1862
  switch (errorCode) {
2324
1863
  case "BadRequestException":
2325
1864
  case "com.amazonaws.schemas#BadRequestException":
2326
- response = {
2327
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2328
- name: errorCode,
2329
- $metadata: deserializeMetadata(output),
2330
- };
2331
- break;
1865
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2332
1866
  case "ForbiddenException":
2333
1867
  case "com.amazonaws.schemas#ForbiddenException":
2334
- response = {
2335
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2336
- name: errorCode,
2337
- $metadata: deserializeMetadata(output),
2338
- };
2339
- break;
1868
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2340
1869
  case "InternalServerErrorException":
2341
1870
  case "com.amazonaws.schemas#InternalServerErrorException":
2342
- response = {
2343
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2344
- name: errorCode,
2345
- $metadata: deserializeMetadata(output),
2346
- };
2347
- break;
1871
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2348
1872
  case "NotFoundException":
2349
1873
  case "com.amazonaws.schemas#NotFoundException":
2350
- response = {
2351
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2352
- name: errorCode,
2353
- $metadata: deserializeMetadata(output),
2354
- };
2355
- break;
1874
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2356
1875
  case "TooManyRequestsException":
2357
1876
  case "com.amazonaws.schemas#TooManyRequestsException":
2358
- response = {
2359
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2360
- name: errorCode,
2361
- $metadata: deserializeMetadata(output),
2362
- };
2363
- break;
1877
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2364
1878
  case "UnauthorizedException":
2365
1879
  case "com.amazonaws.schemas#UnauthorizedException":
2366
- response = {
2367
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2368
- name: errorCode,
2369
- $metadata: deserializeMetadata(output),
2370
- };
2371
- break;
1880
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2372
1881
  default:
2373
1882
  const parsedBody = parsedOutput.body;
2374
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2375
- response = {
2376
- ...parsedBody,
2377
- name: `${errorCode}`,
2378
- message: parsedBody.message || parsedBody.Message || errorCode,
1883
+ response = new SchemasServiceException_1.SchemasServiceException({
1884
+ name: parsedBody.code || parsedBody.Code || errorCode,
2379
1885
  $fault: "client",
2380
1886
  $metadata: deserializeMetadata(output),
2381
- };
1887
+ });
1888
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2382
1889
  }
2383
- const message = response.message || response.Message || errorCode;
2384
- response.message = message;
2385
- delete response.Message;
2386
- return Promise.reject(Object.assign(new Error(message), response));
2387
1890
  };
2388
1891
  const deserializeAws_restJson1GetDiscoveredSchemaCommand = async (output, context) => {
2389
1892
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2411,59 +1914,28 @@ const deserializeAws_restJson1GetDiscoveredSchemaCommandError = async (output, c
2411
1914
  switch (errorCode) {
2412
1915
  case "BadRequestException":
2413
1916
  case "com.amazonaws.schemas#BadRequestException":
2414
- response = {
2415
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2416
- name: errorCode,
2417
- $metadata: deserializeMetadata(output),
2418
- };
2419
- break;
1917
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2420
1918
  case "ForbiddenException":
2421
1919
  case "com.amazonaws.schemas#ForbiddenException":
2422
- response = {
2423
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2424
- name: errorCode,
2425
- $metadata: deserializeMetadata(output),
2426
- };
2427
- break;
1920
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2428
1921
  case "InternalServerErrorException":
2429
1922
  case "com.amazonaws.schemas#InternalServerErrorException":
2430
- response = {
2431
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2432
- name: errorCode,
2433
- $metadata: deserializeMetadata(output),
2434
- };
2435
- break;
1923
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2436
1924
  case "ServiceUnavailableException":
2437
1925
  case "com.amazonaws.schemas#ServiceUnavailableException":
2438
- response = {
2439
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2440
- name: errorCode,
2441
- $metadata: deserializeMetadata(output),
2442
- };
2443
- break;
1926
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2444
1927
  case "UnauthorizedException":
2445
1928
  case "com.amazonaws.schemas#UnauthorizedException":
2446
- response = {
2447
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2448
- name: errorCode,
2449
- $metadata: deserializeMetadata(output),
2450
- };
2451
- break;
1929
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2452
1930
  default:
2453
1931
  const parsedBody = parsedOutput.body;
2454
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2455
- response = {
2456
- ...parsedBody,
2457
- name: `${errorCode}`,
2458
- message: parsedBody.message || parsedBody.Message || errorCode,
1932
+ response = new SchemasServiceException_1.SchemasServiceException({
1933
+ name: parsedBody.code || parsedBody.Code || errorCode,
2459
1934
  $fault: "client",
2460
1935
  $metadata: deserializeMetadata(output),
2461
- };
1936
+ });
1937
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2462
1938
  }
2463
- const message = response.message || response.Message || errorCode;
2464
- response.message = message;
2465
- delete response.Message;
2466
- return Promise.reject(Object.assign(new Error(message), response));
2467
1939
  };
2468
1940
  const deserializeAws_restJson1GetResourcePolicyCommand = async (output, context) => {
2469
1941
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2495,67 +1967,31 @@ const deserializeAws_restJson1GetResourcePolicyCommandError = async (output, con
2495
1967
  switch (errorCode) {
2496
1968
  case "BadRequestException":
2497
1969
  case "com.amazonaws.schemas#BadRequestException":
2498
- response = {
2499
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2500
- name: errorCode,
2501
- $metadata: deserializeMetadata(output),
2502
- };
2503
- break;
1970
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2504
1971
  case "ForbiddenException":
2505
1972
  case "com.amazonaws.schemas#ForbiddenException":
2506
- response = {
2507
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2508
- name: errorCode,
2509
- $metadata: deserializeMetadata(output),
2510
- };
2511
- break;
1973
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2512
1974
  case "InternalServerErrorException":
2513
1975
  case "com.amazonaws.schemas#InternalServerErrorException":
2514
- response = {
2515
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2516
- name: errorCode,
2517
- $metadata: deserializeMetadata(output),
2518
- };
2519
- break;
1976
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2520
1977
  case "NotFoundException":
2521
1978
  case "com.amazonaws.schemas#NotFoundException":
2522
- response = {
2523
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2524
- name: errorCode,
2525
- $metadata: deserializeMetadata(output),
2526
- };
2527
- break;
1979
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2528
1980
  case "ServiceUnavailableException":
2529
1981
  case "com.amazonaws.schemas#ServiceUnavailableException":
2530
- response = {
2531
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2532
- name: errorCode,
2533
- $metadata: deserializeMetadata(output),
2534
- };
2535
- break;
1982
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2536
1983
  case "UnauthorizedException":
2537
1984
  case "com.amazonaws.schemas#UnauthorizedException":
2538
- response = {
2539
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2540
- name: errorCode,
2541
- $metadata: deserializeMetadata(output),
2542
- };
2543
- break;
1985
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2544
1986
  default:
2545
1987
  const parsedBody = parsedOutput.body;
2546
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2547
- response = {
2548
- ...parsedBody,
2549
- name: `${errorCode}`,
2550
- message: parsedBody.message || parsedBody.Message || errorCode,
1988
+ response = new SchemasServiceException_1.SchemasServiceException({
1989
+ name: parsedBody.code || parsedBody.Code || errorCode,
2551
1990
  $fault: "client",
2552
1991
  $metadata: deserializeMetadata(output),
2553
- };
1992
+ });
1993
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2554
1994
  }
2555
- const message = response.message || response.Message || errorCode;
2556
- response.message = message;
2557
- delete response.Message;
2558
- return Promise.reject(Object.assign(new Error(message), response));
2559
1995
  };
2560
1996
  const deserializeAws_restJson1ListDiscoverersCommand = async (output, context) => {
2561
1997
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2587,59 +2023,28 @@ const deserializeAws_restJson1ListDiscoverersCommandError = async (output, conte
2587
2023
  switch (errorCode) {
2588
2024
  case "BadRequestException":
2589
2025
  case "com.amazonaws.schemas#BadRequestException":
2590
- response = {
2591
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2592
- name: errorCode,
2593
- $metadata: deserializeMetadata(output),
2594
- };
2595
- break;
2026
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2596
2027
  case "ForbiddenException":
2597
2028
  case "com.amazonaws.schemas#ForbiddenException":
2598
- response = {
2599
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2600
- name: errorCode,
2601
- $metadata: deserializeMetadata(output),
2602
- };
2603
- break;
2029
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2604
2030
  case "InternalServerErrorException":
2605
2031
  case "com.amazonaws.schemas#InternalServerErrorException":
2606
- response = {
2607
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2608
- name: errorCode,
2609
- $metadata: deserializeMetadata(output),
2610
- };
2611
- break;
2032
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2612
2033
  case "ServiceUnavailableException":
2613
2034
  case "com.amazonaws.schemas#ServiceUnavailableException":
2614
- response = {
2615
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2616
- name: errorCode,
2617
- $metadata: deserializeMetadata(output),
2618
- };
2619
- break;
2035
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2620
2036
  case "UnauthorizedException":
2621
2037
  case "com.amazonaws.schemas#UnauthorizedException":
2622
- response = {
2623
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2624
- name: errorCode,
2625
- $metadata: deserializeMetadata(output),
2626
- };
2627
- break;
2038
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2628
2039
  default:
2629
2040
  const parsedBody = parsedOutput.body;
2630
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2631
- response = {
2632
- ...parsedBody,
2633
- name: `${errorCode}`,
2634
- message: parsedBody.message || parsedBody.Message || errorCode,
2041
+ response = new SchemasServiceException_1.SchemasServiceException({
2042
+ name: parsedBody.code || parsedBody.Code || errorCode,
2635
2043
  $fault: "client",
2636
2044
  $metadata: deserializeMetadata(output),
2637
- };
2045
+ });
2046
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2638
2047
  }
2639
- const message = response.message || response.Message || errorCode;
2640
- response.message = message;
2641
- delete response.Message;
2642
- return Promise.reject(Object.assign(new Error(message), response));
2643
2048
  };
2644
2049
  const deserializeAws_restJson1ListRegistriesCommand = async (output, context) => {
2645
2050
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2671,59 +2076,28 @@ const deserializeAws_restJson1ListRegistriesCommandError = async (output, contex
2671
2076
  switch (errorCode) {
2672
2077
  case "BadRequestException":
2673
2078
  case "com.amazonaws.schemas#BadRequestException":
2674
- response = {
2675
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2676
- name: errorCode,
2677
- $metadata: deserializeMetadata(output),
2678
- };
2679
- break;
2079
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2680
2080
  case "ForbiddenException":
2681
2081
  case "com.amazonaws.schemas#ForbiddenException":
2682
- response = {
2683
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2684
- name: errorCode,
2685
- $metadata: deserializeMetadata(output),
2686
- };
2687
- break;
2082
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2688
2083
  case "InternalServerErrorException":
2689
2084
  case "com.amazonaws.schemas#InternalServerErrorException":
2690
- response = {
2691
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2692
- name: errorCode,
2693
- $metadata: deserializeMetadata(output),
2694
- };
2695
- break;
2085
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2696
2086
  case "ServiceUnavailableException":
2697
2087
  case "com.amazonaws.schemas#ServiceUnavailableException":
2698
- response = {
2699
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2700
- name: errorCode,
2701
- $metadata: deserializeMetadata(output),
2702
- };
2703
- break;
2088
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2704
2089
  case "UnauthorizedException":
2705
2090
  case "com.amazonaws.schemas#UnauthorizedException":
2706
- response = {
2707
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2708
- name: errorCode,
2709
- $metadata: deserializeMetadata(output),
2710
- };
2711
- break;
2091
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2712
2092
  default:
2713
2093
  const parsedBody = parsedOutput.body;
2714
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2715
- response = {
2716
- ...parsedBody,
2717
- name: `${errorCode}`,
2718
- message: parsedBody.message || parsedBody.Message || errorCode,
2094
+ response = new SchemasServiceException_1.SchemasServiceException({
2095
+ name: parsedBody.code || parsedBody.Code || errorCode,
2719
2096
  $fault: "client",
2720
2097
  $metadata: deserializeMetadata(output),
2721
- };
2098
+ });
2099
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2722
2100
  }
2723
- const message = response.message || response.Message || errorCode;
2724
- response.message = message;
2725
- delete response.Message;
2726
- return Promise.reject(Object.assign(new Error(message), response));
2727
2101
  };
2728
2102
  const deserializeAws_restJson1ListSchemasCommand = async (output, context) => {
2729
2103
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2755,59 +2129,28 @@ const deserializeAws_restJson1ListSchemasCommandError = async (output, context)
2755
2129
  switch (errorCode) {
2756
2130
  case "BadRequestException":
2757
2131
  case "com.amazonaws.schemas#BadRequestException":
2758
- response = {
2759
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2760
- name: errorCode,
2761
- $metadata: deserializeMetadata(output),
2762
- };
2763
- break;
2132
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2764
2133
  case "ForbiddenException":
2765
2134
  case "com.amazonaws.schemas#ForbiddenException":
2766
- response = {
2767
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2768
- name: errorCode,
2769
- $metadata: deserializeMetadata(output),
2770
- };
2771
- break;
2135
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2772
2136
  case "InternalServerErrorException":
2773
2137
  case "com.amazonaws.schemas#InternalServerErrorException":
2774
- response = {
2775
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2776
- name: errorCode,
2777
- $metadata: deserializeMetadata(output),
2778
- };
2779
- break;
2138
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2780
2139
  case "ServiceUnavailableException":
2781
2140
  case "com.amazonaws.schemas#ServiceUnavailableException":
2782
- response = {
2783
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2784
- name: errorCode,
2785
- $metadata: deserializeMetadata(output),
2786
- };
2787
- break;
2141
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2788
2142
  case "UnauthorizedException":
2789
2143
  case "com.amazonaws.schemas#UnauthorizedException":
2790
- response = {
2791
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2792
- name: errorCode,
2793
- $metadata: deserializeMetadata(output),
2794
- };
2795
- break;
2144
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2796
2145
  default:
2797
2146
  const parsedBody = parsedOutput.body;
2798
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2799
- response = {
2800
- ...parsedBody,
2801
- name: `${errorCode}`,
2802
- message: parsedBody.message || parsedBody.Message || errorCode,
2147
+ response = new SchemasServiceException_1.SchemasServiceException({
2148
+ name: parsedBody.code || parsedBody.Code || errorCode,
2803
2149
  $fault: "client",
2804
2150
  $metadata: deserializeMetadata(output),
2805
- };
2151
+ });
2152
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2806
2153
  }
2807
- const message = response.message || response.Message || errorCode;
2808
- response.message = message;
2809
- delete response.Message;
2810
- return Promise.reject(Object.assign(new Error(message), response));
2811
2154
  };
2812
2155
  const deserializeAws_restJson1ListSchemaVersionsCommand = async (output, context) => {
2813
2156
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2839,67 +2182,31 @@ const deserializeAws_restJson1ListSchemaVersionsCommandError = async (output, co
2839
2182
  switch (errorCode) {
2840
2183
  case "BadRequestException":
2841
2184
  case "com.amazonaws.schemas#BadRequestException":
2842
- response = {
2843
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2844
- name: errorCode,
2845
- $metadata: deserializeMetadata(output),
2846
- };
2847
- break;
2185
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2848
2186
  case "ForbiddenException":
2849
2187
  case "com.amazonaws.schemas#ForbiddenException":
2850
- response = {
2851
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2852
- name: errorCode,
2853
- $metadata: deserializeMetadata(output),
2854
- };
2855
- break;
2188
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2856
2189
  case "InternalServerErrorException":
2857
2190
  case "com.amazonaws.schemas#InternalServerErrorException":
2858
- response = {
2859
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2860
- name: errorCode,
2861
- $metadata: deserializeMetadata(output),
2862
- };
2863
- break;
2191
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2864
2192
  case "NotFoundException":
2865
2193
  case "com.amazonaws.schemas#NotFoundException":
2866
- response = {
2867
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2868
- name: errorCode,
2869
- $metadata: deserializeMetadata(output),
2870
- };
2871
- break;
2194
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2872
2195
  case "ServiceUnavailableException":
2873
2196
  case "com.amazonaws.schemas#ServiceUnavailableException":
2874
- response = {
2875
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
2876
- name: errorCode,
2877
- $metadata: deserializeMetadata(output),
2878
- };
2879
- break;
2197
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
2880
2198
  case "UnauthorizedException":
2881
2199
  case "com.amazonaws.schemas#UnauthorizedException":
2882
- response = {
2883
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2884
- name: errorCode,
2885
- $metadata: deserializeMetadata(output),
2886
- };
2887
- break;
2200
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2888
2201
  default:
2889
2202
  const parsedBody = parsedOutput.body;
2890
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2891
- response = {
2892
- ...parsedBody,
2893
- name: `${errorCode}`,
2894
- message: parsedBody.message || parsedBody.Message || errorCode,
2203
+ response = new SchemasServiceException_1.SchemasServiceException({
2204
+ name: parsedBody.code || parsedBody.Code || errorCode,
2895
2205
  $fault: "client",
2896
2206
  $metadata: deserializeMetadata(output),
2897
- };
2207
+ });
2208
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2898
2209
  }
2899
- const message = response.message || response.Message || errorCode;
2900
- response.message = message;
2901
- delete response.Message;
2902
- return Promise.reject(Object.assign(new Error(message), response));
2903
2210
  };
2904
2211
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2905
2212
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2927,51 +2234,25 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2927
2234
  switch (errorCode) {
2928
2235
  case "BadRequestException":
2929
2236
  case "com.amazonaws.schemas#BadRequestException":
2930
- response = {
2931
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2932
- name: errorCode,
2933
- $metadata: deserializeMetadata(output),
2934
- };
2935
- break;
2237
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2936
2238
  case "ForbiddenException":
2937
2239
  case "com.amazonaws.schemas#ForbiddenException":
2938
- response = {
2939
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2940
- name: errorCode,
2941
- $metadata: deserializeMetadata(output),
2942
- };
2943
- break;
2240
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
2944
2241
  case "InternalServerErrorException":
2945
2242
  case "com.amazonaws.schemas#InternalServerErrorException":
2946
- response = {
2947
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2948
- name: errorCode,
2949
- $metadata: deserializeMetadata(output),
2950
- };
2951
- break;
2243
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
2952
2244
  case "NotFoundException":
2953
2245
  case "com.amazonaws.schemas#NotFoundException":
2954
- response = {
2955
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2956
- name: errorCode,
2957
- $metadata: deserializeMetadata(output),
2958
- };
2959
- break;
2246
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2960
2247
  default:
2961
2248
  const parsedBody = parsedOutput.body;
2962
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2963
- response = {
2964
- ...parsedBody,
2965
- name: `${errorCode}`,
2966
- message: parsedBody.message || parsedBody.Message || errorCode,
2249
+ response = new SchemasServiceException_1.SchemasServiceException({
2250
+ name: parsedBody.code || parsedBody.Code || errorCode,
2967
2251
  $fault: "client",
2968
2252
  $metadata: deserializeMetadata(output),
2969
- };
2253
+ });
2254
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2970
2255
  }
2971
- const message = response.message || response.Message || errorCode;
2972
- response.message = message;
2973
- delete response.Message;
2974
- return Promise.reject(Object.assign(new Error(message), response));
2975
2256
  };
2976
2257
  const deserializeAws_restJson1PutCodeBindingCommand = async (output, context) => {
2977
2258
  if (output.statusCode !== 202 && output.statusCode >= 300) {
@@ -3011,75 +2292,34 @@ const deserializeAws_restJson1PutCodeBindingCommandError = async (output, contex
3011
2292
  switch (errorCode) {
3012
2293
  case "BadRequestException":
3013
2294
  case "com.amazonaws.schemas#BadRequestException":
3014
- response = {
3015
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3016
- name: errorCode,
3017
- $metadata: deserializeMetadata(output),
3018
- };
3019
- break;
2295
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3020
2296
  case "ForbiddenException":
3021
2297
  case "com.amazonaws.schemas#ForbiddenException":
3022
- response = {
3023
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3024
- name: errorCode,
3025
- $metadata: deserializeMetadata(output),
3026
- };
3027
- break;
2298
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3028
2299
  case "GoneException":
3029
2300
  case "com.amazonaws.schemas#GoneException":
3030
- response = {
3031
- ...(await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context)),
3032
- name: errorCode,
3033
- $metadata: deserializeMetadata(output),
3034
- };
3035
- break;
2301
+ throw await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context);
3036
2302
  case "InternalServerErrorException":
3037
2303
  case "com.amazonaws.schemas#InternalServerErrorException":
3038
- response = {
3039
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3040
- name: errorCode,
3041
- $metadata: deserializeMetadata(output),
3042
- };
3043
- break;
2304
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3044
2305
  case "NotFoundException":
3045
2306
  case "com.amazonaws.schemas#NotFoundException":
3046
- response = {
3047
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3048
- name: errorCode,
3049
- $metadata: deserializeMetadata(output),
3050
- };
3051
- break;
2307
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3052
2308
  case "TooManyRequestsException":
3053
2309
  case "com.amazonaws.schemas#TooManyRequestsException":
3054
- response = {
3055
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3056
- name: errorCode,
3057
- $metadata: deserializeMetadata(output),
3058
- };
3059
- break;
2310
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3060
2311
  case "UnauthorizedException":
3061
2312
  case "com.amazonaws.schemas#UnauthorizedException":
3062
- response = {
3063
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3064
- name: errorCode,
3065
- $metadata: deserializeMetadata(output),
3066
- };
3067
- break;
2313
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3068
2314
  default:
3069
2315
  const parsedBody = parsedOutput.body;
3070
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3071
- response = {
3072
- ...parsedBody,
3073
- name: `${errorCode}`,
3074
- message: parsedBody.message || parsedBody.Message || errorCode,
2316
+ response = new SchemasServiceException_1.SchemasServiceException({
2317
+ name: parsedBody.code || parsedBody.Code || errorCode,
3075
2318
  $fault: "client",
3076
2319
  $metadata: deserializeMetadata(output),
3077
- };
2320
+ });
2321
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3078
2322
  }
3079
- const message = response.message || response.Message || errorCode;
3080
- response.message = message;
3081
- delete response.Message;
3082
- return Promise.reject(Object.assign(new Error(message), response));
3083
2323
  };
3084
2324
  const deserializeAws_restJson1PutResourcePolicyCommand = async (output, context) => {
3085
2325
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3111,75 +2351,34 @@ const deserializeAws_restJson1PutResourcePolicyCommandError = async (output, con
3111
2351
  switch (errorCode) {
3112
2352
  case "BadRequestException":
3113
2353
  case "com.amazonaws.schemas#BadRequestException":
3114
- response = {
3115
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3116
- name: errorCode,
3117
- $metadata: deserializeMetadata(output),
3118
- };
3119
- break;
2354
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3120
2355
  case "ForbiddenException":
3121
2356
  case "com.amazonaws.schemas#ForbiddenException":
3122
- response = {
3123
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3124
- name: errorCode,
3125
- $metadata: deserializeMetadata(output),
3126
- };
3127
- break;
2357
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3128
2358
  case "InternalServerErrorException":
3129
2359
  case "com.amazonaws.schemas#InternalServerErrorException":
3130
- response = {
3131
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3132
- name: errorCode,
3133
- $metadata: deserializeMetadata(output),
3134
- };
3135
- break;
2360
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3136
2361
  case "NotFoundException":
3137
2362
  case "com.amazonaws.schemas#NotFoundException":
3138
- response = {
3139
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3140
- name: errorCode,
3141
- $metadata: deserializeMetadata(output),
3142
- };
3143
- break;
2363
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3144
2364
  case "PreconditionFailedException":
3145
2365
  case "com.amazonaws.schemas#PreconditionFailedException":
3146
- response = {
3147
- ...(await deserializeAws_restJson1PreconditionFailedExceptionResponse(parsedOutput, context)),
3148
- name: errorCode,
3149
- $metadata: deserializeMetadata(output),
3150
- };
3151
- break;
2366
+ throw await deserializeAws_restJson1PreconditionFailedExceptionResponse(parsedOutput, context);
3152
2367
  case "ServiceUnavailableException":
3153
2368
  case "com.amazonaws.schemas#ServiceUnavailableException":
3154
- response = {
3155
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3156
- name: errorCode,
3157
- $metadata: deserializeMetadata(output),
3158
- };
3159
- break;
2369
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3160
2370
  case "UnauthorizedException":
3161
2371
  case "com.amazonaws.schemas#UnauthorizedException":
3162
- response = {
3163
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3164
- name: errorCode,
3165
- $metadata: deserializeMetadata(output),
3166
- };
3167
- break;
2372
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3168
2373
  default:
3169
2374
  const parsedBody = parsedOutput.body;
3170
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3171
- response = {
3172
- ...parsedBody,
3173
- name: `${errorCode}`,
3174
- message: parsedBody.message || parsedBody.Message || errorCode,
2375
+ response = new SchemasServiceException_1.SchemasServiceException({
2376
+ name: parsedBody.code || parsedBody.Code || errorCode,
3175
2377
  $fault: "client",
3176
2378
  $metadata: deserializeMetadata(output),
3177
- };
2379
+ });
2380
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3178
2381
  }
3179
- const message = response.message || response.Message || errorCode;
3180
- response.message = message;
3181
- delete response.Message;
3182
- return Promise.reject(Object.assign(new Error(message), response));
3183
2382
  };
3184
2383
  const deserializeAws_restJson1SearchSchemasCommand = async (output, context) => {
3185
2384
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3211,59 +2410,28 @@ const deserializeAws_restJson1SearchSchemasCommandError = async (output, context
3211
2410
  switch (errorCode) {
3212
2411
  case "BadRequestException":
3213
2412
  case "com.amazonaws.schemas#BadRequestException":
3214
- response = {
3215
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3216
- name: errorCode,
3217
- $metadata: deserializeMetadata(output),
3218
- };
3219
- break;
2413
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3220
2414
  case "ForbiddenException":
3221
2415
  case "com.amazonaws.schemas#ForbiddenException":
3222
- response = {
3223
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3224
- name: errorCode,
3225
- $metadata: deserializeMetadata(output),
3226
- };
3227
- break;
2416
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3228
2417
  case "InternalServerErrorException":
3229
2418
  case "com.amazonaws.schemas#InternalServerErrorException":
3230
- response = {
3231
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3232
- name: errorCode,
3233
- $metadata: deserializeMetadata(output),
3234
- };
3235
- break;
2419
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3236
2420
  case "ServiceUnavailableException":
3237
2421
  case "com.amazonaws.schemas#ServiceUnavailableException":
3238
- response = {
3239
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3240
- name: errorCode,
3241
- $metadata: deserializeMetadata(output),
3242
- };
3243
- break;
2422
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3244
2423
  case "UnauthorizedException":
3245
2424
  case "com.amazonaws.schemas#UnauthorizedException":
3246
- response = {
3247
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3248
- name: errorCode,
3249
- $metadata: deserializeMetadata(output),
3250
- };
3251
- break;
2425
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3252
2426
  default:
3253
2427
  const parsedBody = parsedOutput.body;
3254
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3255
- response = {
3256
- ...parsedBody,
3257
- name: `${errorCode}`,
3258
- message: parsedBody.message || parsedBody.Message || errorCode,
2428
+ response = new SchemasServiceException_1.SchemasServiceException({
2429
+ name: parsedBody.code || parsedBody.Code || errorCode,
3259
2430
  $fault: "client",
3260
2431
  $metadata: deserializeMetadata(output),
3261
- };
2432
+ });
2433
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3262
2434
  }
3263
- const message = response.message || response.Message || errorCode;
3264
- response.message = message;
3265
- delete response.Message;
3266
- return Promise.reject(Object.assign(new Error(message), response));
3267
2435
  };
3268
2436
  const deserializeAws_restJson1StartDiscovererCommand = async (output, context) => {
3269
2437
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3295,67 +2463,31 @@ const deserializeAws_restJson1StartDiscovererCommandError = async (output, conte
3295
2463
  switch (errorCode) {
3296
2464
  case "BadRequestException":
3297
2465
  case "com.amazonaws.schemas#BadRequestException":
3298
- response = {
3299
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3300
- name: errorCode,
3301
- $metadata: deserializeMetadata(output),
3302
- };
3303
- break;
2466
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3304
2467
  case "ForbiddenException":
3305
2468
  case "com.amazonaws.schemas#ForbiddenException":
3306
- response = {
3307
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3308
- name: errorCode,
3309
- $metadata: deserializeMetadata(output),
3310
- };
3311
- break;
2469
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3312
2470
  case "InternalServerErrorException":
3313
2471
  case "com.amazonaws.schemas#InternalServerErrorException":
3314
- response = {
3315
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3316
- name: errorCode,
3317
- $metadata: deserializeMetadata(output),
3318
- };
3319
- break;
2472
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3320
2473
  case "NotFoundException":
3321
2474
  case "com.amazonaws.schemas#NotFoundException":
3322
- response = {
3323
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3324
- name: errorCode,
3325
- $metadata: deserializeMetadata(output),
3326
- };
3327
- break;
2475
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3328
2476
  case "ServiceUnavailableException":
3329
2477
  case "com.amazonaws.schemas#ServiceUnavailableException":
3330
- response = {
3331
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3332
- name: errorCode,
3333
- $metadata: deserializeMetadata(output),
3334
- };
3335
- break;
2478
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3336
2479
  case "UnauthorizedException":
3337
2480
  case "com.amazonaws.schemas#UnauthorizedException":
3338
- response = {
3339
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3340
- name: errorCode,
3341
- $metadata: deserializeMetadata(output),
3342
- };
3343
- break;
2481
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3344
2482
  default:
3345
2483
  const parsedBody = parsedOutput.body;
3346
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3347
- response = {
3348
- ...parsedBody,
3349
- name: `${errorCode}`,
3350
- message: parsedBody.message || parsedBody.Message || errorCode,
2484
+ response = new SchemasServiceException_1.SchemasServiceException({
2485
+ name: parsedBody.code || parsedBody.Code || errorCode,
3351
2486
  $fault: "client",
3352
2487
  $metadata: deserializeMetadata(output),
3353
- };
2488
+ });
2489
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3354
2490
  }
3355
- const message = response.message || response.Message || errorCode;
3356
- response.message = message;
3357
- delete response.Message;
3358
- return Promise.reject(Object.assign(new Error(message), response));
3359
2491
  };
3360
2492
  const deserializeAws_restJson1StopDiscovererCommand = async (output, context) => {
3361
2493
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3387,67 +2519,31 @@ const deserializeAws_restJson1StopDiscovererCommandError = async (output, contex
3387
2519
  switch (errorCode) {
3388
2520
  case "BadRequestException":
3389
2521
  case "com.amazonaws.schemas#BadRequestException":
3390
- response = {
3391
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3392
- name: errorCode,
3393
- $metadata: deserializeMetadata(output),
3394
- };
3395
- break;
2522
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3396
2523
  case "ForbiddenException":
3397
2524
  case "com.amazonaws.schemas#ForbiddenException":
3398
- response = {
3399
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3400
- name: errorCode,
3401
- $metadata: deserializeMetadata(output),
3402
- };
3403
- break;
2525
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3404
2526
  case "InternalServerErrorException":
3405
2527
  case "com.amazonaws.schemas#InternalServerErrorException":
3406
- response = {
3407
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3408
- name: errorCode,
3409
- $metadata: deserializeMetadata(output),
3410
- };
3411
- break;
2528
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3412
2529
  case "NotFoundException":
3413
2530
  case "com.amazonaws.schemas#NotFoundException":
3414
- response = {
3415
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3416
- name: errorCode,
3417
- $metadata: deserializeMetadata(output),
3418
- };
3419
- break;
2531
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3420
2532
  case "ServiceUnavailableException":
3421
2533
  case "com.amazonaws.schemas#ServiceUnavailableException":
3422
- response = {
3423
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3424
- name: errorCode,
3425
- $metadata: deserializeMetadata(output),
3426
- };
3427
- break;
2534
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3428
2535
  case "UnauthorizedException":
3429
2536
  case "com.amazonaws.schemas#UnauthorizedException":
3430
- response = {
3431
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3432
- name: errorCode,
3433
- $metadata: deserializeMetadata(output),
3434
- };
3435
- break;
2537
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3436
2538
  default:
3437
2539
  const parsedBody = parsedOutput.body;
3438
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3439
- response = {
3440
- ...parsedBody,
3441
- name: `${errorCode}`,
3442
- message: parsedBody.message || parsedBody.Message || errorCode,
2540
+ response = new SchemasServiceException_1.SchemasServiceException({
2541
+ name: parsedBody.code || parsedBody.Code || errorCode,
3443
2542
  $fault: "client",
3444
2543
  $metadata: deserializeMetadata(output),
3445
- };
2544
+ });
2545
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3446
2546
  }
3447
- const message = response.message || response.Message || errorCode;
3448
- response.message = message;
3449
- delete response.Message;
3450
- return Promise.reject(Object.assign(new Error(message), response));
3451
2547
  };
3452
2548
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
3453
2549
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -3471,51 +2567,25 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
3471
2567
  switch (errorCode) {
3472
2568
  case "BadRequestException":
3473
2569
  case "com.amazonaws.schemas#BadRequestException":
3474
- response = {
3475
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3476
- name: errorCode,
3477
- $metadata: deserializeMetadata(output),
3478
- };
3479
- break;
2570
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3480
2571
  case "ForbiddenException":
3481
2572
  case "com.amazonaws.schemas#ForbiddenException":
3482
- response = {
3483
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3484
- name: errorCode,
3485
- $metadata: deserializeMetadata(output),
3486
- };
3487
- break;
2573
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3488
2574
  case "InternalServerErrorException":
3489
2575
  case "com.amazonaws.schemas#InternalServerErrorException":
3490
- response = {
3491
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3492
- name: errorCode,
3493
- $metadata: deserializeMetadata(output),
3494
- };
3495
- break;
2576
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3496
2577
  case "NotFoundException":
3497
2578
  case "com.amazonaws.schemas#NotFoundException":
3498
- response = {
3499
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3500
- name: errorCode,
3501
- $metadata: deserializeMetadata(output),
3502
- };
3503
- break;
2579
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3504
2580
  default:
3505
2581
  const parsedBody = parsedOutput.body;
3506
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3507
- response = {
3508
- ...parsedBody,
3509
- name: `${errorCode}`,
3510
- message: parsedBody.message || parsedBody.Message || errorCode,
2582
+ response = new SchemasServiceException_1.SchemasServiceException({
2583
+ name: parsedBody.code || parsedBody.Code || errorCode,
3511
2584
  $fault: "client",
3512
2585
  $metadata: deserializeMetadata(output),
3513
- };
2586
+ });
2587
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3514
2588
  }
3515
- const message = response.message || response.Message || errorCode;
3516
- response.message = message;
3517
- delete response.Message;
3518
- return Promise.reject(Object.assign(new Error(message), response));
3519
2589
  };
3520
2590
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
3521
2591
  if (output.statusCode !== 204 && output.statusCode >= 300) {
@@ -3539,51 +2609,25 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3539
2609
  switch (errorCode) {
3540
2610
  case "BadRequestException":
3541
2611
  case "com.amazonaws.schemas#BadRequestException":
3542
- response = {
3543
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3544
- name: errorCode,
3545
- $metadata: deserializeMetadata(output),
3546
- };
3547
- break;
2612
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3548
2613
  case "ForbiddenException":
3549
2614
  case "com.amazonaws.schemas#ForbiddenException":
3550
- response = {
3551
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3552
- name: errorCode,
3553
- $metadata: deserializeMetadata(output),
3554
- };
3555
- break;
2615
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3556
2616
  case "InternalServerErrorException":
3557
2617
  case "com.amazonaws.schemas#InternalServerErrorException":
3558
- response = {
3559
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3560
- name: errorCode,
3561
- $metadata: deserializeMetadata(output),
3562
- };
3563
- break;
2618
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3564
2619
  case "NotFoundException":
3565
2620
  case "com.amazonaws.schemas#NotFoundException":
3566
- response = {
3567
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3568
- name: errorCode,
3569
- $metadata: deserializeMetadata(output),
3570
- };
3571
- break;
2621
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3572
2622
  default:
3573
2623
  const parsedBody = parsedOutput.body;
3574
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3575
- response = {
3576
- ...parsedBody,
3577
- name: `${errorCode}`,
3578
- message: parsedBody.message || parsedBody.Message || errorCode,
2624
+ response = new SchemasServiceException_1.SchemasServiceException({
2625
+ name: parsedBody.code || parsedBody.Code || errorCode,
3579
2626
  $fault: "client",
3580
2627
  $metadata: deserializeMetadata(output),
3581
- };
2628
+ });
2629
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3582
2630
  }
3583
- const message = response.message || response.Message || errorCode;
3584
- response.message = message;
3585
- delete response.Message;
3586
- return Promise.reject(Object.assign(new Error(message), response));
3587
2631
  };
3588
2632
  const deserializeAws_restJson1UpdateDiscovererCommand = async (output, context) => {
3589
2633
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3635,67 +2679,31 @@ const deserializeAws_restJson1UpdateDiscovererCommandError = async (output, cont
3635
2679
  switch (errorCode) {
3636
2680
  case "BadRequestException":
3637
2681
  case "com.amazonaws.schemas#BadRequestException":
3638
- response = {
3639
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3640
- name: errorCode,
3641
- $metadata: deserializeMetadata(output),
3642
- };
3643
- break;
2682
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3644
2683
  case "ForbiddenException":
3645
2684
  case "com.amazonaws.schemas#ForbiddenException":
3646
- response = {
3647
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3648
- name: errorCode,
3649
- $metadata: deserializeMetadata(output),
3650
- };
3651
- break;
2685
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3652
2686
  case "InternalServerErrorException":
3653
2687
  case "com.amazonaws.schemas#InternalServerErrorException":
3654
- response = {
3655
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3656
- name: errorCode,
3657
- $metadata: deserializeMetadata(output),
3658
- };
3659
- break;
2688
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3660
2689
  case "NotFoundException":
3661
2690
  case "com.amazonaws.schemas#NotFoundException":
3662
- response = {
3663
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3664
- name: errorCode,
3665
- $metadata: deserializeMetadata(output),
3666
- };
3667
- break;
2691
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3668
2692
  case "ServiceUnavailableException":
3669
2693
  case "com.amazonaws.schemas#ServiceUnavailableException":
3670
- response = {
3671
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3672
- name: errorCode,
3673
- $metadata: deserializeMetadata(output),
3674
- };
3675
- break;
2694
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3676
2695
  case "UnauthorizedException":
3677
2696
  case "com.amazonaws.schemas#UnauthorizedException":
3678
- response = {
3679
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3680
- name: errorCode,
3681
- $metadata: deserializeMetadata(output),
3682
- };
3683
- break;
2697
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3684
2698
  default:
3685
2699
  const parsedBody = parsedOutput.body;
3686
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3687
- response = {
3688
- ...parsedBody,
3689
- name: `${errorCode}`,
3690
- message: parsedBody.message || parsedBody.Message || errorCode,
2700
+ response = new SchemasServiceException_1.SchemasServiceException({
2701
+ name: parsedBody.code || parsedBody.Code || errorCode,
3691
2702
  $fault: "client",
3692
2703
  $metadata: deserializeMetadata(output),
3693
- };
2704
+ });
2705
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3694
2706
  }
3695
- const message = response.message || response.Message || errorCode;
3696
- response.message = message;
3697
- delete response.Message;
3698
- return Promise.reject(Object.assign(new Error(message), response));
3699
2707
  };
3700
2708
  const deserializeAws_restJson1UpdateRegistryCommand = async (output, context) => {
3701
2709
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3735,67 +2743,31 @@ const deserializeAws_restJson1UpdateRegistryCommandError = async (output, contex
3735
2743
  switch (errorCode) {
3736
2744
  case "BadRequestException":
3737
2745
  case "com.amazonaws.schemas#BadRequestException":
3738
- response = {
3739
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3740
- name: errorCode,
3741
- $metadata: deserializeMetadata(output),
3742
- };
3743
- break;
2746
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3744
2747
  case "ForbiddenException":
3745
2748
  case "com.amazonaws.schemas#ForbiddenException":
3746
- response = {
3747
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3748
- name: errorCode,
3749
- $metadata: deserializeMetadata(output),
3750
- };
3751
- break;
2749
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3752
2750
  case "InternalServerErrorException":
3753
2751
  case "com.amazonaws.schemas#InternalServerErrorException":
3754
- response = {
3755
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3756
- name: errorCode,
3757
- $metadata: deserializeMetadata(output),
3758
- };
3759
- break;
2752
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3760
2753
  case "NotFoundException":
3761
2754
  case "com.amazonaws.schemas#NotFoundException":
3762
- response = {
3763
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3764
- name: errorCode,
3765
- $metadata: deserializeMetadata(output),
3766
- };
3767
- break;
2755
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3768
2756
  case "ServiceUnavailableException":
3769
2757
  case "com.amazonaws.schemas#ServiceUnavailableException":
3770
- response = {
3771
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3772
- name: errorCode,
3773
- $metadata: deserializeMetadata(output),
3774
- };
3775
- break;
2758
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3776
2759
  case "UnauthorizedException":
3777
2760
  case "com.amazonaws.schemas#UnauthorizedException":
3778
- response = {
3779
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3780
- name: errorCode,
3781
- $metadata: deserializeMetadata(output),
3782
- };
3783
- break;
2761
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3784
2762
  default:
3785
2763
  const parsedBody = parsedOutput.body;
3786
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3787
- response = {
3788
- ...parsedBody,
3789
- name: `${errorCode}`,
3790
- message: parsedBody.message || parsedBody.Message || errorCode,
2764
+ response = new SchemasServiceException_1.SchemasServiceException({
2765
+ name: parsedBody.code || parsedBody.Code || errorCode,
3791
2766
  $fault: "client",
3792
2767
  $metadata: deserializeMetadata(output),
3793
- };
2768
+ });
2769
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3794
2770
  }
3795
- const message = response.message || response.Message || errorCode;
3796
- response.message = message;
3797
- delete response.Message;
3798
- return Promise.reject(Object.assign(new Error(message), response));
3799
2771
  };
3800
2772
  const deserializeAws_restJson1UpdateSchemaCommand = async (output, context) => {
3801
2773
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3851,68 +2823,31 @@ const deserializeAws_restJson1UpdateSchemaCommandError = async (output, context)
3851
2823
  switch (errorCode) {
3852
2824
  case "BadRequestException":
3853
2825
  case "com.amazonaws.schemas#BadRequestException":
3854
- response = {
3855
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3856
- name: errorCode,
3857
- $metadata: deserializeMetadata(output),
3858
- };
3859
- break;
2826
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3860
2827
  case "ForbiddenException":
3861
2828
  case "com.amazonaws.schemas#ForbiddenException":
3862
- response = {
3863
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
3864
- name: errorCode,
3865
- $metadata: deserializeMetadata(output),
3866
- };
3867
- break;
2829
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
3868
2830
  case "InternalServerErrorException":
3869
2831
  case "com.amazonaws.schemas#InternalServerErrorException":
3870
- response = {
3871
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
3872
- name: errorCode,
3873
- $metadata: deserializeMetadata(output),
3874
- };
3875
- break;
2832
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
3876
2833
  case "NotFoundException":
3877
2834
  case "com.amazonaws.schemas#NotFoundException":
3878
- response = {
3879
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3880
- name: errorCode,
3881
- $metadata: deserializeMetadata(output),
3882
- };
3883
- break;
2835
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3884
2836
  case "ServiceUnavailableException":
3885
2837
  case "com.amazonaws.schemas#ServiceUnavailableException":
3886
- response = {
3887
- ...(await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)),
3888
- name: errorCode,
3889
- $metadata: deserializeMetadata(output),
3890
- };
3891
- break;
2838
+ throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context);
3892
2839
  default:
3893
2840
  const parsedBody = parsedOutput.body;
3894
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3895
- response = {
3896
- ...parsedBody,
3897
- name: `${errorCode}`,
3898
- message: parsedBody.message || parsedBody.Message || errorCode,
2841
+ response = new SchemasServiceException_1.SchemasServiceException({
2842
+ name: parsedBody.code || parsedBody.Code || errorCode,
3899
2843
  $fault: "client",
3900
2844
  $metadata: deserializeMetadata(output),
3901
- };
2845
+ });
2846
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3902
2847
  }
3903
- const message = response.message || response.Message || errorCode;
3904
- response.message = message;
3905
- delete response.Message;
3906
- return Promise.reject(Object.assign(new Error(message), response));
3907
2848
  };
3908
2849
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
3909
- const contents = {
3910
- name: "BadRequestException",
3911
- $fault: "client",
3912
- $metadata: deserializeMetadata(parsedOutput),
3913
- Code: undefined,
3914
- Message: undefined,
3915
- };
2850
+ const contents = {};
3916
2851
  const data = parsedOutput.body;
3917
2852
  if (data.Code !== undefined && data.Code !== null) {
3918
2853
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -3920,16 +2855,14 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
3920
2855
  if (data.Message !== undefined && data.Message !== null) {
3921
2856
  contents.Message = smithy_client_1.expectString(data.Message);
3922
2857
  }
3923
- return contents;
2858
+ const exception = new models_0_1.BadRequestException({
2859
+ $metadata: deserializeMetadata(parsedOutput),
2860
+ ...contents,
2861
+ });
2862
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3924
2863
  };
3925
2864
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
3926
- const contents = {
3927
- name: "ConflictException",
3928
- $fault: "client",
3929
- $metadata: deserializeMetadata(parsedOutput),
3930
- Code: undefined,
3931
- Message: undefined,
3932
- };
2865
+ const contents = {};
3933
2866
  const data = parsedOutput.body;
3934
2867
  if (data.Code !== undefined && data.Code !== null) {
3935
2868
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -3937,16 +2870,14 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
3937
2870
  if (data.Message !== undefined && data.Message !== null) {
3938
2871
  contents.Message = smithy_client_1.expectString(data.Message);
3939
2872
  }
3940
- return contents;
2873
+ const exception = new models_0_1.ConflictException({
2874
+ $metadata: deserializeMetadata(parsedOutput),
2875
+ ...contents,
2876
+ });
2877
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3941
2878
  };
3942
2879
  const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
3943
- const contents = {
3944
- name: "ForbiddenException",
3945
- $fault: "client",
3946
- $metadata: deserializeMetadata(parsedOutput),
3947
- Code: undefined,
3948
- Message: undefined,
3949
- };
2880
+ const contents = {};
3950
2881
  const data = parsedOutput.body;
3951
2882
  if (data.Code !== undefined && data.Code !== null) {
3952
2883
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -3954,16 +2885,14 @@ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput,
3954
2885
  if (data.Message !== undefined && data.Message !== null) {
3955
2886
  contents.Message = smithy_client_1.expectString(data.Message);
3956
2887
  }
3957
- return contents;
2888
+ const exception = new models_0_1.ForbiddenException({
2889
+ $metadata: deserializeMetadata(parsedOutput),
2890
+ ...contents,
2891
+ });
2892
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3958
2893
  };
3959
2894
  const deserializeAws_restJson1GoneExceptionResponse = async (parsedOutput, context) => {
3960
- const contents = {
3961
- name: "GoneException",
3962
- $fault: "client",
3963
- $metadata: deserializeMetadata(parsedOutput),
3964
- Code: undefined,
3965
- Message: undefined,
3966
- };
2895
+ const contents = {};
3967
2896
  const data = parsedOutput.body;
3968
2897
  if (data.Code !== undefined && data.Code !== null) {
3969
2898
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -3971,16 +2900,14 @@ const deserializeAws_restJson1GoneExceptionResponse = async (parsedOutput, conte
3971
2900
  if (data.Message !== undefined && data.Message !== null) {
3972
2901
  contents.Message = smithy_client_1.expectString(data.Message);
3973
2902
  }
3974
- return contents;
2903
+ const exception = new models_0_1.GoneException({
2904
+ $metadata: deserializeMetadata(parsedOutput),
2905
+ ...contents,
2906
+ });
2907
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3975
2908
  };
3976
2909
  const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
3977
- const contents = {
3978
- name: "InternalServerErrorException",
3979
- $fault: "server",
3980
- $metadata: deserializeMetadata(parsedOutput),
3981
- Code: undefined,
3982
- Message: undefined,
3983
- };
2910
+ const contents = {};
3984
2911
  const data = parsedOutput.body;
3985
2912
  if (data.Code !== undefined && data.Code !== null) {
3986
2913
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -3988,16 +2915,14 @@ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (pars
3988
2915
  if (data.Message !== undefined && data.Message !== null) {
3989
2916
  contents.Message = smithy_client_1.expectString(data.Message);
3990
2917
  }
3991
- return contents;
2918
+ const exception = new models_0_1.InternalServerErrorException({
2919
+ $metadata: deserializeMetadata(parsedOutput),
2920
+ ...contents,
2921
+ });
2922
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3992
2923
  };
3993
2924
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
3994
- const contents = {
3995
- name: "NotFoundException",
3996
- $fault: "client",
3997
- $metadata: deserializeMetadata(parsedOutput),
3998
- Code: undefined,
3999
- Message: undefined,
4000
- };
2925
+ const contents = {};
4001
2926
  const data = parsedOutput.body;
4002
2927
  if (data.Code !== undefined && data.Code !== null) {
4003
2928
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -4005,16 +2930,14 @@ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, c
4005
2930
  if (data.Message !== undefined && data.Message !== null) {
4006
2931
  contents.Message = smithy_client_1.expectString(data.Message);
4007
2932
  }
4008
- return contents;
2933
+ const exception = new models_0_1.NotFoundException({
2934
+ $metadata: deserializeMetadata(parsedOutput),
2935
+ ...contents,
2936
+ });
2937
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4009
2938
  };
4010
2939
  const deserializeAws_restJson1PreconditionFailedExceptionResponse = async (parsedOutput, context) => {
4011
- const contents = {
4012
- name: "PreconditionFailedException",
4013
- $fault: "client",
4014
- $metadata: deserializeMetadata(parsedOutput),
4015
- Code: undefined,
4016
- Message: undefined,
4017
- };
2940
+ const contents = {};
4018
2941
  const data = parsedOutput.body;
4019
2942
  if (data.Code !== undefined && data.Code !== null) {
4020
2943
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -4022,16 +2945,14 @@ const deserializeAws_restJson1PreconditionFailedExceptionResponse = async (parse
4022
2945
  if (data.Message !== undefined && data.Message !== null) {
4023
2946
  contents.Message = smithy_client_1.expectString(data.Message);
4024
2947
  }
4025
- return contents;
2948
+ const exception = new models_0_1.PreconditionFailedException({
2949
+ $metadata: deserializeMetadata(parsedOutput),
2950
+ ...contents,
2951
+ });
2952
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4026
2953
  };
4027
2954
  const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
4028
- const contents = {
4029
- name: "ServiceUnavailableException",
4030
- $fault: "server",
4031
- $metadata: deserializeMetadata(parsedOutput),
4032
- Code: undefined,
4033
- Message: undefined,
4034
- };
2955
+ const contents = {};
4035
2956
  const data = parsedOutput.body;
4036
2957
  if (data.Code !== undefined && data.Code !== null) {
4037
2958
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -4039,16 +2960,14 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parse
4039
2960
  if (data.Message !== undefined && data.Message !== null) {
4040
2961
  contents.Message = smithy_client_1.expectString(data.Message);
4041
2962
  }
4042
- return contents;
2963
+ const exception = new models_0_1.ServiceUnavailableException({
2964
+ $metadata: deserializeMetadata(parsedOutput),
2965
+ ...contents,
2966
+ });
2967
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4043
2968
  };
4044
2969
  const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
4045
- const contents = {
4046
- name: "TooManyRequestsException",
4047
- $fault: "client",
4048
- $metadata: deserializeMetadata(parsedOutput),
4049
- Code: undefined,
4050
- Message: undefined,
4051
- };
2970
+ const contents = {};
4052
2971
  const data = parsedOutput.body;
4053
2972
  if (data.Code !== undefined && data.Code !== null) {
4054
2973
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -4056,16 +2975,14 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOu
4056
2975
  if (data.Message !== undefined && data.Message !== null) {
4057
2976
  contents.Message = smithy_client_1.expectString(data.Message);
4058
2977
  }
4059
- return contents;
2978
+ const exception = new models_0_1.TooManyRequestsException({
2979
+ $metadata: deserializeMetadata(parsedOutput),
2980
+ ...contents,
2981
+ });
2982
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4060
2983
  };
4061
2984
  const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => {
4062
- const contents = {
4063
- name: "UnauthorizedException",
4064
- $fault: "client",
4065
- $metadata: deserializeMetadata(parsedOutput),
4066
- Code: undefined,
4067
- Message: undefined,
4068
- };
2985
+ const contents = {};
4069
2986
  const data = parsedOutput.body;
4070
2987
  if (data.Code !== undefined && data.Code !== null) {
4071
2988
  contents.Code = smithy_client_1.expectString(data.Code);
@@ -4073,7 +2990,11 @@ const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutpu
4073
2990
  if (data.Message !== undefined && data.Message !== null) {
4074
2991
  contents.Message = smithy_client_1.expectString(data.Message);
4075
2992
  }
4076
- return contents;
2993
+ const exception = new models_0_1.UnauthorizedException({
2994
+ $metadata: deserializeMetadata(parsedOutput),
2995
+ ...contents,
2996
+ });
2997
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4077
2998
  };
4078
2999
  const serializeAws_restJson1__listOfGetDiscoveredSchemaVersionItemInput = (input, context) => {
4079
3000
  return input
@@ -4097,7 +3018,7 @@ const serializeAws_restJson1Tags = (input, context) => {
4097
3018
  }, {});
4098
3019
  };
4099
3020
  const deserializeAws_restJson1__listOfDiscovererSummary = (output, context) => {
4100
- return (output || [])
3021
+ const retVal = (output || [])
4101
3022
  .filter((e) => e != null)
4102
3023
  .map((entry) => {
4103
3024
  if (entry === null) {
@@ -4105,9 +3026,10 @@ const deserializeAws_restJson1__listOfDiscovererSummary = (output, context) => {
4105
3026
  }
4106
3027
  return deserializeAws_restJson1DiscovererSummary(entry, context);
4107
3028
  });
3029
+ return retVal;
4108
3030
  };
4109
3031
  const deserializeAws_restJson1__listOfRegistrySummary = (output, context) => {
4110
- return (output || [])
3032
+ const retVal = (output || [])
4111
3033
  .filter((e) => e != null)
4112
3034
  .map((entry) => {
4113
3035
  if (entry === null) {
@@ -4115,9 +3037,10 @@ const deserializeAws_restJson1__listOfRegistrySummary = (output, context) => {
4115
3037
  }
4116
3038
  return deserializeAws_restJson1RegistrySummary(entry, context);
4117
3039
  });
3040
+ return retVal;
4118
3041
  };
4119
3042
  const deserializeAws_restJson1__listOfSchemaSummary = (output, context) => {
4120
- return (output || [])
3043
+ const retVal = (output || [])
4121
3044
  .filter((e) => e != null)
4122
3045
  .map((entry) => {
4123
3046
  if (entry === null) {
@@ -4125,9 +3048,10 @@ const deserializeAws_restJson1__listOfSchemaSummary = (output, context) => {
4125
3048
  }
4126
3049
  return deserializeAws_restJson1SchemaSummary(entry, context);
4127
3050
  });
3051
+ return retVal;
4128
3052
  };
4129
3053
  const deserializeAws_restJson1__listOfSchemaVersionSummary = (output, context) => {
4130
- return (output || [])
3054
+ const retVal = (output || [])
4131
3055
  .filter((e) => e != null)
4132
3056
  .map((entry) => {
4133
3057
  if (entry === null) {
@@ -4135,9 +3059,10 @@ const deserializeAws_restJson1__listOfSchemaVersionSummary = (output, context) =
4135
3059
  }
4136
3060
  return deserializeAws_restJson1SchemaVersionSummary(entry, context);
4137
3061
  });
3062
+ return retVal;
4138
3063
  };
4139
3064
  const deserializeAws_restJson1__listOfSearchSchemaSummary = (output, context) => {
4140
- return (output || [])
3065
+ const retVal = (output || [])
4141
3066
  .filter((e) => e != null)
4142
3067
  .map((entry) => {
4143
3068
  if (entry === null) {
@@ -4145,9 +3070,10 @@ const deserializeAws_restJson1__listOfSearchSchemaSummary = (output, context) =>
4145
3070
  }
4146
3071
  return deserializeAws_restJson1SearchSchemaSummary(entry, context);
4147
3072
  });
3073
+ return retVal;
4148
3074
  };
4149
3075
  const deserializeAws_restJson1__listOfSearchSchemaVersionSummary = (output, context) => {
4150
- return (output || [])
3076
+ const retVal = (output || [])
4151
3077
  .filter((e) => e != null)
4152
3078
  .map((entry) => {
4153
3079
  if (entry === null) {
@@ -4155,6 +3081,7 @@ const deserializeAws_restJson1__listOfSearchSchemaVersionSummary = (output, cont
4155
3081
  }
4156
3082
  return deserializeAws_restJson1SearchSchemaVersionSummary(entry, context);
4157
3083
  });
3084
+ return retVal;
4158
3085
  };
4159
3086
  const deserializeAws_restJson1DiscovererSummary = (output, context) => {
4160
3087
  return {