@aws-sdk/client-elasticsearch-service 3.52.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1DeleteElasticsearchServiceRoleCommand = exports.
4
4
  exports.deserializeAws_restJson1UpgradeElasticsearchDomainCommand = exports.deserializeAws_restJson1UpdatePackageCommand = exports.deserializeAws_restJson1UpdateElasticsearchDomainConfigCommand = exports.deserializeAws_restJson1StartElasticsearchServiceSoftwareUpdateCommand = exports.deserializeAws_restJson1RemoveTagsCommand = exports.deserializeAws_restJson1RejectInboundCrossClusterSearchConnectionCommand = exports.deserializeAws_restJson1PurchaseReservedElasticsearchInstanceOfferingCommand = exports.deserializeAws_restJson1ListTagsCommand = exports.deserializeAws_restJson1ListPackagesForDomainCommand = exports.deserializeAws_restJson1ListElasticsearchVersionsCommand = exports.deserializeAws_restJson1ListElasticsearchInstanceTypesCommand = exports.deserializeAws_restJson1ListDomainsForPackageCommand = exports.deserializeAws_restJson1ListDomainNamesCommand = exports.deserializeAws_restJson1GetUpgradeStatusCommand = exports.deserializeAws_restJson1GetUpgradeHistoryCommand = exports.deserializeAws_restJson1GetPackageVersionHistoryCommand = exports.deserializeAws_restJson1GetCompatibleElasticsearchVersionsCommand = exports.deserializeAws_restJson1DissociatePackageCommand = exports.deserializeAws_restJson1DescribeReservedElasticsearchInstancesCommand = exports.deserializeAws_restJson1DescribeReservedElasticsearchInstanceOfferingsCommand = exports.deserializeAws_restJson1DescribePackagesCommand = exports.deserializeAws_restJson1DescribeOutboundCrossClusterSearchConnectionsCommand = exports.deserializeAws_restJson1DescribeInboundCrossClusterSearchConnectionsCommand = exports.deserializeAws_restJson1DescribeElasticsearchInstanceTypeLimitsCommand = exports.deserializeAws_restJson1DescribeElasticsearchDomainsCommand = exports.deserializeAws_restJson1DescribeElasticsearchDomainConfigCommand = exports.deserializeAws_restJson1DescribeElasticsearchDomainCommand = exports.deserializeAws_restJson1DescribeDomainChangeProgressCommand = exports.deserializeAws_restJson1DescribeDomainAutoTunesCommand = exports.deserializeAws_restJson1DeletePackageCommand = exports.deserializeAws_restJson1DeleteOutboundCrossClusterSearchConnectionCommand = exports.deserializeAws_restJson1DeleteInboundCrossClusterSearchConnectionCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ const ElasticsearchServiceServiceException_1 = require("../models/ElasticsearchServiceServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_restJson1AcceptInboundCrossClusterSearchConnectionCommand = async (input, context) => {
8
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
11
  const headers = {};
@@ -1226,43 +1228,22 @@ const deserializeAws_restJson1AcceptInboundCrossClusterSearchConnectionCommandEr
1226
1228
  switch (errorCode) {
1227
1229
  case "DisabledOperationException":
1228
1230
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
1229
- response = {
1230
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
1231
- name: errorCode,
1232
- $metadata: deserializeMetadata(output),
1233
- };
1234
- break;
1231
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
1235
1232
  case "LimitExceededException":
1236
1233
  case "com.amazonaws.elasticsearchservice#LimitExceededException":
1237
- response = {
1238
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1239
- name: errorCode,
1240
- $metadata: deserializeMetadata(output),
1241
- };
1242
- break;
1234
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1243
1235
  case "ResourceNotFoundException":
1244
1236
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
1245
- response = {
1246
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1247
- name: errorCode,
1248
- $metadata: deserializeMetadata(output),
1249
- };
1250
- break;
1237
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1251
1238
  default:
1252
1239
  const parsedBody = parsedOutput.body;
1253
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1254
- response = {
1255
- ...parsedBody,
1256
- name: `${errorCode}`,
1257
- message: parsedBody.message || parsedBody.Message || errorCode,
1240
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1241
+ name: parsedBody.code || parsedBody.Code || errorCode,
1258
1242
  $fault: "client",
1259
1243
  $metadata: deserializeMetadata(output),
1260
- };
1244
+ });
1245
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1261
1246
  }
1262
- const message = response.message || response.Message || errorCode;
1263
- response.message = message;
1264
- delete response.Message;
1265
- return Promise.reject(Object.assign(new Error(message), response));
1266
1247
  };
1267
1248
  const deserializeAws_restJson1AddTagsCommand = async (output, context) => {
1268
1249
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1286,51 +1267,25 @@ const deserializeAws_restJson1AddTagsCommandError = async (output, context) => {
1286
1267
  switch (errorCode) {
1287
1268
  case "BaseException":
1288
1269
  case "com.amazonaws.elasticsearchservice#BaseException":
1289
- response = {
1290
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
1291
- name: errorCode,
1292
- $metadata: deserializeMetadata(output),
1293
- };
1294
- break;
1270
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
1295
1271
  case "InternalException":
1296
1272
  case "com.amazonaws.elasticsearchservice#InternalException":
1297
- response = {
1298
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
1299
- name: errorCode,
1300
- $metadata: deserializeMetadata(output),
1301
- };
1302
- break;
1273
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
1303
1274
  case "LimitExceededException":
1304
1275
  case "com.amazonaws.elasticsearchservice#LimitExceededException":
1305
- response = {
1306
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1307
- name: errorCode,
1308
- $metadata: deserializeMetadata(output),
1309
- };
1310
- break;
1276
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1311
1277
  case "ValidationException":
1312
1278
  case "com.amazonaws.elasticsearchservice#ValidationException":
1313
- response = {
1314
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1315
- name: errorCode,
1316
- $metadata: deserializeMetadata(output),
1317
- };
1318
- break;
1279
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1319
1280
  default:
1320
1281
  const parsedBody = parsedOutput.body;
1321
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1322
- response = {
1323
- ...parsedBody,
1324
- name: `${errorCode}`,
1325
- message: parsedBody.message || parsedBody.Message || errorCode,
1282
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1283
+ name: parsedBody.code || parsedBody.Code || errorCode,
1326
1284
  $fault: "client",
1327
1285
  $metadata: deserializeMetadata(output),
1328
- };
1286
+ });
1287
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1329
1288
  }
1330
- const message = response.message || response.Message || errorCode;
1331
- response.message = message;
1332
- delete response.Message;
1333
- return Promise.reject(Object.assign(new Error(message), response));
1334
1289
  };
1335
1290
  const deserializeAws_restJson1AssociatePackageCommand = async (output, context) => {
1336
1291
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1358,67 +1313,31 @@ const deserializeAws_restJson1AssociatePackageCommandError = async (output, cont
1358
1313
  switch (errorCode) {
1359
1314
  case "AccessDeniedException":
1360
1315
  case "com.amazonaws.elasticsearchservice#AccessDeniedException":
1361
- response = {
1362
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1363
- name: errorCode,
1364
- $metadata: deserializeMetadata(output),
1365
- };
1366
- break;
1316
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1367
1317
  case "BaseException":
1368
1318
  case "com.amazonaws.elasticsearchservice#BaseException":
1369
- response = {
1370
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
1371
- name: errorCode,
1372
- $metadata: deserializeMetadata(output),
1373
- };
1374
- break;
1319
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
1375
1320
  case "ConflictException":
1376
1321
  case "com.amazonaws.elasticsearchservice#ConflictException":
1377
- response = {
1378
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1379
- name: errorCode,
1380
- $metadata: deserializeMetadata(output),
1381
- };
1382
- break;
1322
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1383
1323
  case "InternalException":
1384
1324
  case "com.amazonaws.elasticsearchservice#InternalException":
1385
- response = {
1386
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
1387
- name: errorCode,
1388
- $metadata: deserializeMetadata(output),
1389
- };
1390
- break;
1325
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
1391
1326
  case "ResourceNotFoundException":
1392
1327
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
1393
- response = {
1394
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1395
- name: errorCode,
1396
- $metadata: deserializeMetadata(output),
1397
- };
1398
- break;
1328
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1399
1329
  case "ValidationException":
1400
1330
  case "com.amazonaws.elasticsearchservice#ValidationException":
1401
- response = {
1402
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1403
- name: errorCode,
1404
- $metadata: deserializeMetadata(output),
1405
- };
1406
- break;
1331
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1407
1332
  default:
1408
1333
  const parsedBody = parsedOutput.body;
1409
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1410
- response = {
1411
- ...parsedBody,
1412
- name: `${errorCode}`,
1413
- message: parsedBody.message || parsedBody.Message || errorCode,
1334
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1335
+ name: parsedBody.code || parsedBody.Code || errorCode,
1414
1336
  $fault: "client",
1415
1337
  $metadata: deserializeMetadata(output),
1416
- };
1338
+ });
1339
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1417
1340
  }
1418
- const message = response.message || response.Message || errorCode;
1419
- response.message = message;
1420
- delete response.Message;
1421
- return Promise.reject(Object.assign(new Error(message), response));
1422
1341
  };
1423
1342
  const deserializeAws_restJson1CancelElasticsearchServiceSoftwareUpdateCommand = async (output, context) => {
1424
1343
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1446,51 +1365,25 @@ const deserializeAws_restJson1CancelElasticsearchServiceSoftwareUpdateCommandErr
1446
1365
  switch (errorCode) {
1447
1366
  case "BaseException":
1448
1367
  case "com.amazonaws.elasticsearchservice#BaseException":
1449
- response = {
1450
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
1451
- name: errorCode,
1452
- $metadata: deserializeMetadata(output),
1453
- };
1454
- break;
1368
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
1455
1369
  case "InternalException":
1456
1370
  case "com.amazonaws.elasticsearchservice#InternalException":
1457
- response = {
1458
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
1459
- name: errorCode,
1460
- $metadata: deserializeMetadata(output),
1461
- };
1462
- break;
1371
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
1463
1372
  case "ResourceNotFoundException":
1464
1373
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
1465
- response = {
1466
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1467
- name: errorCode,
1468
- $metadata: deserializeMetadata(output),
1469
- };
1470
- break;
1374
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1471
1375
  case "ValidationException":
1472
1376
  case "com.amazonaws.elasticsearchservice#ValidationException":
1473
- response = {
1474
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1475
- name: errorCode,
1476
- $metadata: deserializeMetadata(output),
1477
- };
1478
- break;
1377
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1479
1378
  default:
1480
1379
  const parsedBody = parsedOutput.body;
1481
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1482
- response = {
1483
- ...parsedBody,
1484
- name: `${errorCode}`,
1485
- message: parsedBody.message || parsedBody.Message || errorCode,
1380
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1381
+ name: parsedBody.code || parsedBody.Code || errorCode,
1486
1382
  $fault: "client",
1487
1383
  $metadata: deserializeMetadata(output),
1488
- };
1384
+ });
1385
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1489
1386
  }
1490
- const message = response.message || response.Message || errorCode;
1491
- response.message = message;
1492
- delete response.Message;
1493
- return Promise.reject(Object.assign(new Error(message), response));
1494
1387
  };
1495
1388
  const deserializeAws_restJson1CreateElasticsearchDomainCommand = async (output, context) => {
1496
1389
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1518,75 +1411,34 @@ const deserializeAws_restJson1CreateElasticsearchDomainCommandError = async (out
1518
1411
  switch (errorCode) {
1519
1412
  case "BaseException":
1520
1413
  case "com.amazonaws.elasticsearchservice#BaseException":
1521
- response = {
1522
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
1523
- name: errorCode,
1524
- $metadata: deserializeMetadata(output),
1525
- };
1526
- break;
1414
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
1527
1415
  case "DisabledOperationException":
1528
1416
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
1529
- response = {
1530
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
1531
- name: errorCode,
1532
- $metadata: deserializeMetadata(output),
1533
- };
1534
- break;
1417
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
1535
1418
  case "InternalException":
1536
1419
  case "com.amazonaws.elasticsearchservice#InternalException":
1537
- response = {
1538
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
1539
- name: errorCode,
1540
- $metadata: deserializeMetadata(output),
1541
- };
1542
- break;
1420
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
1543
1421
  case "InvalidTypeException":
1544
1422
  case "com.amazonaws.elasticsearchservice#InvalidTypeException":
1545
- response = {
1546
- ...(await deserializeAws_restJson1InvalidTypeExceptionResponse(parsedOutput, context)),
1547
- name: errorCode,
1548
- $metadata: deserializeMetadata(output),
1549
- };
1550
- break;
1423
+ throw await deserializeAws_restJson1InvalidTypeExceptionResponse(parsedOutput, context);
1551
1424
  case "LimitExceededException":
1552
1425
  case "com.amazonaws.elasticsearchservice#LimitExceededException":
1553
- response = {
1554
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1555
- name: errorCode,
1556
- $metadata: deserializeMetadata(output),
1557
- };
1558
- break;
1426
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1559
1427
  case "ResourceAlreadyExistsException":
1560
1428
  case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException":
1561
- response = {
1562
- ...(await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1563
- name: errorCode,
1564
- $metadata: deserializeMetadata(output),
1565
- };
1566
- break;
1429
+ throw await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1567
1430
  case "ValidationException":
1568
1431
  case "com.amazonaws.elasticsearchservice#ValidationException":
1569
- response = {
1570
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1571
- name: errorCode,
1572
- $metadata: deserializeMetadata(output),
1573
- };
1574
- break;
1432
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1575
1433
  default:
1576
1434
  const parsedBody = parsedOutput.body;
1577
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1578
- response = {
1579
- ...parsedBody,
1580
- name: `${errorCode}`,
1581
- message: parsedBody.message || parsedBody.Message || errorCode,
1435
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1436
+ name: parsedBody.code || parsedBody.Code || errorCode,
1582
1437
  $fault: "client",
1583
1438
  $metadata: deserializeMetadata(output),
1584
- };
1439
+ });
1440
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1585
1441
  }
1586
- const message = response.message || response.Message || errorCode;
1587
- response.message = message;
1588
- delete response.Message;
1589
- return Promise.reject(Object.assign(new Error(message), response));
1590
1442
  };
