@aws-sdk/client-pinpoint-email 3.52.0 → 3.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1DeleteDedicatedIpPoolCommand = exports.deseriali
4
4
  exports.deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1SendEmailCommand = exports.deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommand = exports.deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = exports.deserializeAws_restJson1PutEmailIdentityDkimAttributesCommand = exports.deserializeAws_restJson1PutDeliverabilityDashboardOptionCommand = exports.deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommand = exports.deserializeAws_restJson1PutDedicatedIpInPoolCommand = exports.deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = exports.deserializeAws_restJson1PutConfigurationSetSendingOptionsCommand = exports.deserializeAws_restJson1PutConfigurationSetReputationOptionsCommand = exports.deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = exports.deserializeAws_restJson1PutAccountSendingAttributesCommand = exports.deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListEmailIdentitiesCommand = exports.deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommand = exports.deserializeAws_restJson1ListDeliverabilityTestReportsCommand = exports.deserializeAws_restJson1ListDedicatedIpPoolsCommand = exports.deserializeAws_restJson1ListConfigurationSetsCommand = exports.deserializeAws_restJson1GetEmailIdentityCommand = exports.deserializeAws_restJson1GetDomainStatisticsReportCommand = exports.deserializeAws_restJson1GetDomainDeliverabilityCampaignCommand = exports.deserializeAws_restJson1GetDeliverabilityTestReportCommand = exports.deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommand = exports.deserializeAws_restJson1GetDedicatedIpsCommand = exports.deserializeAws_restJson1GetDedicatedIpCommand = exports.deserializeAws_restJson1GetConfigurationSetEventDestinationsCommand = exports.deserializeAws_restJson1GetConfigurationSetCommand = exports.deserializeAws_restJson1GetBlacklistReportsCommand = exports.deserializeAws_restJson1GetAccountCommand = exports.deserializeAws_restJson1DeleteEmailIdentityCommand = 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 models_0_1 = require("../models/models_0");
8
+ const PinpointEmailServiceException_1 = require("../models/PinpointEmailServiceException");
7
9
  const serializeAws_restJson1CreateConfigurationSetCommand = async (input, context) => {
8
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
11
  const headers = {
@@ -1200,67 +1202,31 @@ const deserializeAws_restJson1CreateConfigurationSetCommandError = async (output
1200
1202
  switch (errorCode) {
1201
1203
  case "AlreadyExistsException":
1202
1204
  case "com.amazonaws.pinpointemail#AlreadyExistsException":
1203
- response = {
1204
- ...(await deserializeAws_restJson1AlreadyExistsExceptionResponse(parsedOutput, context)),
1205
- name: errorCode,
1206
- $metadata: deserializeMetadata(output),
1207
- };
1208
- break;
1205
+ throw await deserializeAws_restJson1AlreadyExistsExceptionResponse(parsedOutput, context);
1209
1206
  case "BadRequestException":
1210
1207
  case "com.amazonaws.pinpointemail#BadRequestException":
1211
- response = {
1212
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1213
- name: errorCode,
1214
- $metadata: deserializeMetadata(output),
1215
- };
1216
- break;
1208
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1217
1209
  case "ConcurrentModificationException":
1218
1210
  case "com.amazonaws.pinpointemail#ConcurrentModificationException":
1219
- response = {
1220
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1221
- name: errorCode,
1222
- $metadata: deserializeMetadata(output),
1223
- };
1224
- break;
1211
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
1225
1212
  case "LimitExceededException":
1226
1213
  case "com.amazonaws.pinpointemail#LimitExceededException":
1227
- response = {
1228
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1229
- name: errorCode,
1230
- $metadata: deserializeMetadata(output),
1231
- };
1232
- break;
1214
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1233
1215
  case "NotFoundException":
1234
1216
  case "com.amazonaws.pinpointemail#NotFoundException":
1235
- response = {
1236
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1237
- name: errorCode,
1238
- $metadata: deserializeMetadata(output),
1239
- };
1240
- break;
1217
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1241
1218
  case "TooManyRequestsException":
1242
1219
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1243
- response = {
1244
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1245
- name: errorCode,
1246
- $metadata: deserializeMetadata(output),
1247
- };
1248
- break;
1220
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1249
1221
  default:
1250
1222
  const parsedBody = parsedOutput.body;
1251
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1252
- response = {
1253
- ...parsedBody,
1254
- name: `${errorCode}`,
1255
- message: parsedBody.message || parsedBody.Message || errorCode,
1223
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1224
+ name: parsedBody.code || parsedBody.Code || errorCode,
1256
1225
  $fault: "client",
1257
1226
  $metadata: deserializeMetadata(output),
1258
- };
1227
+ });
1228
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1259
1229
  }
1260
- const message = response.message || response.Message || errorCode;
1261
- response.message = message;
1262
- delete response.Message;
1263
- return Promise.reject(Object.assign(new Error(message), response));
1264
1230
  };
1265
1231
  const deserializeAws_restJson1CreateConfigurationSetEventDestinationCommand = async (output, context) => {
1266
1232
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1284,59 +1250,28 @@ const deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError
1284
1250
  switch (errorCode) {
1285
1251
  case "AlreadyExistsException":
1286
1252
  case "com.amazonaws.pinpointemail#AlreadyExistsException":
1287
- response = {
1288
- ...(await deserializeAws_restJson1AlreadyExistsExceptionResponse(parsedOutput, context)),
1289
- name: errorCode,
1290
- $metadata: deserializeMetadata(output),
1291
- };
1292
- break;
1253
+ throw await deserializeAws_restJson1AlreadyExistsExceptionResponse(parsedOutput, context);
1293
1254
  case "BadRequestException":
1294
1255
  case "com.amazonaws.pinpointemail#BadRequestException":
1295
- response = {
1296
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1297
- name: errorCode,
1298
- $metadata: deserializeMetadata(output),
1299
- };
1300
- break;
1256
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1301
1257
  case "LimitExceededException":
1302
1258
  case "com.amazonaws.pinpointemail#LimitExceededException":
1303
- response = {
1304
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1305
- name: errorCode,
1306
- $metadata: deserializeMetadata(output),
1307
- };
1308
- break;
1259
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1309
1260
  case "NotFoundException":
1310
1261
  case "com.amazonaws.pinpointemail#NotFoundException":
1311
- response = {
1312
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1313
- name: errorCode,
1314
- $metadata: deserializeMetadata(output),
1315
- };
1316
- break;
1262
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1317
1263
  case "TooManyRequestsException":
1318
1264
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1319
- response = {
1320
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1321
- name: errorCode,
1322
- $metadata: deserializeMetadata(output),
1323
- };
1324
- break;
1265
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1325
1266
  default:
1326
1267
  const parsedBody = parsedOutput.body;
1327
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1328
- response = {
1329
- ...parsedBody,
1330
- name: `${errorCode}`,
1331
- message: parsedBody.message || parsedBody.Message || errorCode,
1268
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1269
+ name: parsedBody.code || parsedBody.Code || errorCode,
1332
1270
  $fault: "client",
1333
1271
  $metadata: deserializeMetadata(output),
1334
- };
1272
+ });
1273
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1335
1274
  }
1336
- const message = response.message || response.Message || errorCode;
1337
- response.message = message;
1338
- delete response.Message;
1339
- return Promise.reject(Object.assign(new Error(message), response));
1340
1275
  };
1341
1276
  const deserializeAws_restJson1CreateDedicatedIpPoolCommand = async (output, context) => {
1342
1277
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1360,59 +1295,28 @@ const deserializeAws_restJson1CreateDedicatedIpPoolCommandError = async (output,
1360
1295
  switch (errorCode) {
1361
1296
  case "AlreadyExistsException":
1362
1297
  case "com.amazonaws.pinpointemail#AlreadyExistsException":
1363
- response = {
1364
- ...(await deserializeAws_restJson1AlreadyExistsExceptionResponse(parsedOutput, context)),
1365
- name: errorCode,
1366
- $metadata: deserializeMetadata(output),
1367
- };
1368
- break;
1298
+ throw await deserializeAws_restJson1AlreadyExistsExceptionResponse(parsedOutput, context);
1369
1299
  case "BadRequestException":
1370
1300
  case "com.amazonaws.pinpointemail#BadRequestException":
1371
- response = {
1372
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1373
- name: errorCode,
1374
- $metadata: deserializeMetadata(output),
1375
- };
1376
- break;
1301
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1377
1302
  case "ConcurrentModificationException":
1378
1303
  case "com.amazonaws.pinpointemail#ConcurrentModificationException":
1379
- response = {
1380
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1381
- name: errorCode,
1382
- $metadata: deserializeMetadata(output),
1383
- };
1384
- break;
1304
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
1385
1305
  case "LimitExceededException":
1386
1306
  case "com.amazonaws.pinpointemail#LimitExceededException":
1387
- response = {
1388
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1389
- name: errorCode,
1390
- $metadata: deserializeMetadata(output),
1391
- };
1392
- break;
1307
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1393
1308
  case "TooManyRequestsException":
1394
1309
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1395
- response = {
1396
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1397
- name: errorCode,
1398
- $metadata: deserializeMetadata(output),
1399
- };
1400
- break;
1310
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1401
1311
  default:
1402
1312
  const parsedBody = parsedOutput.body;
1403
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1404
- response = {
1405
- ...parsedBody,
1406
- name: `${errorCode}`,
1407
- message: parsedBody.message || parsedBody.Message || errorCode,
1313
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1314
+ name: parsedBody.code || parsedBody.Code || errorCode,
1408
1315
  $fault: "client",
1409
1316
  $metadata: deserializeMetadata(output),
1410
- };
1317
+ });
1318
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1411
1319
  }
1412
- const message = response.message || response.Message || errorCode;
1413
- response.message = message;
1414
- delete response.Message;
1415
- return Promise.reject(Object.assign(new Error(message), response));
1416
1320
  };
1417
1321
  const deserializeAws_restJson1CreateDeliverabilityTestReportCommand = async (output, context) => {
1418
1322
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1444,91 +1348,40 @@ const deserializeAws_restJson1CreateDeliverabilityTestReportCommandError = async
1444
1348
  switch (errorCode) {
1445
1349
  case "AccountSuspendedException":
1446
1350
  case "com.amazonaws.pinpointemail#AccountSuspendedException":
1447
- response = {
1448
- ...(await deserializeAws_restJson1AccountSuspendedExceptionResponse(parsedOutput, context)),
1449
- name: errorCode,
1450
- $metadata: deserializeMetadata(output),
1451
- };
1452
- break;
1351
+ throw await deserializeAws_restJson1AccountSuspendedExceptionResponse(parsedOutput, context);
1453
1352
  case "BadRequestException":
1454
1353
  case "com.amazonaws.pinpointemail#BadRequestException":
1455
- response = {
1456
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1457
- name: errorCode,
1458
- $metadata: deserializeMetadata(output),
1459
- };
1460
- break;
1354
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1461
1355
  case "ConcurrentModificationException":
1462
1356
  case "com.amazonaws.pinpointemail#ConcurrentModificationException":
1463
- response = {
1464
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1465
- name: errorCode,
1466
- $metadata: deserializeMetadata(output),
1467
- };
1468
- break;
1357
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
1469
1358
  case "LimitExceededException":
1470
1359
  case "com.amazonaws.pinpointemail#LimitExceededException":
1471
- response = {
1472
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1473
- name: errorCode,
1474
- $metadata: deserializeMetadata(output),
1475
- };
1476
- break;
1360
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1477
1361
  case "MailFromDomainNotVerifiedException":
1478
1362
  case "com.amazonaws.pinpointemail#MailFromDomainNotVerifiedException":
1479
- response = {
1480
- ...(await deserializeAws_restJson1MailFromDomainNotVerifiedExceptionResponse(parsedOutput, context)),
1481
- name: errorCode,
1482
- $metadata: deserializeMetadata(output),
1483
- };
1484
- break;
1363
+ throw await deserializeAws_restJson1MailFromDomainNotVerifiedExceptionResponse(parsedOutput, context);
1485
1364
  case "MessageRejected":
1486
1365
  case "com.amazonaws.pinpointemail#MessageRejected":
1487
- response = {
1488
- ...(await deserializeAws_restJson1MessageRejectedResponse(parsedOutput, context)),
1489
- name: errorCode,
1490
- $metadata: deserializeMetadata(output),
1491
- };
1492
- break;
1366
+ throw await deserializeAws_restJson1MessageRejectedResponse(parsedOutput, context);
1493
1367
  case "NotFoundException":
1494
1368
  case "com.amazonaws.pinpointemail#NotFoundException":
1495
- response = {
1496
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1497
- name: errorCode,
1498
- $metadata: deserializeMetadata(output),
1499
- };
1500
- break;
1369
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1501
1370
  case "SendingPausedException":
1502
1371
  case "com.amazonaws.pinpointemail#SendingPausedException":
1503
- response = {
1504
- ...(await deserializeAws_restJson1SendingPausedExceptionResponse(parsedOutput, context)),
1505
- name: errorCode,
1506
- $metadata: deserializeMetadata(output),
1507
- };
1508
- break;
1372
+ throw await deserializeAws_restJson1SendingPausedExceptionResponse(parsedOutput, context);
1509
1373
  case "TooManyRequestsException":
1510
1374
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1511
- response = {
1512
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1513
- name: errorCode,
1514
- $metadata: deserializeMetadata(output),
1515
- };
1516
- break;
1375
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1517
1376
  default:
1518
1377
  const parsedBody = parsedOutput.body;
1519
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1520
- response = {
1521
- ...parsedBody,
1522
- name: `${errorCode}`,
1523
- message: parsedBody.message || parsedBody.Message || errorCode,
1378
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1379
+ name: parsedBody.code || parsedBody.Code || errorCode,
1524
1380
  $fault: "client",
1525
1381
  $metadata: deserializeMetadata(output),
1526
- };
1382
+ });
1383
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1527
1384
  }