1591
1443
  const deserializeAws_restJson1CreateOutboundCrossClusterSearchConnectionCommand = async (output, context) => {
1592
1444
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1630,51 +1482,25 @@ const deserializeAws_restJson1CreateOutboundCrossClusterSearchConnectionCommandE
1630
1482
  switch (errorCode) {
1631
1483
  case "DisabledOperationException":
1632
1484
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
1633
- response = {
1634
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
1635
- name: errorCode,
1636
- $metadata: deserializeMetadata(output),
1637
- };
1638
- break;
1485
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
1639
1486
  case "InternalException":
1640
1487
  case "com.amazonaws.elasticsearchservice#InternalException":
1641
- response = {
1642
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
1643
- name: errorCode,
1644
- $metadata: deserializeMetadata(output),
1645
- };
1646
- break;
1488
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
1647
1489
  case "LimitExceededException":
1648
1490
  case "com.amazonaws.elasticsearchservice#LimitExceededException":
1649
- response = {
1650
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1651
- name: errorCode,
1652
- $metadata: deserializeMetadata(output),
1653
- };
1654
- break;
1491
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1655
1492
  case "ResourceAlreadyExistsException":
1656
1493
  case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException":
1657
- response = {
1658
- ...(await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1659
- name: errorCode,
1660
- $metadata: deserializeMetadata(output),
1661
- };
1662
- break;
1494
+ throw await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1663
1495
  default:
1664
1496
  const parsedBody = parsedOutput.body;
1665
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1666
- response = {
1667
- ...parsedBody,
1668
- name: `${errorCode}`,
1669
- message: parsedBody.message || parsedBody.Message || errorCode,
1497
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1498
+ name: parsedBody.code || parsedBody.Code || errorCode,
1670
1499
  $fault: "client",
1671
1500
  $metadata: deserializeMetadata(output),
1672
- };
1501
+ });
1502
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1673
1503
  }
1674
- const message = response.message || response.Message || errorCode;
1675
- response.message = message;
1676
- delete response.Message;
1677
- return Promise.reject(Object.assign(new Error(message), response));
1678
1504
  };
1679
1505
  const deserializeAws_restJson1CreatePackageCommand = async (output, context) => {
1680
1506
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1702,75 +1528,34 @@ const deserializeAws_restJson1CreatePackageCommandError = async (output, context
1702
1528
  switch (errorCode) {
1703
1529
  case "AccessDeniedException":
1704
1530
  case "com.amazonaws.elasticsearchservice#AccessDeniedException":
1705
- response = {
1706
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1707
- name: errorCode,
1708
- $metadata: deserializeMetadata(output),
1709
- };
1710
- break;
1531
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1711
1532
  case "BaseException":
1712
1533
  case "com.amazonaws.elasticsearchservice#BaseException":
1713
- response = {
1714
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
1715
- name: errorCode,
1716
- $metadata: deserializeMetadata(output),
1717
- };
1718
- break;
1534
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
1719
1535
  case "InternalException":
1720
1536
  case "com.amazonaws.elasticsearchservice#InternalException":
1721
- response = {
1722
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
1723
- name: errorCode,
1724
- $metadata: deserializeMetadata(output),
1725
- };
1726
- break;
1537
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
1727
1538
  case "InvalidTypeException":
1728
1539
  case "com.amazonaws.elasticsearchservice#InvalidTypeException":
1729
- response = {
1730
- ...(await deserializeAws_restJson1InvalidTypeExceptionResponse(parsedOutput, context)),
1731
- name: errorCode,
1732
- $metadata: deserializeMetadata(output),
1733
- };
1734
- break;
1540
+ throw await deserializeAws_restJson1InvalidTypeExceptionResponse(parsedOutput, context);
1735
1541
  case "LimitExceededException":
1736
1542
  case "com.amazonaws.elasticsearchservice#LimitExceededException":
1737
- response = {
1738
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1739
- name: errorCode,
1740
- $metadata: deserializeMetadata(output),
1741
- };
1742
- break;
1543
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1743
1544
  case "ResourceAlreadyExistsException":
1744
1545
  case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException":
1745
- response = {
1746
- ...(await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1747
- name: errorCode,
1748
- $metadata: deserializeMetadata(output),
1749
- };
1750
- break;
1546
+ throw await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1751
1547
  case "ValidationException":
1752
1548
  case "com.amazonaws.elasticsearchservice#ValidationException":
1753
- response = {
1754
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1755
- name: errorCode,
1756
- $metadata: deserializeMetadata(output),
1757
- };
1758
- break;
1549
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1759
1550
  default:
1760
1551
  const parsedBody = parsedOutput.body;
1761
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1762
- response = {
1763
- ...parsedBody,
1764
- name: `${errorCode}`,
1765
- message: parsedBody.message || parsedBody.Message || errorCode,
1552
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1553
+ name: parsedBody.code || parsedBody.Code || errorCode,
1766
1554
  $fault: "client",
1767
1555
  $metadata: deserializeMetadata(output),
1768
- };
1556
+ });
1557
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1769
1558
  }
1770
- const message = response.message || response.Message || errorCode;
1771
- response.message = message;
1772
- delete response.Message;
1773
- return Promise.reject(Object.assign(new Error(message), response));
1774
1559
  };
1775
1560
  const deserializeAws_restJson1DeleteElasticsearchDomainCommand = async (output, context) => {
1776
1561
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1798,51 +1583,25 @@ const deserializeAws_restJson1DeleteElasticsearchDomainCommandError = async (out
1798
1583
  switch (errorCode) {
1799
1584
  case "BaseException":
1800
1585
  case "com.amazonaws.elasticsearchservice#BaseException":
1801
- response = {
1802
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
1803
- name: errorCode,
1804
- $metadata: deserializeMetadata(output),
1805
- };
1806
- break;
1586
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
1807
1587
  case "InternalException":
1808
1588
  case "com.amazonaws.elasticsearchservice#InternalException":
1809
- response = {
1810
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
1811
- name: errorCode,
1812
- $metadata: deserializeMetadata(output),
1813
- };
1814
- break;
1589
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
1815
1590
  case "ResourceNotFoundException":
1816
1591
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
1817
- response = {
1818
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1819
- name: errorCode,
1820
- $metadata: deserializeMetadata(output),
1821
- };
1822
- break;
1592
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1823
1593
  case "ValidationException":
1824
1594
  case "com.amazonaws.elasticsearchservice#ValidationException":
1825
- response = {
1826
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1827
- name: errorCode,
1828
- $metadata: deserializeMetadata(output),
1829
- };
1830
- break;
1595
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1831
1596
  default:
1832
1597
  const parsedBody = parsedOutput.body;
1833
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1834
- response = {
1835
- ...parsedBody,
1836
- name: `${errorCode}`,
1837
- message: parsedBody.message || parsedBody.Message || errorCode,
1598
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1599
+ name: parsedBody.code || parsedBody.Code || errorCode,
1838
1600
  $fault: "client",
1839
1601
  $metadata: deserializeMetadata(output),
1840
- };
1602
+ });
1603
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1841
1604
  }
1842
- const message = response.message || response.Message || errorCode;
1843
- response.message = message;
1844
- delete response.Message;
1845
- return Promise.reject(Object.assign(new Error(message), response));
1846
1605
  };
1847
1606
  const deserializeAws_restJson1DeleteElasticsearchServiceRoleCommand = async (output, context) => {
1848
1607
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1866,43 +1625,22 @@ const deserializeAws_restJson1DeleteElasticsearchServiceRoleCommandError = async
1866
1625
  switch (errorCode) {
1867
1626
  case "BaseException":
1868
1627
  case "com.amazonaws.elasticsearchservice#BaseException":
1869
- response = {
1870
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
1871
- name: errorCode,
1872
- $metadata: deserializeMetadata(output),
1873
- };
1874
- break;
1628
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
1875
1629
  case "InternalException":
1876
1630
  case "com.amazonaws.elasticsearchservice#InternalException":
1877
- response = {
1878
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
1879
- name: errorCode,
1880
- $metadata: deserializeMetadata(output),
1881
- };
1882
- break;
1631
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
1883
1632
  case "ValidationException":
1884
1633
  case "com.amazonaws.elasticsearchservice#ValidationException":
1885
- response = {
1886
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1887
- name: errorCode,
1888
- $metadata: deserializeMetadata(output),
1889
- };
1890
- break;
1634
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1891
1635
  default:
1892
1636
  const parsedBody = parsedOutput.body;
1893
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1894
- response = {
1895
- ...parsedBody,
1896
- name: `${errorCode}`,
1897
- message: parsedBody.message || parsedBody.Message || errorCode,
1637
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1638
+ name: parsedBody.code || parsedBody.Code || errorCode,
1898
1639
  $fault: "client",
1899
1640
  $metadata: deserializeMetadata(output),
1900
- };
1641
+ });
1642
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1901
1643
  }
1902
- const message = response.message || response.Message || errorCode;
1903
- response.message = message;
1904
- delete response.Message;
1905
- return Promise.reject(Object.assign(new Error(message), response));
1906
1644
  };
1907
1645
  const deserializeAws_restJson1DeleteInboundCrossClusterSearchConnectionCommand = async (output, context) => {
1908
1646
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1930,35 +1668,19 @@ const deserializeAws_restJson1DeleteInboundCrossClusterSearchConnectionCommandEr
1930
1668
  switch (errorCode) {
1931
1669
  case "DisabledOperationException":
1932
1670
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
1933
- response = {
1934
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
1935
- name: errorCode,
1936
- $metadata: deserializeMetadata(output),
1937
- };
1938
- break;
1671
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
1939
1672
  case "ResourceNotFoundException":
1940
1673
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
1941
- response = {
1942
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1943
- name: errorCode,
1944
- $metadata: deserializeMetadata(output),
1945
- };
1946
- break;
1674
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1947
1675
  default:
1948
1676
  const parsedBody = parsedOutput.body;
1949
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1950
- response = {
1951
- ...parsedBody,
1952
- name: `${errorCode}`,
1953
- message: parsedBody.message || parsedBody.Message || errorCode,
1677
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1678
+ name: parsedBody.code || parsedBody.Code || errorCode,
1954
1679
  $fault: "client",
1955
1680
  $metadata: deserializeMetadata(output),
1956
- };
1681
+ });
1682
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1957
1683
  }
1958
- const message = response.message || response.Message || errorCode;
1959
- response.message = message;
1960
- delete response.Message;
1961
- return Promise.reject(Object.assign(new Error(message), response));
1962
1684
  };
1963
1685
  const deserializeAws_restJson1DeleteOutboundCrossClusterSearchConnectionCommand = async (output, context) => {
1964
1686
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1986,35 +1708,19 @@ const deserializeAws_restJson1DeleteOutboundCrossClusterSearchConnectionCommandE
1986
1708
  switch (errorCode) {
1987
1709
  case "DisabledOperationException":
1988
1710
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
1989
- response = {
1990
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
1991
- name: errorCode,
1992
- $metadata: deserializeMetadata(output),
1993
- };
1994
- break;
1711
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
1995
1712
  case "ResourceNotFoundException":
1996
1713
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
1997
- response = {
1998
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1999
- name: errorCode,
2000
- $metadata: deserializeMetadata(output),
2001
- };
2002
- break;
1714
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2003
1715
  default:
2004
1716
  const parsedBody = parsedOutput.body;
2005
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2006
- response = {
2007
- ...parsedBody,
2008
- name: `${errorCode}`,
2009
- message: parsedBody.message || parsedBody.Message || errorCode,
1717
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1718
+ name: parsedBody.code || parsedBody.Code || errorCode,
2010
1719
  $fault: "client",
2011
1720
  $metadata: deserializeMetadata(output),
2012
- };
1721
+ });
1722
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2013
1723
  }
2014
- const message = response.message || response.Message || errorCode;
2015
- response.message = message;
2016
- delete response.Message;
2017
- return Promise.reject(Object.assign(new Error(message), response));
2018
1724
  };
2019
1725
  const deserializeAws_restJson1DeletePackageCommand = async (output, context) => {
2020
1726
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2042,67 +1748,31 @@ const deserializeAws_restJson1DeletePackageCommandError = async (output, context
2042
1748
  switch (errorCode) {
2043
1749
  case "AccessDeniedException":
2044
1750
  case "com.amazonaws.elasticsearchservice#AccessDeniedException":
2045
- response = {
2046
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2047
- name: errorCode,
2048
- $metadata: deserializeMetadata(output),
2049
- };
2050
- break;
1751
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2051
1752
  case "BaseException":
2052
1753
  case "com.amazonaws.elasticsearchservice#BaseException":
2053
- response = {
2054
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
2055
- name: errorCode,
2056
- $metadata: deserializeMetadata(output),
2057
- };
2058
- break;
1754
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
2059
1755
  case "ConflictException":
2060
1756
  case "com.amazonaws.elasticsearchservice#ConflictException":
2061
- response = {
2062
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2063
- name: errorCode,
2064
- $metadata: deserializeMetadata(output),
2065
- };
2066
- break;
1757
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2067
1758
  case "InternalException":
2068
1759
  case "com.amazonaws.elasticsearchservice#InternalException":
2069
- response = {
2070
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2071
- name: errorCode,
2072
- $metadata: deserializeMetadata(output),
2073
- };
2074
- break;
1760
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2075
1761
  case "ResourceNotFoundException":
2076
1762
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2077
- response = {
2078
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2079
- name: errorCode,
2080
- $metadata: deserializeMetadata(output),
2081
- };
2082
- break;
1763
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2083
1764
  case "ValidationException":
2084
1765
  case "com.amazonaws.elasticsearchservice#ValidationException":
2085
- response = {
2086
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2087
- name: errorCode,
2088
- $metadata: deserializeMetadata(output),
2089
- };
2090
- break;
1766
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2091
1767
  default:
2092
1768
  const parsedBody = parsedOutput.body;
2093
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2094
- response = {
2095
- ...parsedBody,
2096
- name: `${errorCode}`,
2097
- message: parsedBody.message || parsedBody.Message || errorCode,
1769
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1770
+ name: parsedBody.code || parsedBody.Code || errorCode,
2098
1771
  $fault: "client",
2099
1772
  $metadata: deserializeMetadata(output),
2100
- };
1773
+ });
1774
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2101
1775
  }
2102
- const message = response.message || response.Message || errorCode;
2103
- response.message = message;
2104
- delete response.Message;
2105
- return Promise.reject(Object.assign(new Error(message), response));
2106
1776
  };
2107
1777
  const deserializeAws_restJson1DescribeDomainAutoTunesCommand = async (output, context) => {
2108
1778
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2134,51 +1804,25 @@ const deserializeAws_restJson1DescribeDomainAutoTunesCommandError = async (outpu
2134
1804
  switch (errorCode) {
2135
1805
  case "BaseException":
2136
1806
  case "com.amazonaws.elasticsearchservice#BaseException":
2137
- response = {
2138
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
2139
- name: errorCode,
2140
- $metadata: deserializeMetadata(output),
2141
- };
2142
- break;
1807
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
2143
1808
  case "InternalException":
2144
1809
  case "com.amazonaws.elasticsearchservice#InternalException":
2145
- response = {
2146
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2147
- name: errorCode,
2148
- $metadata: deserializeMetadata(output),
2149
- };
2150
- break;
1810
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2151
1811
  case "ResourceNotFoundException":
2152
1812
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2153
- response = {
2154
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2155
- name: errorCode,
2156
- $metadata: deserializeMetadata(output),
2157
- };
2158
- break;
1813
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2159
1814
  case "ValidationException":
2160
1815
  case "com.amazonaws.elasticsearchservice#ValidationException":
2161
- response = {
2162
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2163
- name: errorCode,
2164
- $metadata: deserializeMetadata(output),
2165
- };
2166
- break;
1816
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2167
1817
  default:
2168
1818
  const parsedBody = parsedOutput.body;
2169
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2170
- response = {
2171
- ...parsedBody,
2172
- name: `${errorCode}`,
2173
- message: parsedBody.message || parsedBody.Message || errorCode,
1819
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1820
+ name: parsedBody.code || parsedBody.Code || errorCode,
2174
1821
  $fault: "client",
2175
1822
  $metadata: deserializeMetadata(output),
2176
- };
1823
+ });
1824
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2177
1825
  }