1528
- const message = response.message || response.Message || errorCode;
1529
- response.message = message;
1530
- delete response.Message;
1531
- return Promise.reject(Object.assign(new Error(message), response));
1532
1385
  };
1533
1386
  const deserializeAws_restJson1CreateEmailIdentityCommand = async (output, context) => {
1534
1387
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1564,51 +1417,25 @@ const deserializeAws_restJson1CreateEmailIdentityCommandError = async (output, c
1564
1417
  switch (errorCode) {
1565
1418
  case "BadRequestException":
1566
1419
  case "com.amazonaws.pinpointemail#BadRequestException":
1567
- response = {
1568
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1569
- name: errorCode,
1570
- $metadata: deserializeMetadata(output),
1571
- };
1572
- break;
1420
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1573
1421
  case "ConcurrentModificationException":
1574
1422
  case "com.amazonaws.pinpointemail#ConcurrentModificationException":
1575
- response = {
1576
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1577
- name: errorCode,
1578
- $metadata: deserializeMetadata(output),
1579
- };
1580
- break;
1423
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
1581
1424
  case "LimitExceededException":
1582
1425
  case "com.amazonaws.pinpointemail#LimitExceededException":
1583
- response = {
1584
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1585
- name: errorCode,
1586
- $metadata: deserializeMetadata(output),
1587
- };
1588
- break;
1426
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1589
1427
  case "TooManyRequestsException":
1590
1428
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1591
- response = {
1592
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1593
- name: errorCode,
1594
- $metadata: deserializeMetadata(output),
1595
- };
1596
- break;
1429
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1597
1430
  default:
1598
1431
  const parsedBody = parsedOutput.body;
1599
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1600
- response = {
1601
- ...parsedBody,
1602
- name: `${errorCode}`,
1603
- message: parsedBody.message || parsedBody.Message || errorCode,
1432
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1433
+ name: parsedBody.code || parsedBody.Code || errorCode,
1604
1434
  $fault: "client",
1605
1435
  $metadata: deserializeMetadata(output),
1606
- };
1436
+ });
1437
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1607
1438
  }
1608
- const message = response.message || response.Message || errorCode;
1609
- response.message = message;
1610
- delete response.Message;
1611
- return Promise.reject(Object.assign(new Error(message), response));
1612
1439
  };
1613
1440
  const deserializeAws_restJson1DeleteConfigurationSetCommand = async (output, context) => {
1614
1441
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1632,51 +1459,25 @@ const deserializeAws_restJson1DeleteConfigurationSetCommandError = async (output
1632
1459
  switch (errorCode) {
1633
1460
  case "BadRequestException":
1634
1461
  case "com.amazonaws.pinpointemail#BadRequestException":
1635
- response = {
1636
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1637
- name: errorCode,
1638
- $metadata: deserializeMetadata(output),
1639
- };
1640
- break;
1462
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1641
1463
  case "ConcurrentModificationException":
1642
1464
  case "com.amazonaws.pinpointemail#ConcurrentModificationException":
1643
- response = {
1644
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1645
- name: errorCode,
1646
- $metadata: deserializeMetadata(output),
1647
- };
1648
- break;
1465
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
1649
1466
  case "NotFoundException":
1650
1467
  case "com.amazonaws.pinpointemail#NotFoundException":
1651
- response = {
1652
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1653
- name: errorCode,
1654
- $metadata: deserializeMetadata(output),
1655
- };
1656
- break;
1468
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1657
1469
  case "TooManyRequestsException":
1658
1470
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1659
- response = {
1660
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1661
- name: errorCode,
1662
- $metadata: deserializeMetadata(output),
1663
- };
1664
- break;
1471
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1665
1472
  default:
1666
1473
  const parsedBody = parsedOutput.body;
1667
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1668
- response = {
1669
- ...parsedBody,
1670
- name: `${errorCode}`,
1671
- message: parsedBody.message || parsedBody.Message || errorCode,
1474
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1475
+ name: parsedBody.code || parsedBody.Code || errorCode,
1672
1476
  $fault: "client",
1673
1477
  $metadata: deserializeMetadata(output),
1674
- };
1478
+ });
1479
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1675
1480
  }
1676
- const message = response.message || response.Message || errorCode;
1677
- response.message = message;
1678
- delete response.Message;
1679
- return Promise.reject(Object.assign(new Error(message), response));
1680
1481
  };
1681
1482
  const deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommand = async (output, context) => {
1682
1483
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1700,43 +1501,22 @@ const deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError
1700
1501
  switch (errorCode) {
1701
1502
  case "BadRequestException":
1702
1503
  case "com.amazonaws.pinpointemail#BadRequestException":
1703
- response = {
1704
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1705
- name: errorCode,
1706
- $metadata: deserializeMetadata(output),
1707
- };
1708
- break;
1504
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1709
1505
  case "NotFoundException":
1710
1506
  case "com.amazonaws.pinpointemail#NotFoundException":
1711
- response = {
1712
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1713
- name: errorCode,
1714
- $metadata: deserializeMetadata(output),
1715
- };
1716
- break;
1507
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1717
1508
  case "TooManyRequestsException":
1718
1509
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1719
- response = {
1720
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1721
- name: errorCode,
1722
- $metadata: deserializeMetadata(output),
1723
- };
1724
- break;
1510
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1725
1511
  default:
1726
1512
  const parsedBody = parsedOutput.body;
1727
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1728
- response = {
1729
- ...parsedBody,
1730
- name: `${errorCode}`,
1731
- message: parsedBody.message || parsedBody.Message || errorCode,
1513
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1514
+ name: parsedBody.code || parsedBody.Code || errorCode,
1732
1515
  $fault: "client",
1733
1516
  $metadata: deserializeMetadata(output),
1734
- };
1517
+ });
1518
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1735
1519
  }
1736
- const message = response.message || response.Message || errorCode;
1737
- response.message = message;
1738
- delete response.Message;
1739
- return Promise.reject(Object.assign(new Error(message), response));
1740
1520
  };
1741
1521
  const deserializeAws_restJson1DeleteDedicatedIpPoolCommand = async (output, context) => {
1742
1522
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1760,51 +1540,25 @@ const deserializeAws_restJson1DeleteDedicatedIpPoolCommandError = async (output,
1760
1540
  switch (errorCode) {
1761
1541
  case "BadRequestException":
1762
1542
  case "com.amazonaws.pinpointemail#BadRequestException":
1763
- response = {
1764
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1765
- name: errorCode,
1766
- $metadata: deserializeMetadata(output),
1767
- };
1768
- break;
1543
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1769
1544
  case "ConcurrentModificationException":
1770
1545
  case "com.amazonaws.pinpointemail#ConcurrentModificationException":
1771
- response = {
1772
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1773
- name: errorCode,
1774
- $metadata: deserializeMetadata(output),
1775
- };
1776
- break;
1546
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
1777
1547
  case "NotFoundException":
1778
1548
  case "com.amazonaws.pinpointemail#NotFoundException":
1779
- response = {
1780
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1781
- name: errorCode,
1782
- $metadata: deserializeMetadata(output),
1783
- };
1784
- break;
1549
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1785
1550
  case "TooManyRequestsException":
1786
1551
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1787
- response = {
1788
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1789
- name: errorCode,
1790
- $metadata: deserializeMetadata(output),
1791
- };
1792
- break;
1552
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1793
1553
  default:
1794
1554
  const parsedBody = parsedOutput.body;
1795
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1796
- response = {
1797
- ...parsedBody,
1798
- name: `${errorCode}`,
1799
- message: parsedBody.message || parsedBody.Message || errorCode,
1555
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1556
+ name: parsedBody.code || parsedBody.Code || errorCode,
1800
1557
  $fault: "client",
1801
1558
  $metadata: deserializeMetadata(output),
1802
- };
1559
+ });
1560
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1803
1561
  }
1804
- const message = response.message || response.Message || errorCode;
1805
- response.message = message;
1806
- delete response.Message;
1807
- return Promise.reject(Object.assign(new Error(message), response));
1808
1562
  };
1809
1563
  const deserializeAws_restJson1DeleteEmailIdentityCommand = async (output, context) => {
1810
1564
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1828,51 +1582,25 @@ const deserializeAws_restJson1DeleteEmailIdentityCommandError = async (output, c
1828
1582
  switch (errorCode) {
1829
1583
  case "BadRequestException":
1830
1584
  case "com.amazonaws.pinpointemail#BadRequestException":
1831
- response = {
1832
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1833
- name: errorCode,
1834
- $metadata: deserializeMetadata(output),
1835
- };
1836
- break;
1585
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1837
1586
  case "ConcurrentModificationException":
1838
1587
  case "com.amazonaws.pinpointemail#ConcurrentModificationException":
1839
- response = {
1840
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1841
- name: errorCode,
1842
- $metadata: deserializeMetadata(output),
1843
- };
1844
- break;
1588
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
1845
1589
  case "NotFoundException":
1846
1590
  case "com.amazonaws.pinpointemail#NotFoundException":
1847
- response = {
1848
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1849
- name: errorCode,
1850
- $metadata: deserializeMetadata(output),
1851
- };
1852
- break;
1591
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1853
1592
  case "TooManyRequestsException":
1854
1593
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1855
- response = {
1856
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1857
- name: errorCode,
1858
- $metadata: deserializeMetadata(output),
1859
- };
1860
- break;
1594
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1861
1595
  default:
1862
1596
  const parsedBody = parsedOutput.body;
1863
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1864
- response = {
1865
- ...parsedBody,
1866
- name: `${errorCode}`,
1867
- message: parsedBody.message || parsedBody.Message || errorCode,
1597
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1598
+ name: parsedBody.code || parsedBody.Code || errorCode,
1868
1599
  $fault: "client",
1869
1600
  $metadata: deserializeMetadata(output),
1870
- };
1601
+ });
1602
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1871
1603
  }
1872
- const message = response.message || response.Message || errorCode;
1873
- response.message = message;
1874
- delete response.Message;
1875
- return Promise.reject(Object.assign(new Error(message), response));
1876
1604
  };
1877
1605
  const deserializeAws_restJson1GetAccountCommand = async (output, context) => {
1878
1606
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1916,35 +1644,19 @@ const deserializeAws_restJson1GetAccountCommandError = async (output, context) =
1916
1644
  switch (errorCode) {
1917
1645
  case "BadRequestException":
1918
1646
  case "com.amazonaws.pinpointemail#BadRequestException":
1919
- response = {
1920
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1921
- name: errorCode,
1922
- $metadata: deserializeMetadata(output),
1923
- };
1924
- break;
1647
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1925
1648
  case "TooManyRequestsException":
1926
1649
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1927
- response = {
1928
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1929
- name: errorCode,
1930
- $metadata: deserializeMetadata(output),
1931
- };
1932
- break;
1650
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1933
1651
  default:
1934
1652
  const parsedBody = parsedOutput.body;
1935
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1936
- response = {
1937
- ...parsedBody,
1938
- name: `${errorCode}`,
1939
- message: parsedBody.message || parsedBody.Message || errorCode,
1653
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1654
+ name: parsedBody.code || parsedBody.Code || errorCode,
1940
1655
  $fault: "client",
1941
1656
  $metadata: deserializeMetadata(output),
1942
- };
1657
+ });
1658
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1943
1659
  }
1944
- const message = response.message || response.Message || errorCode;
1945
- response.message = message;
1946
- delete response.Message;
1947
- return Promise.reject(Object.assign(new Error(message), response));
1948
1660
  };
1949
1661
  const deserializeAws_restJson1GetBlacklistReportsCommand = async (output, context) => {
1950
1662
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1972,43 +1684,22 @@ const deserializeAws_restJson1GetBlacklistReportsCommandError = async (output, c
1972
1684
  switch (errorCode) {
1973
1685
  case "BadRequestException":
1974
1686
  case "com.amazonaws.pinpointemail#BadRequestException":
1975
- response = {
1976
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1977
- name: errorCode,
1978
- $metadata: deserializeMetadata(output),
1979
- };
1980
- break;
1687
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1981
1688
  case "NotFoundException":
1982
1689
  case "com.amazonaws.pinpointemail#NotFoundException":
1983
- response = {
1984
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1985
- name: errorCode,
1986
- $metadata: deserializeMetadata(output),
1987
- };
1988
- break;
1690
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1989
1691
  case "TooManyRequestsException":
1990
1692
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
1991
- response = {
1992
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1993
- name: errorCode,
1994
- $metadata: deserializeMetadata(output),
1995
- };
1996
- break;
1693
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1997
1694
  default:
1998
1695
  const parsedBody = parsedOutput.body;
1999
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2000
- response = {
2001
- ...parsedBody,
2002
- name: `${errorCode}`,
2003
- message: parsedBody.message || parsedBody.Message || errorCode,
1696
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1697
+ name: parsedBody.code || parsedBody.Code || errorCode,
2004
1698
  $fault: "client",
2005
1699
  $metadata: deserializeMetadata(output),
2006
- };
1700
+ });
1701
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2007
1702
  }