2178
- const message = response.message || response.Message || errorCode;
2179
- response.message = message;
2180
- delete response.Message;
2181
- return Promise.reject(Object.assign(new Error(message), response));
2182
1826
  };
2183
1827
  const deserializeAws_restJson1DescribeDomainChangeProgressCommand = async (output, context) => {
2184
1828
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2206,51 +1850,25 @@ const deserializeAws_restJson1DescribeDomainChangeProgressCommandError = async (
2206
1850
  switch (errorCode) {
2207
1851
  case "BaseException":
2208
1852
  case "com.amazonaws.elasticsearchservice#BaseException":
2209
- response = {
2210
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
2211
- name: errorCode,
2212
- $metadata: deserializeMetadata(output),
2213
- };
2214
- break;
1853
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
2215
1854
  case "InternalException":
2216
1855
  case "com.amazonaws.elasticsearchservice#InternalException":
2217
- response = {
2218
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2219
- name: errorCode,
2220
- $metadata: deserializeMetadata(output),
2221
- };
2222
- break;
1856
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2223
1857
  case "ResourceNotFoundException":
2224
1858
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2225
- response = {
2226
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2227
- name: errorCode,
2228
- $metadata: deserializeMetadata(output),
2229
- };
2230
- break;
1859
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2231
1860
  case "ValidationException":
2232
1861
  case "com.amazonaws.elasticsearchservice#ValidationException":
2233
- response = {
2234
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2235
- name: errorCode,
2236
- $metadata: deserializeMetadata(output),
2237
- };
2238
- break;
1862
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2239
1863
  default:
2240
1864
  const parsedBody = parsedOutput.body;
2241
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2242
- response = {
2243
- ...parsedBody,
2244
- name: `${errorCode}`,
2245
- message: parsedBody.message || parsedBody.Message || errorCode,
1865
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1866
+ name: parsedBody.code || parsedBody.Code || errorCode,
2246
1867
  $fault: "client",
2247
1868
  $metadata: deserializeMetadata(output),
2248
- };
1869
+ });
1870
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2249
1871
  }
2250
- const message = response.message || response.Message || errorCode;
2251
- response.message = message;
2252
- delete response.Message;
2253
- return Promise.reject(Object.assign(new Error(message), response));
2254
1872
  };
2255
1873
  const deserializeAws_restJson1DescribeElasticsearchDomainCommand = async (output, context) => {
2256
1874
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2278,51 +1896,25 @@ const deserializeAws_restJson1DescribeElasticsearchDomainCommandError = async (o
2278
1896
  switch (errorCode) {
2279
1897
  case "BaseException":
2280
1898
  case "com.amazonaws.elasticsearchservice#BaseException":
2281
- response = {
2282
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
2283
- name: errorCode,
2284
- $metadata: deserializeMetadata(output),
2285
- };
2286
- break;
1899
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
2287
1900
  case "InternalException":
2288
1901
  case "com.amazonaws.elasticsearchservice#InternalException":
2289
- response = {
2290
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2291
- name: errorCode,
2292
- $metadata: deserializeMetadata(output),
2293
- };
2294
- break;
1902
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2295
1903
  case "ResourceNotFoundException":
2296
1904
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2297
- response = {
2298
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2299
- name: errorCode,
2300
- $metadata: deserializeMetadata(output),
2301
- };
2302
- break;
1905
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2303
1906
  case "ValidationException":
2304
1907
  case "com.amazonaws.elasticsearchservice#ValidationException":
2305
- response = {
2306
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2307
- name: errorCode,
2308
- $metadata: deserializeMetadata(output),
2309
- };
2310
- break;
1908
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2311
1909
  default:
2312
1910
  const parsedBody = parsedOutput.body;
2313
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2314
- response = {
2315
- ...parsedBody,
2316
- name: `${errorCode}`,
2317
- message: parsedBody.message || parsedBody.Message || errorCode,
1911
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1912
+ name: parsedBody.code || parsedBody.Code || errorCode,
2318
1913
  $fault: "client",
2319
1914
  $metadata: deserializeMetadata(output),
2320
- };
1915
+ });
1916
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2321
1917
  }
2322
- const message = response.message || response.Message || errorCode;
2323
- response.message = message;
2324
- delete response.Message;
2325
- return Promise.reject(Object.assign(new Error(message), response));
2326
1918
  };
2327
1919
  const deserializeAws_restJson1DescribeElasticsearchDomainConfigCommand = async (output, context) => {
2328
1920
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2350,51 +1942,25 @@ const deserializeAws_restJson1DescribeElasticsearchDomainConfigCommandError = as
2350
1942
  switch (errorCode) {
2351
1943
  case "BaseException":
2352
1944
  case "com.amazonaws.elasticsearchservice#BaseException":
2353
- response = {
2354
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
2355
- name: errorCode,
2356
- $metadata: deserializeMetadata(output),
2357
- };
2358
- break;
1945
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
2359
1946
  case "InternalException":
2360
1947
  case "com.amazonaws.elasticsearchservice#InternalException":
2361
- response = {
2362
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2363
- name: errorCode,
2364
- $metadata: deserializeMetadata(output),
2365
- };
2366
- break;
1948
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2367
1949
  case "ResourceNotFoundException":
2368
1950
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2369
- response = {
2370
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2371
- name: errorCode,
2372
- $metadata: deserializeMetadata(output),
2373
- };
2374
- break;
1951
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2375
1952
  case "ValidationException":
2376
1953
  case "com.amazonaws.elasticsearchservice#ValidationException":
2377
- response = {
2378
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2379
- name: errorCode,
2380
- $metadata: deserializeMetadata(output),
2381
- };
2382
- break;
1954
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2383
1955
  default:
2384
1956
  const parsedBody = parsedOutput.body;
2385
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2386
- response = {
2387
- ...parsedBody,
2388
- name: `${errorCode}`,
2389
- message: parsedBody.message || parsedBody.Message || errorCode,
1957
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
1958
+ name: parsedBody.code || parsedBody.Code || errorCode,
2390
1959
  $fault: "client",
2391
1960
  $metadata: deserializeMetadata(output),
2392
- };
1961
+ });
1962
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2393
1963
  }
2394
- const message = response.message || response.Message || errorCode;
2395
- response.message = message;
2396
- delete response.Message;
2397
- return Promise.reject(Object.assign(new Error(message), response));
2398
1964
  };
2399
1965
  const deserializeAws_restJson1DescribeElasticsearchDomainsCommand = async (output, context) => {
2400
1966
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2422,43 +1988,22 @@ const deserializeAws_restJson1DescribeElasticsearchDomainsCommandError = async (
2422
1988
  switch (errorCode) {
2423
1989
  case "BaseException":
2424
1990
  case "com.amazonaws.elasticsearchservice#BaseException":
2425
- response = {
2426
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
2427
- name: errorCode,
2428
- $metadata: deserializeMetadata(output),
2429
- };
2430
- break;
1991
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
2431
1992
  case "InternalException":
2432
1993
  case "com.amazonaws.elasticsearchservice#InternalException":
2433
- response = {
2434
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2435
- name: errorCode,
2436
- $metadata: deserializeMetadata(output),
2437
- };
2438
- break;
1994
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2439
1995
  case "ValidationException":
2440
1996
  case "com.amazonaws.elasticsearchservice#ValidationException":
2441
- response = {
2442
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2443
- name: errorCode,
2444
- $metadata: deserializeMetadata(output),
2445
- };
2446
- break;
1997
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2447
1998
  default:
2448
1999
  const parsedBody = parsedOutput.body;
2449
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2450
- response = {
2451
- ...parsedBody,
2452
- name: `${errorCode}`,
2453
- message: parsedBody.message || parsedBody.Message || errorCode,
2000
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2001
+ name: parsedBody.code || parsedBody.Code || errorCode,
2454
2002
  $fault: "client",
2455
2003
  $metadata: deserializeMetadata(output),
2456
- };
2004
+ });
2005
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2457
2006
  }
2458
- const message = response.message || response.Message || errorCode;
2459
- response.message = message;
2460
- delete response.Message;
2461
- return Promise.reject(Object.assign(new Error(message), response));
2462
2007
  };
2463
2008
  const deserializeAws_restJson1DescribeElasticsearchInstanceTypeLimitsCommand = async (output, context) => {
2464
2009
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2486,67 +2031,31 @@ const deserializeAws_restJson1DescribeElasticsearchInstanceTypeLimitsCommandErro
2486
2031
  switch (errorCode) {
2487
2032
  case "BaseException":
2488
2033
  case "com.amazonaws.elasticsearchservice#BaseException":
2489
- response = {
2490
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
2491
- name: errorCode,
2492
- $metadata: deserializeMetadata(output),
2493
- };
2494
- break;
2034
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
2495
2035
  case "InternalException":
2496
2036
  case "com.amazonaws.elasticsearchservice#InternalException":
2497
- response = {
2498
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2499
- name: errorCode,
2500
- $metadata: deserializeMetadata(output),
2501
- };
2502
- break;
2037
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2503
2038
  case "InvalidTypeException":
2504
2039
  case "com.amazonaws.elasticsearchservice#InvalidTypeException":
2505
- response = {
2506
- ...(await deserializeAws_restJson1InvalidTypeExceptionResponse(parsedOutput, context)),
2507
- name: errorCode,
2508
- $metadata: deserializeMetadata(output),
2509
- };
2510
- break;
2040
+ throw await deserializeAws_restJson1InvalidTypeExceptionResponse(parsedOutput, context);
2511
2041
  case "LimitExceededException":
2512
2042
  case "com.amazonaws.elasticsearchservice#LimitExceededException":
2513
- response = {
2514
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
2515
- name: errorCode,
2516
- $metadata: deserializeMetadata(output),
2517
- };
2518
- break;
2043
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
2519
2044
  case "ResourceNotFoundException":
2520
2045
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2521
- response = {
2522
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2523
- name: errorCode,
2524
- $metadata: deserializeMetadata(output),
2525
- };
2526
- break;
2046
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2527
2047
  case "ValidationException":
2528
2048
  case "com.amazonaws.elasticsearchservice#ValidationException":
2529
- response = {
2530
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2531
- name: errorCode,
2532
- $metadata: deserializeMetadata(output),
2533
- };
2534
- break;
2049
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2535
2050
  default:
2536
2051
  const parsedBody = parsedOutput.body;
2537
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2538
- response = {
2539
- ...parsedBody,
2540
- name: `${errorCode}`,
2541
- message: parsedBody.message || parsedBody.Message || errorCode,
2052
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2053
+ name: parsedBody.code || parsedBody.Code || errorCode,
2542
2054
  $fault: "client",
2543
2055
  $metadata: deserializeMetadata(output),
2544
- };
2056
+ });
2057
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2545
2058
  }
2546
- const message = response.message || response.Message || errorCode;
2547
- response.message = message;
2548
- delete response.Message;
2549
- return Promise.reject(Object.assign(new Error(message), response));
2550
2059
  };
2551
2060
  const deserializeAws_restJson1DescribeInboundCrossClusterSearchConnectionsCommand = async (output, context) => {
2552
2061
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2578,35 +2087,19 @@ const deserializeAws_restJson1DescribeInboundCrossClusterSearchConnectionsComman
2578
2087
  switch (errorCode) {
2579
2088
  case "DisabledOperationException":
2580
2089
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
2581
- response = {
2582
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
2583
- name: errorCode,
2584
- $metadata: deserializeMetadata(output),
2585
- };
2586
- break;
2090
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
2587
2091
  case "InvalidPaginationTokenException":
2588
2092
  case "com.amazonaws.elasticsearchservice#InvalidPaginationTokenException":
2589
- response = {
2590
- ...(await deserializeAws_restJson1InvalidPaginationTokenExceptionResponse(parsedOutput, context)),
2591
- name: errorCode,
2592
- $metadata: deserializeMetadata(output),
2593
- };
2594
- break;
2093
+ throw await deserializeAws_restJson1InvalidPaginationTokenExceptionResponse(parsedOutput, context);
2595
2094
  default:
2596
2095
  const parsedBody = parsedOutput.body;
2597
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2598
- response = {
2599
- ...parsedBody,
2600
- name: `${errorCode}`,
2601
- message: parsedBody.message || parsedBody.Message || errorCode,
2096
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2097
+ name: parsedBody.code || parsedBody.Code || errorCode,
2602
2098
  $fault: "client",
2603
2099
  $metadata: deserializeMetadata(output),
2604
- };
2100
+ });
2101
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2605
2102
  }
2606
- const message = response.message || response.Message || errorCode;
2607
- response.message = message;
2608
- delete response.Message;
2609
- return Promise.reject(Object.assign(new Error(message), response));
2610
2103
  };
2611
2104
  const deserializeAws_restJson1DescribeOutboundCrossClusterSearchConnectionsCommand = async (output, context) => {
2612
2105
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2638,35 +2131,19 @@ const deserializeAws_restJson1DescribeOutboundCrossClusterSearchConnectionsComma
2638
2131
  switch (errorCode) {
2639
2132
  case "DisabledOperationException":
2640
2133
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
2641
- response = {
2642
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
2643
- name: errorCode,
2644
- $metadata: deserializeMetadata(output),
2645
- };
2646
- break;
2134
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
2647
2135
  case "InvalidPaginationTokenException":
2648
2136
  case "com.amazonaws.elasticsearchservice#InvalidPaginationTokenException":
2649
- response = {
2650
- ...(await deserializeAws_restJson1InvalidPaginationTokenExceptionResponse(parsedOutput, context)),
2651
- name: errorCode,
2652
- $metadata: deserializeMetadata(output),
2653
- };
2654
- break;
2137
+ throw await deserializeAws_restJson1InvalidPaginationTokenExceptionResponse(parsedOutput, context);
2655
2138
  default:
2656
2139
  const parsedBody = parsedOutput.body;
2657
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2658
- response = {
2659
- ...parsedBody,
2660
- name: `${errorCode}`,
2661
- message: parsedBody.message || parsedBody.Message || errorCode,
2140
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2141
+ name: parsedBody.code || parsedBody.Code || errorCode,
2662
2142
  $fault: "client",
2663
2143
  $metadata: deserializeMetadata(output),
2664
- };
2144
+ });
2145
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2665
2146
  }
2666
- const message = response.message || response.Message || errorCode;
2667
- response.message = message;
2668
- delete response.Message;
2669
- return Promise.reject(Object.assign(new Error(message), response));
2670
2147
  };
2671
2148
  const deserializeAws_restJson1DescribePackagesCommand = async (output, context) => {
2672
2149
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2698,59 +2175,28 @@ const deserializeAws_restJson1DescribePackagesCommandError = async (output, cont
2698
2175
  switch (errorCode) {
2699
2176
  case "AccessDeniedException":
2700
2177
  case "com.amazonaws.elasticsearchservice#AccessDeniedException":
2701
- response = {
2702
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2703
- name: errorCode,
2704
- $metadata: deserializeMetadata(output),
2705
- };
2706
- break;
2178
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2707
2179
  case "BaseException":
2708
2180
  case "com.amazonaws.elasticsearchservice#BaseException":
2709
- response = {
2710
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
2711
- name: errorCode,
2712
- $metadata: deserializeMetadata(output),
2713
- };
2714
- break;
2181
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
2715
2182
  case "InternalException":
2716
2183
  case "com.amazonaws.elasticsearchservice#InternalException":
2717
- response = {
2718
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2719
- name: errorCode,
2720
- $metadata: deserializeMetadata(output),
2721
- };
2722
- break;
2184
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2723
2185
  case "ResourceNotFoundException":
2724
2186
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2725
- response = {
2726
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2727
- name: errorCode,
2728
- $metadata: deserializeMetadata(output),
2729
- };
2730
- break;
2187
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2731
2188
  case "ValidationException":
2732
2189
  case "com.amazonaws.elasticsearchservice#ValidationException":
2733
- response = {
2734
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2735
- name: errorCode,
2736
- $metadata: deserializeMetadata(output),
2737
- };
2738
- break;
2190
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2739
2191
  default:
2740
2192
  const parsedBody = parsedOutput.body;
2741
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2742
- response = {
2743
- ...parsedBody,
2744
- name: `${errorCode}`,
2745
- message: parsedBody.message || parsedBody.Message || errorCode,
2193
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2194
+ name: parsedBody.code || parsedBody.Code || errorCode,
2746
2195
  $fault: "client",
2747
2196
  $metadata: deserializeMetadata(output),
2748
- };
2197
+ });
2198
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2749
2199
  }
2750
- const message = response.message || response.Message || errorCode;
2751
- response.message = message;
2752
- delete response.Message;
2753
- return Promise.reject(Object.assign(new Error(message), response));
2754
2200
  };
2755
2201
  const deserializeAws_restJson1DescribeReservedElasticsearchInstanceOfferingsCommand = async (output, context) => {
2756
2202
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2783,51 +2229,25 @@ const deserializeAws_restJson1DescribeReservedElasticsearchInstanceOfferingsComm
2783
2229
  switch (errorCode) {
2784
2230
  case "DisabledOperationException":
2785
2231
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
2786
- response = {
2787
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
2788
- name: errorCode,
2789
- $metadata: deserializeMetadata(output),
2790
- };
2791
- break;
2232
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
2792
2233
  case "InternalException":
2793
2234
  case "com.amazonaws.elasticsearchservice#InternalException":
2794
- response = {
2795
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2796
- name: errorCode,
2797
- $metadata: deserializeMetadata(output),
2798
- };
2799
- break;
2235
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2800
2236
  case "ResourceNotFoundException":
2801
2237
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2802
- response = {
2803
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2804
- name: errorCode,
2805
- $metadata: deserializeMetadata(output),
2806
- };
2807
- break;
2238
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2808
2239
  case "ValidationException":
2809
2240
  case "com.amazonaws.elasticsearchservice#ValidationException":
2810
- response = {
2811
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2812
- name: errorCode,
2813
- $metadata: deserializeMetadata(output),
2814
- };
2815
- break;
2241
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2816
2242
  default:
2817
2243
  const parsedBody = parsedOutput.body;
2818
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2819
- response = {
2820
- ...parsedBody,
2821
- name: `${errorCode}`,
2822
- message: parsedBody.message || parsedBody.Message || errorCode,
2244
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2245
+ name: parsedBody.code || parsedBody.Code || errorCode,
2823
2246
  $fault: "client",
2824
2247
  $metadata: deserializeMetadata(output),
2825
- };
2248
+ });
2249
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2826
2250
  }
2827
- const message = response.message || response.Message || errorCode;
2828
- response.message = message;
2829
- delete response.Message;
2830
- return Promise.reject(Object.assign(new Error(message), response));
2831
2251
  };
2832
2252
  const deserializeAws_restJson1DescribeReservedElasticsearchInstancesCommand = async (output, context) => {
2833
2253
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2859,51 +2279,25 @@ const deserializeAws_restJson1DescribeReservedElasticsearchInstancesCommandError
2859
2279
  switch (errorCode) {
2860
2280
  case "DisabledOperationException":
2861
2281
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
2862
- response = {
2863
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
2864
- name: errorCode,
2865
- $metadata: deserializeMetadata(output),
2866
- };
2867
- break;
2282
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
2868
2283
  case "InternalException":
2869
2284
  case "com.amazonaws.elasticsearchservice#InternalException":
2870
- response = {
2871
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2872
- name: errorCode,
2873
- $metadata: deserializeMetadata(output),
2874
- };
2875
- break;
2285
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2876
2286
  case "ResourceNotFoundException":
2877
2287
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2878
- response = {
2879
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2880
- name: errorCode,
2881
- $metadata: deserializeMetadata(output),
2882
- };
2883
- break;
2288
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2884
2289
  case "ValidationException":
2885
2290
  case "com.amazonaws.elasticsearchservice#ValidationException":
2886
- response = {
2887
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2888
- name: errorCode,
2889
- $metadata: deserializeMetadata(output),
2890
- };
2891
- break;
2291
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2892
2292
  default:
2893
2293
  const parsedBody = parsedOutput.body;
2894
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2895
- response = {
2896
- ...parsedBody,
2897
- name: `${errorCode}`,
2898
- message: parsedBody.message || parsedBody.Message || errorCode,
2294
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2295
+ name: parsedBody.code || parsedBody.Code || errorCode,
2899
2296
  $fault: "client",
2900
2297
  $metadata: deserializeMetadata(output),
2901
- };
2298
+ });
2299
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2902
2300
  }
2903
- const message = response.message || response.Message || errorCode;
2904
- response.message = message;
2905
- delete response.Message;
2906
- return Promise.reject(Object.assign(new Error(message), response));
2907
2301
  };
2908
2302
  const deserializeAws_restJson1DissociatePackageCommand = async (output, context) => {
2909
2303
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2931,67 +2325,31 @@ const deserializeAws_restJson1DissociatePackageCommandError = async (output, con
2931
2325
  switch (errorCode) {
2932
2326
  case "AccessDeniedException":
2933
2327
  case "com.amazonaws.elasticsearchservice#AccessDeniedException":
2934
- response = {
2935
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2936
- name: errorCode,
2937
- $metadata: deserializeMetadata(output),
2938
- };
2939
- break;
2328
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2940
2329
  case "BaseException":
2941
2330
  case "com.amazonaws.elasticsearchservice#BaseException":
2942
- response = {
2943
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
2944
- name: errorCode,
2945
- $metadata: deserializeMetadata(output),
2946
- };
2947
- break;
2331
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
2948
2332
  case "ConflictException":
2949
2333
  case "com.amazonaws.elasticsearchservice#ConflictException":
2950
- response = {
2951
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2952
- name: errorCode,
2953
- $metadata: deserializeMetadata(output),
2954
- };
2955
- break;
2334
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2956
2335
  case "InternalException":
2957
2336
  case "com.amazonaws.elasticsearchservice#InternalException":
2958
- response = {
2959
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
2960
- name: errorCode,
2961
- $metadata: deserializeMetadata(output),
2962
- };
2963
- break;
2337
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
2964
2338
  case "ResourceNotFoundException":
2965
2339
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
2966
- response = {
2967
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2968
- name: errorCode,
2969
- $metadata: deserializeMetadata(output),
2970
- };
2971
- break;
2340
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2972
2341
  case "ValidationException":
2973
2342
  case "com.amazonaws.elasticsearchservice#ValidationException":
2974
- response = {
2975
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2976
- name: errorCode,
2977
- $metadata: deserializeMetadata(output),
2978
- };
2979
- break;
2343
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2980
2344
  default:
2981
2345
  const parsedBody = parsedOutput.body;
2982
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2983
- response = {
2984
- ...parsedBody,
2985
- name: `${errorCode}`,
2986
- message: parsedBody.message || parsedBody.Message || errorCode,
2346
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2347
+ name: parsedBody.code || parsedBody.Code || errorCode,
2987
2348
  $fault: "client",
2988
2349
  $metadata: deserializeMetadata(output),
2989
- };
2350
+ });
2351
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2990
2352
  }
2991
- const message = response.message || response.Message || errorCode;
2992
- response.message = message;
2993
- delete response.Message;
2994
- return Promise.reject(Object.assign(new Error(message), response));
2995
2353
  };
2996
2354
  const deserializeAws_restJson1GetCompatibleElasticsearchVersionsCommand = async (output, context) => {
2997
2355
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3019,59 +2377,28 @@ const deserializeAws_restJson1GetCompatibleElasticsearchVersionsCommandError = a
3019
2377
  switch (errorCode) {
3020
2378
  case "BaseException":
3021
2379
  case "com.amazonaws.elasticsearchservice#BaseException":
3022
- response = {
3023
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3024
- name: errorCode,
3025
- $metadata: deserializeMetadata(output),
3026
- };
3027
- break;
2380
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3028
2381
  case "DisabledOperationException":
3029
2382
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
3030
- response = {
3031
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
3032
- name: errorCode,
3033
- $metadata: deserializeMetadata(output),
3034
- };
3035
- break;
2383
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
3036
2384
  case "InternalException":
3037
2385
  case "com.amazonaws.elasticsearchservice#InternalException":
3038
- response = {
3039
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3040
- name: errorCode,
3041
- $metadata: deserializeMetadata(output),
3042
- };
3043
- break;
2386
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3044
2387
  case "ResourceNotFoundException":
3045
2388
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3046
- response = {
3047
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3048
- name: errorCode,
3049
- $metadata: deserializeMetadata(output),
3050
- };
3051
- break;
2389
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3052
2390
  case "ValidationException":
3053
2391
  case "com.amazonaws.elasticsearchservice#ValidationException":
3054
- response = {
3055
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3056
- name: errorCode,
3057
- $metadata: deserializeMetadata(output),
3058
- };
3059
- break;
2392
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3060
2393
  default:
3061
2394
  const parsedBody = parsedOutput.body;
3062
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3063
- response = {
3064
- ...parsedBody,
3065
- name: `${errorCode}`,
3066
- message: parsedBody.message || parsedBody.Message || errorCode,
2395
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2396
+ name: parsedBody.code || parsedBody.Code || errorCode,
3067
2397
  $fault: "client",
3068
2398
  $metadata: deserializeMetadata(output),
3069
- };
2399
+ });
2400
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3070
2401
  }
3071
- const message = response.message || response.Message || errorCode;
3072
- response.message = message;
3073
- delete response.Message;
3074
- return Promise.reject(Object.assign(new Error(message), response));
3075
2402
  };
3076
2403
  const deserializeAws_restJson1GetPackageVersionHistoryCommand = async (output, context) => {
3077
2404
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3107,59 +2434,28 @@ const deserializeAws_restJson1GetPackageVersionHistoryCommandError = async (outp
3107
2434
  switch (errorCode) {
3108
2435
  case "AccessDeniedException":
3109
2436
  case "com.amazonaws.elasticsearchservice#AccessDeniedException":
3110
- response = {
3111
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3112
- name: errorCode,
3113
- $metadata: deserializeMetadata(output),
3114
- };
3115
- break;
2437
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3116
2438
  case "BaseException":
3117
2439
  case "com.amazonaws.elasticsearchservice#BaseException":
3118
- response = {
3119
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3120
- name: errorCode,
3121
- $metadata: deserializeMetadata(output),
3122
- };
3123
- break;
2440
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3124
2441
  case "InternalException":
3125
2442
  case "com.amazonaws.elasticsearchservice#InternalException":
3126
- response = {
3127
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3128
- name: errorCode,
3129
- $metadata: deserializeMetadata(output),
3130
- };
3131
- break;
2443
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3132
2444
  case "ResourceNotFoundException":
3133
2445
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3134
- response = {
3135
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3136
- name: errorCode,
3137
- $metadata: deserializeMetadata(output),
3138
- };
3139
- break;
2446
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3140
2447
  case "ValidationException":
3141
2448
  case "com.amazonaws.elasticsearchservice#ValidationException":
3142
- response = {
3143
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3144
- name: errorCode,
3145
- $metadata: deserializeMetadata(output),
3146
- };
3147
- break;
2449
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3148
2450
  default:
3149
2451
  const parsedBody = parsedOutput.body;
3150
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3151
- response = {
3152
- ...parsedBody,
3153
- name: `${errorCode}`,
3154
- message: parsedBody.message || parsedBody.Message || errorCode,
2452
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2453
+ name: parsedBody.code || parsedBody.Code || errorCode,
3155
2454
  $fault: "client",
3156
2455
  $metadata: deserializeMetadata(output),
3157
- };
2456
+ });
2457
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3158
2458
  }
3159
- const message = response.message || response.Message || errorCode;
3160
- response.message = message;
3161
- delete response.Message;
3162
- return Promise.reject(Object.assign(new Error(message), response));
3163
2459
  };
3164
2460
  const deserializeAws_restJson1GetUpgradeHistoryCommand = async (output, context) => {
3165
2461
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3191,59 +2487,28 @@ const deserializeAws_restJson1GetUpgradeHistoryCommandError = async (output, con
3191
2487
  switch (errorCode) {
3192
2488
  case "BaseException":
3193
2489
  case "com.amazonaws.elasticsearchservice#BaseException":
3194
- response = {
3195
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3196
- name: errorCode,
3197
- $metadata: deserializeMetadata(output),
3198
- };
3199
- break;
2490
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3200
2491
  case "DisabledOperationException":
3201
2492
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
3202
- response = {
3203
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
3204
- name: errorCode,
3205
- $metadata: deserializeMetadata(output),
3206
- };
3207
- break;
2493
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
3208
2494
  case "InternalException":
3209
2495
  case "com.amazonaws.elasticsearchservice#InternalException":
3210
- response = {
3211
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3212
- name: errorCode,
3213
- $metadata: deserializeMetadata(output),
3214
- };
3215
- break;
2496
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3216
2497
  case "ResourceNotFoundException":
3217
2498
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3218
- response = {
3219
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3220
- name: errorCode,
3221
- $metadata: deserializeMetadata(output),
3222
- };
3223
- break;
2499
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3224
2500
  case "ValidationException":
3225
2501
  case "com.amazonaws.elasticsearchservice#ValidationException":
3226
- response = {
3227
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3228
- name: errorCode,
3229
- $metadata: deserializeMetadata(output),
3230
- };
3231
- break;
2502
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3232
2503
  default:
3233
2504
  const parsedBody = parsedOutput.body;
3234
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3235
- response = {
3236
- ...parsedBody,
3237
- name: `${errorCode}`,
3238
- message: parsedBody.message || parsedBody.Message || errorCode,
2505
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2506
+ name: parsedBody.code || parsedBody.Code || errorCode,
3239
2507
  $fault: "client",
3240
2508
  $metadata: deserializeMetadata(output),
3241
- };
2509
+ });
2510
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3242
2511
  }