2008
- const message = response.message || response.Message || errorCode;
2009
- response.message = message;
2010
- delete response.Message;
2011
- return Promise.reject(Object.assign(new Error(message), response));
2012
1703
  };
2013
1704
  const deserializeAws_restJson1GetConfigurationSetCommand = async (output, context) => {
2014
1705
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2056,43 +1747,22 @@ const deserializeAws_restJson1GetConfigurationSetCommandError = async (output, c
2056
1747
  switch (errorCode) {
2057
1748
  case "BadRequestException":
2058
1749
  case "com.amazonaws.pinpointemail#BadRequestException":
2059
- response = {
2060
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2061
- name: errorCode,
2062
- $metadata: deserializeMetadata(output),
2063
- };
2064
- break;
1750
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2065
1751
  case "NotFoundException":
2066
1752
  case "com.amazonaws.pinpointemail#NotFoundException":
2067
- response = {
2068
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2069
- name: errorCode,
2070
- $metadata: deserializeMetadata(output),
2071
- };
2072
- break;
1753
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2073
1754
  case "TooManyRequestsException":
2074
1755
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2075
- response = {
2076
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2077
- name: errorCode,
2078
- $metadata: deserializeMetadata(output),
2079
- };
2080
- break;
1756
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2081
1757
  default:
2082
1758
  const parsedBody = parsedOutput.body;
2083
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2084
- response = {
2085
- ...parsedBody,
2086
- name: `${errorCode}`,
2087
- message: parsedBody.message || parsedBody.Message || errorCode,
1759
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1760
+ name: parsedBody.code || parsedBody.Code || errorCode,
2088
1761
  $fault: "client",
2089
1762
  $metadata: deserializeMetadata(output),
2090
- };
1763
+ });
1764
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2091
1765
  }
2092
- const message = response.message || response.Message || errorCode;
2093
- response.message = message;
2094
- delete response.Message;
2095
- return Promise.reject(Object.assign(new Error(message), response));
2096
1766
  };
2097
1767
  const deserializeAws_restJson1GetConfigurationSetEventDestinationsCommand = async (output, context) => {
2098
1768
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2120,43 +1790,22 @@ const deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError =
2120
1790
  switch (errorCode) {
2121
1791
  case "BadRequestException":
2122
1792
  case "com.amazonaws.pinpointemail#BadRequestException":
2123
- response = {
2124
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2125
- name: errorCode,
2126
- $metadata: deserializeMetadata(output),
2127
- };
2128
- break;
1793
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2129
1794
  case "NotFoundException":
2130
1795
  case "com.amazonaws.pinpointemail#NotFoundException":
2131
- response = {
2132
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2133
- name: errorCode,
2134
- $metadata: deserializeMetadata(output),
2135
- };
2136
- break;
1796
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2137
1797
  case "TooManyRequestsException":
2138
1798
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2139
- response = {
2140
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2141
- name: errorCode,
2142
- $metadata: deserializeMetadata(output),
2143
- };
2144
- break;
1799
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2145
1800
  default:
2146
1801
  const parsedBody = parsedOutput.body;
2147
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2148
- response = {
2149
- ...parsedBody,
2150
- name: `${errorCode}`,
2151
- message: parsedBody.message || parsedBody.Message || errorCode,
1802
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1803
+ name: parsedBody.code || parsedBody.Code || errorCode,
2152
1804
  $fault: "client",
2153
1805
  $metadata: deserializeMetadata(output),
2154
- };
1806
+ });
1807
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2155
1808
  }
2156
- const message = response.message || response.Message || errorCode;
2157
- response.message = message;
2158
- delete response.Message;
2159
- return Promise.reject(Object.assign(new Error(message), response));
2160
1809
  };
2161
1810
  const deserializeAws_restJson1GetDedicatedIpCommand = async (output, context) => {
2162
1811
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2184,43 +1833,22 @@ const deserializeAws_restJson1GetDedicatedIpCommandError = async (output, contex
2184
1833
  switch (errorCode) {
2185
1834
  case "BadRequestException":
2186
1835
  case "com.amazonaws.pinpointemail#BadRequestException":
2187
- response = {
2188
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2189
- name: errorCode,
2190
- $metadata: deserializeMetadata(output),
2191
- };
2192
- break;
1836
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2193
1837
  case "NotFoundException":
2194
1838
  case "com.amazonaws.pinpointemail#NotFoundException":
2195
- response = {
2196
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2197
- name: errorCode,
2198
- $metadata: deserializeMetadata(output),
2199
- };
2200
- break;
1839
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2201
1840
  case "TooManyRequestsException":
2202
1841
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2203
- response = {
2204
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2205
- name: errorCode,
2206
- $metadata: deserializeMetadata(output),
2207
- };
2208
- break;
1842
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2209
1843
  default:
2210
1844
  const parsedBody = parsedOutput.body;
2211
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2212
- response = {
2213
- ...parsedBody,
2214
- name: `${errorCode}`,
2215
- message: parsedBody.message || parsedBody.Message || errorCode,
1845
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1846
+ name: parsedBody.code || parsedBody.Code || errorCode,
2216
1847
  $fault: "client",
2217
1848
  $metadata: deserializeMetadata(output),
2218
- };
1849
+ });
1850
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2219
1851
  }
2220
- const message = response.message || response.Message || errorCode;
2221
- response.message = message;
2222
- delete response.Message;
2223
- return Promise.reject(Object.assign(new Error(message), response));
2224
1852
  };
2225
1853
  const deserializeAws_restJson1GetDedicatedIpsCommand = async (output, context) => {
2226
1854
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2252,43 +1880,22 @@ const deserializeAws_restJson1GetDedicatedIpsCommandError = async (output, conte
2252
1880
  switch (errorCode) {
2253
1881
  case "BadRequestException":
2254
1882
  case "com.amazonaws.pinpointemail#BadRequestException":
2255
- response = {
2256
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2257
- name: errorCode,
2258
- $metadata: deserializeMetadata(output),
2259
- };
2260
- break;
1883
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2261
1884
  case "NotFoundException":
2262
1885
  case "com.amazonaws.pinpointemail#NotFoundException":
2263
- response = {
2264
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2265
- name: errorCode,
2266
- $metadata: deserializeMetadata(output),
2267
- };
2268
- break;
1886
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2269
1887
  case "TooManyRequestsException":
2270
1888
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2271
- response = {
2272
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2273
- name: errorCode,
2274
- $metadata: deserializeMetadata(output),
2275
- };
2276
- break;
1889
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2277
1890
  default:
2278
1891
  const parsedBody = parsedOutput.body;
2279
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2280
- response = {
2281
- ...parsedBody,
2282
- name: `${errorCode}`,
2283
- message: parsedBody.message || parsedBody.Message || errorCode,
1892
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1893
+ name: parsedBody.code || parsedBody.Code || errorCode,
2284
1894
  $fault: "client",
2285
1895
  $metadata: deserializeMetadata(output),
2286
- };
1896
+ });
1897
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2287
1898
  }
2288
- const message = response.message || response.Message || errorCode;
2289
- response.message = message;
2290
- delete response.Message;
2291
- return Promise.reject(Object.assign(new Error(message), response));
2292
1899
  };
2293
1900
  const deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommand = async (output, context) => {
2294
1901
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2332,43 +1939,22 @@ const deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommandError = as
2332
1939
  switch (errorCode) {
2333
1940
  case "BadRequestException":
2334
1941
  case "com.amazonaws.pinpointemail#BadRequestException":
2335
- response = {
2336
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2337
- name: errorCode,
2338
- $metadata: deserializeMetadata(output),
2339
- };
2340
- break;
1942
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2341
1943
  case "LimitExceededException":
2342
1944
  case "com.amazonaws.pinpointemail#LimitExceededException":
2343
- response = {
2344
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
2345
- name: errorCode,
2346
- $metadata: deserializeMetadata(output),
2347
- };
2348
- break;
1945
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
2349
1946
  case "TooManyRequestsException":
2350
1947
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2351
- response = {
2352
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2353
- name: errorCode,
2354
- $metadata: deserializeMetadata(output),
2355
- };
2356
- break;
1948
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2357
1949
  default:
2358
1950
  const parsedBody = parsedOutput.body;
2359
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2360
- response = {
2361
- ...parsedBody,
2362
- name: `${errorCode}`,
2363
- message: parsedBody.message || parsedBody.Message || errorCode,
1951
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
1952
+ name: parsedBody.code || parsedBody.Code || errorCode,
2364
1953
  $fault: "client",
2365
1954
  $metadata: deserializeMetadata(output),
2366
- };
1955
+ });
1956
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2367
1957
  }
2368
- const message = response.message || response.Message || errorCode;
2369
- response.message = message;
2370
- delete response.Message;
2371
- return Promise.reject(Object.assign(new Error(message), response));
2372
1958
  };
2373
1959
  const deserializeAws_restJson1GetDeliverabilityTestReportCommand = async (output, context) => {
2374
1960
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2412,43 +1998,22 @@ const deserializeAws_restJson1GetDeliverabilityTestReportCommandError = async (o
2412
1998
  switch (errorCode) {
2413
1999
  case "BadRequestException":
2414
2000
  case "com.amazonaws.pinpointemail#BadRequestException":
2415
- response = {
2416
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2417
- name: errorCode,
2418
- $metadata: deserializeMetadata(output),
2419
- };
2420
- break;
2001
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2421
2002
  case "NotFoundException":
2422
2003
  case "com.amazonaws.pinpointemail#NotFoundException":
2423
- response = {
2424
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2425
- name: errorCode,
2426
- $metadata: deserializeMetadata(output),
2427
- };
2428
- break;
2004
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2429
2005
  case "TooManyRequestsException":
2430
2006
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2431
- response = {
2432
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2433
- name: errorCode,
2434
- $metadata: deserializeMetadata(output),
2435
- };
2436
- break;
2007
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2437
2008
  default:
2438
2009
  const parsedBody = parsedOutput.body;
2439
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2440
- response = {
2441
- ...parsedBody,
2442
- name: `${errorCode}`,
2443
- message: parsedBody.message || parsedBody.Message || errorCode,
2010
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2011
+ name: parsedBody.code || parsedBody.Code || errorCode,
2444
2012
  $fault: "client",
2445
2013
  $metadata: deserializeMetadata(output),
2446
- };
2014
+ });
2015
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2447
2016
  }
2448
- const message = response.message || response.Message || errorCode;
2449
- response.message = message;
2450
- delete response.Message;
2451
- return Promise.reject(Object.assign(new Error(message), response));
2452
2017
  };
2453
2018
  const deserializeAws_restJson1GetDomainDeliverabilityCampaignCommand = async (output, context) => {
2454
2019
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2476,43 +2041,22 @@ const deserializeAws_restJson1GetDomainDeliverabilityCampaignCommandError = asyn
2476
2041
  switch (errorCode) {
2477
2042
  case "BadRequestException":
2478
2043
  case "com.amazonaws.pinpointemail#BadRequestException":
2479
- response = {
2480
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2481
- name: errorCode,
2482
- $metadata: deserializeMetadata(output),
2483
- };
2484
- break;
2044
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2485
2045
  case "NotFoundException":
2486
2046
  case "com.amazonaws.pinpointemail#NotFoundException":
2487
- response = {
2488
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2489
- name: errorCode,
2490
- $metadata: deserializeMetadata(output),
2491
- };
2492
- break;
2047
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2493
2048
  case "TooManyRequestsException":
2494
2049
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2495
- response = {
2496
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2497
- name: errorCode,
2498
- $metadata: deserializeMetadata(output),
2499
- };
2500
- break;
2050
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2501
2051
  default:
2502
2052
  const parsedBody = parsedOutput.body;
2503
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2504
- response = {
2505
- ...parsedBody,
2506
- name: `${errorCode}`,
2507
- message: parsedBody.message || parsedBody.Message || errorCode,
2053
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2054
+ name: parsedBody.code || parsedBody.Code || errorCode,
2508
2055
  $fault: "client",
2509
2056
  $metadata: deserializeMetadata(output),
2510
- };
2057
+ });
2058
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2511
2059
  }
2512
- const message = response.message || response.Message || errorCode;
2513
- response.message = message;
2514
- delete response.Message;
2515
- return Promise.reject(Object.assign(new Error(message), response));
2516
2060
  };