3243
- const message = response.message || response.Message || errorCode;
3244
- response.message = message;
3245
- delete response.Message;
3246
- return Promise.reject(Object.assign(new Error(message), response));
3247
2512
  };
3248
2513
  const deserializeAws_restJson1GetUpgradeStatusCommand = async (output, context) => {
3249
2514
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3279,59 +2544,28 @@ const deserializeAws_restJson1GetUpgradeStatusCommandError = async (output, cont
3279
2544
  switch (errorCode) {
3280
2545
  case "BaseException":
3281
2546
  case "com.amazonaws.elasticsearchservice#BaseException":
3282
- response = {
3283
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3284
- name: errorCode,
3285
- $metadata: deserializeMetadata(output),
3286
- };
3287
- break;
2547
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3288
2548
  case "DisabledOperationException":
3289
2549
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
3290
- response = {
3291
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
3292
- name: errorCode,
3293
- $metadata: deserializeMetadata(output),
3294
- };
3295
- break;
2550
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
3296
2551
  case "InternalException":
3297
2552
  case "com.amazonaws.elasticsearchservice#InternalException":
3298
- response = {
3299
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3300
- name: errorCode,
3301
- $metadata: deserializeMetadata(output),
3302
- };
3303
- break;
2553
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3304
2554
  case "ResourceNotFoundException":
3305
2555
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3306
- response = {
3307
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3308
- name: errorCode,
3309
- $metadata: deserializeMetadata(output),
3310
- };
3311
- break;
2556
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3312
2557
  case "ValidationException":
3313
2558
  case "com.amazonaws.elasticsearchservice#ValidationException":
3314
- response = {
3315
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3316
- name: errorCode,
3317
- $metadata: deserializeMetadata(output),
3318
- };
3319
- break;
2559
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3320
2560
  default:
3321
2561
  const parsedBody = parsedOutput.body;
3322
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3323
- response = {
3324
- ...parsedBody,
3325
- name: `${errorCode}`,
3326
- message: parsedBody.message || parsedBody.Message || errorCode,
2562
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2563
+ name: parsedBody.code || parsedBody.Code || errorCode,
3327
2564
  $fault: "client",
3328
2565
  $metadata: deserializeMetadata(output),
3329
- };
2566
+ });
2567
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3330
2568
  }
3331
- const message = response.message || response.Message || errorCode;
3332
- response.message = message;
3333
- delete response.Message;
3334
- return Promise.reject(Object.assign(new Error(message), response));
3335
2569
  };
3336
2570
  const deserializeAws_restJson1ListDomainNamesCommand = async (output, context) => {
3337
2571
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3359,35 +2593,19 @@ const deserializeAws_restJson1ListDomainNamesCommandError = async (output, conte
3359
2593
  switch (errorCode) {
3360
2594
  case "BaseException":
3361
2595
  case "com.amazonaws.elasticsearchservice#BaseException":
3362
- response = {
3363
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3364
- name: errorCode,
3365
- $metadata: deserializeMetadata(output),
3366
- };
3367
- break;
2596
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3368
2597
  case "ValidationException":
3369
2598
  case "com.amazonaws.elasticsearchservice#ValidationException":
3370
- response = {
3371
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3372
- name: errorCode,
3373
- $metadata: deserializeMetadata(output),
3374
- };
3375
- break;
2599
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3376
2600
  default:
3377
2601
  const parsedBody = parsedOutput.body;
3378
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3379
- response = {
3380
- ...parsedBody,
3381
- name: `${errorCode}`,
3382
- message: parsedBody.message || parsedBody.Message || errorCode,
2602
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2603
+ name: parsedBody.code || parsedBody.Code || errorCode,
3383
2604
  $fault: "client",
3384
2605
  $metadata: deserializeMetadata(output),
3385
- };
2606
+ });
2607
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3386
2608
  }
3387
- const message = response.message || response.Message || errorCode;
3388
- response.message = message;
3389
- delete response.Message;
3390
- return Promise.reject(Object.assign(new Error(message), response));
3391
2609
  };
3392
2610
  const deserializeAws_restJson1ListDomainsForPackageCommand = async (output, context) => {
3393
2611
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3419,59 +2637,28 @@ const deserializeAws_restJson1ListDomainsForPackageCommandError = async (output,
3419
2637
  switch (errorCode) {
3420
2638
  case "AccessDeniedException":
3421
2639
  case "com.amazonaws.elasticsearchservice#AccessDeniedException":
3422
- response = {
3423
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3424
- name: errorCode,
3425
- $metadata: deserializeMetadata(output),
3426
- };
3427
- break;
2640
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3428
2641
  case "BaseException":
3429
2642
  case "com.amazonaws.elasticsearchservice#BaseException":
3430
- response = {
3431
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3432
- name: errorCode,
3433
- $metadata: deserializeMetadata(output),
3434
- };
3435
- break;
2643
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3436
2644
  case "InternalException":
3437
2645
  case "com.amazonaws.elasticsearchservice#InternalException":
3438
- response = {
3439
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3440
- name: errorCode,
3441
- $metadata: deserializeMetadata(output),
3442
- };
3443
- break;
2646
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3444
2647
  case "ResourceNotFoundException":
3445
2648
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3446
- response = {
3447
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3448
- name: errorCode,
3449
- $metadata: deserializeMetadata(output),
3450
- };
3451
- break;
2649
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3452
2650
  case "ValidationException":
3453
2651
  case "com.amazonaws.elasticsearchservice#ValidationException":
3454
- response = {
3455
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3456
- name: errorCode,
3457
- $metadata: deserializeMetadata(output),
3458
- };
3459
- break;
2652
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3460
2653
  default:
3461
2654
  const parsedBody = parsedOutput.body;
3462
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3463
- response = {
3464
- ...parsedBody,
3465
- name: `${errorCode}`,
3466
- message: parsedBody.message || parsedBody.Message || errorCode,
2655
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2656
+ name: parsedBody.code || parsedBody.Code || errorCode,
3467
2657
  $fault: "client",
3468
2658
  $metadata: deserializeMetadata(output),
3469
- };
2659
+ });
2660
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3470
2661
  }
3471
- const message = response.message || response.Message || errorCode;
3472
- response.message = message;
3473
- delete response.Message;
3474
- return Promise.reject(Object.assign(new Error(message), response));
3475
2662
  };
3476
2663
  const deserializeAws_restJson1ListElasticsearchInstanceTypesCommand = async (output, context) => {
3477
2664
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3503,51 +2690,25 @@ const deserializeAws_restJson1ListElasticsearchInstanceTypesCommandError = async
3503
2690
  switch (errorCode) {
3504
2691
  case "BaseException":
3505
2692
  case "com.amazonaws.elasticsearchservice#BaseException":
3506
- response = {
3507
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3508
- name: errorCode,
3509
- $metadata: deserializeMetadata(output),
3510
- };
3511
- break;
2693
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3512
2694
  case "InternalException":
3513
2695
  case "com.amazonaws.elasticsearchservice#InternalException":
3514
- response = {
3515
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3516
- name: errorCode,
3517
- $metadata: deserializeMetadata(output),
3518
- };
3519
- break;
2696
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3520
2697
  case "ResourceNotFoundException":
3521
2698
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3522
- response = {
3523
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3524
- name: errorCode,
3525
- $metadata: deserializeMetadata(output),
3526
- };
3527
- break;
2699
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3528
2700
  case "ValidationException":
3529
2701
  case "com.amazonaws.elasticsearchservice#ValidationException":
3530
- response = {
3531
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3532
- name: errorCode,
3533
- $metadata: deserializeMetadata(output),
3534
- };
3535
- break;
2702
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3536
2703
  default:
3537
2704
  const parsedBody = parsedOutput.body;
3538
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3539
- response = {
3540
- ...parsedBody,
3541
- name: `${errorCode}`,
3542
- message: parsedBody.message || parsedBody.Message || errorCode,
2705
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2706
+ name: parsedBody.code || parsedBody.Code || errorCode,
3543
2707
  $fault: "client",
3544
2708
  $metadata: deserializeMetadata(output),
3545
- };
2709
+ });
2710
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3546
2711
  }
3547
- const message = response.message || response.Message || errorCode;
3548
- response.message = message;
3549
- delete response.Message;
3550
- return Promise.reject(Object.assign(new Error(message), response));
3551
2712
  };
3552
2713
  const deserializeAws_restJson1ListElasticsearchVersionsCommand = async (output, context) => {
3553
2714
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3579,51 +2740,25 @@ const deserializeAws_restJson1ListElasticsearchVersionsCommandError = async (out
3579
2740
  switch (errorCode) {
3580
2741
  case "BaseException":
3581
2742
  case "com.amazonaws.elasticsearchservice#BaseException":
3582
- response = {
3583
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3584
- name: errorCode,
3585
- $metadata: deserializeMetadata(output),
3586
- };
3587
- break;
2743
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3588
2744
  case "InternalException":
3589
2745
  case "com.amazonaws.elasticsearchservice#InternalException":
3590
- response = {
3591
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3592
- name: errorCode,
3593
- $metadata: deserializeMetadata(output),
3594
- };
3595
- break;
2746
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3596
2747
  case "ResourceNotFoundException":
3597
2748
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3598
- response = {
3599
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3600
- name: errorCode,
3601
- $metadata: deserializeMetadata(output),
3602
- };
3603
- break;
2749
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3604
2750
  case "ValidationException":
3605
2751
  case "com.amazonaws.elasticsearchservice#ValidationException":
3606
- response = {
3607
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3608
- name: errorCode,
3609
- $metadata: deserializeMetadata(output),
3610
- };
3611
- break;
2752
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3612
2753
  default:
3613
2754
  const parsedBody = parsedOutput.body;
3614
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3615
- response = {
3616
- ...parsedBody,
3617
- name: `${errorCode}`,
3618
- message: parsedBody.message || parsedBody.Message || errorCode,
2755
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2756
+ name: parsedBody.code || parsedBody.Code || errorCode,
3619
2757
  $fault: "client",
3620
2758
  $metadata: deserializeMetadata(output),
3621
- };
2759
+ });
2760
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3622
2761
  }
3623
- const message = response.message || response.Message || errorCode;
3624
- response.message = message;
3625
- delete response.Message;
3626
- return Promise.reject(Object.assign(new Error(message), response));
3627
2762
  };
3628
2763
  const deserializeAws_restJson1ListPackagesForDomainCommand = async (output, context) => {
3629
2764
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3655,59 +2790,28 @@ const deserializeAws_restJson1ListPackagesForDomainCommandError = async (output,
3655
2790
  switch (errorCode) {
3656
2791
  case "AccessDeniedException":
3657
2792
  case "com.amazonaws.elasticsearchservice#AccessDeniedException":
3658
- response = {
3659
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3660
- name: errorCode,
3661
- $metadata: deserializeMetadata(output),
3662
- };
3663
- break;
2793
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3664
2794
  case "BaseException":
3665
2795
  case "com.amazonaws.elasticsearchservice#BaseException":
3666
- response = {
3667
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3668
- name: errorCode,
3669
- $metadata: deserializeMetadata(output),
3670
- };
3671
- break;
2796
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3672
2797
  case "InternalException":
3673
2798
  case "com.amazonaws.elasticsearchservice#InternalException":
3674
- response = {
3675
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3676
- name: errorCode,
3677
- $metadata: deserializeMetadata(output),
3678
- };
3679
- break;
2799
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3680
2800
  case "ResourceNotFoundException":
3681
2801
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3682
- response = {
3683
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3684
- name: errorCode,
3685
- $metadata: deserializeMetadata(output),
3686
- };
3687
- break;
2802
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3688
2803
  case "ValidationException":
3689
2804
  case "com.amazonaws.elasticsearchservice#ValidationException":
3690
- response = {
3691
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3692
- name: errorCode,
3693
- $metadata: deserializeMetadata(output),
3694
- };
3695
- break;
2805
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3696
2806
  default:
3697
2807
  const parsedBody = parsedOutput.body;
3698
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3699
- response = {
3700
- ...parsedBody,
3701
- name: `${errorCode}`,
3702
- message: parsedBody.message || parsedBody.Message || errorCode,
2808
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2809
+ name: parsedBody.code || parsedBody.Code || errorCode,
3703
2810
  $fault: "client",
3704
2811
  $metadata: deserializeMetadata(output),
3705
- };
2812
+ });
2813
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3706
2814
  }
3707
- const message = response.message || response.Message || errorCode;
3708
- response.message = message;
3709
- delete response.Message;
3710
- return Promise.reject(Object.assign(new Error(message), response));
3711
2815
  };
3712
2816
  const deserializeAws_restJson1ListTagsCommand = async (output, context) => {
3713
2817
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3735,51 +2839,25 @@ const deserializeAws_restJson1ListTagsCommandError = async (output, context) =>
3735
2839
  switch (errorCode) {
3736
2840
  case "BaseException":
3737
2841
  case "com.amazonaws.elasticsearchservice#BaseException":
3738
- response = {
3739
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3740
- name: errorCode,
3741
- $metadata: deserializeMetadata(output),
3742
- };
3743
- break;
2842
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3744
2843
  case "InternalException":
3745
2844
  case "com.amazonaws.elasticsearchservice#InternalException":
3746
- response = {
3747
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3748
- name: errorCode,
3749
- $metadata: deserializeMetadata(output),
3750
- };
3751
- break;
2845
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3752
2846
  case "ResourceNotFoundException":
3753
2847
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3754
- response = {
3755
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3756
- name: errorCode,
3757
- $metadata: deserializeMetadata(output),
3758
- };
3759
- break;
2848
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3760
2849
  case "ValidationException":
3761
2850
  case "com.amazonaws.elasticsearchservice#ValidationException":
3762
- response = {
3763
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3764
- name: errorCode,
3765
- $metadata: deserializeMetadata(output),
3766
- };
3767
- break;
2851
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3768
2852
  default:
3769
2853
  const parsedBody = parsedOutput.body;
3770
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3771
- response = {
3772
- ...parsedBody,
3773
- name: `${errorCode}`,
3774
- message: parsedBody.message || parsedBody.Message || errorCode,
2854
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2855
+ name: parsedBody.code || parsedBody.Code || errorCode,
3775
2856
  $fault: "client",
3776
2857
  $metadata: deserializeMetadata(output),
3777
- };
2858
+ });
2859
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3778
2860
  }
3779
- const message = response.message || response.Message || errorCode;
3780
- response.message = message;
3781
- delete response.Message;
3782
- return Promise.reject(Object.assign(new Error(message), response));
3783
2861
  };