2517
2061
  const deserializeAws_restJson1GetDomainStatisticsReportCommand = async (output, context) => {
2518
2062
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2544,43 +2088,22 @@ const deserializeAws_restJson1GetDomainStatisticsReportCommandError = async (out
2544
2088
  switch (errorCode) {
2545
2089
  case "BadRequestException":
2546
2090
  case "com.amazonaws.pinpointemail#BadRequestException":
2547
- response = {
2548
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2549
- name: errorCode,
2550
- $metadata: deserializeMetadata(output),
2551
- };
2552
- break;
2091
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2553
2092
  case "NotFoundException":
2554
2093
  case "com.amazonaws.pinpointemail#NotFoundException":
2555
- response = {
2556
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2557
- name: errorCode,
2558
- $metadata: deserializeMetadata(output),
2559
- };
2560
- break;
2094
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2561
2095
  case "TooManyRequestsException":
2562
2096
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2563
- response = {
2564
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2565
- name: errorCode,
2566
- $metadata: deserializeMetadata(output),
2567
- };
2568
- break;
2097
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2569
2098
  default:
2570
2099
  const parsedBody = parsedOutput.body;
2571
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2572
- response = {
2573
- ...parsedBody,
2574
- name: `${errorCode}`,
2575
- message: parsedBody.message || parsedBody.Message || errorCode,
2100
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2101
+ name: parsedBody.code || parsedBody.Code || errorCode,
2576
2102
  $fault: "client",
2577
2103
  $metadata: deserializeMetadata(output),
2578
- };
2104
+ });
2105
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2579
2106
  }
2580
- const message = response.message || response.Message || errorCode;
2581
- response.message = message;
2582
- delete response.Message;
2583
- return Promise.reject(Object.assign(new Error(message), response));
2584
2107
  };
2585
2108
  const deserializeAws_restJson1GetEmailIdentityCommand = async (output, context) => {
2586
2109
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2628,43 +2151,22 @@ const deserializeAws_restJson1GetEmailIdentityCommandError = async (output, cont
2628
2151
  switch (errorCode) {
2629
2152
  case "BadRequestException":
2630
2153
  case "com.amazonaws.pinpointemail#BadRequestException":
2631
- response = {
2632
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2633
- name: errorCode,
2634
- $metadata: deserializeMetadata(output),
2635
- };
2636
- break;
2154
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2637
2155
  case "NotFoundException":
2638
2156
  case "com.amazonaws.pinpointemail#NotFoundException":
2639
- response = {
2640
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2641
- name: errorCode,
2642
- $metadata: deserializeMetadata(output),
2643
- };
2644
- break;
2157
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2645
2158
  case "TooManyRequestsException":
2646
2159
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2647
- response = {
2648
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2649
- name: errorCode,
2650
- $metadata: deserializeMetadata(output),
2651
- };
2652
- break;
2160
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2653
2161
  default:
2654
2162
  const parsedBody = parsedOutput.body;
2655
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2656
- response = {
2657
- ...parsedBody,
2658
- name: `${errorCode}`,
2659
- message: parsedBody.message || parsedBody.Message || errorCode,
2163
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2164
+ name: parsedBody.code || parsedBody.Code || errorCode,
2660
2165
  $fault: "client",
2661
2166
  $metadata: deserializeMetadata(output),
2662
- };
2167
+ });
2168
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2663
2169
  }
2664
- const message = response.message || response.Message || errorCode;
2665
- response.message = message;
2666
- delete response.Message;
2667
- return Promise.reject(Object.assign(new Error(message), response));
2668
2170
  };
2669
2171
  const deserializeAws_restJson1ListConfigurationSetsCommand = async (output, context) => {
2670
2172
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2696,35 +2198,19 @@ const deserializeAws_restJson1ListConfigurationSetsCommandError = async (output,
2696
2198
  switch (errorCode) {
2697
2199
  case "BadRequestException":
2698
2200
  case "com.amazonaws.pinpointemail#BadRequestException":
2699
- response = {
2700
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2701
- name: errorCode,
2702
- $metadata: deserializeMetadata(output),
2703
- };
2704
- break;
2201
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2705
2202
  case "TooManyRequestsException":
2706
2203
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2707
- response = {
2708
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2709
- name: errorCode,
2710
- $metadata: deserializeMetadata(output),
2711
- };
2712
- break;
2204
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2713
2205
  default:
2714
2206
  const parsedBody = parsedOutput.body;
2715
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2716
- response = {
2717
- ...parsedBody,
2718
- name: `${errorCode}`,
2719
- message: parsedBody.message || parsedBody.Message || errorCode,
2207
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2208
+ name: parsedBody.code || parsedBody.Code || errorCode,
2720
2209
  $fault: "client",
2721
2210
  $metadata: deserializeMetadata(output),
2722
- };
2211
+ });
2212
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2723
2213
  }
2724
- const message = response.message || response.Message || errorCode;
2725
- response.message = message;
2726
- delete response.Message;
2727
- return Promise.reject(Object.assign(new Error(message), response));
2728
2214
  };
2729
2215
  const deserializeAws_restJson1ListDedicatedIpPoolsCommand = async (output, context) => {
2730
2216
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2756,35 +2242,19 @@ const deserializeAws_restJson1ListDedicatedIpPoolsCommandError = async (output,
2756
2242
  switch (errorCode) {
2757
2243
  case "BadRequestException":
2758
2244
  case "com.amazonaws.pinpointemail#BadRequestException":
2759
- response = {
2760
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2761
- name: errorCode,
2762
- $metadata: deserializeMetadata(output),
2763
- };
2764
- break;
2245
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2765
2246
  case "TooManyRequestsException":
2766
2247
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2767
- response = {
2768
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2769
- name: errorCode,
2770
- $metadata: deserializeMetadata(output),
2771
- };
2772
- break;
2248
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2773
2249
  default:
2774
2250
  const parsedBody = parsedOutput.body;
2775
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2776
- response = {
2777
- ...parsedBody,
2778
- name: `${errorCode}`,
2779
- message: parsedBody.message || parsedBody.Message || errorCode,
2251
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2252
+ name: parsedBody.code || parsedBody.Code || errorCode,
2780
2253
  $fault: "client",
2781
2254
  $metadata: deserializeMetadata(output),
2782
- };
2255
+ });
2256
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2783
2257
  }
2784
- const message = response.message || response.Message || errorCode;
2785
- response.message = message;
2786
- delete response.Message;
2787
- return Promise.reject(Object.assign(new Error(message), response));
2788
2258
  };
2789
2259
  const deserializeAws_restJson1ListDeliverabilityTestReportsCommand = async (output, context) => {
2790
2260
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2816,43 +2286,22 @@ const deserializeAws_restJson1ListDeliverabilityTestReportsCommandError = async
2816
2286
  switch (errorCode) {
2817
2287
  case "BadRequestException":
2818
2288
  case "com.amazonaws.pinpointemail#BadRequestException":
2819
- response = {
2820
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2821
- name: errorCode,
2822
- $metadata: deserializeMetadata(output),
2823
- };
2824
- break;
2289
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2825
2290
  case "NotFoundException":
2826
2291
  case "com.amazonaws.pinpointemail#NotFoundException":
2827
- response = {
2828
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2829
- name: errorCode,
2830
- $metadata: deserializeMetadata(output),
2831
- };
2832
- break;
2292
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2833
2293
  case "TooManyRequestsException":
2834
2294
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2835
- response = {
2836
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2837
- name: errorCode,
2838
- $metadata: deserializeMetadata(output),
2839
- };
2840
- break;
2295
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2841
2296
  default:
2842
2297
  const parsedBody = parsedOutput.body;
2843
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2844
- response = {
2845
- ...parsedBody,
2846
- name: `${errorCode}`,
2847
- message: parsedBody.message || parsedBody.Message || errorCode,
2298
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2299
+ name: parsedBody.code || parsedBody.Code || errorCode,
2848
2300
  $fault: "client",
2849
2301
  $metadata: deserializeMetadata(output),
2850
- };
2302
+ });
2303
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2851
2304
  }
2852
- const message = response.message || response.Message || errorCode;
2853
- response.message = message;
2854
- delete response.Message;
2855
- return Promise.reject(Object.assign(new Error(message), response));
2856
2305
  };
2857
2306
  const deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommand = async (output, context) => {
2858
2307
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2884,43 +2333,22 @@ const deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommandError = as
2884
2333
  switch (errorCode) {
2885
2334
  case "BadRequestException":
2886
2335
  case "com.amazonaws.pinpointemail#BadRequestException":
2887
- response = {
2888
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2889
- name: errorCode,
2890
- $metadata: deserializeMetadata(output),
2891
- };
2892
- break;
2336
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2893
2337
  case "NotFoundException":
2894
2338
  case "com.amazonaws.pinpointemail#NotFoundException":
2895
- response = {
2896
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2897
- name: errorCode,
2898
- $metadata: deserializeMetadata(output),
2899
- };
2900
- break;
2339
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2901
2340
  case "TooManyRequestsException":
2902
2341
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2903
- response = {
2904
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2905
- name: errorCode,
2906
- $metadata: deserializeMetadata(output),
2907
- };
2908
- break;
2342
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2909
2343
  default:
2910
2344
  const parsedBody = parsedOutput.body;
2911
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2912
- response = {
2913
- ...parsedBody,
2914
- name: `${errorCode}`,
2915
- message: parsedBody.message || parsedBody.Message || errorCode,
2345
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2346
+ name: parsedBody.code || parsedBody.Code || errorCode,
2916
2347
  $fault: "client",
2917
2348
  $metadata: deserializeMetadata(output),
2918
- };
2349
+ });
2350
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2919
2351
  }
2920
- const message = response.message || response.Message || errorCode;
2921
- response.message = message;
2922
- delete response.Message;
2923
- return Promise.reject(Object.assign(new Error(message), response));
2924
2352
  };
2925
2353
  const deserializeAws_restJson1ListEmailIdentitiesCommand = async (output, context) => {
2926
2354
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2952,35 +2380,19 @@ const deserializeAws_restJson1ListEmailIdentitiesCommandError = async (output, c
2952
2380
  switch (errorCode) {
2953
2381
  case "BadRequestException":
2954
2382
  case "com.amazonaws.pinpointemail#BadRequestException":
2955
- response = {
2956
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2957
- name: errorCode,
2958
- $metadata: deserializeMetadata(output),
2959
- };
2960
- break;
2383
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2961
2384
  case "TooManyRequestsException":
2962
2385
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
2963
- response = {
2964
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2965
- name: errorCode,
2966
- $metadata: deserializeMetadata(output),
2967
- };
2968
- break;
2386
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
2969
2387
  default:
2970
2388
  const parsedBody = parsedOutput.body;
2971
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2972
- response = {
2973
- ...parsedBody,
2974
- name: `${errorCode}`,
2975
- message: parsedBody.message || parsedBody.Message || errorCode,
2389
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2390
+ name: parsedBody.code || parsedBody.Code || errorCode,
2976
2391
  $fault: "client",
2977
2392
  $metadata: deserializeMetadata(output),
2978
- };
2393
+ });
2394
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2979
2395
  }
2980
- const message = response.message || response.Message || errorCode;
2981
- response.message = message;
2982
- delete response.Message;
2983
- return Promise.reject(Object.assign(new Error(message), response));
2984
2396
  };
2985
2397
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2986
2398
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3008,43 +2420,22 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
3008
2420
  switch (errorCode) {
3009
2421
  case "BadRequestException":
3010
2422
  case "com.amazonaws.pinpointemail#BadRequestException":
3011
- response = {
3012
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3013
- name: errorCode,
3014
- $metadata: deserializeMetadata(output),
3015
- };
3016
- break;
2423
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3017
2424
  case "NotFoundException":
3018
2425
  case "com.amazonaws.pinpointemail#NotFoundException":
3019
- response = {
3020
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3021
- name: errorCode,
3022
- $metadata: deserializeMetadata(output),
3023
- };
3024
- break;
2426
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3025
2427
  case "TooManyRequestsException":
3026
2428
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3027
- response = {
3028
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3029
- name: errorCode,
3030
- $metadata: deserializeMetadata(output),
3031
- };
3032
- break;
2429
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3033
2430
  default:
3034
2431
  const parsedBody = parsedOutput.body;
3035
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3036
- response = {
3037
- ...parsedBody,
3038
- name: `${errorCode}`,
3039
- message: parsedBody.message || parsedBody.Message || errorCode,
2432
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2433
+ name: parsedBody.code || parsedBody.Code || errorCode,
3040
2434
  $fault: "client",
3041
2435
  $metadata: deserializeMetadata(output),
3042
- };
2436
+ });
2437
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3043
2438
  }
3044
- const message = response.message || response.Message || errorCode;
3045
- response.message = message;
3046
- delete response.Message;
3047
- return Promise.reject(Object.assign(new Error(message), response));
3048
2439
  };