3784
2862
  const deserializeAws_restJson1PurchaseReservedElasticsearchInstanceOfferingCommand = async (output, context) => {
3785
2863
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3811,67 +2889,31 @@ const deserializeAws_restJson1PurchaseReservedElasticsearchInstanceOfferingComma
3811
2889
  switch (errorCode) {
3812
2890
  case "DisabledOperationException":
3813
2891
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
3814
- response = {
3815
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
3816
- name: errorCode,
3817
- $metadata: deserializeMetadata(output),
3818
- };
3819
- break;
2892
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
3820
2893
  case "InternalException":
3821
2894
  case "com.amazonaws.elasticsearchservice#InternalException":
3822
- response = {
3823
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3824
- name: errorCode,
3825
- $metadata: deserializeMetadata(output),
3826
- };
3827
- break;
2895
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3828
2896
  case "LimitExceededException":
3829
2897
  case "com.amazonaws.elasticsearchservice#LimitExceededException":
3830
- response = {
3831
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
3832
- name: errorCode,
3833
- $metadata: deserializeMetadata(output),
3834
- };
3835
- break;
2898
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
3836
2899
  case "ResourceAlreadyExistsException":
3837
2900
  case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException":
3838
- response = {
3839
- ...(await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
3840
- name: errorCode,
3841
- $metadata: deserializeMetadata(output),
3842
- };
3843
- break;
2901
+ throw await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
3844
2902
  case "ResourceNotFoundException":
3845
2903
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3846
- response = {
3847
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3848
- name: errorCode,
3849
- $metadata: deserializeMetadata(output),
3850
- };
3851
- break;
2904
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3852
2905
  case "ValidationException":
3853
2906
  case "com.amazonaws.elasticsearchservice#ValidationException":
3854
- response = {
3855
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3856
- name: errorCode,
3857
- $metadata: deserializeMetadata(output),
3858
- };
3859
- break;
2907
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3860
2908
  default:
3861
2909
  const parsedBody = parsedOutput.body;
3862
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3863
- response = {
3864
- ...parsedBody,
3865
- name: `${errorCode}`,
3866
- message: parsedBody.message || parsedBody.Message || errorCode,
2910
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2911
+ name: parsedBody.code || parsedBody.Code || errorCode,
3867
2912
  $fault: "client",
3868
2913
  $metadata: deserializeMetadata(output),
3869
- };
2914
+ });
2915
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3870
2916
  }
3871
- const message = response.message || response.Message || errorCode;
3872
- response.message = message;
3873
- delete response.Message;
3874
- return Promise.reject(Object.assign(new Error(message), response));
3875
2917
  };
3876
2918
  const deserializeAws_restJson1RejectInboundCrossClusterSearchConnectionCommand = async (output, context) => {
3877
2919
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3899,35 +2941,19 @@ const deserializeAws_restJson1RejectInboundCrossClusterSearchConnectionCommandEr
3899
2941
  switch (errorCode) {
3900
2942
  case "DisabledOperationException":
3901
2943
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
3902
- response = {
3903
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
3904
- name: errorCode,
3905
- $metadata: deserializeMetadata(output),
3906
- };
3907
- break;
2944
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
3908
2945
  case "ResourceNotFoundException":
3909
2946
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
3910
- response = {
3911
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3912
- name: errorCode,
3913
- $metadata: deserializeMetadata(output),
3914
- };
3915
- break;
2947
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3916
2948
  default:
3917
2949
  const parsedBody = parsedOutput.body;
3918
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3919
- response = {
3920
- ...parsedBody,
3921
- name: `${errorCode}`,
3922
- message: parsedBody.message || parsedBody.Message || errorCode,
2950
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2951
+ name: parsedBody.code || parsedBody.Code || errorCode,
3923
2952
  $fault: "client",
3924
2953
  $metadata: deserializeMetadata(output),
3925
- };
2954
+ });
2955
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3926
2956
  }
3927
- const message = response.message || response.Message || errorCode;
3928
- response.message = message;
3929
- delete response.Message;
3930
- return Promise.reject(Object.assign(new Error(message), response));
3931
2957
  };
3932
2958
  const deserializeAws_restJson1RemoveTagsCommand = async (output, context) => {
3933
2959
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3951,43 +2977,22 @@ const deserializeAws_restJson1RemoveTagsCommandError = async (output, context) =
3951
2977
  switch (errorCode) {
3952
2978
  case "BaseException":
3953
2979
  case "com.amazonaws.elasticsearchservice#BaseException":
3954
- response = {
3955
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
3956
- name: errorCode,
3957
- $metadata: deserializeMetadata(output),
3958
- };
3959
- break;
2980
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
3960
2981
  case "InternalException":
3961
2982
  case "com.amazonaws.elasticsearchservice#InternalException":
3962
- response = {
3963
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
3964
- name: errorCode,
3965
- $metadata: deserializeMetadata(output),
3966
- };
3967
- break;
2983
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
3968
2984
  case "ValidationException":
3969
2985
  case "com.amazonaws.elasticsearchservice#ValidationException":
3970
- response = {
3971
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3972
- name: errorCode,
3973
- $metadata: deserializeMetadata(output),
3974
- };
3975
- break;
2986
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3976
2987
  default:
3977
2988
  const parsedBody = parsedOutput.body;
3978
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3979
- response = {
3980
- ...parsedBody,
3981
- name: `${errorCode}`,
3982
- message: parsedBody.message || parsedBody.Message || errorCode,
2989
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
2990
+ name: parsedBody.code || parsedBody.Code || errorCode,
3983
2991
  $fault: "client",
3984
2992
  $metadata: deserializeMetadata(output),
3985
- };
2993
+ });
2994
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3986
2995
  }
3987
- const message = response.message || response.Message || errorCode;
3988
- response.message = message;
3989
- delete response.Message;
3990
- return Promise.reject(Object.assign(new Error(message), response));
3991
2996
  };
3992
2997
  const deserializeAws_restJson1StartElasticsearchServiceSoftwareUpdateCommand = async (output, context) => {
3993
2998
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4015,51 +3020,25 @@ const deserializeAws_restJson1StartElasticsearchServiceSoftwareUpdateCommandErro
4015
3020
  switch (errorCode) {
4016
3021
  case "BaseException":
4017
3022
  case "com.amazonaws.elasticsearchservice#BaseException":
4018
- response = {
4019
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
4020
- name: errorCode,
4021
- $metadata: deserializeMetadata(output),
4022
- };
4023
- break;
3023
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
4024
3024
  case "InternalException":
4025
3025
  case "com.amazonaws.elasticsearchservice#InternalException":
4026
- response = {
4027
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
4028
- name: errorCode,
4029
- $metadata: deserializeMetadata(output),
4030
- };
4031
- break;
3026
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
4032
3027
  case "ResourceNotFoundException":
4033
3028
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
4034
- response = {
4035
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4036
- name: errorCode,
4037
- $metadata: deserializeMetadata(output),
4038
- };
4039
- break;
3029
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4040
3030
  case "ValidationException":
4041
3031
  case "com.amazonaws.elasticsearchservice#ValidationException":
4042
- response = {
4043
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4044
- name: errorCode,
4045
- $metadata: deserializeMetadata(output),
4046
- };
4047
- break;
3032
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4048
3033
  default:
4049
3034
  const parsedBody = parsedOutput.body;
4050
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4051
- response = {
4052
- ...parsedBody,
4053
- name: `${errorCode}`,
4054
- message: parsedBody.message || parsedBody.Message || errorCode,
3035
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
3036
+ name: parsedBody.code || parsedBody.Code || errorCode,
4055
3037
  $fault: "client",
4056
3038
  $metadata: deserializeMetadata(output),
4057
- };
3039
+ });
3040
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4058
3041
  }
4059
- const message = response.message || response.Message || errorCode;
4060
- response.message = message;
4061
- delete response.Message;
4062
- return Promise.reject(Object.assign(new Error(message), response));
4063
3042
  };
4064
3043
  const deserializeAws_restJson1UpdateElasticsearchDomainConfigCommand = async (output, context) => {
4065
3044
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4091,67 +3070,31 @@ const deserializeAws_restJson1UpdateElasticsearchDomainConfigCommandError = asyn
4091
3070
  switch (errorCode) {
4092
3071
  case "BaseException":
4093
3072
  case "com.amazonaws.elasticsearchservice#BaseException":
4094
- response = {
4095
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
4096
- name: errorCode,
4097
- $metadata: deserializeMetadata(output),
4098
- };
4099
- break;
3073
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
4100
3074
  case "InternalException":
4101
3075
  case "com.amazonaws.elasticsearchservice#InternalException":
4102
- response = {
4103
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
4104
- name: errorCode,
4105
- $metadata: deserializeMetadata(output),
4106
- };
4107
- break;
3076
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
4108
3077
  case "InvalidTypeException":
4109
3078
  case "com.amazonaws.elasticsearchservice#InvalidTypeException":
4110
- response = {
4111
- ...(await deserializeAws_restJson1InvalidTypeExceptionResponse(parsedOutput, context)),
4112
- name: errorCode,
4113
- $metadata: deserializeMetadata(output),
4114
- };
4115
- break;
3079
+ throw await deserializeAws_restJson1InvalidTypeExceptionResponse(parsedOutput, context);
4116
3080
  case "LimitExceededException":
4117
3081
  case "com.amazonaws.elasticsearchservice#LimitExceededException":
4118
- response = {
4119
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
4120
- name: errorCode,
4121
- $metadata: deserializeMetadata(output),
4122
- };
4123
- break;
3082
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
4124
3083
  case "ResourceNotFoundException":
4125
3084
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
4126
- response = {
4127
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4128
- name: errorCode,
4129
- $metadata: deserializeMetadata(output),
4130
- };
4131
- break;
3085
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4132
3086
  case "ValidationException":
4133
3087
  case "com.amazonaws.elasticsearchservice#ValidationException":
4134
- response = {
4135
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4136
- name: errorCode,
4137
- $metadata: deserializeMetadata(output),
4138
- };
4139
- break;
3088
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4140
3089
  default:
4141
3090
  const parsedBody = parsedOutput.body;
4142
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4143
- response = {
4144
- ...parsedBody,
4145
- name: `${errorCode}`,
4146
- message: parsedBody.message || parsedBody.Message || errorCode,
3091
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
3092
+ name: parsedBody.code || parsedBody.Code || errorCode,
4147
3093
  $fault: "client",
4148
3094
  $metadata: deserializeMetadata(output),
4149
- };
3095
+ });
3096
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4150
3097
  }
4151
- const message = response.message || response.Message || errorCode;
4152
- response.message = message;
4153
- delete response.Message;
4154
- return Promise.reject(Object.assign(new Error(message), response));
4155
3098
  };
4156
3099
  const deserializeAws_restJson1UpdatePackageCommand = async (output, context) => {
4157
3100
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4179,67 +3122,31 @@ const deserializeAws_restJson1UpdatePackageCommandError = async (output, context
4179
3122
  switch (errorCode) {
4180
3123
  case "AccessDeniedException":
4181
3124
  case "com.amazonaws.elasticsearchservice#AccessDeniedException":
4182
- response = {
4183
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4184
- name: errorCode,
4185
- $metadata: deserializeMetadata(output),
4186
- };
4187
- break;
3125
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4188
3126
  case "BaseException":
4189
3127
  case "com.amazonaws.elasticsearchservice#BaseException":
4190
- response = {
4191
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
4192
- name: errorCode,
4193
- $metadata: deserializeMetadata(output),
4194
- };
4195
- break;
3128
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
4196
3129
  case "InternalException":
4197
3130
  case "com.amazonaws.elasticsearchservice#InternalException":
4198
- response = {
4199
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
4200
- name: errorCode,
4201
- $metadata: deserializeMetadata(output),
4202
- };
4203
- break;
3131
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
4204
3132
  case "LimitExceededException":
4205
3133
  case "com.amazonaws.elasticsearchservice#LimitExceededException":
4206
- response = {
4207
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
4208
- name: errorCode,
4209
- $metadata: deserializeMetadata(output),
4210
- };
4211
- break;
3134
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
4212
3135
  case "ResourceNotFoundException":
4213
3136
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
4214
- response = {
4215
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4216
- name: errorCode,
4217
- $metadata: deserializeMetadata(output),
4218
- };
4219
- break;
3137
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4220
3138
  case "ValidationException":
4221
3139
  case "com.amazonaws.elasticsearchservice#ValidationException":
4222
- response = {
4223
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4224
- name: errorCode,
4225
- $metadata: deserializeMetadata(output),
4226
- };
4227
- break;
3140
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4228
3141
  default:
4229
3142
  const parsedBody = parsedOutput.body;
4230
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4231
- response = {
4232
- ...parsedBody,
4233
- name: `${errorCode}`,
4234
- message: parsedBody.message || parsedBody.Message || errorCode,
3143
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
3144
+ name: parsedBody.code || parsedBody.Code || errorCode,
4235
3145
  $fault: "client",
4236
3146
  $metadata: deserializeMetadata(output),
4237
- };
3147
+ });
3148
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4238
3149
  }
4239
- const message = response.message || response.Message || errorCode;
4240
- response.message = message;
4241
- delete response.Message;
4242
- return Promise.reject(Object.assign(new Error(message), response));
4243
3150
  };
4244
3151
  const deserializeAws_restJson1UpgradeElasticsearchDomainCommand = async (output, context) => {
4245
3152
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4279,210 +3186,163 @@ const deserializeAws_restJson1UpgradeElasticsearchDomainCommandError = async (ou
4279
3186
  switch (errorCode) {
4280
3187
  case "BaseException":
4281
3188
  case "com.amazonaws.elasticsearchservice#BaseException":
4282
- response = {
4283
- ...(await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context)),
4284
- name: errorCode,
4285
- $metadata: deserializeMetadata(output),
4286
- };
4287
- break;
3189
+ throw await deserializeAws_restJson1BaseExceptionResponse(parsedOutput, context);
4288
3190
  case "DisabledOperationException":
4289
3191
  case "com.amazonaws.elasticsearchservice#DisabledOperationException":
4290
- response = {
4291
- ...(await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context)),
4292
- name: errorCode,
4293
- $metadata: deserializeMetadata(output),
4294
- };
4295
- break;
3192
+ throw await deserializeAws_restJson1DisabledOperationExceptionResponse(parsedOutput, context);
4296
3193
  case "InternalException":
4297
3194
  case "com.amazonaws.elasticsearchservice#InternalException":
4298
- response = {
4299
- ...(await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context)),
4300
- name: errorCode,
4301
- $metadata: deserializeMetadata(output),
4302
- };
4303
- break;
3195
+ throw await deserializeAws_restJson1InternalExceptionResponse(parsedOutput, context);
4304
3196
  case "ResourceAlreadyExistsException":
4305
3197
  case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException":