3049
2440
  const deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommand = async (output, context) => {
3050
2441
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3068,35 +2459,19 @@ const deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommandError
3068
2459
  switch (errorCode) {
3069
2460
  case "BadRequestException":
3070
2461
  case "com.amazonaws.pinpointemail#BadRequestException":
3071
- response = {
3072
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3073
- name: errorCode,
3074
- $metadata: deserializeMetadata(output),
3075
- };
3076
- break;
2462
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3077
2463
  case "TooManyRequestsException":
3078
2464
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3079
- response = {
3080
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3081
- name: errorCode,
3082
- $metadata: deserializeMetadata(output),
3083
- };
3084
- break;
2465
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3085
2466
  default:
3086
2467
  const parsedBody = parsedOutput.body;
3087
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3088
- response = {
3089
- ...parsedBody,
3090
- name: `${errorCode}`,
3091
- message: parsedBody.message || parsedBody.Message || errorCode,
2468
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2469
+ name: parsedBody.code || parsedBody.Code || errorCode,
3092
2470
  $fault: "client",
3093
2471
  $metadata: deserializeMetadata(output),
3094
- };
2472
+ });
2473
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3095
2474
  }
3096
- const message = response.message || response.Message || errorCode;
3097
- response.message = message;
3098
- delete response.Message;
3099
- return Promise.reject(Object.assign(new Error(message), response));
3100
2475
  };
3101
2476
  const deserializeAws_restJson1PutAccountSendingAttributesCommand = async (output, context) => {
3102
2477
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3120,35 +2495,19 @@ const deserializeAws_restJson1PutAccountSendingAttributesCommandError = async (o
3120
2495
  switch (errorCode) {
3121
2496
  case "BadRequestException":
3122
2497
  case "com.amazonaws.pinpointemail#BadRequestException":
3123
- response = {
3124
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3125
- name: errorCode,
3126
- $metadata: deserializeMetadata(output),
3127
- };
3128
- break;
2498
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3129
2499
  case "TooManyRequestsException":
3130
2500
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3131
- response = {
3132
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3133
- name: errorCode,
3134
- $metadata: deserializeMetadata(output),
3135
- };
3136
- break;
2501
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3137
2502
  default:
3138
2503
  const parsedBody = parsedOutput.body;
3139
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3140
- response = {
3141
- ...parsedBody,
3142
- name: `${errorCode}`,
3143
- message: parsedBody.message || parsedBody.Message || errorCode,
2504
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2505
+ name: parsedBody.code || parsedBody.Code || errorCode,
3144
2506
  $fault: "client",
3145
2507
  $metadata: deserializeMetadata(output),
3146
- };
2508
+ });
2509
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3147
2510
  }
3148
- const message = response.message || response.Message || errorCode;
3149
- response.message = message;
3150
- delete response.Message;
3151
- return Promise.reject(Object.assign(new Error(message), response));
3152
2511
  };
3153
2512
  const deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand = async (output, context) => {
3154
2513
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3172,43 +2531,22 @@ const deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommandError = a
3172
2531
  switch (errorCode) {
3173
2532
  case "BadRequestException":
3174
2533
  case "com.amazonaws.pinpointemail#BadRequestException":
3175
- response = {
3176
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3177
- name: errorCode,
3178
- $metadata: deserializeMetadata(output),
3179
- };
3180
- break;
2534
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3181
2535
  case "NotFoundException":
3182
2536
  case "com.amazonaws.pinpointemail#NotFoundException":
3183
- response = {
3184
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3185
- name: errorCode,
3186
- $metadata: deserializeMetadata(output),
3187
- };
3188
- break;
2537
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3189
2538
  case "TooManyRequestsException":
3190
2539
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3191
- response = {
3192
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3193
- name: errorCode,
3194
- $metadata: deserializeMetadata(output),
3195
- };
3196
- break;
2540
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3197
2541
  default:
3198
2542
  const parsedBody = parsedOutput.body;
3199
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3200
- response = {
3201
- ...parsedBody,
3202
- name: `${errorCode}`,
3203
- message: parsedBody.message || parsedBody.Message || errorCode,
2543
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2544
+ name: parsedBody.code || parsedBody.Code || errorCode,
3204
2545
  $fault: "client",
3205
2546
  $metadata: deserializeMetadata(output),
3206
- };
2547
+ });
2548
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3207
2549
  }
3208
- const message = response.message || response.Message || errorCode;
3209
- response.message = message;
3210
- delete response.Message;
3211
- return Promise.reject(Object.assign(new Error(message), response));
3212
2550
  };
3213
2551
  const deserializeAws_restJson1PutConfigurationSetReputationOptionsCommand = async (output, context) => {
3214
2552
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3232,43 +2570,22 @@ const deserializeAws_restJson1PutConfigurationSetReputationOptionsCommandError =
3232
2570
  switch (errorCode) {
3233
2571
  case "BadRequestException":
3234
2572
  case "com.amazonaws.pinpointemail#BadRequestException":
3235
- response = {
3236
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3237
- name: errorCode,
3238
- $metadata: deserializeMetadata(output),
3239
- };
3240
- break;
2573
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3241
2574
  case "NotFoundException":
3242
2575
  case "com.amazonaws.pinpointemail#NotFoundException":
3243
- response = {
3244
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3245
- name: errorCode,
3246
- $metadata: deserializeMetadata(output),
3247
- };
3248
- break;
2576
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3249
2577
  case "TooManyRequestsException":
3250
2578
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3251
- response = {
3252
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3253
- name: errorCode,
3254
- $metadata: deserializeMetadata(output),
3255
- };
3256
- break;
2579
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3257
2580
  default:
3258
2581
  const parsedBody = parsedOutput.body;
3259
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3260
- response = {
3261
- ...parsedBody,
3262
- name: `${errorCode}`,
3263
- message: parsedBody.message || parsedBody.Message || errorCode,
2582
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2583
+ name: parsedBody.code || parsedBody.Code || errorCode,
3264
2584
  $fault: "client",
3265
2585
  $metadata: deserializeMetadata(output),
3266
- };
2586
+ });
2587
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3267
2588
  }
3268
- const message = response.message || response.Message || errorCode;
3269
- response.message = message;
3270
- delete response.Message;
3271
- return Promise.reject(Object.assign(new Error(message), response));
3272
2589
  };
3273
2590
  const deserializeAws_restJson1PutConfigurationSetSendingOptionsCommand = async (output, context) => {
3274
2591
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3292,43 +2609,22 @@ const deserializeAws_restJson1PutConfigurationSetSendingOptionsCommandError = as
3292
2609
  switch (errorCode) {
3293
2610
  case "BadRequestException":
3294
2611
  case "com.amazonaws.pinpointemail#BadRequestException":
3295
- response = {
3296
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3297
- name: errorCode,
3298
- $metadata: deserializeMetadata(output),
3299
- };
3300
- break;
2612
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3301
2613
  case "NotFoundException":
3302
2614
  case "com.amazonaws.pinpointemail#NotFoundException":
3303
- response = {
3304
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3305
- name: errorCode,
3306
- $metadata: deserializeMetadata(output),
3307
- };
3308
- break;
2615
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3309
2616
  case "TooManyRequestsException":
3310
2617
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3311
- response = {
3312
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3313
- name: errorCode,
3314
- $metadata: deserializeMetadata(output),
3315
- };
3316
- break;
2618
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3317
2619
  default:
3318
2620
  const parsedBody = parsedOutput.body;
3319
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3320
- response = {
3321
- ...parsedBody,
3322
- name: `${errorCode}`,
3323
- message: parsedBody.message || parsedBody.Message || errorCode,
2621
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2622
+ name: parsedBody.code || parsedBody.Code || errorCode,
3324
2623
  $fault: "client",
3325
2624
  $metadata: deserializeMetadata(output),
3326
- };
2625
+ });
2626
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3327
2627
  }
3328
- const message = response.message || response.Message || errorCode;
3329
- response.message = message;
3330
- delete response.Message;
3331
- return Promise.reject(Object.assign(new Error(message), response));
3332
2628
  };
3333
2629
  const deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommand = async (output, context) => {
3334
2630
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3352,43 +2648,22 @@ const deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommandError = a
3352
2648
  switch (errorCode) {
3353
2649
  case "BadRequestException":
3354
2650
  case "com.amazonaws.pinpointemail#BadRequestException":
3355
- response = {
3356
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3357
- name: errorCode,
3358
- $metadata: deserializeMetadata(output),
3359
- };
3360
- break;
2651
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3361
2652
  case "NotFoundException":
3362
2653
  case "com.amazonaws.pinpointemail#NotFoundException":
3363
- response = {
3364
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3365
- name: errorCode,
3366
- $metadata: deserializeMetadata(output),
3367
- };
3368
- break;
2654
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3369
2655
  case "TooManyRequestsException":
3370
2656
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3371
- response = {
3372
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3373
- name: errorCode,
3374
- $metadata: deserializeMetadata(output),
3375
- };
3376
- break;
2657
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3377
2658
  default:
3378
2659
  const parsedBody = parsedOutput.body;
3379
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3380
- response = {
3381
- ...parsedBody,
3382
- name: `${errorCode}`,
3383
- message: parsedBody.message || parsedBody.Message || errorCode,
2660
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2661
+ name: parsedBody.code || parsedBody.Code || errorCode,
3384
2662
  $fault: "client",
3385
2663
  $metadata: deserializeMetadata(output),
3386
- };
2664
+ });
2665
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3387
2666
  }
3388
- const message = response.message || response.Message || errorCode;
3389
- response.message = message;
3390
- delete response.Message;
3391
- return Promise.reject(Object.assign(new Error(message), response));
3392
2667
  };
3393
2668
  const deserializeAws_restJson1PutDedicatedIpInPoolCommand = async (output, context) => {
3394
2669
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3412,43 +2687,22 @@ const deserializeAws_restJson1PutDedicatedIpInPoolCommandError = async (output,
3412
2687
  switch (errorCode) {
3413
2688
  case "BadRequestException":
3414
2689
  case "com.amazonaws.pinpointemail#BadRequestException":
3415
- response = {
3416
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3417
- name: errorCode,
3418
- $metadata: deserializeMetadata(output),
3419
- };
3420
- break;
2690
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3421
2691
  case "NotFoundException":
3422
2692
  case "com.amazonaws.pinpointemail#NotFoundException":
3423
- response = {
3424
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3425
- name: errorCode,
3426
- $metadata: deserializeMetadata(output),
3427
- };
3428
- break;
2693
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3429
2694
  case "TooManyRequestsException":
3430
2695
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3431
- response = {
3432
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3433
- name: errorCode,
3434
- $metadata: deserializeMetadata(output),
3435
- };
3436
- break;
2696
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3437
2697
  default:
3438
2698
  const parsedBody = parsedOutput.body;
3439
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3440
- response = {
3441
- ...parsedBody,
3442
- name: `${errorCode}`,
3443
- message: parsedBody.message || parsedBody.Message || errorCode,
2699
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2700
+ name: parsedBody.code || parsedBody.Code || errorCode,
3444
2701
  $fault: "client",
3445
2702
  $metadata: deserializeMetadata(output),
3446
- };
2703
+ });
2704
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3447
2705
  }
3448
- const message = response.message || response.Message || errorCode;
3449
- response.message = message;
3450
- delete response.Message;
3451
- return Promise.reject(Object.assign(new Error(message), response));
3452
2706
  };
3453
2707
  const deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommand = async (output, context) => {
3454
2708
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3472,43 +2726,22 @@ const deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommandError = async
3472
2726
  switch (errorCode) {
3473
2727
  case "BadRequestException":
3474
2728
  case "com.amazonaws.pinpointemail#BadRequestException":
3475
- response = {
3476
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3477
- name: errorCode,
3478
- $metadata: deserializeMetadata(output),
3479
- };
3480
- break;
2729
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3481
2730
  case "NotFoundException":
3482
2731
  case "com.amazonaws.pinpointemail#NotFoundException":
3483
- response = {
3484
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3485
- name: errorCode,
3486
- $metadata: deserializeMetadata(output),
3487
- };
3488
- break;
2732
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3489
2733
  case "TooManyRequestsException":
3490
2734
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3491
- response = {
3492
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3493
- name: errorCode,
3494
- $metadata: deserializeMetadata(output),
3495
- };
3496
- break;
2735
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3497
2736
  default:
3498
2737
  const parsedBody = parsedOutput.body;
3499
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3500
- response = {
3501
- ...parsedBody,
3502
- name: `${errorCode}`,
3503
- message: parsedBody.message || parsedBody.Message || errorCode,
2738
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2739
+ name: parsedBody.code || parsedBody.Code || errorCode,
3504
2740
  $fault: "client",
3505
2741
  $metadata: deserializeMetadata(output),
3506
- };
2742
+ });
2743
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3507
2744
  }
3508
- const message = response.message || response.Message || errorCode;
3509
- response.message = message;
3510
- delete response.Message;
3511
- return Promise.reject(Object.assign(new Error(message), response));
3512
2745
  };
3513
2746
  const deserializeAws_restJson1PutDeliverabilityDashboardOptionCommand = async (output, context) => {
3514
2747
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3532,59 +2765,28 @@ const deserializeAws_restJson1PutDeliverabilityDashboardOptionCommandError = asy
3532
2765
  switch (errorCode) {
3533
2766
  case "AlreadyExistsException":
3534
2767
  case "com.amazonaws.pinpointemail#AlreadyExistsException":
3535
- response = {
3536
- ...(await deserializeAws_restJson1AlreadyExistsExceptionResponse(parsedOutput, context)),
3537
- name: errorCode,
3538
- $metadata: deserializeMetadata(output),
3539
- };
3540
- break;
2768
+ throw await deserializeAws_restJson1AlreadyExistsExceptionResponse(parsedOutput, context);
3541
2769
  case "BadRequestException":
3542
2770
  case "com.amazonaws.pinpointemail#BadRequestException":
3543
- response = {
3544
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3545
- name: errorCode,
3546
- $metadata: deserializeMetadata(output),
3547
- };
3548
- break;
2771
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3549
2772
  case "LimitExceededException":
3550
2773
  case "com.amazonaws.pinpointemail#LimitExceededException":
3551
- response = {
3552
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
3553
- name: errorCode,
3554
- $metadata: deserializeMetadata(output),
3555
- };
3556
- break;
2774
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
3557
2775
  case "NotFoundException":
3558
2776
  case "com.amazonaws.pinpointemail#NotFoundException":
3559
- response = {
3560
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3561
- name: errorCode,
3562
- $metadata: deserializeMetadata(output),
3563
- };
3564
- break;
2777
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3565
2778
  case "TooManyRequestsException":
3566
2779
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3567
- response = {
3568
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3569
- name: errorCode,
3570
- $metadata: deserializeMetadata(output),
3571
- };
3572
- break;
2780
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3573
2781
  default:
3574
2782
  const parsedBody = parsedOutput.body;
3575
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3576
- response = {
3577
- ...parsedBody,
3578
- name: `${errorCode}`,
3579
- message: parsedBody.message || parsedBody.Message || errorCode,
2783
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2784
+ name: parsedBody.code || parsedBody.Code || errorCode,
3580
2785
  $fault: "client",
3581
2786
  $metadata: deserializeMetadata(output),
3582
- };
2787
+ });
2788
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3583
2789
  }
3584
- const message = response.message || response.Message || errorCode;
3585
- response.message = message;
3586
- delete response.Message;
3587
- return Promise.reject(Object.assign(new Error(message), response));
3588
2790
  };
3589
2791
  const deserializeAws_restJson1PutEmailIdentityDkimAttributesCommand = async (output, context) => {
3590
2792
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3608,43 +2810,22 @@ const deserializeAws_restJson1PutEmailIdentityDkimAttributesCommandError = async
3608
2810
  switch (errorCode) {
3609
2811
  case "BadRequestException":
3610
2812
  case "com.amazonaws.pinpointemail#BadRequestException":
3611
- response = {
3612
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3613
- name: errorCode,
3614
- $metadata: deserializeMetadata(output),
3615
- };
3616
- break;
2813
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3617
2814
  case "NotFoundException":
3618
2815
  case "com.amazonaws.pinpointemail#NotFoundException":
3619
- response = {
3620
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3621
- name: errorCode,
3622
- $metadata: deserializeMetadata(output),
3623
- };
3624
- break;
2816
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3625
2817
  case "TooManyRequestsException":
3626
2818
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3627
- response = {
3628
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3629
- name: errorCode,
3630
- $metadata: deserializeMetadata(output),
3631
- };
3632
- break;
2819
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3633
2820
  default:
3634
2821
  const parsedBody = parsedOutput.body;
3635
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3636
- response = {
3637
- ...parsedBody,
3638
- name: `${errorCode}`,
3639
- message: parsedBody.message || parsedBody.Message || errorCode,
2822
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2823
+ name: parsedBody.code || parsedBody.Code || errorCode,
3640
2824
  $fault: "client",
3641
2825
  $metadata: deserializeMetadata(output),
3642
- };
2826
+ });
2827
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3643
2828
  }
3644
- const message = response.message || response.Message || errorCode;
3645
- response.message = message;
3646
- delete response.Message;
3647
- return Promise.reject(Object.assign(new Error(message), response));
3648
2829
  };
3649
2830
  const deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand = async (output, context) => {
3650
2831
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3668,43 +2849,22 @@ const deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommandError = a
3668
2849
  switch (errorCode) {
3669
2850
  case "BadRequestException":
3670
2851
  case "com.amazonaws.pinpointemail#BadRequestException":
3671
- response = {
3672
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3673
- name: errorCode,
3674
- $metadata: deserializeMetadata(output),
3675
- };
3676
- break;
2852
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3677
2853
  case "NotFoundException":
3678
2854
  case "com.amazonaws.pinpointemail#NotFoundException":
3679
- response = {
3680
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3681
- name: errorCode,
3682
- $metadata: deserializeMetadata(output),
3683
- };
3684
- break;
2855
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3685
2856
  case "TooManyRequestsException":
3686
2857
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3687
- response = {
3688
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3689
- name: errorCode,
3690
- $metadata: deserializeMetadata(output),
3691
- };
3692
- break;
2858
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3693
2859
  default:
3694
2860
  const parsedBody = parsedOutput.body;
3695
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3696
- response = {
3697
- ...parsedBody,
3698
- name: `${errorCode}`,
3699
- message: parsedBody.message || parsedBody.Message || errorCode,
2861
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2862
+ name: parsedBody.code || parsedBody.Code || errorCode,
3700
2863
  $fault: "client",
3701
2864
  $metadata: deserializeMetadata(output),
3702
- };
2865
+ });
2866
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3703
2867
  }
3704
- const message = response.message || response.Message || errorCode;
3705
- response.message = message;
3706
- delete response.Message;
3707
- return Promise.reject(Object.assign(new Error(message), response));
3708
2868
  };
3709
2869
  const deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommand = async (output, context) => {
3710
2870
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3728,43 +2888,22 @@ const deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommandError = a
3728
2888
  switch (errorCode) {
3729
2889
  case "BadRequestException":
3730
2890
  case "com.amazonaws.pinpointemail#BadRequestException":
3731
- response = {
3732
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3733
- name: errorCode,
3734
- $metadata: deserializeMetadata(output),
3735
- };
3736
- break;
2891
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3737
2892
  case "NotFoundException":
3738
2893
  case "com.amazonaws.pinpointemail#NotFoundException":
3739
- response = {
3740
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3741
- name: errorCode,
3742
- $metadata: deserializeMetadata(output),
3743
- };
3744
- break;
2894
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3745
2895
  case "TooManyRequestsException":
3746
2896
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3747
- response = {
3748
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3749
- name: errorCode,
3750
- $metadata: deserializeMetadata(output),
3751
- };
3752
- break;
2897
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3753
2898
  default:
3754
2899
  const parsedBody = parsedOutput.body;
3755
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3756
- response = {
3757
- ...parsedBody,
3758
- name: `${errorCode}`,
3759
- message: parsedBody.message || parsedBody.Message || errorCode,
2900
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2901
+ name: parsedBody.code || parsedBody.Code || errorCode,
3760
2902
  $fault: "client",
3761
2903
  $metadata: deserializeMetadata(output),
3762
- };
2904
+ });
2905
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3763
2906
  }
3764
- const message = response.message || response.Message || errorCode;
3765
- response.message = message;
3766
- delete response.Message;
3767
- return Promise.reject(Object.assign(new Error(message), response));
3768
2907
  };
3769
2908
  const deserializeAws_restJson1SendEmailCommand = async (output, context) => {
3770
2909
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3792,83 +2931,37 @@ const deserializeAws_restJson1SendEmailCommandError = async (output, context) =>
3792
2931
  switch (errorCode) {
3793
2932
  case "AccountSuspendedException":
3794
2933
  case "com.amazonaws.pinpointemail#AccountSuspendedException":
3795
- response = {
3796
- ...(await deserializeAws_restJson1AccountSuspendedExceptionResponse(parsedOutput, context)),
3797
- name: errorCode,
3798
- $metadata: deserializeMetadata(output),
3799
- };
3800
- break;
2934
+ throw await deserializeAws_restJson1AccountSuspendedExceptionResponse(parsedOutput, context);
3801
2935
  case "BadRequestException":
3802
2936
  case "com.amazonaws.pinpointemail#BadRequestException":
3803
- response = {
3804
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3805
- name: errorCode,
3806
- $metadata: deserializeMetadata(output),
3807
- };
3808
- break;
2937
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3809
2938
  case "LimitExceededException":
3810
2939
  case "com.amazonaws.pinpointemail#LimitExceededException":
3811
- response = {
3812
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
3813
- name: errorCode,
3814
- $metadata: deserializeMetadata(output),
3815
- };
3816
- break;
2940
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
3817
2941
  case "MailFromDomainNotVerifiedException":
3818
2942
  case "com.amazonaws.pinpointemail#MailFromDomainNotVerifiedException":
3819
- response = {
3820
- ...(await deserializeAws_restJson1MailFromDomainNotVerifiedExceptionResponse(parsedOutput, context)),
3821
- name: errorCode,
3822
- $metadata: deserializeMetadata(output),
3823
- };
3824
- break;
2943
+ throw await deserializeAws_restJson1MailFromDomainNotVerifiedExceptionResponse(parsedOutput, context);
3825
2944
  case "MessageRejected":
3826
2945
  case "com.amazonaws.pinpointemail#MessageRejected":
3827
- response = {
3828
- ...(await deserializeAws_restJson1MessageRejectedResponse(parsedOutput, context)),
3829
- name: errorCode,
3830
- $metadata: deserializeMetadata(output),
3831
- };
3832
- break;
2946
+ throw await deserializeAws_restJson1MessageRejectedResponse(parsedOutput, context);
3833
2947
  case "NotFoundException":
3834
2948
  case "com.amazonaws.pinpointemail#NotFoundException":
3835
- response = {
3836
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3837
- name: errorCode,
3838
- $metadata: deserializeMetadata(output),
3839
- };
3840
- break;
2949
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3841
2950
  case "SendingPausedException":
3842
2951
  case "com.amazonaws.pinpointemail#SendingPausedException":
3843
- response = {
3844
- ...(await deserializeAws_restJson1SendingPausedExceptionResponse(parsedOutput, context)),
3845
- name: errorCode,
3846
- $metadata: deserializeMetadata(output),
3847
- };
3848
- break;
2952
+ throw await deserializeAws_restJson1SendingPausedExceptionResponse(parsedOutput, context);
3849
2953
  case "TooManyRequestsException":
3850
2954
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3851
- response = {
3852
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3853
- name: errorCode,
3854
- $metadata: deserializeMetadata(output),
3855
- };
3856
- break;
2955
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3857
2956
  default:
3858
2957
  const parsedBody = parsedOutput.body;
3859
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3860
- response = {
3861
- ...parsedBody,
3862
- name: `${errorCode}`,
3863
- message: parsedBody.message || parsedBody.Message || errorCode,
2958
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
2959
+ name: parsedBody.code || parsedBody.Code || errorCode,
3864
2960
  $fault: "client",
3865
2961
  $metadata: deserializeMetadata(output),
3866
- };
2962
+ });
2963
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3867
2964
  }
3868
- const message = response.message || response.Message || errorCode;
3869
- response.message = message;
3870
- delete response.Message;
3871
- return Promise.reject(Object.assign(new Error(message), response));
3872
2965
  };
3873
2966
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
3874
2967
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3892,51 +2985,25 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
3892
2985
  switch (errorCode) {
3893
2986
  case "BadRequestException":
3894
2987
  case "com.amazonaws.pinpointemail#BadRequestException":
3895
- response = {
3896
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3897
- name: errorCode,
3898
- $metadata: deserializeMetadata(output),
3899
- };
3900
- break;
2988
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3901
2989
  case "ConcurrentModificationException":
3902
2990
  case "com.amazonaws.pinpointemail#ConcurrentModificationException":
3903
- response = {
3904
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3905
- name: errorCode,
3906
- $metadata: deserializeMetadata(output),
3907
- };
3908
- break;
2991
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3909
2992
  case "NotFoundException":
3910
2993
  case "com.amazonaws.pinpointemail#NotFoundException":
3911
- response = {
3912
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3913
- name: errorCode,
3914
- $metadata: deserializeMetadata(output),
3915
- };
3916
- break;
2994
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3917
2995
  case "TooManyRequestsException":
3918
2996
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3919
- response = {
3920
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3921
- name: errorCode,
3922
- $metadata: deserializeMetadata(output),
3923
- };
3924
- break;
2997
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3925
2998
  default:
3926
2999
  const parsedBody = parsedOutput.body;
3927
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3928
- response = {
3929
- ...parsedBody,
3930
- name: `${errorCode}`,
3931
- message: parsedBody.message || parsedBody.Message || errorCode,
3000
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
3001
+ name: parsedBody.code || parsedBody.Code || errorCode,
3932
3002
  $fault: "client",
3933
3003
  $metadata: deserializeMetadata(output),
3934
- };
3004
+ });
3005
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3935
3006
  }
3936
- const message = response.message || response.Message || errorCode;
3937
- response.message = message;
3938
- delete response.Message;
3939
- return Promise.reject(Object.assign(new Error(message), response));
3940
3007
  };