4306
- response = {
4307
- ...(await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
4308
- name: errorCode,
4309
- $metadata: deserializeMetadata(output),
4310
- };
4311
- break;
3198
+ throw await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
4312
3199
  case "ResourceNotFoundException":
4313
3200
  case "com.amazonaws.elasticsearchservice#ResourceNotFoundException":
4314
- response = {
4315
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4316
- name: errorCode,
4317
- $metadata: deserializeMetadata(output),
4318
- };
4319
- break;
3201
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4320
3202
  case "ValidationException":
4321
3203
  case "com.amazonaws.elasticsearchservice#ValidationException":
4322
- response = {
4323
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4324
- name: errorCode,
4325
- $metadata: deserializeMetadata(output),
4326
- };
4327
- break;
3204
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4328
3205
  default:
4329
3206
  const parsedBody = parsedOutput.body;
4330
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4331
- response = {
4332
- ...parsedBody,
4333
- name: `${errorCode}`,
4334
- message: parsedBody.message || parsedBody.Message || errorCode,
3207
+ response = new ElasticsearchServiceServiceException_1.ElasticsearchServiceServiceException({
3208
+ name: parsedBody.code || parsedBody.Code || errorCode,
4335
3209
  $fault: "client",
4336
3210
  $metadata: deserializeMetadata(output),
4337
- };
3211
+ });
3212
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4338
3213
  }
4339
- const message = response.message || response.Message || errorCode;
4340
- response.message = message;
4341
- delete response.Message;
4342
- return Promise.reject(Object.assign(new Error(message), response));
4343
3214
  };
4344
3215
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
4345
- const contents = {
4346
- name: "AccessDeniedException",
4347
- $fault: "client",
4348
- $metadata: deserializeMetadata(parsedOutput),
4349
- message: undefined,
4350
- };
3216
+ const contents = {};
4351
3217
  const data = parsedOutput.body;
4352
3218
  if (data.message !== undefined && data.message !== null) {
4353
3219
  contents.message = smithy_client_1.expectString(data.message);
4354
3220
  }
4355
- return contents;
3221
+ const exception = new models_0_1.AccessDeniedException({
3222
+ $metadata: deserializeMetadata(parsedOutput),
3223
+ ...contents,
3224
+ });
3225
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4356
3226
  };
4357
3227
  const deserializeAws_restJson1BaseExceptionResponse = async (parsedOutput, context) => {
4358
- const contents = {
4359
- name: "BaseException",
4360
- $fault: "client",
4361
- $metadata: deserializeMetadata(parsedOutput),
4362
- message: undefined,
4363
- };
3228
+ const contents = {};
4364
3229
  const data = parsedOutput.body;
4365
3230
  if (data.message !== undefined && data.message !== null) {
4366
3231
  contents.message = smithy_client_1.expectString(data.message);
4367
3232
  }
4368
- return contents;
3233
+ const exception = new models_0_1.BaseException({
3234
+ $metadata: deserializeMetadata(parsedOutput),
3235
+ ...contents,
3236
+ });
3237
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4369
3238
  };
4370
3239
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
4371
- const contents = {
4372
- name: "ConflictException",
4373
- $fault: "client",
4374
- $metadata: deserializeMetadata(parsedOutput),
4375
- message: undefined,
4376
- };
3240
+ const contents = {};
4377
3241
  const data = parsedOutput.body;
4378
3242
  if (data.message !== undefined && data.message !== null) {
4379
3243
  contents.message = smithy_client_1.expectString(data.message);
4380
3244
  }
4381
- return contents;
3245
+ const exception = new models_0_1.ConflictException({
3246
+ $metadata: deserializeMetadata(parsedOutput),
3247
+ ...contents,
3248
+ });
3249
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4382
3250
  };
4383
3251
  const deserializeAws_restJson1DisabledOperationExceptionResponse = async (parsedOutput, context) => {
4384
- const contents = {
4385
- name: "DisabledOperationException",
4386
- $fault: "client",
4387
- $metadata: deserializeMetadata(parsedOutput),
4388
- message: undefined,
4389
- };
3252
+ const contents = {};
4390
3253
  const data = parsedOutput.body;
4391
3254
  if (data.message !== undefined && data.message !== null) {
4392
3255
  contents.message = smithy_client_1.expectString(data.message);
4393
3256
  }
4394
- return contents;
3257
+ const exception = new models_0_1.DisabledOperationException({
3258
+ $metadata: deserializeMetadata(parsedOutput),
3259
+ ...contents,
3260
+ });
3261
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4395
3262
  };
4396
3263
  const deserializeAws_restJson1InternalExceptionResponse = async (parsedOutput, context) => {
4397
- const contents = {
4398
- name: "InternalException",
4399
- $fault: "server",
4400
- $metadata: deserializeMetadata(parsedOutput),
4401
- message: undefined,
4402
- };
3264
+ const contents = {};
4403
3265
  const data = parsedOutput.body;
4404
3266
  if (data.message !== undefined && data.message !== null) {
4405
3267
  contents.message = smithy_client_1.expectString(data.message);
4406
3268
  }
4407
- return contents;
3269
+ const exception = new models_0_1.InternalException({
3270
+ $metadata: deserializeMetadata(parsedOutput),
3271
+ ...contents,
3272
+ });
3273
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4408
3274
  };
4409
3275
  const deserializeAws_restJson1InvalidPaginationTokenExceptionResponse = async (parsedOutput, context) => {
4410
- const contents = {
4411
- name: "InvalidPaginationTokenException",
4412
- $fault: "client",
4413
- $metadata: deserializeMetadata(parsedOutput),
4414
- message: undefined,
4415
- };
3276
+ const contents = {};
4416
3277
  const data = parsedOutput.body;
4417
3278
  if (data.message !== undefined && data.message !== null) {
4418
3279
  contents.message = smithy_client_1.expectString(data.message);
4419
3280
  }
4420
- return contents;
3281
+ const exception = new models_0_1.InvalidPaginationTokenException({
3282
+ $metadata: deserializeMetadata(parsedOutput),
3283
+ ...contents,
3284
+ });
3285
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4421
3286
  };
4422
3287
  const deserializeAws_restJson1InvalidTypeExceptionResponse = async (parsedOutput, context) => {
4423
- const contents = {
4424
- name: "InvalidTypeException",
4425
- $fault: "client",
4426
- $metadata: deserializeMetadata(parsedOutput),
4427
- message: undefined,
4428
- };
3288
+ const contents = {};
4429
3289
  const data = parsedOutput.body;
4430
3290
  if (data.message !== undefined && data.message !== null) {
4431
3291
  contents.message = smithy_client_1.expectString(data.message);
4432
3292
  }
4433
- return contents;
3293
+ const exception = new models_0_1.InvalidTypeException({
3294
+ $metadata: deserializeMetadata(parsedOutput),
3295
+ ...contents,
3296
+ });
3297
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4434
3298
  };
4435
3299
  const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
4436
- const contents = {
4437
- name: "LimitExceededException",
4438
- $fault: "client",
4439
- $metadata: deserializeMetadata(parsedOutput),
4440
- message: undefined,
4441
- };
3300
+ const contents = {};
4442
3301
  const data = parsedOutput.body;
4443
3302
  if (data.message !== undefined && data.message !== null) {
4444
3303
  contents.message = smithy_client_1.expectString(data.message);
4445
3304
  }
4446
- return contents;
3305
+ const exception = new models_0_1.LimitExceededException({
3306
+ $metadata: deserializeMetadata(parsedOutput),
3307
+ ...contents,
3308
+ });
3309
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4447
3310
  };
4448
3311
  const deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse = async (parsedOutput, context) => {
4449
- const contents = {
4450
- name: "ResourceAlreadyExistsException",
4451
- $fault: "client",
4452
- $metadata: deserializeMetadata(parsedOutput),
4453
- message: undefined,
4454
- };
3312
+ const contents = {};
4455
3313
  const data = parsedOutput.body;
4456
3314
  if (data.message !== undefined && data.message !== null) {
4457
3315
  contents.message = smithy_client_1.expectString(data.message);
4458
3316
  }
4459
- return contents;
3317
+ const exception = new models_0_1.ResourceAlreadyExistsException({
3318
+ $metadata: deserializeMetadata(parsedOutput),
3319
+ ...contents,
3320
+ });
3321
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4460
3322
  };
4461
3323
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
4462
- const contents = {
4463
- name: "ResourceNotFoundException",
4464
- $fault: "client",
4465
- $metadata: deserializeMetadata(parsedOutput),
4466
- message: undefined,
4467
- };
3324
+ const contents = {};
4468
3325
  const data = parsedOutput.body;
4469
3326
  if (data.message !== undefined && data.message !== null) {
4470
3327
  contents.message = smithy_client_1.expectString(data.message);
4471
3328
  }
4472
- return contents;
3329
+ const exception = new models_0_1.ResourceNotFoundException({
3330
+ $metadata: deserializeMetadata(parsedOutput),
3331
+ ...contents,
3332
+ });
3333
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4473
3334
  };
4474
3335
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
4475
- const contents = {
4476
- name: "ValidationException",
4477
- $fault: "client",
4478
- $metadata: deserializeMetadata(parsedOutput),
4479
- message: undefined,
4480
- };
3336
+ const contents = {};
4481
3337
  const data = parsedOutput.body;
4482
3338
  if (data.message !== undefined && data.message !== null) {
4483
3339
  contents.message = smithy_client_1.expectString(data.message);
4484
3340
  }
4485
- return contents;
3341
+ const exception = new models_0_1.ValidationException({
3342
+ $metadata: deserializeMetadata(parsedOutput),
3343
+ ...contents,
3344
+ });
3345
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4486
3346
  };