3941
3008
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
3942
3009
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3960,51 +3027,25 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
3960
3027
  switch (errorCode) {
3961
3028
  case "BadRequestException":
3962
3029
  case "com.amazonaws.pinpointemail#BadRequestException":
3963
- response = {
3964
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3965
- name: errorCode,
3966
- $metadata: deserializeMetadata(output),
3967
- };
3968
- break;
3030
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3969
3031
  case "ConcurrentModificationException":
3970
3032
  case "com.amazonaws.pinpointemail#ConcurrentModificationException":
3971
- response = {
3972
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3973
- name: errorCode,
3974
- $metadata: deserializeMetadata(output),
3975
- };
3976
- break;
3033
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3977
3034
  case "NotFoundException":
3978
3035
  case "com.amazonaws.pinpointemail#NotFoundException":
3979
- response = {
3980
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3981
- name: errorCode,
3982
- $metadata: deserializeMetadata(output),
3983
- };
3984
- break;
3036
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3985
3037
  case "TooManyRequestsException":
3986
3038
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
3987
- response = {
3988
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
3989
- name: errorCode,
3990
- $metadata: deserializeMetadata(output),
3991
- };
3992
- break;
3039
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
3993
3040
  default:
3994
3041
  const parsedBody = parsedOutput.body;
3995
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3996
- response = {
3997
- ...parsedBody,
3998
- name: `${errorCode}`,
3999
- message: parsedBody.message || parsedBody.Message || errorCode,
3042
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
3043
+ name: parsedBody.code || parsedBody.Code || errorCode,
4000
3044
  $fault: "client",
4001
3045
  $metadata: deserializeMetadata(output),
4002
- };
3046
+ });
3047
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4003
3048
  }
4004
- const message = response.message || response.Message || errorCode;
4005
- response.message = message;
4006
- delete response.Message;
4007
- return Promise.reject(Object.assign(new Error(message), response));
4008
3049
  };
4009
3050
  const deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommand = async (output, context) => {
4010
3051
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4028,173 +3069,142 @@ const deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError
4028
3069
  switch (errorCode) {
4029
3070
  case "BadRequestException":
4030
3071
  case "com.amazonaws.pinpointemail#BadRequestException":
4031
- response = {
4032
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4033
- name: errorCode,
4034
- $metadata: deserializeMetadata(output),
4035
- };
4036
- break;
3072
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4037
3073
  case "NotFoundException":
4038
3074
  case "com.amazonaws.pinpointemail#NotFoundException":
4039
- response = {
4040
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4041
- name: errorCode,
4042
- $metadata: deserializeMetadata(output),
4043
- };
4044
- break;
3075
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4045
3076
  case "TooManyRequestsException":
4046
3077
  case "com.amazonaws.pinpointemail#TooManyRequestsException":
4047
- response = {
4048
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
4049
- name: errorCode,
4050
- $metadata: deserializeMetadata(output),
4051
- };
4052
- break;
3078
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
4053
3079
  default:
4054
3080
  const parsedBody = parsedOutput.body;
4055
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4056
- response = {
4057
- ...parsedBody,
4058
- name: `${errorCode}`,
4059
- message: parsedBody.message || parsedBody.Message || errorCode,
3081
+ response = new PinpointEmailServiceException_1.PinpointEmailServiceException({
3082
+ name: parsedBody.code || parsedBody.Code || errorCode,
4060
3083
  $fault: "client",
4061
3084
  $metadata: deserializeMetadata(output),
4062
- };
3085
+ });
3086
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4063
3087
  }
4064
- const message = response.message || response.Message || errorCode;
4065
- response.message = message;
4066
- delete response.Message;
4067
- return Promise.reject(Object.assign(new Error(message), response));
4068
3088
  };
4069
3089
  const deserializeAws_restJson1AccountSuspendedExceptionResponse = async (parsedOutput, context) => {
4070
- const contents = {
4071
- name: "AccountSuspendedException",
4072
- $fault: "client",
4073
- $metadata: deserializeMetadata(parsedOutput),
4074
- message: undefined,
4075
- };
3090
+ const contents = {};
4076
3091
  const data = parsedOutput.body;
4077
3092
  if (data.message !== undefined && data.message !== null) {
4078
3093
  contents.message = smithy_client_1.expectString(data.message);
4079
3094
  }
4080
- return contents;
3095
+ const exception = new models_0_1.AccountSuspendedException({
3096
+ $metadata: deserializeMetadata(parsedOutput),
3097
+ ...contents,
3098
+ });
3099
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4081
3100
  };
4082
3101
  const deserializeAws_restJson1AlreadyExistsExceptionResponse = async (parsedOutput, context) => {
4083
- const contents = {
4084
- name: "AlreadyExistsException",
4085
- $fault: "client",
4086
- $metadata: deserializeMetadata(parsedOutput),
4087
- message: undefined,
4088
- };
3102
+ const contents = {};
4089
3103
  const data = parsedOutput.body;
4090
3104
  if (data.message !== undefined && data.message !== null) {
4091
3105
  contents.message = smithy_client_1.expectString(data.message);
4092
3106
  }
4093
- return contents;
3107
+ const exception = new models_0_1.AlreadyExistsException({
3108
+ $metadata: deserializeMetadata(parsedOutput),
3109
+ ...contents,
3110
+ });
3111
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4094
3112
  };
4095
3113
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
4096
- const contents = {
4097
- name: "BadRequestException",
4098
- $fault: "client",
4099
- $metadata: deserializeMetadata(parsedOutput),
4100
- message: undefined,
4101
- };
3114
+ const contents = {};
4102
3115
  const data = parsedOutput.body;
4103
3116
  if (data.message !== undefined && data.message !== null) {
4104
3117
  contents.message = smithy_client_1.expectString(data.message);
4105
3118
  }
4106
- return contents;
3119
+ const exception = new models_0_1.BadRequestException({
3120
+ $metadata: deserializeMetadata(parsedOutput),
3121
+ ...contents,
3122
+ });
3123
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4107
3124
  };
4108
3125
  const deserializeAws_restJson1ConcurrentModificationExceptionResponse = async (parsedOutput, context) => {
4109
- const contents = {
4110
- name: "ConcurrentModificationException",
4111
- $fault: "server",
4112
- $metadata: deserializeMetadata(parsedOutput),
4113
- message: undefined,
4114
- };
3126
+ const contents = {};
4115
3127
  const data = parsedOutput.body;
4116
3128
  if (data.message !== undefined && data.message !== null) {
4117
3129
  contents.message = smithy_client_1.expectString(data.message);
4118
3130
  }
4119
- return contents;
3131
+ const exception = new models_0_1.ConcurrentModificationException({
3132
+ $metadata: deserializeMetadata(parsedOutput),
3133
+ ...contents,
3134
+ });
3135
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4120
3136
  };
4121
3137
  const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
4122
- const contents = {
4123
- name: "LimitExceededException",
4124
- $fault: "client",
4125
- $metadata: deserializeMetadata(parsedOutput),
4126
- message: undefined,
4127
- };
3138
+ const contents = {};
4128
3139
  const data = parsedOutput.body;
4129
3140
  if (data.message !== undefined && data.message !== null) {
4130
3141
  contents.message = smithy_client_1.expectString(data.message);
4131
3142
  }
4132
- return contents;
3143
+ const exception = new models_0_1.LimitExceededException({
3144
+ $metadata: deserializeMetadata(parsedOutput),
3145
+ ...contents,
3146
+ });
3147
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4133
3148
  };
4134
3149
  const deserializeAws_restJson1MailFromDomainNotVerifiedExceptionResponse = async (parsedOutput, context) => {
4135
- const contents = {
4136
- name: "MailFromDomainNotVerifiedException",
4137
- $fault: "client",
4138
- $metadata: deserializeMetadata(parsedOutput),
4139
- message: undefined,
4140
- };
3150
+ const contents = {};
4141
3151
  const data = parsedOutput.body;
4142
3152
  if (data.message !== undefined && data.message !== null) {
4143
3153
  contents.message = smithy_client_1.expectString(data.message);
4144
3154
  }
4145
- return contents;
3155
+ const exception = new models_0_1.MailFromDomainNotVerifiedException({
3156
+ $metadata: deserializeMetadata(parsedOutput),
3157
+ ...contents,
3158
+ });
3159
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4146
3160
  };
4147
3161
  const deserializeAws_restJson1MessageRejectedResponse = async (parsedOutput, context) => {
4148
- const contents = {
4149
- name: "MessageRejected",
4150
- $fault: "client",
4151
- $metadata: deserializeMetadata(parsedOutput),
4152
- message: undefined,
4153
- };
3162
+ const contents = {};
4154
3163
  const data = parsedOutput.body;
4155
3164
  if (data.message !== undefined && data.message !== null) {
4156
3165
  contents.message = smithy_client_1.expectString(data.message);
4157
3166
  }
4158
- return contents;
3167
+ const exception = new models_0_1.MessageRejected({
3168
+ $metadata: deserializeMetadata(parsedOutput),
3169
+ ...contents,
3170
+ });
3171
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4159
3172
  };
4160
3173
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
4161
- const contents = {
4162
- name: "NotFoundException",
4163
- $fault: "client",
4164
- $metadata: deserializeMetadata(parsedOutput),
4165
- message: undefined,
4166
- };
3174
+ const contents = {};
4167
3175
  const data = parsedOutput.body;
4168
3176
  if (data.message !== undefined && data.message !== null) {
4169
3177
  contents.message = smithy_client_1.expectString(data.message);
4170
3178
  }
4171
- return contents;
3179
+ const exception = new models_0_1.NotFoundException({
3180
+ $metadata: deserializeMetadata(parsedOutput),
3181
+ ...contents,
3182
+ });
3183
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4172
3184
  };
4173
3185
  const deserializeAws_restJson1SendingPausedExceptionResponse = async (parsedOutput, context) => {
4174
- const contents = {
4175
- name: "SendingPausedException",
4176
- $fault: "client",
4177
- $metadata: deserializeMetadata(parsedOutput),
4178
- message: undefined,
4179
- };
3186
+ const contents = {};
4180
3187
  const data = parsedOutput.body;
4181
3188
  if (data.message !== undefined && data.message !== null) {
4182
3189
  contents.message = smithy_client_1.expectString(data.message);
4183
3190
  }
4184
- return contents;
3191
+ const exception = new models_0_1.SendingPausedException({
3192
+ $metadata: deserializeMetadata(parsedOutput),
3193
+ ...contents,
3194
+ });
3195
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4185
3196
  };
4186
3197
  const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
4187
- const contents = {
4188
- name: "TooManyRequestsException",
4189
- $fault: "client",
4190
- $metadata: deserializeMetadata(parsedOutput),
4191
- message: undefined,
4192
- };
3198
+ const contents = {};
4193
3199
  const data = parsedOutput.body;
4194
3200
  if (data.message !== undefined && data.message !== null) {
4195
3201
  contents.message = smithy_client_1.expectString(data.message);
4196
3202
  }
4197
- return contents;
3203
+ const exception = new models_0_1.TooManyRequestsException({
3204
+ $metadata: deserializeMetadata(parsedOutput),
3205
+ ...contents,
3206
+ });
3207
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
4198
3208
  };