4487
3347
  const serializeAws_restJson1AdvancedOptions = (input, context) => {
4488
3348
  return Object.entries(input).reduce((acc, [key, value]) => {
@@ -4821,7 +3681,7 @@ const deserializeAws_restJson1AdditionalLimit = (output, context) => {
4821
3681
  };
4822
3682
  };
4823
3683
  const deserializeAws_restJson1AdditionalLimitList = (output, context) => {
4824
- return (output || [])
3684
+ const retVal = (output || [])
4825
3685
  .filter((e) => e != null)
4826
3686
  .map((entry) => {
4827
3687
  if (entry === null) {
@@ -4829,6 +3689,7 @@ const deserializeAws_restJson1AdditionalLimitList = (output, context) => {
4829
3689
  }
4830
3690
  return deserializeAws_restJson1AdditionalLimit(entry, context);
4831
3691
  });
3692
+ return retVal;
4832
3693
  };
4833
3694
  const deserializeAws_restJson1AdvancedOptions = (output, context) => {
4834
3695
  return Object.entries(output).reduce((acc, [key, value]) => {
@@ -4890,7 +3751,7 @@ const deserializeAws_restJson1AutoTuneDetails = (output, context) => {
4890
3751
  };
4891
3752
  };
4892
3753
  const deserializeAws_restJson1AutoTuneList = (output, context) => {
4893
- return (output || [])
3754
+ const retVal = (output || [])
4894
3755
  .filter((e) => e != null)
4895
3756
  .map((entry) => {
4896
3757
  if (entry === null) {
@@ -4898,6 +3759,7 @@ const deserializeAws_restJson1AutoTuneList = (output, context) => {
4898
3759
  }
4899
3760
  return deserializeAws_restJson1AutoTune(entry, context);
4900
3761
  });
3762
+ return retVal;
4901
3763
  };
4902
3764
  const deserializeAws_restJson1AutoTuneMaintenanceSchedule = (output, context) => {
4903
3765
  return {
@@ -4911,7 +3773,7 @@ const deserializeAws_restJson1AutoTuneMaintenanceSchedule = (output, context) =>
4911
3773
  };
4912
3774
  };
4913
3775
  const deserializeAws_restJson1AutoTuneMaintenanceScheduleList = (output, context) => {
4914
- return (output || [])
3776
+ const retVal = (output || [])
4915
3777
  .filter((e) => e != null)
4916
3778
  .map((entry) => {
4917
3779
  if (entry === null) {
@@ -4919,6 +3781,7 @@ const deserializeAws_restJson1AutoTuneMaintenanceScheduleList = (output, context
4919
3781
  }
4920
3782
  return deserializeAws_restJson1AutoTuneMaintenanceSchedule(entry, context);
4921
3783
  });
3784
+ return retVal;
4922
3785
  };
4923
3786
  const deserializeAws_restJson1AutoTuneOptions = (output, context) => {
4924
3787
  return {
@@ -4976,7 +3839,7 @@ const deserializeAws_restJson1ChangeProgressStage = (output, context) => {
4976
3839
  };
4977
3840
  };
4978
3841
  const deserializeAws_restJson1ChangeProgressStageList = (output, context) => {
4979
- return (output || [])
3842
+ const retVal = (output || [])
4980
3843
  .filter((e) => e != null)
4981
3844
  .map((entry) => {
4982
3845
  if (entry === null) {
@@ -4984,6 +3847,7 @@ const deserializeAws_restJson1ChangeProgressStageList = (output, context) => {
4984
3847
  }
4985
3848
  return deserializeAws_restJson1ChangeProgressStage(entry, context);
4986
3849
  });
3850
+ return retVal;
4987
3851
  };
4988
3852
  const deserializeAws_restJson1ChangeProgressStatusDetails = (output, context) => {
4989
3853
  return {
@@ -5028,7 +3892,7 @@ const deserializeAws_restJson1ColdStorageOptions = (output, context) => {
5028
3892
  };
5029
3893
  };
5030
3894
  const deserializeAws_restJson1CompatibleElasticsearchVersionsList = (output, context) => {
5031
- return (output || [])
3895
+ const retVal = (output || [])
5032
3896
  .filter((e) => e != null)
5033
3897
  .map((entry) => {
5034
3898
  if (entry === null) {
@@ -5036,6 +3900,7 @@ const deserializeAws_restJson1CompatibleElasticsearchVersionsList = (output, con
5036
3900
  }
5037
3901
  return deserializeAws_restJson1CompatibleVersionsMap(entry, context);
5038
3902
  });
3903
+ return retVal;
5039
3904
  };
5040
3905
  const deserializeAws_restJson1CompatibleVersionsMap = (output, context) => {
5041
3906
  return {
@@ -5071,7 +3936,7 @@ const deserializeAws_restJson1DomainInfo = (output, context) => {
5071
3936
  };
5072
3937
  };
5073
3938
  const deserializeAws_restJson1DomainInfoList = (output, context) => {
5074
- return (output || [])
3939
+ const retVal = (output || [])
5075
3940
  .filter((e) => e != null)
5076
3941
  .map((entry) => {
5077
3942
  if (entry === null) {
@@ -5079,6 +3944,7 @@ const deserializeAws_restJson1DomainInfoList = (output, context) => {
5079
3944
  }
5080
3945
  return deserializeAws_restJson1DomainInfo(entry, context);
5081
3946
  });
3947
+ return retVal;
5082
3948
  };
5083
3949
  const deserializeAws_restJson1DomainInformation = (output, context) => {
5084
3950
  return {
@@ -5105,7 +3971,7 @@ const deserializeAws_restJson1DomainPackageDetails = (output, context) => {
5105
3971
  };
5106
3972
  };
5107
3973
  const deserializeAws_restJson1DomainPackageDetailsList = (output, context) => {
5108
- return (output || [])
3974
+ const retVal = (output || [])
5109
3975
  .filter((e) => e != null)
5110
3976
  .map((entry) => {
5111
3977
  if (entry === null) {
@@ -5113,6 +3979,7 @@ const deserializeAws_restJson1DomainPackageDetailsList = (output, context) => {
5113
3979
  }
5114
3980
  return deserializeAws_restJson1DomainPackageDetails(entry, context);
5115
3981
  });
3982
+ return retVal;
5116
3983
  };
5117
3984
  const deserializeAws_restJson1DryRunResults = (output, context) => {
5118
3985
  return {
@@ -5282,7 +4149,7 @@ const deserializeAws_restJson1ElasticsearchDomainStatus = (output, context) => {
5282
4149
  };
5283
4150
  };
5284
4151
  const deserializeAws_restJson1ElasticsearchDomainStatusList = (output, context) => {
5285
- return (output || [])
4152
+ const retVal = (output || [])
5286
4153
  .filter((e) => e != null)
5287
4154
  .map((entry) => {
5288
4155
  if (entry === null) {
@@ -5290,9 +4157,10 @@ const deserializeAws_restJson1ElasticsearchDomainStatusList = (output, context)
5290
4157
  }
5291
4158
  return deserializeAws_restJson1ElasticsearchDomainStatus(entry, context);
5292
4159
  });
4160
+ return retVal;
5293
4161
  };
5294
4162
  const deserializeAws_restJson1ElasticsearchInstanceTypeList = (output, context) => {
5295
- return (output || [])
4163
+ const retVal = (output || [])
5296
4164
  .filter((e) => e != null)
5297
4165
  .map((entry) => {
5298
4166
  if (entry === null) {
@@ -5300,9 +4168,10 @@ const deserializeAws_restJson1ElasticsearchInstanceTypeList = (output, context)
5300
4168
  }
5301
4169
  return smithy_client_1.expectString(entry);
5302
4170
  });
4171
+ return retVal;
5303
4172
  };
5304
4173
  const deserializeAws_restJson1ElasticsearchVersionList = (output, context) => {
5305
- return (output || [])
4174
+ const retVal = (output || [])
5306
4175
  .filter((e) => e != null)
5307
4176
  .map((entry) => {
5308
4177
  if (entry === null) {
@@ -5310,6 +4179,7 @@ const deserializeAws_restJson1ElasticsearchVersionList = (output, context) => {
5310
4179
  }
5311
4180
  return smithy_client_1.expectString(entry);
5312
4181
  });
4182
+ return retVal;
5313
4183
  };
5314
4184
  const deserializeAws_restJson1ElasticsearchVersionStatus = (output, context) => {
5315
4185
  return {
@@ -5367,7 +4237,7 @@ const deserializeAws_restJson1InboundCrossClusterSearchConnection = (output, con
5367
4237
  };
5368
4238
  };
5369
4239
  const deserializeAws_restJson1InboundCrossClusterSearchConnections = (output, context) => {
5370
- return (output || [])
4240
+ const retVal = (output || [])
5371
4241
  .filter((e) => e != null)
5372
4242
  .map((entry) => {
5373
4243
  if (entry === null) {
@@ -5375,6 +4245,7 @@ const deserializeAws_restJson1InboundCrossClusterSearchConnections = (output, co
5375
4245
  }
5376
4246
  return deserializeAws_restJson1InboundCrossClusterSearchConnection(entry, context);
5377
4247
  });
4248
+ return retVal;
5378
4249
  };
5379
4250
  const deserializeAws_restJson1InboundCrossClusterSearchConnectionStatus = (output, context) => {
5380
4251
  return {
@@ -5396,7 +4267,7 @@ const deserializeAws_restJson1InstanceLimits = (output, context) => {
5396
4267
  };
5397
4268
  };
5398
4269
  const deserializeAws_restJson1Issues = (output, context) => {
5399
- return (output || [])
4270
+ const retVal = (output || [])
5400
4271
  .filter((e) => e != null)
5401
4272
  .map((entry) => {
5402
4273
  if (entry === null) {
@@ -5404,6 +4275,7 @@ const deserializeAws_restJson1Issues = (output, context) => {
5404
4275
  }
5405
4276
  return smithy_client_1.expectString(entry);
5406
4277
  });
4278
+ return retVal;
5407
4279
  };
5408
4280
  const deserializeAws_restJson1Limits = (output, context) => {
5409
4281
  return {
@@ -5430,7 +4302,7 @@ const deserializeAws_restJson1LimitsByRole = (output, context) => {
5430
4302
  }, {});
5431
4303
  };
5432
4304
  const deserializeAws_restJson1LimitValueList = (output, context) => {
5433
- return (output || [])
4305
+ const retVal = (output || [])
5434
4306
  .filter((e) => e != null)
5435
4307
  .map((entry) => {
5436
4308
  if (entry === null) {
@@ -5438,6 +4310,7 @@ const deserializeAws_restJson1LimitValueList = (output, context) => {
5438
4310
  }
5439
4311
  return smithy_client_1.expectString(entry);
5440
4312
  });
4313
+ return retVal;
5441
4314
  };
5442
4315
  const deserializeAws_restJson1LogPublishingOption = (output, context) => {
5443
4316
  return {
@@ -5510,7 +4383,7 @@ const deserializeAws_restJson1OutboundCrossClusterSearchConnection = (output, co
5510
4383
  };
5511
4384
  };
5512
4385
  const deserializeAws_restJson1OutboundCrossClusterSearchConnections = (output, context) => {
5513
- return (output || [])
4386
+ const retVal = (output || [])
5514
4387
  .filter((e) => e != null)
5515
4388
  .map((entry) => {
5516
4389
  if (entry === null) {
@@ -5518,6 +4391,7 @@ const deserializeAws_restJson1OutboundCrossClusterSearchConnections = (output, c
5518
4391
  }
5519
4392
  return deserializeAws_restJson1OutboundCrossClusterSearchConnection(entry, context);
5520
4393
  });
4394
+ return retVal;
5521
4395
  };
5522
4396
  const deserializeAws_restJson1OutboundCrossClusterSearchConnectionStatus = (output, context) => {
5523
4397
  return {
@@ -5545,7 +4419,7 @@ const deserializeAws_restJson1PackageDetails = (output, context) => {
5545
4419
  };
5546
4420
  };
5547
4421
  const deserializeAws_restJson1PackageDetailsList = (output, context) => {
5548
- return (output || [])
4422
+ const retVal = (output || [])
5549
4423
  .filter((e) => e != null)
5550
4424
  .map((entry) => {
5551
4425
  if (entry === null) {
@@ -5553,6 +4427,7 @@ const deserializeAws_restJson1PackageDetailsList = (output, context) => {
5553
4427
  }
5554
4428
  return deserializeAws_restJson1PackageDetails(entry, context);
5555
4429
  });
4430
+ return retVal;
5556
4431
  };
5557
4432
  const deserializeAws_restJson1PackageVersionHistory = (output, context) => {
5558
4433
  return {
@@ -5564,7 +4439,7 @@ const deserializeAws_restJson1PackageVersionHistory = (output, context) => {
5564
4439
  };
5565
4440
  };
5566
4441
  const deserializeAws_restJson1PackageVersionHistoryList = (output, context) => {
5567
- return (output || [])
4442
+ const retVal = (output || [])
5568
4443
  .filter((e) => e != null)
5569
4444
  .map((entry) => {
5570
4445
  if (entry === null) {
@@ -5572,6 +4447,7 @@ const deserializeAws_restJson1PackageVersionHistoryList = (output, context) => {
5572
4447
  }
5573
4448
  return deserializeAws_restJson1PackageVersionHistory(entry, context);
5574
4449
  });
4450
+ return retVal;
5575
4451
  };
5576
4452
  const deserializeAws_restJson1RecurringCharge = (output, context) => {
5577
4453
  return {
@@ -5580,7 +4456,7 @@ const deserializeAws_restJson1RecurringCharge = (output, context) => {
5580
4456
  };
5581
4457
  };
5582
4458
  const deserializeAws_restJson1RecurringChargeList = (output, context) => {
5583
- return (output || [])
4459
+ const retVal = (output || [])
5584
4460
  .filter((e) => e != null)
5585
4461
  .map((entry) => {
5586
4462
  if (entry === null) {
@@ -5588,6 +4464,7 @@ const deserializeAws_restJson1RecurringChargeList = (output, context) => {
5588
4464
  }
5589
4465
  return deserializeAws_restJson1RecurringCharge(entry, context);
5590
4466
  });
4467
+ return retVal;
5591
4468
  };
5592
4469
  const deserializeAws_restJson1ReservedElasticsearchInstance = (output, context) => {
5593
4470
  return {
@@ -5611,7 +4488,7 @@ const deserializeAws_restJson1ReservedElasticsearchInstance = (output, context)
5611
4488
  };
5612
4489
  };
5613
4490
  const deserializeAws_restJson1ReservedElasticsearchInstanceList = (output, context) => {
5614
- return (output || [])
4491
+ const retVal = (output || [])
5615
4492
  .filter((e) => e != null)
5616
4493
  .map((entry) => {
5617
4494
  if (entry === null) {
@@ -5619,6 +4496,7 @@ const deserializeAws_restJson1ReservedElasticsearchInstanceList = (output, conte
5619
4496
  }
5620
4497
  return deserializeAws_restJson1ReservedElasticsearchInstance(entry, context);
5621
4498
  });
4499
+ return retVal;
5622
4500
  };
5623
4501
  const deserializeAws_restJson1ReservedElasticsearchInstanceOffering = (output, context) => {
5624
4502
  return {
@@ -5635,7 +4513,7 @@ const deserializeAws_restJson1ReservedElasticsearchInstanceOffering = (output, c
5635
4513
  };
5636
4514
  };
5637
4515
  const deserializeAws_restJson1ReservedElasticsearchInstanceOfferingList = (output, context) => {
5638
- return (output || [])
4516
+ const retVal = (output || [])
5639
4517
  .filter((e) => e != null)
5640
4518
  .map((entry) => {
5641
4519
  if (entry === null) {
@@ -5643,6 +4521,7 @@ const deserializeAws_restJson1ReservedElasticsearchInstanceOfferingList = (outpu
5643
4521
  }
5644
4522
  return deserializeAws_restJson1ReservedElasticsearchInstanceOffering(entry, context);
5645
4523
  });
4524
+ return retVal;
5646
4525
  };
5647
4526
  const deserializeAws_restJson1SAMLIdp = (output, context) => {
5648
4527
  return {
@@ -5718,7 +4597,7 @@ const deserializeAws_restJson1StorageTypeLimit = (output, context) => {
5718
4597
  };
5719
4598
  };
5720
4599
  const deserializeAws_restJson1StorageTypeLimitList = (output, context) => {
5721
- return (output || [])
4600
+ const retVal = (output || [])
5722
4601
  .filter((e) => e != null)
5723
4602
  .map((entry) => {
5724
4603
  if (entry === null) {
@@ -5726,9 +4605,10 @@ const deserializeAws_restJson1StorageTypeLimitList = (output, context) => {
5726
4605
  }
5727
4606
  return deserializeAws_restJson1StorageTypeLimit(entry, context);
5728
4607
  });
4608
+ return retVal;
5729
4609
  };
5730
4610
  const deserializeAws_restJson1StorageTypeList = (output, context) => {
5731
- return (output || [])
4611
+ const retVal = (output || [])
5732
4612
  .filter((e) => e != null)
5733
4613
  .map((entry) => {
5734
4614
  if (entry === null) {
@@ -5736,9 +4616,10 @@ const deserializeAws_restJson1StorageTypeList = (output, context) => {
5736
4616
  }
5737
4617
  return deserializeAws_restJson1StorageType(entry, context);
5738
4618
  });
4619
+ return retVal;
5739
4620
  };
5740
4621
  const deserializeAws_restJson1StringList = (output, context) => {
5741
- return (output || [])
4622
+ const retVal = (output || [])
5742
4623
  .filter((e) => e != null)
5743
4624
  .map((entry) => {
5744
4625
  if (entry === null) {
@@ -5746,6 +4627,7 @@ const deserializeAws_restJson1StringList = (output, context) => {
5746
4627
  }
5747
4628
  return smithy_client_1.expectString(entry);
5748
4629
  });
4630
+ return retVal;
5749
4631
  };
5750
4632
  const deserializeAws_restJson1Tag = (output, context) => {
5751
4633
  return {
@@ -5754,7 +4636,7 @@ const deserializeAws_restJson1Tag = (output, context) => {
5754
4636
  };
5755
4637
  };
5756
4638
  const deserializeAws_restJson1TagList = (output, context) => {
5757
- return (output || [])
4639
+ const retVal = (output || [])
5758
4640
  .filter((e) => e != null)
5759
4641
  .map((entry) => {
5760
4642
  if (entry === null) {
@@ -5762,6 +4644,7 @@ const deserializeAws_restJson1TagList = (output, context) => {
5762
4644
  }
5763
4645
  return deserializeAws_restJson1Tag(entry, context);
5764
4646
  });
4647
+ return retVal;
5765
4648
  };
5766
4649
  const deserializeAws_restJson1UpgradeHistory = (output, context) => {
5767
4650
  return {
@@ -5776,7 +4659,7 @@ const deserializeAws_restJson1UpgradeHistory = (output, context) => {
5776
4659
  };
5777
4660
  };
5778
4661
  const deserializeAws_restJson1UpgradeHistoryList = (output, context) => {
5779
- return (output || [])
4662
+ const retVal = (output || [])
5780
4663
  .filter((e) => e != null)
5781
4664
  .map((entry) => {
5782
4665
  if (entry === null) {
@@ -5784,6 +4667,7 @@ const deserializeAws_restJson1UpgradeHistoryList = (output, context) => {
5784
4667
  }
5785
4668
  return deserializeAws_restJson1UpgradeHistory(entry, context);
5786
4669
  });
4670
+ return retVal;
5787
4671
  };
5788
4672
  const deserializeAws_restJson1UpgradeStepItem = (output, context) => {
5789
4673
  return {
@@ -5796,7 +4680,7 @@ const deserializeAws_restJson1UpgradeStepItem = (output, context) => {
5796
4680
  };
5797
4681
  };
5798
4682
  const deserializeAws_restJson1UpgradeStepsList = (output, context) => {
5799
- return (output || [])
4683
+ const retVal = (output || [])
5800
4684
  .filter((e) => e != null)
5801
4685
  .map((entry) => {
5802
4686
  if (entry === null) {
@@ -5804,6 +4688,7 @@ const deserializeAws_restJson1UpgradeStepsList = (output, context) => {
5804
4688
  }
5805
4689
  return deserializeAws_restJson1UpgradeStepItem(entry, context);
5806
4690
  });
4691
+ return retVal;
5807
4692
  };
5808
4693
  const deserializeAws_restJson1VPCDerivedInfo = (output, context) => {
5809
4694
  return {