4199
3209
  const serializeAws_restJson1Body = (input, context) => {
4200
3210
  return {
@@ -4443,7 +3453,7 @@ const serializeAws_restJson1TrackingOptions = (input, context) => {
4443
3453
  };
4444
3454
  };
4445
3455
  const deserializeAws_restJson1BlacklistEntries = (output, context) => {
4446
- return (output || [])
3456
+ const retVal = (output || [])
4447
3457
  .filter((e) => e != null)
4448
3458
  .map((entry) => {
4449
3459
  if (entry === null) {
@@ -4451,6 +3461,7 @@ const deserializeAws_restJson1BlacklistEntries = (output, context) => {
4451
3461
  }
4452
3462
  return deserializeAws_restJson1BlacklistEntry(entry, context);
4453
3463
  });
3464
+ return retVal;
4454
3465
  };
4455
3466
  const deserializeAws_restJson1BlacklistEntry = (output, context) => {
4456
3467
  return {
@@ -4487,7 +3498,7 @@ const deserializeAws_restJson1CloudWatchDimensionConfiguration = (output, contex
4487
3498
  };
4488
3499
  };
4489
3500
  const deserializeAws_restJson1CloudWatchDimensionConfigurations = (output, context) => {
4490
- return (output || [])
3501
+ const retVal = (output || [])
4491
3502
  .filter((e) => e != null)
4492
3503
  .map((entry) => {
4493
3504
  if (entry === null) {
@@ -4495,9 +3506,10 @@ const deserializeAws_restJson1CloudWatchDimensionConfigurations = (output, conte
4495
3506
  }
4496
3507
  return deserializeAws_restJson1CloudWatchDimensionConfiguration(entry, context);
4497
3508
  });
3509
+ return retVal;
4498
3510
  };
4499
3511
  const deserializeAws_restJson1ConfigurationSetNameList = (output, context) => {
4500
- return (output || [])
3512
+ const retVal = (output || [])
4501
3513
  .filter((e) => e != null)
4502
3514
  .map((entry) => {
4503
3515
  if (entry === null) {
@@ -4505,6 +3517,7 @@ const deserializeAws_restJson1ConfigurationSetNameList = (output, context) => {
4505
3517
  }
4506
3518
  return smithy_client_1.expectString(entry);
4507
3519
  });
3520
+ return retVal;
4508
3521
  };
4509
3522
  const deserializeAws_restJson1DailyVolume = (output, context) => {
4510
3523
  return {
@@ -4520,7 +3533,7 @@ const deserializeAws_restJson1DailyVolume = (output, context) => {
4520
3533
  };
4521
3534
  };
4522
3535
  const deserializeAws_restJson1DailyVolumes = (output, context) => {
4523
- return (output || [])
3536
+ const retVal = (output || [])
4524
3537
  .filter((e) => e != null)
4525
3538
  .map((entry) => {
4526
3539
  if (entry === null) {
@@ -4528,6 +3541,7 @@ const deserializeAws_restJson1DailyVolumes = (output, context) => {
4528
3541
  }
4529
3542
  return deserializeAws_restJson1DailyVolume(entry, context);
4530
3543
  });
3544
+ return retVal;
4531
3545
  };
4532
3546
  const deserializeAws_restJson1DedicatedIp = (output, context) => {
4533
3547
  return {
@@ -4538,7 +3552,7 @@ const deserializeAws_restJson1DedicatedIp = (output, context) => {
4538
3552
  };
4539
3553
  };
4540
3554
  const deserializeAws_restJson1DedicatedIpList = (output, context) => {
4541
- return (output || [])
3555
+ const retVal = (output || [])
4542
3556
  .filter((e) => e != null)
4543
3557
  .map((entry) => {
4544
3558
  if (entry === null) {
@@ -4546,6 +3560,7 @@ const deserializeAws_restJson1DedicatedIpList = (output, context) => {
4546
3560
  }
4547
3561
  return deserializeAws_restJson1DedicatedIp(entry, context);
4548
3562
  });
3563
+ return retVal;
4549
3564
  };
4550
3565
  const deserializeAws_restJson1DeliverabilityTestReport = (output, context) => {
4551
3566
  return {
@@ -4560,7 +3575,7 @@ const deserializeAws_restJson1DeliverabilityTestReport = (output, context) => {
4560
3575
  };
4561
3576
  };
4562
3577
  const deserializeAws_restJson1DeliverabilityTestReports = (output, context) => {
4563
- return (output || [])
3578
+ const retVal = (output || [])
4564
3579
  .filter((e) => e != null)
4565
3580
  .map((entry) => {
4566
3581
  if (entry === null) {
@@ -4568,6 +3583,7 @@ const deserializeAws_restJson1DeliverabilityTestReports = (output, context) => {
4568
3583
  }
4569
3584
  return deserializeAws_restJson1DeliverabilityTestReport(entry, context);
4570
3585
  });
3586
+ return retVal;
4571
3587
  };
4572
3588
  const deserializeAws_restJson1DeliveryOptions = (output, context) => {
4573
3589
  return {
@@ -4585,7 +3601,7 @@ const deserializeAws_restJson1DkimAttributes = (output, context) => {
4585
3601
  };
4586
3602
  };
4587
3603
  const deserializeAws_restJson1DnsTokenList = (output, context) => {
4588
- return (output || [])
3604
+ const retVal = (output || [])
4589
3605
  .filter((e) => e != null)
4590
3606
  .map((entry) => {
4591
3607
  if (entry === null) {
@@ -4593,6 +3609,7 @@ const deserializeAws_restJson1DnsTokenList = (output, context) => {
4593
3609
  }
4594
3610
  return smithy_client_1.expectString(entry);
4595
3611
  });
3612
+ return retVal;
4596
3613
  };
4597
3614
  const deserializeAws_restJson1DomainDeliverabilityCampaign = (output, context) => {
4598
3615
  return {
@@ -4621,7 +3638,7 @@ const deserializeAws_restJson1DomainDeliverabilityCampaign = (output, context) =
4621
3638
  };
4622
3639
  };
4623
3640
  const deserializeAws_restJson1DomainDeliverabilityCampaignList = (output, context) => {
4624
- return (output || [])
3641
+ const retVal = (output || [])
4625
3642
  .filter((e) => e != null)
4626
3643
  .map((entry) => {
4627
3644
  if (entry === null) {
@@ -4629,6 +3646,7 @@ const deserializeAws_restJson1DomainDeliverabilityCampaignList = (output, contex
4629
3646
  }
4630
3647
  return deserializeAws_restJson1DomainDeliverabilityCampaign(entry, context);
4631
3648
  });
3649
+ return retVal;
4632
3650
  };
4633
3651
  const deserializeAws_restJson1DomainDeliverabilityTrackingOption = (output, context) => {
4634
3652
  return {
@@ -4642,7 +3660,7 @@ const deserializeAws_restJson1DomainDeliverabilityTrackingOption = (output, cont
4642
3660
  };
4643
3661
  };
4644
3662
  const deserializeAws_restJson1DomainDeliverabilityTrackingOptions = (output, context) => {
4645
- return (output || [])
3663
+ const retVal = (output || [])
4646
3664
  .filter((e) => e != null)
4647
3665
  .map((entry) => {
4648
3666
  if (entry === null) {
@@ -4650,6 +3668,7 @@ const deserializeAws_restJson1DomainDeliverabilityTrackingOptions = (output, con
4650
3668
  }
4651
3669
  return deserializeAws_restJson1DomainDeliverabilityTrackingOption(entry, context);
4652
3670
  });
3671
+ return retVal;
4653
3672
  };
4654
3673
  const deserializeAws_restJson1DomainIspPlacement = (output, context) => {
4655
3674
  return {
@@ -4661,7 +3680,7 @@ const deserializeAws_restJson1DomainIspPlacement = (output, context) => {
4661
3680
  };
4662
3681
  };
4663
3682
  const deserializeAws_restJson1DomainIspPlacements = (output, context) => {
4664
- return (output || [])
3683
+ const retVal = (output || [])
4665
3684
  .filter((e) => e != null)
4666
3685
  .map((entry) => {
4667
3686
  if (entry === null) {
@@ -4669,9 +3688,10 @@ const deserializeAws_restJson1DomainIspPlacements = (output, context) => {
4669
3688
  }
4670
3689
  return deserializeAws_restJson1DomainIspPlacement(entry, context);
4671
3690
  });
3691
+ return retVal;
4672
3692
  };
4673
3693
  const deserializeAws_restJson1Esps = (output, context) => {
4674
- return (output || [])
3694
+ const retVal = (output || [])
4675
3695
  .filter((e) => e != null)
4676
3696
  .map((entry) => {
4677
3697
  if (entry === null) {
@@ -4679,6 +3699,7 @@ const deserializeAws_restJson1Esps = (output, context) => {
4679
3699
  }
4680
3700
  return smithy_client_1.expectString(entry);
4681
3701
  });
3702
+ return retVal;
4682
3703
  };
4683
3704
  const deserializeAws_restJson1EventDestination = (output, context) => {
4684
3705
  return {
@@ -4702,7 +3723,7 @@ const deserializeAws_restJson1EventDestination = (output, context) => {
4702
3723
  };
4703
3724
  };
4704
3725
  const deserializeAws_restJson1EventDestinations = (output, context) => {
4705
- return (output || [])
3726
+ const retVal = (output || [])
4706
3727
  .filter((e) => e != null)
4707
3728
  .map((entry) => {
4708
3729
  if (entry === null) {
@@ -4710,9 +3731,10 @@ const deserializeAws_restJson1EventDestinations = (output, context) => {
4710
3731
  }
4711
3732
  return deserializeAws_restJson1EventDestination(entry, context);
4712
3733
  });
3734
+ return retVal;
4713
3735
  };
4714
3736
  const deserializeAws_restJson1EventTypes = (output, context) => {
4715
- return (output || [])
3737
+ const retVal = (output || [])
4716
3738
  .filter((e) => e != null)
4717
3739
  .map((entry) => {
4718
3740
  if (entry === null) {
@@ -4720,6 +3742,7 @@ const deserializeAws_restJson1EventTypes = (output, context) => {
4720
3742
  }
4721
3743
  return smithy_client_1.expectString(entry);
4722
3744
  });
3745
+ return retVal;
4723
3746
  };
4724
3747
  const deserializeAws_restJson1IdentityInfo = (output, context) => {
4725
3748
  return {
@@ -4729,7 +3752,7 @@ const deserializeAws_restJson1IdentityInfo = (output, context) => {
4729
3752
  };
4730
3753
  };
4731
3754
  const deserializeAws_restJson1IdentityInfoList = (output, context) => {
4732
- return (output || [])
3755
+ const retVal = (output || [])
4733
3756
  .filter((e) => e != null)
4734
3757
  .map((entry) => {
4735
3758
  if (entry === null) {
@@ -4737,6 +3760,7 @@ const deserializeAws_restJson1IdentityInfoList = (output, context) => {
4737
3760
  }
4738
3761
  return deserializeAws_restJson1IdentityInfo(entry, context);
4739
3762
  });
3763
+ return retVal;
4740
3764
  };
4741
3765
  const deserializeAws_restJson1InboxPlacementTrackingOption = (output, context) => {
4742
3766
  return {
@@ -4747,7 +3771,7 @@ const deserializeAws_restJson1InboxPlacementTrackingOption = (output, context) =
4747
3771
  };
4748
3772
  };
4749
3773
  const deserializeAws_restJson1IpList = (output, context) => {
4750
- return (output || [])
3774
+ const retVal = (output || [])
4751
3775
  .filter((e) => e != null)
4752
3776
  .map((entry) => {
4753
3777
  if (entry === null) {
@@ -4755,9 +3779,10 @@ const deserializeAws_restJson1IpList = (output, context) => {
4755
3779
  }
4756
3780
  return smithy_client_1.expectString(entry);
4757
3781
  });
3782
+ return retVal;
4758
3783
  };
4759
3784
  const deserializeAws_restJson1IspNameList = (output, context) => {
4760
- return (output || [])
3785
+ const retVal = (output || [])
4761
3786
  .filter((e) => e != null)
4762
3787
  .map((entry) => {
4763
3788
  if (entry === null) {
@@ -4765,6 +3790,7 @@ const deserializeAws_restJson1IspNameList = (output, context) => {
4765
3790
  }
4766
3791
  return smithy_client_1.expectString(entry);
4767
3792
  });
3793
+ return retVal;
4768
3794
  };
4769
3795
  const deserializeAws_restJson1IspPlacement = (output, context) => {
4770
3796
  return {
@@ -4775,7 +3801,7 @@ const deserializeAws_restJson1IspPlacement = (output, context) => {
4775
3801
  };
4776
3802
  };
4777
3803
  const deserializeAws_restJson1IspPlacements = (output, context) => {
4778
- return (output || [])
3804
+ const retVal = (output || [])
4779
3805
  .filter((e) => e != null)
4780
3806
  .map((entry) => {
4781
3807
  if (entry === null) {
@@ -4783,6 +3809,7 @@ const deserializeAws_restJson1IspPlacements = (output, context) => {
4783
3809
  }
4784
3810
  return deserializeAws_restJson1IspPlacement(entry, context);
4785
3811
  });
3812
+ return retVal;
4786
3813
  };
4787
3814
  const deserializeAws_restJson1KinesisFirehoseDestination = (output, context) => {
4788
3815
  return {
@@ -4791,7 +3818,7 @@ const deserializeAws_restJson1KinesisFirehoseDestination = (output, context) =>
4791
3818
  };
4792
3819
  };
4793
3820
  const deserializeAws_restJson1ListOfDedicatedIpPools = (output, context) => {
4794
- return (output || [])
3821
+ const retVal = (output || [])
4795
3822
  .filter((e) => e != null)
4796
3823
  .map((entry) => {
4797
3824
  if (entry === null) {
@@ -4799,6 +3826,7 @@ const deserializeAws_restJson1ListOfDedicatedIpPools = (output, context) => {
4799
3826
  }
4800
3827
  return smithy_client_1.expectString(entry);
4801
3828
  });
3829
+ return retVal;
4802
3830
  };
4803
3831
  const deserializeAws_restJson1MailFromAttributes = (output, context) => {
4804
3832
  return {
@@ -4864,7 +3892,7 @@ const deserializeAws_restJson1Tag = (output, context) => {
4864
3892
  };
4865
3893
  };
4866
3894
  const deserializeAws_restJson1TagList = (output, context) => {
4867
- return (output || [])
3895
+ const retVal = (output || [])
4868
3896
  .filter((e) => e != null)
4869
3897
  .map((entry) => {
4870
3898
  if (entry === null) {
@@ -4872,6 +3900,7 @@ const deserializeAws_restJson1TagList = (output, context) => {
4872
3900
  }
4873
3901
  return deserializeAws_restJson1Tag(entry, context);
4874
3902
  });
3903
+ return retVal;
4875
3904
  };
4876
3905
  const deserializeAws_restJson1TrackingOptions = (output, context) => {
4877
3906
  return {