@aws-sdk/client-backup 3.504.0 → 3.509.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1215,7 +1215,7 @@ export const se_UpdateRestoreTestingSelectionCommand = async (input, context) =>
1215
1215
  };
1216
1216
  export const de_CancelLegalHoldCommand = async (output, context) => {
1217
1217
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1218
- return de_CancelLegalHoldCommandError(output, context);
1218
+ return de_CommandError(output, context);
1219
1219
  }
1220
1220
  const contents = map({
1221
1221
  $metadata: deserializeMetadata(output),
@@ -1223,40 +1223,9 @@ export const de_CancelLegalHoldCommand = async (output, context) => {
1223
1223
  await collectBody(output.body, context);
1224
1224
  return contents;
1225
1225
  };
1226
- const de_CancelLegalHoldCommandError = async (output, context) => {
1227
- const parsedOutput = {
1228
- ...output,
1229
- body: await parseErrorBody(output.body, context),
1230
- };
1231
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1232
- switch (errorCode) {
1233
- case "InvalidParameterValueException":
1234
- case "com.amazonaws.backup#InvalidParameterValueException":
1235
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1236
- case "InvalidResourceStateException":
1237
- case "com.amazonaws.backup#InvalidResourceStateException":
1238
- throw await de_InvalidResourceStateExceptionRes(parsedOutput, context);
1239
- case "MissingParameterValueException":
1240
- case "com.amazonaws.backup#MissingParameterValueException":
1241
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1242
- case "ResourceNotFoundException":
1243
- case "com.amazonaws.backup#ResourceNotFoundException":
1244
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1245
- case "ServiceUnavailableException":
1246
- case "com.amazonaws.backup#ServiceUnavailableException":
1247
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1248
- default:
1249
- const parsedBody = parsedOutput.body;
1250
- return throwDefaultError({
1251
- output,
1252
- parsedBody,
1253
- errorCode,
1254
- });
1255
- }
1256
- };
1257
1226
  export const de_CreateBackupPlanCommand = async (output, context) => {
1258
1227
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1259
- return de_CreateBackupPlanCommandError(output, context);
1228
+ return de_CommandError(output, context);
1260
1229
  }
1261
1230
  const contents = map({
1262
1231
  $metadata: deserializeMetadata(output),
@@ -1272,40 +1241,9 @@ export const de_CreateBackupPlanCommand = async (output, context) => {
1272
1241
  Object.assign(contents, doc);
1273
1242
  return contents;
1274
1243
  };
1275
- const de_CreateBackupPlanCommandError = async (output, context) => {
1276
- const parsedOutput = {
1277
- ...output,
1278
- body: await parseErrorBody(output.body, context),
1279
- };
1280
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1281
- switch (errorCode) {
1282
- case "AlreadyExistsException":
1283
- case "com.amazonaws.backup#AlreadyExistsException":
1284
- throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
1285
- case "InvalidParameterValueException":
1286
- case "com.amazonaws.backup#InvalidParameterValueException":
1287
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1288
- case "LimitExceededException":
1289
- case "com.amazonaws.backup#LimitExceededException":
1290
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1291
- case "MissingParameterValueException":
1292
- case "com.amazonaws.backup#MissingParameterValueException":
1293
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1294
- case "ServiceUnavailableException":
1295
- case "com.amazonaws.backup#ServiceUnavailableException":
1296
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1297
- default:
1298
- const parsedBody = parsedOutput.body;
1299
- return throwDefaultError({
1300
- output,
1301
- parsedBody,
1302
- errorCode,
1303
- });
1304
- }
1305
- };
1306
1244
  export const de_CreateBackupSelectionCommand = async (output, context) => {
1307
1245
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1308
- return de_CreateBackupSelectionCommandError(output, context);
1246
+ return de_CommandError(output, context);
1309
1247
  }
1310
1248
  const contents = map({
1311
1249
  $metadata: deserializeMetadata(output),
@@ -1319,40 +1257,9 @@ export const de_CreateBackupSelectionCommand = async (output, context) => {
1319
1257
  Object.assign(contents, doc);
1320
1258
  return contents;
1321
1259
  };
1322
- const de_CreateBackupSelectionCommandError = async (output, context) => {
1323
- const parsedOutput = {
1324
- ...output,
1325
- body: await parseErrorBody(output.body, context),
1326
- };
1327
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1328
- switch (errorCode) {
1329
- case "AlreadyExistsException":
1330
- case "com.amazonaws.backup#AlreadyExistsException":
1331
- throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
1332
- case "InvalidParameterValueException":
1333
- case "com.amazonaws.backup#InvalidParameterValueException":
1334
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1335
- case "LimitExceededException":
1336
- case "com.amazonaws.backup#LimitExceededException":
1337
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1338
- case "MissingParameterValueException":
1339
- case "com.amazonaws.backup#MissingParameterValueException":
1340
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1341
- case "ServiceUnavailableException":
1342
- case "com.amazonaws.backup#ServiceUnavailableException":
1343
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1344
- default:
1345
- const parsedBody = parsedOutput.body;
1346
- return throwDefaultError({
1347
- output,
1348
- parsedBody,
1349
- errorCode,
1350
- });
1351
- }
1352
- };
1353
1260
  export const de_CreateBackupVaultCommand = async (output, context) => {
1354
1261
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1355
- return de_CreateBackupVaultCommandError(output, context);
1262
+ return de_CommandError(output, context);
1356
1263
  }
1357
1264
  const contents = map({
1358
1265
  $metadata: deserializeMetadata(output),
@@ -1366,40 +1273,9 @@ export const de_CreateBackupVaultCommand = async (output, context) => {
1366
1273
  Object.assign(contents, doc);
1367
1274
  return contents;
1368
1275
  };
1369
- const de_CreateBackupVaultCommandError = async (output, context) => {
1370
- const parsedOutput = {
1371
- ...output,
1372
- body: await parseErrorBody(output.body, context),
1373
- };
1374
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1375
- switch (errorCode) {
1376
- case "AlreadyExistsException":
1377
- case "com.amazonaws.backup#AlreadyExistsException":
1378
- throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
1379
- case "InvalidParameterValueException":
1380
- case "com.amazonaws.backup#InvalidParameterValueException":
1381
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1382
- case "LimitExceededException":
1383
- case "com.amazonaws.backup#LimitExceededException":
1384
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1385
- case "MissingParameterValueException":
1386
- case "com.amazonaws.backup#MissingParameterValueException":
1387
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1388
- case "ServiceUnavailableException":
1389
- case "com.amazonaws.backup#ServiceUnavailableException":
1390
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1391
- default:
1392
- const parsedBody = parsedOutput.body;
1393
- return throwDefaultError({
1394
- output,
1395
- parsedBody,
1396
- errorCode,
1397
- });
1398
- }
1399
- };
1400
1276
  export const de_CreateFrameworkCommand = async (output, context) => {
1401
1277
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1402
- return de_CreateFrameworkCommandError(output, context);
1278
+ return de_CommandError(output, context);
1403
1279
  }
1404
1280
  const contents = map({
1405
1281
  $metadata: deserializeMetadata(output),
@@ -1412,40 +1288,9 @@ export const de_CreateFrameworkCommand = async (output, context) => {
1412
1288
  Object.assign(contents, doc);
1413
1289
  return contents;
1414
1290
  };
1415
- const de_CreateFrameworkCommandError = async (output, context) => {
1416
- const parsedOutput = {
1417
- ...output,
1418
- body: await parseErrorBody(output.body, context),
1419
- };
1420
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1421
- switch (errorCode) {
1422
- case "AlreadyExistsException":
1423
- case "com.amazonaws.backup#AlreadyExistsException":
1424
- throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
1425
- case "InvalidParameterValueException":
1426
- case "com.amazonaws.backup#InvalidParameterValueException":
1427
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1428
- case "LimitExceededException":
1429
- case "com.amazonaws.backup#LimitExceededException":
1430
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1431
- case "MissingParameterValueException":
1432
- case "com.amazonaws.backup#MissingParameterValueException":
1433
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1434
- case "ServiceUnavailableException":
1435
- case "com.amazonaws.backup#ServiceUnavailableException":
1436
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1437
- default:
1438
- const parsedBody = parsedOutput.body;
1439
- return throwDefaultError({
1440
- output,
1441
- parsedBody,
1442
- errorCode,
1443
- });
1444
- }
1445
- };
1446
1291
  export const de_CreateLegalHoldCommand = async (output, context) => {
1447
1292
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1448
- return de_CreateLegalHoldCommandError(output, context);
1293
+ return de_CommandError(output, context);
1449
1294
  }
1450
1295
  const contents = map({
1451
1296
  $metadata: deserializeMetadata(output),
@@ -1463,37 +1308,9 @@ export const de_CreateLegalHoldCommand = async (output, context) => {
1463
1308
  Object.assign(contents, doc);
1464
1309
  return contents;
1465
1310
  };
1466
- const de_CreateLegalHoldCommandError = async (output, context) => {
1467
- const parsedOutput = {
1468
- ...output,
1469
- body: await parseErrorBody(output.body, context),
1470
- };
1471
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1472
- switch (errorCode) {
1473
- case "InvalidParameterValueException":
1474
- case "com.amazonaws.backup#InvalidParameterValueException":
1475
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1476
- case "LimitExceededException":
1477
- case "com.amazonaws.backup#LimitExceededException":
1478
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1479
- case "MissingParameterValueException":
1480
- case "com.amazonaws.backup#MissingParameterValueException":
1481
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1482
- case "ServiceUnavailableException":
1483
- case "com.amazonaws.backup#ServiceUnavailableException":
1484
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1485
- default:
1486
- const parsedBody = parsedOutput.body;
1487
- return throwDefaultError({
1488
- output,
1489
- parsedBody,
1490
- errorCode,
1491
- });
1492
- }
1493
- };
1494
1311
  export const de_CreateLogicallyAirGappedBackupVaultCommand = async (output, context) => {
1495
1312
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1496
- return de_CreateLogicallyAirGappedBackupVaultCommandError(output, context);
1313
+ return de_CommandError(output, context);
1497
1314
  }
1498
1315
  const contents = map({
1499
1316
  $metadata: deserializeMetadata(output),
@@ -1508,43 +1325,9 @@ export const de_CreateLogicallyAirGappedBackupVaultCommand = async (output, cont
1508
1325
  Object.assign(contents, doc);
1509
1326
  return contents;
1510
1327
  };
1511
- const de_CreateLogicallyAirGappedBackupVaultCommandError = async (output, context) => {
1512
- const parsedOutput = {
1513
- ...output,
1514
- body: await parseErrorBody(output.body, context),
1515
- };
1516
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1517
- switch (errorCode) {
1518
- case "AlreadyExistsException":
1519
- case "com.amazonaws.backup#AlreadyExistsException":
1520
- throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
1521
- case "InvalidParameterValueException":
1522
- case "com.amazonaws.backup#InvalidParameterValueException":
1523
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1524
- case "InvalidRequestException":
1525
- case "com.amazonaws.backup#InvalidRequestException":
1526
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1527
- case "LimitExceededException":
1528
- case "com.amazonaws.backup#LimitExceededException":
1529
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1530
- case "MissingParameterValueException":
1531
- case "com.amazonaws.backup#MissingParameterValueException":
1532
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1533
- case "ServiceUnavailableException":
1534
- case "com.amazonaws.backup#ServiceUnavailableException":
1535
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1536
- default:
1537
- const parsedBody = parsedOutput.body;
1538
- return throwDefaultError({
1539
- output,
1540
- parsedBody,
1541
- errorCode,
1542
- });
1543
- }
1544
- };
1545
1328
  export const de_CreateReportPlanCommand = async (output, context) => {
1546
1329
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1547
- return de_CreateReportPlanCommandError(output, context);
1330
+ return de_CommandError(output, context);
1548
1331
  }
1549
1332
  const contents = map({
1550
1333
  $metadata: deserializeMetadata(output),
@@ -1558,40 +1341,25 @@ export const de_CreateReportPlanCommand = async (output, context) => {
1558
1341
  Object.assign(contents, doc);
1559
1342
  return contents;
1560
1343
  };
1561
- const de_CreateReportPlanCommandError = async (output, context) => {
1562
- const parsedOutput = {
1563
- ...output,
1564
- body: await parseErrorBody(output.body, context),
1565
- };
1566
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1567
- switch (errorCode) {
1568
- case "AlreadyExistsException":
1569
- case "com.amazonaws.backup#AlreadyExistsException":
1570
- throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
1571
- case "InvalidParameterValueException":
1572
- case "com.amazonaws.backup#InvalidParameterValueException":
1573
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1574
- case "LimitExceededException":
1575
- case "com.amazonaws.backup#LimitExceededException":
1576
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1577
- case "MissingParameterValueException":
1578
- case "com.amazonaws.backup#MissingParameterValueException":
1579
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1580
- case "ServiceUnavailableException":
1581
- case "com.amazonaws.backup#ServiceUnavailableException":
1582
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1583
- default:
1584
- const parsedBody = parsedOutput.body;
1585
- return throwDefaultError({
1586
- output,
1587
- parsedBody,
1588
- errorCode,
1589
- });
1344
+ export const de_CreateRestoreTestingPlanCommand = async (output, context) => {
1345
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1346
+ return de_CommandError(output, context);
1590
1347
  }
1348
+ const contents = map({
1349
+ $metadata: deserializeMetadata(output),
1350
+ });
1351
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1352
+ const doc = take(data, {
1353
+ CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1354
+ RestoreTestingPlanArn: __expectString,
1355
+ RestoreTestingPlanName: __expectString,
1356
+ });
1357
+ Object.assign(contents, doc);
1358
+ return contents;
1591
1359
  };
1592
- export const de_CreateRestoreTestingPlanCommand = async (output, context) => {
1360
+ export const de_CreateRestoreTestingSelectionCommand = async (output, context) => {
1593
1361
  if (output.statusCode !== 201 && output.statusCode >= 300) {
1594
- return de_CreateRestoreTestingPlanCommandError(output, context);
1362
+ return de_CommandError(output, context);
1595
1363
  }
1596
1364
  const contents = map({
1597
1365
  $metadata: deserializeMetadata(output),
@@ -1601,98 +1369,14 @@ export const de_CreateRestoreTestingPlanCommand = async (output, context) => {
1601
1369
  CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1602
1370
  RestoreTestingPlanArn: __expectString,
1603
1371
  RestoreTestingPlanName: __expectString,
1372
+ RestoreTestingSelectionName: __expectString,
1604
1373
  });
1605
1374
  Object.assign(contents, doc);
1606
1375
  return contents;
1607
1376
  };
1608
- const de_CreateRestoreTestingPlanCommandError = async (output, context) => {
1609
- const parsedOutput = {
1610
- ...output,
1611
- body: await parseErrorBody(output.body, context),
1612
- };
1613
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1614
- switch (errorCode) {
1615
- case "AlreadyExistsException":
1616
- case "com.amazonaws.backup#AlreadyExistsException":
1617
- throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
1618
- case "ConflictException":
1619
- case "com.amazonaws.backup#ConflictException":
1620
- throw await de_ConflictExceptionRes(parsedOutput, context);
1621
- case "InvalidParameterValueException":
1622
- case "com.amazonaws.backup#InvalidParameterValueException":
1623
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1624
- case "LimitExceededException":
1625
- case "com.amazonaws.backup#LimitExceededException":
1626
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1627
- case "MissingParameterValueException":
1628
- case "com.amazonaws.backup#MissingParameterValueException":
1629
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1630
- case "ServiceUnavailableException":
1631
- case "com.amazonaws.backup#ServiceUnavailableException":
1632
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1633
- default:
1634
- const parsedBody = parsedOutput.body;
1635
- return throwDefaultError({
1636
- output,
1637
- parsedBody,
1638
- errorCode,
1639
- });
1640
- }
1641
- };
1642
- export const de_CreateRestoreTestingSelectionCommand = async (output, context) => {
1643
- if (output.statusCode !== 201 && output.statusCode >= 300) {
1644
- return de_CreateRestoreTestingSelectionCommandError(output, context);
1645
- }
1646
- const contents = map({
1647
- $metadata: deserializeMetadata(output),
1648
- });
1649
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1650
- const doc = take(data, {
1651
- CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1652
- RestoreTestingPlanArn: __expectString,
1653
- RestoreTestingPlanName: __expectString,
1654
- RestoreTestingSelectionName: __expectString,
1655
- });
1656
- Object.assign(contents, doc);
1657
- return contents;
1658
- };
1659
- const de_CreateRestoreTestingSelectionCommandError = async (output, context) => {
1660
- const parsedOutput = {
1661
- ...output,
1662
- body: await parseErrorBody(output.body, context),
1663
- };
1664
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1665
- switch (errorCode) {
1666
- case "AlreadyExistsException":
1667
- case "com.amazonaws.backup#AlreadyExistsException":
1668
- throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
1669
- case "InvalidParameterValueException":
1670
- case "com.amazonaws.backup#InvalidParameterValueException":
1671
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1672
- case "LimitExceededException":
1673
- case "com.amazonaws.backup#LimitExceededException":
1674
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
1675
- case "MissingParameterValueException":
1676
- case "com.amazonaws.backup#MissingParameterValueException":
1677
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1678
- case "ResourceNotFoundException":
1679
- case "com.amazonaws.backup#ResourceNotFoundException":
1680
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1681
- case "ServiceUnavailableException":
1682
- case "com.amazonaws.backup#ServiceUnavailableException":
1683
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1684
- default:
1685
- const parsedBody = parsedOutput.body;
1686
- return throwDefaultError({
1687
- output,
1688
- parsedBody,
1689
- errorCode,
1690
- });
1691
- }
1692
- };
1693
1377
  export const de_DeleteBackupPlanCommand = async (output, context) => {
1694
1378
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1695
- return de_DeleteBackupPlanCommandError(output, context);
1379
+ return de_CommandError(output, context);
1696
1380
  }
1697
1381
  const contents = map({
1698
1382
  $metadata: deserializeMetadata(output),
@@ -1707,40 +1391,9 @@ export const de_DeleteBackupPlanCommand = async (output, context) => {
1707
1391
  Object.assign(contents, doc);
1708
1392
  return contents;
1709
1393
  };
1710
- const de_DeleteBackupPlanCommandError = async (output, context) => {
1711
- const parsedOutput = {
1712
- ...output,
1713
- body: await parseErrorBody(output.body, context),
1714
- };
1715
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1716
- switch (errorCode) {
1717
- case "InvalidParameterValueException":
1718
- case "com.amazonaws.backup#InvalidParameterValueException":
1719
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1720
- case "InvalidRequestException":
1721
- case "com.amazonaws.backup#InvalidRequestException":
1722
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1723
- case "MissingParameterValueException":
1724
- case "com.amazonaws.backup#MissingParameterValueException":
1725
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1726
- case "ResourceNotFoundException":
1727
- case "com.amazonaws.backup#ResourceNotFoundException":
1728
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1729
- case "ServiceUnavailableException":
1730
- case "com.amazonaws.backup#ServiceUnavailableException":
1731
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1732
- default:
1733
- const parsedBody = parsedOutput.body;
1734
- return throwDefaultError({
1735
- output,
1736
- parsedBody,
1737
- errorCode,
1738
- });
1739
- }
1740
- };
1741
1394
  export const de_DeleteBackupSelectionCommand = async (output, context) => {
1742
1395
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1743
- return de_DeleteBackupSelectionCommandError(output, context);
1396
+ return de_CommandError(output, context);
1744
1397
  }
1745
1398
  const contents = map({
1746
1399
  $metadata: deserializeMetadata(output),
@@ -1748,37 +1401,9 @@ export const de_DeleteBackupSelectionCommand = async (output, context) => {
1748
1401
  await collectBody(output.body, context);
1749
1402
  return contents;
1750
1403
  };
1751
- const de_DeleteBackupSelectionCommandError = async (output, context) => {
1752
- const parsedOutput = {
1753
- ...output,
1754
- body: await parseErrorBody(output.body, context),
1755
- };
1756
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1757
- switch (errorCode) {
1758
- case "InvalidParameterValueException":
1759
- case "com.amazonaws.backup#InvalidParameterValueException":
1760
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1761
- case "MissingParameterValueException":
1762
- case "com.amazonaws.backup#MissingParameterValueException":
1763
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1764
- case "ResourceNotFoundException":
1765
- case "com.amazonaws.backup#ResourceNotFoundException":
1766
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1767
- case "ServiceUnavailableException":
1768
- case "com.amazonaws.backup#ServiceUnavailableException":
1769
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1770
- default:
1771
- const parsedBody = parsedOutput.body;
1772
- return throwDefaultError({
1773
- output,
1774
- parsedBody,
1775
- errorCode,
1776
- });
1777
- }
1778
- };
1779
1404
  export const de_DeleteBackupVaultCommand = async (output, context) => {
1780
1405
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1781
- return de_DeleteBackupVaultCommandError(output, context);
1406
+ return de_CommandError(output, context);
1782
1407
  }
1783
1408
  const contents = map({
1784
1409
  $metadata: deserializeMetadata(output),
@@ -1786,40 +1411,9 @@ export const de_DeleteBackupVaultCommand = async (output, context) => {
1786
1411
  await collectBody(output.body, context);
1787
1412
  return contents;
1788
1413
  };
1789
- const de_DeleteBackupVaultCommandError = async (output, context) => {
1790
- const parsedOutput = {
1791
- ...output,
1792
- body: await parseErrorBody(output.body, context),
1793
- };
1794
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1795
- switch (errorCode) {
1796
- case "InvalidParameterValueException":
1797
- case "com.amazonaws.backup#InvalidParameterValueException":
1798
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1799
- case "InvalidRequestException":
1800
- case "com.amazonaws.backup#InvalidRequestException":
1801
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1802
- case "MissingParameterValueException":
1803
- case "com.amazonaws.backup#MissingParameterValueException":
1804
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1805
- case "ResourceNotFoundException":
1806
- case "com.amazonaws.backup#ResourceNotFoundException":
1807
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1808
- case "ServiceUnavailableException":
1809
- case "com.amazonaws.backup#ServiceUnavailableException":
1810
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1811
- default:
1812
- const parsedBody = parsedOutput.body;
1813
- return throwDefaultError({
1814
- output,
1815
- parsedBody,
1816
- errorCode,
1817
- });
1818
- }
1819
- };
1820
1414
  export const de_DeleteBackupVaultAccessPolicyCommand = async (output, context) => {
1821
1415
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1822
- return de_DeleteBackupVaultAccessPolicyCommandError(output, context);
1416
+ return de_CommandError(output, context);
1823
1417
  }
1824
1418
  const contents = map({
1825
1419
  $metadata: deserializeMetadata(output),
@@ -1827,37 +1421,9 @@ export const de_DeleteBackupVaultAccessPolicyCommand = async (output, context) =
1827
1421
  await collectBody(output.body, context);
1828
1422
  return contents;
1829
1423
  };
1830
- const de_DeleteBackupVaultAccessPolicyCommandError = async (output, context) => {
1831
- const parsedOutput = {
1832
- ...output,
1833
- body: await parseErrorBody(output.body, context),
1834
- };
1835
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1836
- switch (errorCode) {
1837
- case "InvalidParameterValueException":
1838
- case "com.amazonaws.backup#InvalidParameterValueException":
1839
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1840
- case "MissingParameterValueException":
1841
- case "com.amazonaws.backup#MissingParameterValueException":
1842
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1843
- case "ResourceNotFoundException":
1844
- case "com.amazonaws.backup#ResourceNotFoundException":
1845
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1846
- case "ServiceUnavailableException":
1847
- case "com.amazonaws.backup#ServiceUnavailableException":
1848
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1849
- default:
1850
- const parsedBody = parsedOutput.body;
1851
- return throwDefaultError({
1852
- output,
1853
- parsedBody,
1854
- errorCode,
1855
- });
1856
- }
1857
- };
1858
1424
  export const de_DeleteBackupVaultLockConfigurationCommand = async (output, context) => {
1859
1425
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1860
- return de_DeleteBackupVaultLockConfigurationCommandError(output, context);
1426
+ return de_CommandError(output, context);
1861
1427
  }
1862
1428
  const contents = map({
1863
1429
  $metadata: deserializeMetadata(output),
@@ -1865,40 +1431,9 @@ export const de_DeleteBackupVaultLockConfigurationCommand = async (output, conte
1865
1431
  await collectBody(output.body, context);
1866
1432
  return contents;
1867
1433
  };
1868
- const de_DeleteBackupVaultLockConfigurationCommandError = async (output, context) => {
1869
- const parsedOutput = {
1870
- ...output,
1871
- body: await parseErrorBody(output.body, context),
1872
- };
1873
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1874
- switch (errorCode) {
1875
- case "InvalidParameterValueException":
1876
- case "com.amazonaws.backup#InvalidParameterValueException":
1877
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1878
- case "InvalidRequestException":
1879
- case "com.amazonaws.backup#InvalidRequestException":
1880
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1881
- case "MissingParameterValueException":
1882
- case "com.amazonaws.backup#MissingParameterValueException":
1883
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1884
- case "ResourceNotFoundException":
1885
- case "com.amazonaws.backup#ResourceNotFoundException":
1886
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1887
- case "ServiceUnavailableException":
1888
- case "com.amazonaws.backup#ServiceUnavailableException":
1889
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1890
- default:
1891
- const parsedBody = parsedOutput.body;
1892
- return throwDefaultError({
1893
- output,
1894
- parsedBody,
1895
- errorCode,
1896
- });
1897
- }
1898
- };
1899
1434
  export const de_DeleteBackupVaultNotificationsCommand = async (output, context) => {
1900
1435
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1901
- return de_DeleteBackupVaultNotificationsCommandError(output, context);
1436
+ return de_CommandError(output, context);
1902
1437
  }
1903
1438
  const contents = map({
1904
1439
  $metadata: deserializeMetadata(output),
@@ -1906,37 +1441,9 @@ export const de_DeleteBackupVaultNotificationsCommand = async (output, context)
1906
1441
  await collectBody(output.body, context);
1907
1442
  return contents;
1908
1443
  };
1909
- const de_DeleteBackupVaultNotificationsCommandError = async (output, context) => {
1910
- const parsedOutput = {
1911
- ...output,
1912
- body: await parseErrorBody(output.body, context),
1913
- };
1914
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1915
- switch (errorCode) {
1916
- case "InvalidParameterValueException":
1917
- case "com.amazonaws.backup#InvalidParameterValueException":
1918
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1919
- case "MissingParameterValueException":
1920
- case "com.amazonaws.backup#MissingParameterValueException":
1921
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1922
- case "ResourceNotFoundException":
1923
- case "com.amazonaws.backup#ResourceNotFoundException":
1924
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1925
- case "ServiceUnavailableException":
1926
- case "com.amazonaws.backup#ServiceUnavailableException":
1927
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1928
- default:
1929
- const parsedBody = parsedOutput.body;
1930
- return throwDefaultError({
1931
- output,
1932
- parsedBody,
1933
- errorCode,
1934
- });
1935
- }
1936
- };
1937
1444
  export const de_DeleteFrameworkCommand = async (output, context) => {
1938
1445
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1939
- return de_DeleteFrameworkCommandError(output, context);
1446
+ return de_CommandError(output, context);
1940
1447
  }
1941
1448
  const contents = map({
1942
1449
  $metadata: deserializeMetadata(output),
@@ -1944,40 +1451,9 @@ export const de_DeleteFrameworkCommand = async (output, context) => {
1944
1451
  await collectBody(output.body, context);
1945
1452
  return contents;
1946
1453
  };
1947
- const de_DeleteFrameworkCommandError = async (output, context) => {
1948
- const parsedOutput = {
1949
- ...output,
1950
- body: await parseErrorBody(output.body, context),
1951
- };
1952
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1953
- switch (errorCode) {
1954
- case "ConflictException":
1955
- case "com.amazonaws.backup#ConflictException":
1956
- throw await de_ConflictExceptionRes(parsedOutput, context);
1957
- case "InvalidParameterValueException":
1958
- case "com.amazonaws.backup#InvalidParameterValueException":
1959
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1960
- case "MissingParameterValueException":
1961
- case "com.amazonaws.backup#MissingParameterValueException":
1962
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
1963
- case "ResourceNotFoundException":
1964
- case "com.amazonaws.backup#ResourceNotFoundException":
1965
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1966
- case "ServiceUnavailableException":
1967
- case "com.amazonaws.backup#ServiceUnavailableException":
1968
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1969
- default:
1970
- const parsedBody = parsedOutput.body;
1971
- return throwDefaultError({
1972
- output,
1973
- parsedBody,
1974
- errorCode,
1975
- });
1976
- }
1977
- };
1978
1454
  export const de_DeleteRecoveryPointCommand = async (output, context) => {
1979
1455
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1980
- return de_DeleteRecoveryPointCommandError(output, context);
1456
+ return de_CommandError(output, context);
1981
1457
  }
1982
1458
  const contents = map({
1983
1459
  $metadata: deserializeMetadata(output),
@@ -1985,43 +1461,9 @@ export const de_DeleteRecoveryPointCommand = async (output, context) => {
1985
1461
  await collectBody(output.body, context);
1986
1462
  return contents;
1987
1463
  };
1988
- const de_DeleteRecoveryPointCommandError = async (output, context) => {
1989
- const parsedOutput = {
1990
- ...output,
1991
- body: await parseErrorBody(output.body, context),
1992
- };
1993
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1994
- switch (errorCode) {
1995
- case "InvalidParameterValueException":
1996
- case "com.amazonaws.backup#InvalidParameterValueException":
1997
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1998
- case "InvalidRequestException":
1999
- case "com.amazonaws.backup#InvalidRequestException":
2000
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2001
- case "InvalidResourceStateException":
2002
- case "com.amazonaws.backup#InvalidResourceStateException":
2003
- throw await de_InvalidResourceStateExceptionRes(parsedOutput, context);
2004
- case "MissingParameterValueException":
2005
- case "com.amazonaws.backup#MissingParameterValueException":
2006
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2007
- case "ResourceNotFoundException":
2008
- case "com.amazonaws.backup#ResourceNotFoundException":
2009
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2010
- case "ServiceUnavailableException":
2011
- case "com.amazonaws.backup#ServiceUnavailableException":
2012
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2013
- default:
2014
- const parsedBody = parsedOutput.body;
2015
- return throwDefaultError({
2016
- output,
2017
- parsedBody,
2018
- errorCode,
2019
- });
2020
- }
2021
- };
2022
1464
  export const de_DeleteReportPlanCommand = async (output, context) => {
2023
1465
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2024
- return de_DeleteReportPlanCommandError(output, context);
1466
+ return de_CommandError(output, context);
2025
1467
  }
2026
1468
  const contents = map({
2027
1469
  $metadata: deserializeMetadata(output),
@@ -2029,40 +1471,9 @@ export const de_DeleteReportPlanCommand = async (output, context) => {
2029
1471
  await collectBody(output.body, context);
2030
1472
  return contents;
2031
1473
  };
2032
- const de_DeleteReportPlanCommandError = async (output, context) => {
2033
- const parsedOutput = {
2034
- ...output,
2035
- body: await parseErrorBody(output.body, context),
2036
- };
2037
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2038
- switch (errorCode) {
2039
- case "ConflictException":
2040
- case "com.amazonaws.backup#ConflictException":
2041
- throw await de_ConflictExceptionRes(parsedOutput, context);
2042
- case "InvalidParameterValueException":
2043
- case "com.amazonaws.backup#InvalidParameterValueException":
2044
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2045
- case "MissingParameterValueException":
2046
- case "com.amazonaws.backup#MissingParameterValueException":
2047
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2048
- case "ResourceNotFoundException":
2049
- case "com.amazonaws.backup#ResourceNotFoundException":
2050
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2051
- case "ServiceUnavailableException":
2052
- case "com.amazonaws.backup#ServiceUnavailableException":
2053
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2054
- default:
2055
- const parsedBody = parsedOutput.body;
2056
- return throwDefaultError({
2057
- output,
2058
- parsedBody,
2059
- errorCode,
2060
- });
2061
- }
2062
- };
2063
1474
  export const de_DeleteRestoreTestingPlanCommand = async (output, context) => {
2064
1475
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2065
- return de_DeleteRestoreTestingPlanCommandError(output, context);
1476
+ return de_CommandError(output, context);
2066
1477
  }
2067
1478
  const contents = map({
2068
1479
  $metadata: deserializeMetadata(output),
@@ -2070,63 +1481,19 @@ export const de_DeleteRestoreTestingPlanCommand = async (output, context) => {
2070
1481
  await collectBody(output.body, context);
2071
1482
  return contents;
2072
1483
  };
2073
- const de_DeleteRestoreTestingPlanCommandError = async (output, context) => {
2074
- const parsedOutput = {
2075
- ...output,
2076
- body: await parseErrorBody(output.body, context),
2077
- };
2078
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2079
- switch (errorCode) {
2080
- case "InvalidRequestException":
2081
- case "com.amazonaws.backup#InvalidRequestException":
2082
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2083
- case "ServiceUnavailableException":
2084
- case "com.amazonaws.backup#ServiceUnavailableException":
2085
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2086
- default:
2087
- const parsedBody = parsedOutput.body;
2088
- return throwDefaultError({
2089
- output,
2090
- parsedBody,
2091
- errorCode,
2092
- });
2093
- }
2094
- };
2095
1484
  export const de_DeleteRestoreTestingSelectionCommand = async (output, context) => {
2096
1485
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2097
- return de_DeleteRestoreTestingSelectionCommandError(output, context);
2098
- }
2099
- const contents = map({
2100
- $metadata: deserializeMetadata(output),
2101
- });
2102
- await collectBody(output.body, context);
2103
- return contents;
2104
- };
2105
- const de_DeleteRestoreTestingSelectionCommandError = async (output, context) => {
2106
- const parsedOutput = {
2107
- ...output,
2108
- body: await parseErrorBody(output.body, context),
2109
- };
2110
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2111
- switch (errorCode) {
2112
- case "ResourceNotFoundException":
2113
- case "com.amazonaws.backup#ResourceNotFoundException":
2114
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2115
- case "ServiceUnavailableException":
2116
- case "com.amazonaws.backup#ServiceUnavailableException":
2117
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2118
- default:
2119
- const parsedBody = parsedOutput.body;
2120
- return throwDefaultError({
2121
- output,
2122
- parsedBody,
2123
- errorCode,
2124
- });
1486
+ return de_CommandError(output, context);
2125
1487
  }
1488
+ const contents = map({
1489
+ $metadata: deserializeMetadata(output),
1490
+ });
1491
+ await collectBody(output.body, context);
1492
+ return contents;
2126
1493
  };
2127
1494
  export const de_DescribeBackupJobCommand = async (output, context) => {
2128
1495
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2129
- return de_DescribeBackupJobCommandError(output, context);
1496
+ return de_CommandError(output, context);
2130
1497
  }
2131
1498
  const contents = map({
2132
1499
  $metadata: deserializeMetadata(output),
@@ -2164,40 +1531,9 @@ export const de_DescribeBackupJobCommand = async (output, context) => {
2164
1531
  Object.assign(contents, doc);
2165
1532
  return contents;
2166
1533
  };
2167
- const de_DescribeBackupJobCommandError = async (output, context) => {
2168
- const parsedOutput = {
2169
- ...output,
2170
- body: await parseErrorBody(output.body, context),
2171
- };
2172
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2173
- switch (errorCode) {
2174
- case "DependencyFailureException":
2175
- case "com.amazonaws.backup#DependencyFailureException":
2176
- throw await de_DependencyFailureExceptionRes(parsedOutput, context);
2177
- case "InvalidParameterValueException":
2178
- case "com.amazonaws.backup#InvalidParameterValueException":
2179
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2180
- case "MissingParameterValueException":
2181
- case "com.amazonaws.backup#MissingParameterValueException":
2182
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2183
- case "ResourceNotFoundException":
2184
- case "com.amazonaws.backup#ResourceNotFoundException":
2185
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2186
- case "ServiceUnavailableException":
2187
- case "com.amazonaws.backup#ServiceUnavailableException":
2188
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2189
- default:
2190
- const parsedBody = parsedOutput.body;
2191
- return throwDefaultError({
2192
- output,
2193
- parsedBody,
2194
- errorCode,
2195
- });
2196
- }
2197
- };
2198
1534
  export const de_DescribeBackupVaultCommand = async (output, context) => {
2199
1535
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2200
- return de_DescribeBackupVaultCommandError(output, context);
1536
+ return de_CommandError(output, context);
2201
1537
  }
2202
1538
  const contents = map({
2203
1539
  $metadata: deserializeMetadata(output),
@@ -2219,37 +1555,9 @@ export const de_DescribeBackupVaultCommand = async (output, context) => {
2219
1555
  Object.assign(contents, doc);
2220
1556
  return contents;
2221
1557
  };
2222
- const de_DescribeBackupVaultCommandError = async (output, context) => {
2223
- const parsedOutput = {
2224
- ...output,
2225
- body: await parseErrorBody(output.body, context),
2226
- };
2227
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2228
- switch (errorCode) {
2229
- case "InvalidParameterValueException":
2230
- case "com.amazonaws.backup#InvalidParameterValueException":
2231
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2232
- case "MissingParameterValueException":
2233
- case "com.amazonaws.backup#MissingParameterValueException":
2234
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2235
- case "ResourceNotFoundException":
2236
- case "com.amazonaws.backup#ResourceNotFoundException":
2237
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2238
- case "ServiceUnavailableException":
2239
- case "com.amazonaws.backup#ServiceUnavailableException":
2240
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2241
- default:
2242
- const parsedBody = parsedOutput.body;
2243
- return throwDefaultError({
2244
- output,
2245
- parsedBody,
2246
- errorCode,
2247
- });
2248
- }
2249
- };
2250
1558
  export const de_DescribeCopyJobCommand = async (output, context) => {
2251
1559
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2252
- return de_DescribeCopyJobCommandError(output, context);
1560
+ return de_CommandError(output, context);
2253
1561
  }
2254
1562
  const contents = map({
2255
1563
  $metadata: deserializeMetadata(output),
@@ -2261,37 +1569,9 @@ export const de_DescribeCopyJobCommand = async (output, context) => {
2261
1569
  Object.assign(contents, doc);
2262
1570
  return contents;
2263
1571
  };
2264
- const de_DescribeCopyJobCommandError = async (output, context) => {
2265
- const parsedOutput = {
2266
- ...output,
2267
- body: await parseErrorBody(output.body, context),
2268
- };
2269
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2270
- switch (errorCode) {
2271
- case "InvalidParameterValueException":
2272
- case "com.amazonaws.backup#InvalidParameterValueException":
2273
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2274
- case "MissingParameterValueException":
2275
- case "com.amazonaws.backup#MissingParameterValueException":
2276
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2277
- case "ResourceNotFoundException":
2278
- case "com.amazonaws.backup#ResourceNotFoundException":
2279
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2280
- case "ServiceUnavailableException":
2281
- case "com.amazonaws.backup#ServiceUnavailableException":
2282
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2283
- default:
2284
- const parsedBody = parsedOutput.body;
2285
- return throwDefaultError({
2286
- output,
2287
- parsedBody,
2288
- errorCode,
2289
- });
2290
- }
2291
- };
2292
1572
  export const de_DescribeFrameworkCommand = async (output, context) => {
2293
1573
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2294
- return de_DescribeFrameworkCommandError(output, context);
1574
+ return de_CommandError(output, context);
2295
1575
  }
2296
1576
  const contents = map({
2297
1577
  $metadata: deserializeMetadata(output),
@@ -2310,37 +1590,9 @@ export const de_DescribeFrameworkCommand = async (output, context) => {
2310
1590
  Object.assign(contents, doc);
2311
1591
  return contents;
2312
1592
  };
2313
- const de_DescribeFrameworkCommandError = async (output, context) => {
2314
- const parsedOutput = {
2315
- ...output,
2316
- body: await parseErrorBody(output.body, context),
2317
- };
2318
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2319
- switch (errorCode) {
2320
- case "InvalidParameterValueException":
2321
- case "com.amazonaws.backup#InvalidParameterValueException":
2322
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2323
- case "MissingParameterValueException":
2324
- case "com.amazonaws.backup#MissingParameterValueException":
2325
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2326
- case "ResourceNotFoundException":
2327
- case "com.amazonaws.backup#ResourceNotFoundException":
2328
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2329
- case "ServiceUnavailableException":
2330
- case "com.amazonaws.backup#ServiceUnavailableException":
2331
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2332
- default:
2333
- const parsedBody = parsedOutput.body;
2334
- return throwDefaultError({
2335
- output,
2336
- parsedBody,
2337
- errorCode,
2338
- });
2339
- }
2340
- };
2341
1593
  export const de_DescribeGlobalSettingsCommand = async (output, context) => {
2342
1594
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2343
- return de_DescribeGlobalSettingsCommandError(output, context);
1595
+ return de_CommandError(output, context);
2344
1596
  }
2345
1597
  const contents = map({
2346
1598
  $metadata: deserializeMetadata(output),
@@ -2353,31 +1605,9 @@ export const de_DescribeGlobalSettingsCommand = async (output, context) => {
2353
1605
  Object.assign(contents, doc);
2354
1606
  return contents;
2355
1607
  };
2356
- const de_DescribeGlobalSettingsCommandError = async (output, context) => {
2357
- const parsedOutput = {
2358
- ...output,
2359
- body: await parseErrorBody(output.body, context),
2360
- };
2361
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2362
- switch (errorCode) {
2363
- case "InvalidRequestException":
2364
- case "com.amazonaws.backup#InvalidRequestException":
2365
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2366
- case "ServiceUnavailableException":
2367
- case "com.amazonaws.backup#ServiceUnavailableException":
2368
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2369
- default:
2370
- const parsedBody = parsedOutput.body;
2371
- return throwDefaultError({
2372
- output,
2373
- parsedBody,
2374
- errorCode,
2375
- });
2376
- }
2377
- };
2378
1608
  export const de_DescribeProtectedResourceCommand = async (output, context) => {
2379
1609
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2380
- return de_DescribeProtectedResourceCommandError(output, context);
1610
+ return de_CommandError(output, context);
2381
1611
  }
2382
1612
  const contents = map({
2383
1613
  $metadata: deserializeMetadata(output),
@@ -2397,37 +1627,9 @@ export const de_DescribeProtectedResourceCommand = async (output, context) => {
2397
1627
  Object.assign(contents, doc);
2398
1628
  return contents;
2399
1629
  };
2400
- const de_DescribeProtectedResourceCommandError = async (output, context) => {
2401
- const parsedOutput = {
2402
- ...output,
2403
- body: await parseErrorBody(output.body, context),
2404
- };
2405
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2406
- switch (errorCode) {
2407
- case "InvalidParameterValueException":
2408
- case "com.amazonaws.backup#InvalidParameterValueException":
2409
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2410
- case "MissingParameterValueException":
2411
- case "com.amazonaws.backup#MissingParameterValueException":
2412
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2413
- case "ResourceNotFoundException":
2414
- case "com.amazonaws.backup#ResourceNotFoundException":
2415
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2416
- case "ServiceUnavailableException":
2417
- case "com.amazonaws.backup#ServiceUnavailableException":
2418
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2419
- default:
2420
- const parsedBody = parsedOutput.body;
2421
- return throwDefaultError({
2422
- output,
2423
- parsedBody,
2424
- errorCode,
2425
- });
2426
- }
2427
- };
2428
1630
  export const de_DescribeRecoveryPointCommand = async (output, context) => {
2429
1631
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2430
- return de_DescribeRecoveryPointCommandError(output, context);
1632
+ return de_CommandError(output, context);
2431
1633
  }
2432
1634
  const contents = map({
2433
1635
  $metadata: deserializeMetadata(output),
@@ -2462,152 +1664,52 @@ export const de_DescribeRecoveryPointCommand = async (output, context) => {
2462
1664
  Object.assign(contents, doc);
2463
1665
  return contents;
2464
1666
  };
2465
- const de_DescribeRecoveryPointCommandError = async (output, context) => {
2466
- const parsedOutput = {
2467
- ...output,
2468
- body: await parseErrorBody(output.body, context),
2469
- };
2470
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2471
- switch (errorCode) {
2472
- case "InvalidParameterValueException":
2473
- case "com.amazonaws.backup#InvalidParameterValueException":
2474
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2475
- case "MissingParameterValueException":
2476
- case "com.amazonaws.backup#MissingParameterValueException":
2477
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2478
- case "ResourceNotFoundException":
2479
- case "com.amazonaws.backup#ResourceNotFoundException":
2480
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2481
- case "ServiceUnavailableException":
2482
- case "com.amazonaws.backup#ServiceUnavailableException":
2483
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2484
- default:
2485
- const parsedBody = parsedOutput.body;
2486
- return throwDefaultError({
2487
- output,
2488
- parsedBody,
2489
- errorCode,
2490
- });
2491
- }
2492
- };
2493
1667
  export const de_DescribeRegionSettingsCommand = async (output, context) => {
2494
1668
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2495
- return de_DescribeRegionSettingsCommandError(output, context);
2496
- }
2497
- const contents = map({
2498
- $metadata: deserializeMetadata(output),
2499
- });
2500
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2501
- const doc = take(data, {
2502
- ResourceTypeManagementPreference: _json,
2503
- ResourceTypeOptInPreference: _json,
2504
- });
2505
- Object.assign(contents, doc);
2506
- return contents;
2507
- };
2508
- const de_DescribeRegionSettingsCommandError = async (output, context) => {
2509
- const parsedOutput = {
2510
- ...output,
2511
- body: await parseErrorBody(output.body, context),
2512
- };
2513
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2514
- switch (errorCode) {
2515
- case "ServiceUnavailableException":
2516
- case "com.amazonaws.backup#ServiceUnavailableException":
2517
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2518
- default:
2519
- const parsedBody = parsedOutput.body;
2520
- return throwDefaultError({
2521
- output,
2522
- parsedBody,
2523
- errorCode,
2524
- });
2525
- }
2526
- };
2527
- export const de_DescribeReportJobCommand = async (output, context) => {
2528
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2529
- return de_DescribeReportJobCommandError(output, context);
2530
- }
2531
- const contents = map({
2532
- $metadata: deserializeMetadata(output),
2533
- });
2534
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2535
- const doc = take(data, {
2536
- ReportJob: (_) => de_ReportJob(_, context),
2537
- });
2538
- Object.assign(contents, doc);
2539
- return contents;
2540
- };
2541
- const de_DescribeReportJobCommandError = async (output, context) => {
2542
- const parsedOutput = {
2543
- ...output,
2544
- body: await parseErrorBody(output.body, context),
2545
- };
2546
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2547
- switch (errorCode) {
2548
- case "MissingParameterValueException":
2549
- case "com.amazonaws.backup#MissingParameterValueException":
2550
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2551
- case "ResourceNotFoundException":
2552
- case "com.amazonaws.backup#ResourceNotFoundException":
2553
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2554
- case "ServiceUnavailableException":
2555
- case "com.amazonaws.backup#ServiceUnavailableException":
2556
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2557
- default:
2558
- const parsedBody = parsedOutput.body;
2559
- return throwDefaultError({
2560
- output,
2561
- parsedBody,
2562
- errorCode,
2563
- });
1669
+ return de_CommandError(output, context);
2564
1670
  }
1671
+ const contents = map({
1672
+ $metadata: deserializeMetadata(output),
1673
+ });
1674
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1675
+ const doc = take(data, {
1676
+ ResourceTypeManagementPreference: _json,
1677
+ ResourceTypeOptInPreference: _json,
1678
+ });
1679
+ Object.assign(contents, doc);
1680
+ return contents;
2565
1681
  };
2566
- export const de_DescribeReportPlanCommand = async (output, context) => {
1682
+ export const de_DescribeReportJobCommand = async (output, context) => {
2567
1683
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2568
- return de_DescribeReportPlanCommandError(output, context);
1684
+ return de_CommandError(output, context);
2569
1685
  }
2570
1686
  const contents = map({
2571
1687
  $metadata: deserializeMetadata(output),
2572
1688
  });
2573
1689
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2574
1690
  const doc = take(data, {
2575
- ReportPlan: (_) => de_ReportPlan(_, context),
1691
+ ReportJob: (_) => de_ReportJob(_, context),
2576
1692
  });
2577
1693
  Object.assign(contents, doc);
2578
1694
  return contents;
2579
1695
  };
2580
- const de_DescribeReportPlanCommandError = async (output, context) => {
2581
- const parsedOutput = {
2582
- ...output,
2583
- body: await parseErrorBody(output.body, context),
2584
- };
2585
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2586
- switch (errorCode) {
2587
- case "InvalidParameterValueException":
2588
- case "com.amazonaws.backup#InvalidParameterValueException":
2589
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2590
- case "MissingParameterValueException":
2591
- case "com.amazonaws.backup#MissingParameterValueException":
2592
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2593
- case "ResourceNotFoundException":
2594
- case "com.amazonaws.backup#ResourceNotFoundException":
2595
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2596
- case "ServiceUnavailableException":
2597
- case "com.amazonaws.backup#ServiceUnavailableException":
2598
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2599
- default:
2600
- const parsedBody = parsedOutput.body;
2601
- return throwDefaultError({
2602
- output,
2603
- parsedBody,
2604
- errorCode,
2605
- });
1696
+ export const de_DescribeReportPlanCommand = async (output, context) => {
1697
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1698
+ return de_CommandError(output, context);
2606
1699
  }
1700
+ const contents = map({
1701
+ $metadata: deserializeMetadata(output),
1702
+ });
1703
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1704
+ const doc = take(data, {
1705
+ ReportPlan: (_) => de_ReportPlan(_, context),
1706
+ });
1707
+ Object.assign(contents, doc);
1708
+ return contents;
2607
1709
  };
2608
1710
  export const de_DescribeRestoreJobCommand = async (output, context) => {
2609
1711
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2610
- return de_DescribeRestoreJobCommandError(output, context);
1712
+ return de_CommandError(output, context);
2611
1713
  }
2612
1714
  const contents = map({
2613
1715
  $metadata: deserializeMetadata(output),
@@ -2637,40 +1739,9 @@ export const de_DescribeRestoreJobCommand = async (output, context) => {
2637
1739
  Object.assign(contents, doc);
2638
1740
  return contents;
2639
1741
  };
2640
- const de_DescribeRestoreJobCommandError = async (output, context) => {
2641
- const parsedOutput = {
2642
- ...output,
2643
- body: await parseErrorBody(output.body, context),
2644
- };
2645
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2646
- switch (errorCode) {
2647
- case "DependencyFailureException":
2648
- case "com.amazonaws.backup#DependencyFailureException":
2649
- throw await de_DependencyFailureExceptionRes(parsedOutput, context);
2650
- case "InvalidParameterValueException":
2651
- case "com.amazonaws.backup#InvalidParameterValueException":
2652
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2653
- case "MissingParameterValueException":
2654
- case "com.amazonaws.backup#MissingParameterValueException":
2655
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2656
- case "ResourceNotFoundException":
2657
- case "com.amazonaws.backup#ResourceNotFoundException":
2658
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2659
- case "ServiceUnavailableException":
2660
- case "com.amazonaws.backup#ServiceUnavailableException":
2661
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2662
- default:
2663
- const parsedBody = parsedOutput.body;
2664
- return throwDefaultError({
2665
- output,
2666
- parsedBody,
2667
- errorCode,
2668
- });
2669
- }
2670
- };
2671
1742
  export const de_DisassociateRecoveryPointCommand = async (output, context) => {
2672
1743
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2673
- return de_DisassociateRecoveryPointCommandError(output, context);
1744
+ return de_CommandError(output, context);
2674
1745
  }
2675
1746
  const contents = map({
2676
1747
  $metadata: deserializeMetadata(output),
@@ -2678,43 +1749,9 @@ export const de_DisassociateRecoveryPointCommand = async (output, context) => {
2678
1749
  await collectBody(output.body, context);
2679
1750
  return contents;
2680
1751
  };
2681
- const de_DisassociateRecoveryPointCommandError = async (output, context) => {
2682
- const parsedOutput = {
2683
- ...output,
2684
- body: await parseErrorBody(output.body, context),
2685
- };
2686
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2687
- switch (errorCode) {
2688
- case "InvalidParameterValueException":
2689
- case "com.amazonaws.backup#InvalidParameterValueException":
2690
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2691
- case "InvalidRequestException":
2692
- case "com.amazonaws.backup#InvalidRequestException":
2693
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2694
- case "InvalidResourceStateException":
2695
- case "com.amazonaws.backup#InvalidResourceStateException":
2696
- throw await de_InvalidResourceStateExceptionRes(parsedOutput, context);
2697
- case "MissingParameterValueException":
2698
- case "com.amazonaws.backup#MissingParameterValueException":
2699
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2700
- case "ResourceNotFoundException":
2701
- case "com.amazonaws.backup#ResourceNotFoundException":
2702
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2703
- case "ServiceUnavailableException":
2704
- case "com.amazonaws.backup#ServiceUnavailableException":
2705
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2706
- default:
2707
- const parsedBody = parsedOutput.body;
2708
- return throwDefaultError({
2709
- output,
2710
- parsedBody,
2711
- errorCode,
2712
- });
2713
- }
2714
- };
2715
1752
  export const de_DisassociateRecoveryPointFromParentCommand = async (output, context) => {
2716
1753
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2717
- return de_DisassociateRecoveryPointFromParentCommandError(output, context);
1754
+ return de_CommandError(output, context);
2718
1755
  }
2719
1756
  const contents = map({
2720
1757
  $metadata: deserializeMetadata(output),
@@ -2722,40 +1759,9 @@ export const de_DisassociateRecoveryPointFromParentCommand = async (output, cont
2722
1759
  await collectBody(output.body, context);
2723
1760
  return contents;
2724
1761
  };
2725
- const de_DisassociateRecoveryPointFromParentCommandError = async (output, context) => {
2726
- const parsedOutput = {
2727
- ...output,
2728
- body: await parseErrorBody(output.body, context),
2729
- };
2730
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2731
- switch (errorCode) {
2732
- case "InvalidParameterValueException":
2733
- case "com.amazonaws.backup#InvalidParameterValueException":
2734
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2735
- case "InvalidRequestException":
2736
- case "com.amazonaws.backup#InvalidRequestException":
2737
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2738
- case "MissingParameterValueException":
2739
- case "com.amazonaws.backup#MissingParameterValueException":
2740
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2741
- case "ResourceNotFoundException":
2742
- case "com.amazonaws.backup#ResourceNotFoundException":
2743
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2744
- case "ServiceUnavailableException":
2745
- case "com.amazonaws.backup#ServiceUnavailableException":
2746
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2747
- default:
2748
- const parsedBody = parsedOutput.body;
2749
- return throwDefaultError({
2750
- output,
2751
- parsedBody,
2752
- errorCode,
2753
- });
2754
- }
2755
- };
2756
1762
  export const de_ExportBackupPlanTemplateCommand = async (output, context) => {
2757
1763
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2758
- return de_ExportBackupPlanTemplateCommandError(output, context);
1764
+ return de_CommandError(output, context);
2759
1765
  }
2760
1766
  const contents = map({
2761
1767
  $metadata: deserializeMetadata(output),
@@ -2767,132 +1773,45 @@ export const de_ExportBackupPlanTemplateCommand = async (output, context) => {
2767
1773
  Object.assign(contents, doc);
2768
1774
  return contents;
2769
1775
  };
2770
- const de_ExportBackupPlanTemplateCommandError = async (output, context) => {
2771
- const parsedOutput = {
2772
- ...output,
2773
- body: await parseErrorBody(output.body, context),
2774
- };
2775
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2776
- switch (errorCode) {
2777
- case "InvalidParameterValueException":
2778
- case "com.amazonaws.backup#InvalidParameterValueException":
2779
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2780
- case "MissingParameterValueException":
2781
- case "com.amazonaws.backup#MissingParameterValueException":
2782
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2783
- case "ResourceNotFoundException":
2784
- case "com.amazonaws.backup#ResourceNotFoundException":
2785
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2786
- case "ServiceUnavailableException":
2787
- case "com.amazonaws.backup#ServiceUnavailableException":
2788
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2789
- default:
2790
- const parsedBody = parsedOutput.body;
2791
- return throwDefaultError({
2792
- output,
2793
- parsedBody,
2794
- errorCode,
2795
- });
2796
- }
2797
- };
2798
1776
  export const de_GetBackupPlanCommand = async (output, context) => {
2799
1777
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2800
- return de_GetBackupPlanCommandError(output, context);
2801
- }
2802
- const contents = map({
2803
- $metadata: deserializeMetadata(output),
2804
- });
2805
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2806
- const doc = take(data, {
2807
- AdvancedBackupSettings: _json,
2808
- BackupPlan: _json,
2809
- BackupPlanArn: __expectString,
2810
- BackupPlanId: __expectString,
2811
- CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2812
- CreatorRequestId: __expectString,
2813
- DeletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2814
- LastExecutionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2815
- VersionId: __expectString,
2816
- });
2817
- Object.assign(contents, doc);
2818
- return contents;
2819
- };
2820
- const de_GetBackupPlanCommandError = async (output, context) => {
2821
- const parsedOutput = {
2822
- ...output,
2823
- body: await parseErrorBody(output.body, context),
2824
- };
2825
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2826
- switch (errorCode) {
2827
- case "InvalidParameterValueException":
2828
- case "com.amazonaws.backup#InvalidParameterValueException":
2829
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2830
- case "MissingParameterValueException":
2831
- case "com.amazonaws.backup#MissingParameterValueException":
2832
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2833
- case "ResourceNotFoundException":
2834
- case "com.amazonaws.backup#ResourceNotFoundException":
2835
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2836
- case "ServiceUnavailableException":
2837
- case "com.amazonaws.backup#ServiceUnavailableException":
2838
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2839
- default:
2840
- const parsedBody = parsedOutput.body;
2841
- return throwDefaultError({
2842
- output,
2843
- parsedBody,
2844
- errorCode,
2845
- });
2846
- }
2847
- };
2848
- export const de_GetBackupPlanFromJSONCommand = async (output, context) => {
2849
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2850
- return de_GetBackupPlanFromJSONCommandError(output, context);
1778
+ return de_CommandError(output, context);
2851
1779
  }
2852
- const contents = map({
2853
- $metadata: deserializeMetadata(output),
2854
- });
2855
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2856
- const doc = take(data, {
2857
- BackupPlan: _json,
2858
- });
2859
- Object.assign(contents, doc);
2860
- return contents;
2861
- };
2862
- const de_GetBackupPlanFromJSONCommandError = async (output, context) => {
2863
- const parsedOutput = {
2864
- ...output,
2865
- body: await parseErrorBody(output.body, context),
2866
- };
2867
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2868
- switch (errorCode) {
2869
- case "InvalidParameterValueException":
2870
- case "com.amazonaws.backup#InvalidParameterValueException":
2871
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2872
- case "InvalidRequestException":
2873
- case "com.amazonaws.backup#InvalidRequestException":
2874
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2875
- case "LimitExceededException":
2876
- case "com.amazonaws.backup#LimitExceededException":
2877
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
2878
- case "MissingParameterValueException":
2879
- case "com.amazonaws.backup#MissingParameterValueException":
2880
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2881
- case "ServiceUnavailableException":
2882
- case "com.amazonaws.backup#ServiceUnavailableException":
2883
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2884
- default:
2885
- const parsedBody = parsedOutput.body;
2886
- return throwDefaultError({
2887
- output,
2888
- parsedBody,
2889
- errorCode,
2890
- });
1780
+ const contents = map({
1781
+ $metadata: deserializeMetadata(output),
1782
+ });
1783
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1784
+ const doc = take(data, {
1785
+ AdvancedBackupSettings: _json,
1786
+ BackupPlan: _json,
1787
+ BackupPlanArn: __expectString,
1788
+ BackupPlanId: __expectString,
1789
+ CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1790
+ CreatorRequestId: __expectString,
1791
+ DeletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1792
+ LastExecutionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1793
+ VersionId: __expectString,
1794
+ });
1795
+ Object.assign(contents, doc);
1796
+ return contents;
1797
+ };
1798
+ export const de_GetBackupPlanFromJSONCommand = async (output, context) => {
1799
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1800
+ return de_CommandError(output, context);
2891
1801
  }
1802
+ const contents = map({
1803
+ $metadata: deserializeMetadata(output),
1804
+ });
1805
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1806
+ const doc = take(data, {
1807
+ BackupPlan: _json,
1808
+ });
1809
+ Object.assign(contents, doc);
1810
+ return contents;
2892
1811
  };
2893
1812
  export const de_GetBackupPlanFromTemplateCommand = async (output, context) => {
2894
1813
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2895
- return de_GetBackupPlanFromTemplateCommandError(output, context);
1814
+ return de_CommandError(output, context);
2896
1815
  }
2897
1816
  const contents = map({
2898
1817
  $metadata: deserializeMetadata(output),
@@ -2904,37 +1823,9 @@ export const de_GetBackupPlanFromTemplateCommand = async (output, context) => {
2904
1823
  Object.assign(contents, doc);
2905
1824
  return contents;
2906
1825
  };
2907
- const de_GetBackupPlanFromTemplateCommandError = async (output, context) => {
2908
- const parsedOutput = {
2909
- ...output,
2910
- body: await parseErrorBody(output.body, context),
2911
- };
2912
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2913
- switch (errorCode) {
2914
- case "InvalidParameterValueException":
2915
- case "com.amazonaws.backup#InvalidParameterValueException":
2916
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2917
- case "MissingParameterValueException":
2918
- case "com.amazonaws.backup#MissingParameterValueException":
2919
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2920
- case "ResourceNotFoundException":
2921
- case "com.amazonaws.backup#ResourceNotFoundException":
2922
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2923
- case "ServiceUnavailableException":
2924
- case "com.amazonaws.backup#ServiceUnavailableException":
2925
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2926
- default:
2927
- const parsedBody = parsedOutput.body;
2928
- return throwDefaultError({
2929
- output,
2930
- parsedBody,
2931
- errorCode,
2932
- });
2933
- }
2934
- };
2935
1826
  export const de_GetBackupSelectionCommand = async (output, context) => {
2936
1827
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2937
- return de_GetBackupSelectionCommandError(output, context);
1828
+ return de_CommandError(output, context);
2938
1829
  }
2939
1830
  const contents = map({
2940
1831
  $metadata: deserializeMetadata(output),
@@ -2950,37 +1841,9 @@ export const de_GetBackupSelectionCommand = async (output, context) => {
2950
1841
  Object.assign(contents, doc);
2951
1842
  return contents;
2952
1843
  };
2953
- const de_GetBackupSelectionCommandError = async (output, context) => {
2954
- const parsedOutput = {
2955
- ...output,
2956
- body: await parseErrorBody(output.body, context),
2957
- };
2958
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2959
- switch (errorCode) {
2960
- case "InvalidParameterValueException":
2961
- case "com.amazonaws.backup#InvalidParameterValueException":
2962
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2963
- case "MissingParameterValueException":
2964
- case "com.amazonaws.backup#MissingParameterValueException":
2965
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
2966
- case "ResourceNotFoundException":
2967
- case "com.amazonaws.backup#ResourceNotFoundException":
2968
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2969
- case "ServiceUnavailableException":
2970
- case "com.amazonaws.backup#ServiceUnavailableException":
2971
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2972
- default:
2973
- const parsedBody = parsedOutput.body;
2974
- return throwDefaultError({
2975
- output,
2976
- parsedBody,
2977
- errorCode,
2978
- });
2979
- }
2980
- };
2981
1844
  export const de_GetBackupVaultAccessPolicyCommand = async (output, context) => {
2982
1845
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2983
- return de_GetBackupVaultAccessPolicyCommandError(output, context);
1846
+ return de_CommandError(output, context);
2984
1847
  }
2985
1848
  const contents = map({
2986
1849
  $metadata: deserializeMetadata(output),
@@ -2994,37 +1857,9 @@ export const de_GetBackupVaultAccessPolicyCommand = async (output, context) => {
2994
1857
  Object.assign(contents, doc);
2995
1858
  return contents;
2996
1859
  };
2997
- const de_GetBackupVaultAccessPolicyCommandError = async (output, context) => {
2998
- const parsedOutput = {
2999
- ...output,
3000
- body: await parseErrorBody(output.body, context),
3001
- };
3002
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3003
- switch (errorCode) {
3004
- case "InvalidParameterValueException":
3005
- case "com.amazonaws.backup#InvalidParameterValueException":
3006
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3007
- case "MissingParameterValueException":
3008
- case "com.amazonaws.backup#MissingParameterValueException":
3009
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3010
- case "ResourceNotFoundException":
3011
- case "com.amazonaws.backup#ResourceNotFoundException":
3012
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3013
- case "ServiceUnavailableException":
3014
- case "com.amazonaws.backup#ServiceUnavailableException":
3015
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3016
- default:
3017
- const parsedBody = parsedOutput.body;
3018
- return throwDefaultError({
3019
- output,
3020
- parsedBody,
3021
- errorCode,
3022
- });
3023
- }
3024
- };
3025
1860
  export const de_GetBackupVaultNotificationsCommand = async (output, context) => {
3026
1861
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3027
- return de_GetBackupVaultNotificationsCommandError(output, context);
1862
+ return de_CommandError(output, context);
3028
1863
  }
3029
1864
  const contents = map({
3030
1865
  $metadata: deserializeMetadata(output),
@@ -3039,37 +1874,9 @@ export const de_GetBackupVaultNotificationsCommand = async (output, context) =>
3039
1874
  Object.assign(contents, doc);
3040
1875
  return contents;
3041
1876
  };
3042
- const de_GetBackupVaultNotificationsCommandError = async (output, context) => {
3043
- const parsedOutput = {
3044
- ...output,
3045
- body: await parseErrorBody(output.body, context),
3046
- };
3047
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3048
- switch (errorCode) {
3049
- case "InvalidParameterValueException":
3050
- case "com.amazonaws.backup#InvalidParameterValueException":
3051
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3052
- case "MissingParameterValueException":
3053
- case "com.amazonaws.backup#MissingParameterValueException":
3054
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3055
- case "ResourceNotFoundException":
3056
- case "com.amazonaws.backup#ResourceNotFoundException":
3057
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3058
- case "ServiceUnavailableException":
3059
- case "com.amazonaws.backup#ServiceUnavailableException":
3060
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3061
- default:
3062
- const parsedBody = parsedOutput.body;
3063
- return throwDefaultError({
3064
- output,
3065
- parsedBody,
3066
- errorCode,
3067
- });
3068
- }
3069
- };
3070
1877
  export const de_GetLegalHoldCommand = async (output, context) => {
3071
1878
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3072
- return de_GetLegalHoldCommandError(output, context);
1879
+ return de_CommandError(output, context);
3073
1880
  }
3074
1881
  const contents = map({
3075
1882
  $metadata: deserializeMetadata(output),
@@ -3090,37 +1897,9 @@ export const de_GetLegalHoldCommand = async (output, context) => {
3090
1897
  Object.assign(contents, doc);
3091
1898
  return contents;
3092
1899
  };
3093
- const de_GetLegalHoldCommandError = async (output, context) => {
3094
- const parsedOutput = {
3095
- ...output,
3096
- body: await parseErrorBody(output.body, context),
3097
- };
3098
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3099
- switch (errorCode) {
3100
- case "InvalidParameterValueException":
3101
- case "com.amazonaws.backup#InvalidParameterValueException":
3102
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3103
- case "MissingParameterValueException":
3104
- case "com.amazonaws.backup#MissingParameterValueException":
3105
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3106
- case "ResourceNotFoundException":
3107
- case "com.amazonaws.backup#ResourceNotFoundException":
3108
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3109
- case "ServiceUnavailableException":
3110
- case "com.amazonaws.backup#ServiceUnavailableException":
3111
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3112
- default:
3113
- const parsedBody = parsedOutput.body;
3114
- return throwDefaultError({
3115
- output,
3116
- parsedBody,
3117
- errorCode,
3118
- });
3119
- }
3120
- };
3121
1900
  export const de_GetRecoveryPointRestoreMetadataCommand = async (output, context) => {
3122
1901
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3123
- return de_GetRecoveryPointRestoreMetadataCommandError(output, context);
1902
+ return de_CommandError(output, context);
3124
1903
  }
3125
1904
  const contents = map({
3126
1905
  $metadata: deserializeMetadata(output),
@@ -3135,37 +1914,9 @@ export const de_GetRecoveryPointRestoreMetadataCommand = async (output, context)
3135
1914
  Object.assign(contents, doc);
3136
1915
  return contents;
3137
1916
  };
3138
- const de_GetRecoveryPointRestoreMetadataCommandError = async (output, context) => {
3139
- const parsedOutput = {
3140
- ...output,
3141
- body: await parseErrorBody(output.body, context),
3142
- };
3143
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3144
- switch (errorCode) {
3145
- case "InvalidParameterValueException":
3146
- case "com.amazonaws.backup#InvalidParameterValueException":
3147
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3148
- case "MissingParameterValueException":
3149
- case "com.amazonaws.backup#MissingParameterValueException":
3150
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3151
- case "ResourceNotFoundException":
3152
- case "com.amazonaws.backup#ResourceNotFoundException":
3153
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3154
- case "ServiceUnavailableException":
3155
- case "com.amazonaws.backup#ServiceUnavailableException":
3156
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3157
- default:
3158
- const parsedBody = parsedOutput.body;
3159
- return throwDefaultError({
3160
- output,
3161
- parsedBody,
3162
- errorCode,
3163
- });
3164
- }
3165
- };
3166
1917
  export const de_GetRestoreJobMetadataCommand = async (output, context) => {
3167
1918
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3168
- return de_GetRestoreJobMetadataCommandError(output, context);
1919
+ return de_CommandError(output, context);
3169
1920
  }
3170
1921
  const contents = map({
3171
1922
  $metadata: deserializeMetadata(output),
@@ -3178,79 +1929,23 @@ export const de_GetRestoreJobMetadataCommand = async (output, context) => {
3178
1929
  Object.assign(contents, doc);
3179
1930
  return contents;
3180
1931
  };
3181
- const de_GetRestoreJobMetadataCommandError = async (output, context) => {
3182
- const parsedOutput = {
3183
- ...output,
3184
- body: await parseErrorBody(output.body, context),
3185
- };
3186
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3187
- switch (errorCode) {
3188
- case "InvalidParameterValueException":
3189
- case "com.amazonaws.backup#InvalidParameterValueException":
3190
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3191
- case "MissingParameterValueException":
3192
- case "com.amazonaws.backup#MissingParameterValueException":
3193
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3194
- case "ResourceNotFoundException":
3195
- case "com.amazonaws.backup#ResourceNotFoundException":
3196
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3197
- case "ServiceUnavailableException":
3198
- case "com.amazonaws.backup#ServiceUnavailableException":
3199
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3200
- default:
3201
- const parsedBody = parsedOutput.body;
3202
- return throwDefaultError({
3203
- output,
3204
- parsedBody,
3205
- errorCode,
3206
- });
3207
- }
3208
- };
3209
- export const de_GetRestoreTestingInferredMetadataCommand = async (output, context) => {
3210
- if (output.statusCode !== 200 && output.statusCode >= 300) {
3211
- return de_GetRestoreTestingInferredMetadataCommandError(output, context);
3212
- }
3213
- const contents = map({
3214
- $metadata: deserializeMetadata(output),
3215
- });
3216
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3217
- const doc = take(data, {
3218
- InferredMetadata: _json,
3219
- });
3220
- Object.assign(contents, doc);
3221
- return contents;
3222
- };
3223
- const de_GetRestoreTestingInferredMetadataCommandError = async (output, context) => {
3224
- const parsedOutput = {
3225
- ...output,
3226
- body: await parseErrorBody(output.body, context),
3227
- };
3228
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3229
- switch (errorCode) {
3230
- case "InvalidParameterValueException":
3231
- case "com.amazonaws.backup#InvalidParameterValueException":
3232
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3233
- case "MissingParameterValueException":
3234
- case "com.amazonaws.backup#MissingParameterValueException":
3235
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3236
- case "ResourceNotFoundException":
3237
- case "com.amazonaws.backup#ResourceNotFoundException":
3238
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3239
- case "ServiceUnavailableException":
3240
- case "com.amazonaws.backup#ServiceUnavailableException":
3241
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3242
- default:
3243
- const parsedBody = parsedOutput.body;
3244
- return throwDefaultError({
3245
- output,
3246
- parsedBody,
3247
- errorCode,
3248
- });
1932
+ export const de_GetRestoreTestingInferredMetadataCommand = async (output, context) => {
1933
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1934
+ return de_CommandError(output, context);
3249
1935
  }
1936
+ const contents = map({
1937
+ $metadata: deserializeMetadata(output),
1938
+ });
1939
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1940
+ const doc = take(data, {
1941
+ InferredMetadata: _json,
1942
+ });
1943
+ Object.assign(contents, doc);
1944
+ return contents;
3250
1945
  };
3251
1946
  export const de_GetRestoreTestingPlanCommand = async (output, context) => {
3252
1947
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3253
- return de_GetRestoreTestingPlanCommandError(output, context);
1948
+ return de_CommandError(output, context);
3254
1949
  }
3255
1950
  const contents = map({
3256
1951
  $metadata: deserializeMetadata(output),
@@ -3262,31 +1957,9 @@ export const de_GetRestoreTestingPlanCommand = async (output, context) => {
3262
1957
  Object.assign(contents, doc);
3263
1958
  return contents;
3264
1959
  };
3265
- const de_GetRestoreTestingPlanCommandError = async (output, context) => {
3266
- const parsedOutput = {
3267
- ...output,
3268
- body: await parseErrorBody(output.body, context),
3269
- };
3270
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3271
- switch (errorCode) {
3272
- case "ResourceNotFoundException":
3273
- case "com.amazonaws.backup#ResourceNotFoundException":
3274
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3275
- case "ServiceUnavailableException":
3276
- case "com.amazonaws.backup#ServiceUnavailableException":
3277
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3278
- default:
3279
- const parsedBody = parsedOutput.body;
3280
- return throwDefaultError({
3281
- output,
3282
- parsedBody,
3283
- errorCode,
3284
- });
3285
- }
3286
- };
3287
1960
  export const de_GetRestoreTestingSelectionCommand = async (output, context) => {
3288
1961
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3289
- return de_GetRestoreTestingSelectionCommandError(output, context);
1962
+ return de_CommandError(output, context);
3290
1963
  }
3291
1964
  const contents = map({
3292
1965
  $metadata: deserializeMetadata(output),
@@ -3298,31 +1971,9 @@ export const de_GetRestoreTestingSelectionCommand = async (output, context) => {
3298
1971
  Object.assign(contents, doc);
3299
1972
  return contents;
3300
1973
  };
3301
- const de_GetRestoreTestingSelectionCommandError = async (output, context) => {
3302
- const parsedOutput = {
3303
- ...output,
3304
- body: await parseErrorBody(output.body, context),
3305
- };
3306
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3307
- switch (errorCode) {
3308
- case "ResourceNotFoundException":
3309
- case "com.amazonaws.backup#ResourceNotFoundException":
3310
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3311
- case "ServiceUnavailableException":
3312
- case "com.amazonaws.backup#ServiceUnavailableException":
3313
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3314
- default:
3315
- const parsedBody = parsedOutput.body;
3316
- return throwDefaultError({
3317
- output,
3318
- parsedBody,
3319
- errorCode,
3320
- });
3321
- }
3322
- };
3323
1974
  export const de_GetSupportedResourceTypesCommand = async (output, context) => {
3324
1975
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3325
- return de_GetSupportedResourceTypesCommandError(output, context);
1976
+ return de_CommandError(output, context);
3326
1977
  }
3327
1978
  const contents = map({
3328
1979
  $metadata: deserializeMetadata(output),
@@ -3334,28 +1985,9 @@ export const de_GetSupportedResourceTypesCommand = async (output, context) => {
3334
1985
  Object.assign(contents, doc);
3335
1986
  return contents;
3336
1987
  };
3337
- const de_GetSupportedResourceTypesCommandError = async (output, context) => {
3338
- const parsedOutput = {
3339
- ...output,
3340
- body: await parseErrorBody(output.body, context),
3341
- };
3342
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3343
- switch (errorCode) {
3344
- case "ServiceUnavailableException":
3345
- case "com.amazonaws.backup#ServiceUnavailableException":
3346
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3347
- default:
3348
- const parsedBody = parsedOutput.body;
3349
- return throwDefaultError({
3350
- output,
3351
- parsedBody,
3352
- errorCode,
3353
- });
3354
- }
3355
- };
3356
1988
  export const de_ListBackupJobsCommand = async (output, context) => {
3357
1989
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3358
- return de_ListBackupJobsCommandError(output, context);
1990
+ return de_CommandError(output, context);
3359
1991
  }
3360
1992
  const contents = map({
3361
1993
  $metadata: deserializeMetadata(output),
@@ -3368,31 +2000,9 @@ export const de_ListBackupJobsCommand = async (output, context) => {
3368
2000
  Object.assign(contents, doc);
3369
2001
  return contents;
3370
2002
  };
3371
- const de_ListBackupJobsCommandError = async (output, context) => {
3372
- const parsedOutput = {
3373
- ...output,
3374
- body: await parseErrorBody(output.body, context),
3375
- };
3376
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3377
- switch (errorCode) {
3378
- case "InvalidParameterValueException":
3379
- case "com.amazonaws.backup#InvalidParameterValueException":
3380
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3381
- case "ServiceUnavailableException":
3382
- case "com.amazonaws.backup#ServiceUnavailableException":
3383
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3384
- default:
3385
- const parsedBody = parsedOutput.body;
3386
- return throwDefaultError({
3387
- output,
3388
- parsedBody,
3389
- errorCode,
3390
- });
3391
- }
3392
- };
3393
2003
  export const de_ListBackupJobSummariesCommand = async (output, context) => {
3394
2004
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3395
- return de_ListBackupJobSummariesCommandError(output, context);
2005
+ return de_CommandError(output, context);
3396
2006
  }
3397
2007
  const contents = map({
3398
2008
  $metadata: deserializeMetadata(output),
@@ -3406,31 +2016,9 @@ export const de_ListBackupJobSummariesCommand = async (output, context) => {
3406
2016
  Object.assign(contents, doc);
3407
2017
  return contents;
3408
2018
  };
3409
- const de_ListBackupJobSummariesCommandError = async (output, context) => {
3410
- const parsedOutput = {
3411
- ...output,
3412
- body: await parseErrorBody(output.body, context),
3413
- };
3414
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3415
- switch (errorCode) {
3416
- case "InvalidParameterValueException":
3417
- case "com.amazonaws.backup#InvalidParameterValueException":
3418
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3419
- case "ServiceUnavailableException":
3420
- case "com.amazonaws.backup#ServiceUnavailableException":
3421
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3422
- default:
3423
- const parsedBody = parsedOutput.body;
3424
- return throwDefaultError({
3425
- output,
3426
- parsedBody,
3427
- errorCode,
3428
- });
3429
- }
3430
- };
3431
2019
  export const de_ListBackupPlansCommand = async (output, context) => {
3432
2020
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3433
- return de_ListBackupPlansCommandError(output, context);
2021
+ return de_CommandError(output, context);
3434
2022
  }
3435
2023
  const contents = map({
3436
2024
  $metadata: deserializeMetadata(output),
@@ -3443,37 +2031,9 @@ export const de_ListBackupPlansCommand = async (output, context) => {
3443
2031
  Object.assign(contents, doc);
3444
2032
  return contents;
3445
2033
  };
3446
- const de_ListBackupPlansCommandError = async (output, context) => {
3447
- const parsedOutput = {
3448
- ...output,
3449
- body: await parseErrorBody(output.body, context),
3450
- };
3451
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3452
- switch (errorCode) {
3453
- case "InvalidParameterValueException":
3454
- case "com.amazonaws.backup#InvalidParameterValueException":
3455
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3456
- case "MissingParameterValueException":
3457
- case "com.amazonaws.backup#MissingParameterValueException":
3458
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3459
- case "ResourceNotFoundException":
3460
- case "com.amazonaws.backup#ResourceNotFoundException":
3461
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3462
- case "ServiceUnavailableException":
3463
- case "com.amazonaws.backup#ServiceUnavailableException":
3464
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3465
- default:
3466
- const parsedBody = parsedOutput.body;
3467
- return throwDefaultError({
3468
- output,
3469
- parsedBody,
3470
- errorCode,
3471
- });
3472
- }
3473
- };
3474
2034
  export const de_ListBackupPlanTemplatesCommand = async (output, context) => {
3475
2035
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3476
- return de_ListBackupPlanTemplatesCommandError(output, context);
2036
+ return de_CommandError(output, context);
3477
2037
  }
3478
2038
  const contents = map({
3479
2039
  $metadata: deserializeMetadata(output),
@@ -3486,37 +2046,9 @@ export const de_ListBackupPlanTemplatesCommand = async (output, context) => {
3486
2046
  Object.assign(contents, doc);
3487
2047
  return contents;
3488
2048
  };
3489
- const de_ListBackupPlanTemplatesCommandError = async (output, context) => {
3490
- const parsedOutput = {
3491
- ...output,
3492
- body: await parseErrorBody(output.body, context),
3493
- };
3494
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3495
- switch (errorCode) {
3496
- case "InvalidParameterValueException":
3497
- case "com.amazonaws.backup#InvalidParameterValueException":
3498
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3499
- case "MissingParameterValueException":
3500
- case "com.amazonaws.backup#MissingParameterValueException":
3501
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3502
- case "ResourceNotFoundException":
3503
- case "com.amazonaws.backup#ResourceNotFoundException":
3504
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3505
- case "ServiceUnavailableException":
3506
- case "com.amazonaws.backup#ServiceUnavailableException":
3507
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3508
- default:
3509
- const parsedBody = parsedOutput.body;
3510
- return throwDefaultError({
3511
- output,
3512
- parsedBody,
3513
- errorCode,
3514
- });
3515
- }
3516
- };
3517
2049
  export const de_ListBackupPlanVersionsCommand = async (output, context) => {
3518
2050
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3519
- return de_ListBackupPlanVersionsCommandError(output, context);
2051
+ return de_CommandError(output, context);
3520
2052
  }
3521
2053
  const contents = map({
3522
2054
  $metadata: deserializeMetadata(output),
@@ -3529,37 +2061,9 @@ export const de_ListBackupPlanVersionsCommand = async (output, context) => {
3529
2061
  Object.assign(contents, doc);
3530
2062
  return contents;
3531
2063
  };
3532
- const de_ListBackupPlanVersionsCommandError = async (output, context) => {
3533
- const parsedOutput = {
3534
- ...output,
3535
- body: await parseErrorBody(output.body, context),
3536
- };
3537
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3538
- switch (errorCode) {
3539
- case "InvalidParameterValueException":
3540
- case "com.amazonaws.backup#InvalidParameterValueException":
3541
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3542
- case "MissingParameterValueException":
3543
- case "com.amazonaws.backup#MissingParameterValueException":
3544
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3545
- case "ResourceNotFoundException":
3546
- case "com.amazonaws.backup#ResourceNotFoundException":
3547
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3548
- case "ServiceUnavailableException":
3549
- case "com.amazonaws.backup#ServiceUnavailableException":
3550
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3551
- default:
3552
- const parsedBody = parsedOutput.body;
3553
- return throwDefaultError({
3554
- output,
3555
- parsedBody,
3556
- errorCode,
3557
- });
3558
- }
3559
- };
3560
2064
  export const de_ListBackupSelectionsCommand = async (output, context) => {
3561
2065
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3562
- return de_ListBackupSelectionsCommandError(output, context);
2066
+ return de_CommandError(output, context);
3563
2067
  }
3564
2068
  const contents = map({
3565
2069
  $metadata: deserializeMetadata(output),
@@ -3572,80 +2076,24 @@ export const de_ListBackupSelectionsCommand = async (output, context) => {
3572
2076
  Object.assign(contents, doc);
3573
2077
  return contents;
3574
2078
  };
3575
- const de_ListBackupSelectionsCommandError = async (output, context) => {
3576
- const parsedOutput = {
3577
- ...output,
3578
- body: await parseErrorBody(output.body, context),
3579
- };
3580
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3581
- switch (errorCode) {
3582
- case "InvalidParameterValueException":
3583
- case "com.amazonaws.backup#InvalidParameterValueException":
3584
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3585
- case "MissingParameterValueException":
3586
- case "com.amazonaws.backup#MissingParameterValueException":
3587
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3588
- case "ResourceNotFoundException":
3589
- case "com.amazonaws.backup#ResourceNotFoundException":
3590
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3591
- case "ServiceUnavailableException":
3592
- case "com.amazonaws.backup#ServiceUnavailableException":
3593
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3594
- default:
3595
- const parsedBody = parsedOutput.body;
3596
- return throwDefaultError({
3597
- output,
3598
- parsedBody,
3599
- errorCode,
3600
- });
3601
- }
3602
- };
3603
2079
  export const de_ListBackupVaultsCommand = async (output, context) => {
3604
2080
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3605
- return de_ListBackupVaultsCommandError(output, context);
2081
+ return de_CommandError(output, context);
3606
2082
  }
3607
2083
  const contents = map({
3608
2084
  $metadata: deserializeMetadata(output),
3609
- });
3610
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3611
- const doc = take(data, {
3612
- BackupVaultList: (_) => de_BackupVaultList(_, context),
3613
- NextToken: __expectString,
3614
- });
3615
- Object.assign(contents, doc);
3616
- return contents;
3617
- };
3618
- const de_ListBackupVaultsCommandError = async (output, context) => {
3619
- const parsedOutput = {
3620
- ...output,
3621
- body: await parseErrorBody(output.body, context),
3622
- };
3623
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3624
- switch (errorCode) {
3625
- case "InvalidParameterValueException":
3626
- case "com.amazonaws.backup#InvalidParameterValueException":
3627
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3628
- case "MissingParameterValueException":
3629
- case "com.amazonaws.backup#MissingParameterValueException":
3630
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3631
- case "ResourceNotFoundException":
3632
- case "com.amazonaws.backup#ResourceNotFoundException":
3633
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3634
- case "ServiceUnavailableException":
3635
- case "com.amazonaws.backup#ServiceUnavailableException":
3636
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3637
- default:
3638
- const parsedBody = parsedOutput.body;
3639
- return throwDefaultError({
3640
- output,
3641
- parsedBody,
3642
- errorCode,
3643
- });
3644
- }
2085
+ });
2086
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2087
+ const doc = take(data, {
2088
+ BackupVaultList: (_) => de_BackupVaultList(_, context),
2089
+ NextToken: __expectString,
2090
+ });
2091
+ Object.assign(contents, doc);
2092
+ return contents;
3645
2093
  };
3646
2094
  export const de_ListCopyJobsCommand = async (output, context) => {
3647
2095
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3648
- return de_ListCopyJobsCommandError(output, context);
2096
+ return de_CommandError(output, context);
3649
2097
  }
3650
2098
  const contents = map({
3651
2099
  $metadata: deserializeMetadata(output),
@@ -3658,31 +2106,9 @@ export const de_ListCopyJobsCommand = async (output, context) => {
3658
2106
  Object.assign(contents, doc);
3659
2107
  return contents;
3660
2108
  };
3661
- const de_ListCopyJobsCommandError = async (output, context) => {
3662
- const parsedOutput = {
3663
- ...output,
3664
- body: await parseErrorBody(output.body, context),
3665
- };
3666
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3667
- switch (errorCode) {
3668
- case "InvalidParameterValueException":
3669
- case "com.amazonaws.backup#InvalidParameterValueException":
3670
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3671
- case "ServiceUnavailableException":
3672
- case "com.amazonaws.backup#ServiceUnavailableException":
3673
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3674
- default:
3675
- const parsedBody = parsedOutput.body;
3676
- return throwDefaultError({
3677
- output,
3678
- parsedBody,
3679
- errorCode,
3680
- });
3681
- }
3682
- };
3683
2109
  export const de_ListCopyJobSummariesCommand = async (output, context) => {
3684
2110
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3685
- return de_ListCopyJobSummariesCommandError(output, context);
2111
+ return de_CommandError(output, context);
3686
2112
  }
3687
2113
  const contents = map({
3688
2114
  $metadata: deserializeMetadata(output),
@@ -3696,31 +2122,9 @@ export const de_ListCopyJobSummariesCommand = async (output, context) => {
3696
2122
  Object.assign(contents, doc);
3697
2123
  return contents;
3698
2124
  };
3699
- const de_ListCopyJobSummariesCommandError = async (output, context) => {
3700
- const parsedOutput = {
3701
- ...output,
3702
- body: await parseErrorBody(output.body, context),
3703
- };
3704
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3705
- switch (errorCode) {
3706
- case "InvalidParameterValueException":
3707
- case "com.amazonaws.backup#InvalidParameterValueException":
3708
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3709
- case "ServiceUnavailableException":
3710
- case "com.amazonaws.backup#ServiceUnavailableException":
3711
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3712
- default:
3713
- const parsedBody = parsedOutput.body;
3714
- return throwDefaultError({
3715
- output,
3716
- parsedBody,
3717
- errorCode,
3718
- });
3719
- }
3720
- };
3721
2125
  export const de_ListFrameworksCommand = async (output, context) => {
3722
2126
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3723
- return de_ListFrameworksCommandError(output, context);
2127
+ return de_CommandError(output, context);
3724
2128
  }
3725
2129
  const contents = map({
3726
2130
  $metadata: deserializeMetadata(output),
@@ -3733,31 +2137,9 @@ export const de_ListFrameworksCommand = async (output, context) => {
3733
2137
  Object.assign(contents, doc);
3734
2138
  return contents;
3735
2139
  };
3736
- const de_ListFrameworksCommandError = async (output, context) => {
3737
- const parsedOutput = {
3738
- ...output,
3739
- body: await parseErrorBody(output.body, context),
3740
- };
3741
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3742
- switch (errorCode) {
3743
- case "InvalidParameterValueException":
3744
- case "com.amazonaws.backup#InvalidParameterValueException":
3745
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3746
- case "ServiceUnavailableException":
3747
- case "com.amazonaws.backup#ServiceUnavailableException":
3748
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3749
- default:
3750
- const parsedBody = parsedOutput.body;
3751
- return throwDefaultError({
3752
- output,
3753
- parsedBody,
3754
- errorCode,
3755
- });
3756
- }
3757
- };
3758
2140
  export const de_ListLegalHoldsCommand = async (output, context) => {
3759
2141
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3760
- return de_ListLegalHoldsCommandError(output, context);
2142
+ return de_CommandError(output, context);
3761
2143
  }
3762
2144
  const contents = map({
3763
2145
  $metadata: deserializeMetadata(output),
@@ -3770,31 +2152,9 @@ export const de_ListLegalHoldsCommand = async (output, context) => {
3770
2152
  Object.assign(contents, doc);
3771
2153
  return contents;
3772
2154
  };
3773
- const de_ListLegalHoldsCommandError = async (output, context) => {
3774
- const parsedOutput = {
3775
- ...output,
3776
- body: await parseErrorBody(output.body, context),
3777
- };
3778
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3779
- switch (errorCode) {
3780
- case "InvalidParameterValueException":
3781
- case "com.amazonaws.backup#InvalidParameterValueException":
3782
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3783
- case "ServiceUnavailableException":
3784
- case "com.amazonaws.backup#ServiceUnavailableException":
3785
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3786
- default:
3787
- const parsedBody = parsedOutput.body;
3788
- return throwDefaultError({
3789
- output,
3790
- parsedBody,
3791
- errorCode,
3792
- });
3793
- }
3794
- };
3795
2155
  export const de_ListProtectedResourcesCommand = async (output, context) => {
3796
2156
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3797
- return de_ListProtectedResourcesCommandError(output, context);
2157
+ return de_CommandError(output, context);
3798
2158
  }
3799
2159
  const contents = map({
3800
2160
  $metadata: deserializeMetadata(output),
@@ -3807,31 +2167,9 @@ export const de_ListProtectedResourcesCommand = async (output, context) => {
3807
2167
  Object.assign(contents, doc);
3808
2168
  return contents;
3809
2169
  };
3810
- const de_ListProtectedResourcesCommandError = async (output, context) => {
3811
- const parsedOutput = {
3812
- ...output,
3813
- body: await parseErrorBody(output.body, context),
3814
- };
3815
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3816
- switch (errorCode) {
3817
- case "InvalidParameterValueException":
3818
- case "com.amazonaws.backup#InvalidParameterValueException":
3819
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3820
- case "ServiceUnavailableException":
3821
- case "com.amazonaws.backup#ServiceUnavailableException":
3822
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3823
- default:
3824
- const parsedBody = parsedOutput.body;
3825
- return throwDefaultError({
3826
- output,
3827
- parsedBody,
3828
- errorCode,
3829
- });
3830
- }
3831
- };
3832
2170
  export const de_ListProtectedResourcesByBackupVaultCommand = async (output, context) => {
3833
2171
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3834
- return de_ListProtectedResourcesByBackupVaultCommandError(output, context);
2172
+ return de_CommandError(output, context);
3835
2173
  }
3836
2174
  const contents = map({
3837
2175
  $metadata: deserializeMetadata(output),
@@ -3844,34 +2182,9 @@ export const de_ListProtectedResourcesByBackupVaultCommand = async (output, cont
3844
2182
  Object.assign(contents, doc);
3845
2183
  return contents;
3846
2184
  };
3847
- const de_ListProtectedResourcesByBackupVaultCommandError = async (output, context) => {
3848
- const parsedOutput = {
3849
- ...output,
3850
- body: await parseErrorBody(output.body, context),
3851
- };
3852
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3853
- switch (errorCode) {
3854
- case "InvalidParameterValueException":
3855
- case "com.amazonaws.backup#InvalidParameterValueException":
3856
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3857
- case "ResourceNotFoundException":
3858
- case "com.amazonaws.backup#ResourceNotFoundException":
3859
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3860
- case "ServiceUnavailableException":
3861
- case "com.amazonaws.backup#ServiceUnavailableException":
3862
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3863
- default:
3864
- const parsedBody = parsedOutput.body;
3865
- return throwDefaultError({
3866
- output,
3867
- parsedBody,
3868
- errorCode,
3869
- });
3870
- }
3871
- };
3872
2185
  export const de_ListRecoveryPointsByBackupVaultCommand = async (output, context) => {
3873
2186
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3874
- return de_ListRecoveryPointsByBackupVaultCommandError(output, context);
2187
+ return de_CommandError(output, context);
3875
2188
  }
3876
2189
  const contents = map({
3877
2190
  $metadata: deserializeMetadata(output),
@@ -3884,37 +2197,9 @@ export const de_ListRecoveryPointsByBackupVaultCommand = async (output, context)
3884
2197
  Object.assign(contents, doc);
3885
2198
  return contents;
3886
2199
  };
3887
- const de_ListRecoveryPointsByBackupVaultCommandError = async (output, context) => {
3888
- const parsedOutput = {
3889
- ...output,
3890
- body: await parseErrorBody(output.body, context),
3891
- };
3892
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3893
- switch (errorCode) {
3894
- case "InvalidParameterValueException":
3895
- case "com.amazonaws.backup#InvalidParameterValueException":
3896
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3897
- case "MissingParameterValueException":
3898
- case "com.amazonaws.backup#MissingParameterValueException":
3899
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3900
- case "ResourceNotFoundException":
3901
- case "com.amazonaws.backup#ResourceNotFoundException":
3902
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3903
- case "ServiceUnavailableException":
3904
- case "com.amazonaws.backup#ServiceUnavailableException":
3905
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3906
- default:
3907
- const parsedBody = parsedOutput.body;
3908
- return throwDefaultError({
3909
- output,
3910
- parsedBody,
3911
- errorCode,
3912
- });
3913
- }
3914
- };
3915
2200
  export const de_ListRecoveryPointsByLegalHoldCommand = async (output, context) => {
3916
2201
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3917
- return de_ListRecoveryPointsByLegalHoldCommandError(output, context);
2202
+ return de_CommandError(output, context);
3918
2203
  }
3919
2204
  const contents = map({
3920
2205
  $metadata: deserializeMetadata(output),
@@ -3927,77 +2212,9 @@ export const de_ListRecoveryPointsByLegalHoldCommand = async (output, context) =
3927
2212
  Object.assign(contents, doc);
3928
2213
  return contents;
3929
2214
  };
3930
- const de_ListRecoveryPointsByLegalHoldCommandError = async (output, context) => {
3931
- const parsedOutput = {
3932
- ...output,
3933
- body: await parseErrorBody(output.body, context),
3934
- };
3935
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3936
- switch (errorCode) {
3937
- case "InvalidParameterValueException":
3938
- case "com.amazonaws.backup#InvalidParameterValueException":
3939
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3940
- case "MissingParameterValueException":
3941
- case "com.amazonaws.backup#MissingParameterValueException":
3942
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3943
- case "ServiceUnavailableException":
3944
- case "com.amazonaws.backup#ServiceUnavailableException":
3945
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3946
- default:
3947
- const parsedBody = parsedOutput.body;
3948
- return throwDefaultError({
3949
- output,
3950
- parsedBody,
3951
- errorCode,
3952
- });
3953
- }
3954
- };
3955
2215
  export const de_ListRecoveryPointsByResourceCommand = async (output, context) => {
3956
2216
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3957
- return de_ListRecoveryPointsByResourceCommandError(output, context);
3958
- }
3959
- const contents = map({
3960
- $metadata: deserializeMetadata(output),
3961
- });
3962
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3963
- const doc = take(data, {
3964
- NextToken: __expectString,
3965
- RecoveryPoints: (_) => de_RecoveryPointByResourceList(_, context),
3966
- });
3967
- Object.assign(contents, doc);
3968
- return contents;
3969
- };
3970
- const de_ListRecoveryPointsByResourceCommandError = async (output, context) => {
3971
- const parsedOutput = {
3972
- ...output,
3973
- body: await parseErrorBody(output.body, context),
3974
- };
3975
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3976
- switch (errorCode) {
3977
- case "InvalidParameterValueException":
3978
- case "com.amazonaws.backup#InvalidParameterValueException":
3979
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
3980
- case "MissingParameterValueException":
3981
- case "com.amazonaws.backup#MissingParameterValueException":
3982
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
3983
- case "ResourceNotFoundException":
3984
- case "com.amazonaws.backup#ResourceNotFoundException":
3985
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
3986
- case "ServiceUnavailableException":
3987
- case "com.amazonaws.backup#ServiceUnavailableException":
3988
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
3989
- default:
3990
- const parsedBody = parsedOutput.body;
3991
- return throwDefaultError({
3992
- output,
3993
- parsedBody,
3994
- errorCode,
3995
- });
3996
- }
3997
- };
3998
- export const de_ListReportJobsCommand = async (output, context) => {
3999
- if (output.statusCode !== 200 && output.statusCode >= 300) {
4000
- return de_ListReportJobsCommandError(output, context);
2217
+ return de_CommandError(output, context);
4001
2218
  }
4002
2219
  const contents = map({
4003
2220
  $metadata: deserializeMetadata(output),
@@ -4005,39 +2222,29 @@ export const de_ListReportJobsCommand = async (output, context) => {
4005
2222
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
4006
2223
  const doc = take(data, {
4007
2224
  NextToken: __expectString,
4008
- ReportJobs: (_) => de_ReportJobList(_, context),
4009
- });
4010
- Object.assign(contents, doc);
4011
- return contents;
4012
- };
4013
- const de_ListReportJobsCommandError = async (output, context) => {
4014
- const parsedOutput = {
4015
- ...output,
4016
- body: await parseErrorBody(output.body, context),
4017
- };
4018
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4019
- switch (errorCode) {
4020
- case "InvalidParameterValueException":
4021
- case "com.amazonaws.backup#InvalidParameterValueException":
4022
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4023
- case "ResourceNotFoundException":
4024
- case "com.amazonaws.backup#ResourceNotFoundException":
4025
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4026
- case "ServiceUnavailableException":
4027
- case "com.amazonaws.backup#ServiceUnavailableException":
4028
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4029
- default:
4030
- const parsedBody = parsedOutput.body;
4031
- return throwDefaultError({
4032
- output,
4033
- parsedBody,
4034
- errorCode,
4035
- });
2225
+ RecoveryPoints: (_) => de_RecoveryPointByResourceList(_, context),
2226
+ });
2227
+ Object.assign(contents, doc);
2228
+ return contents;
2229
+ };
2230
+ export const de_ListReportJobsCommand = async (output, context) => {
2231
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2232
+ return de_CommandError(output, context);
4036
2233
  }
2234
+ const contents = map({
2235
+ $metadata: deserializeMetadata(output),
2236
+ });
2237
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2238
+ const doc = take(data, {
2239
+ NextToken: __expectString,
2240
+ ReportJobs: (_) => de_ReportJobList(_, context),
2241
+ });
2242
+ Object.assign(contents, doc);
2243
+ return contents;
4037
2244
  };
4038
2245
  export const de_ListReportPlansCommand = async (output, context) => {
4039
2246
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4040
- return de_ListReportPlansCommandError(output, context);
2247
+ return de_CommandError(output, context);
4041
2248
  }
4042
2249
  const contents = map({
4043
2250
  $metadata: deserializeMetadata(output),
@@ -4050,31 +2257,9 @@ export const de_ListReportPlansCommand = async (output, context) => {
4050
2257
  Object.assign(contents, doc);
4051
2258
  return contents;
4052
2259
  };
4053
- const de_ListReportPlansCommandError = async (output, context) => {
4054
- const parsedOutput = {
4055
- ...output,
4056
- body: await parseErrorBody(output.body, context),
4057
- };
4058
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4059
- switch (errorCode) {
4060
- case "InvalidParameterValueException":
4061
- case "com.amazonaws.backup#InvalidParameterValueException":
4062
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4063
- case "ServiceUnavailableException":
4064
- case "com.amazonaws.backup#ServiceUnavailableException":
4065
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4066
- default:
4067
- const parsedBody = parsedOutput.body;
4068
- return throwDefaultError({
4069
- output,
4070
- parsedBody,
4071
- errorCode,
4072
- });
4073
- }
4074
- };
4075
2260
  export const de_ListRestoreJobsCommand = async (output, context) => {
4076
2261
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4077
- return de_ListRestoreJobsCommandError(output, context);
2262
+ return de_CommandError(output, context);
4078
2263
  }
4079
2264
  const contents = map({
4080
2265
  $metadata: deserializeMetadata(output),
@@ -4087,37 +2272,9 @@ export const de_ListRestoreJobsCommand = async (output, context) => {
4087
2272
  Object.assign(contents, doc);
4088
2273
  return contents;
4089
2274
  };
4090
- const de_ListRestoreJobsCommandError = async (output, context) => {
4091
- const parsedOutput = {
4092
- ...output,
4093
- body: await parseErrorBody(output.body, context),
4094
- };
4095
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4096
- switch (errorCode) {
4097
- case "InvalidParameterValueException":
4098
- case "com.amazonaws.backup#InvalidParameterValueException":
4099
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4100
- case "MissingParameterValueException":
4101
- case "com.amazonaws.backup#MissingParameterValueException":
4102
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4103
- case "ResourceNotFoundException":
4104
- case "com.amazonaws.backup#ResourceNotFoundException":
4105
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4106
- case "ServiceUnavailableException":
4107
- case "com.amazonaws.backup#ServiceUnavailableException":
4108
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4109
- default:
4110
- const parsedBody = parsedOutput.body;
4111
- return throwDefaultError({
4112
- output,
4113
- parsedBody,
4114
- errorCode,
4115
- });
4116
- }
4117
- };
4118
2275
  export const de_ListRestoreJobsByProtectedResourceCommand = async (output, context) => {
4119
2276
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4120
- return de_ListRestoreJobsByProtectedResourceCommandError(output, context);
2277
+ return de_CommandError(output, context);
4121
2278
  }
4122
2279
  const contents = map({
4123
2280
  $metadata: deserializeMetadata(output),
@@ -4130,37 +2287,9 @@ export const de_ListRestoreJobsByProtectedResourceCommand = async (output, conte
4130
2287
  Object.assign(contents, doc);
4131
2288
  return contents;
4132
2289
  };
4133
- const de_ListRestoreJobsByProtectedResourceCommandError = async (output, context) => {
4134
- const parsedOutput = {
4135
- ...output,
4136
- body: await parseErrorBody(output.body, context),
4137
- };
4138
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4139
- switch (errorCode) {
4140
- case "InvalidParameterValueException":
4141
- case "com.amazonaws.backup#InvalidParameterValueException":
4142
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4143
- case "MissingParameterValueException":
4144
- case "com.amazonaws.backup#MissingParameterValueException":
4145
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4146
- case "ResourceNotFoundException":
4147
- case "com.amazonaws.backup#ResourceNotFoundException":
4148
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4149
- case "ServiceUnavailableException":
4150
- case "com.amazonaws.backup#ServiceUnavailableException":
4151
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4152
- default:
4153
- const parsedBody = parsedOutput.body;
4154
- return throwDefaultError({
4155
- output,
4156
- parsedBody,
4157
- errorCode,
4158
- });
4159
- }
4160
- };
4161
2290
  export const de_ListRestoreJobSummariesCommand = async (output, context) => {
4162
2291
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4163
- return de_ListRestoreJobSummariesCommandError(output, context);
2292
+ return de_CommandError(output, context);
4164
2293
  }
4165
2294
  const contents = map({
4166
2295
  $metadata: deserializeMetadata(output),
@@ -4174,31 +2303,9 @@ export const de_ListRestoreJobSummariesCommand = async (output, context) => {
4174
2303
  Object.assign(contents, doc);
4175
2304
  return contents;
4176
2305
  };
4177
- const de_ListRestoreJobSummariesCommandError = async (output, context) => {
4178
- const parsedOutput = {
4179
- ...output,
4180
- body: await parseErrorBody(output.body, context),
4181
- };
4182
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4183
- switch (errorCode) {
4184
- case "InvalidParameterValueException":
4185
- case "com.amazonaws.backup#InvalidParameterValueException":
4186
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4187
- case "ServiceUnavailableException":
4188
- case "com.amazonaws.backup#ServiceUnavailableException":
4189
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4190
- default:
4191
- const parsedBody = parsedOutput.body;
4192
- return throwDefaultError({
4193
- output,
4194
- parsedBody,
4195
- errorCode,
4196
- });
4197
- }
4198
- };
4199
2306
  export const de_ListRestoreTestingPlansCommand = async (output, context) => {
4200
2307
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4201
- return de_ListRestoreTestingPlansCommandError(output, context);
2308
+ return de_CommandError(output, context);
4202
2309
  }
4203
2310
  const contents = map({
4204
2311
  $metadata: deserializeMetadata(output),
@@ -4211,31 +2318,9 @@ export const de_ListRestoreTestingPlansCommand = async (output, context) => {
4211
2318
  Object.assign(contents, doc);
4212
2319
  return contents;
4213
2320
  };
4214
- const de_ListRestoreTestingPlansCommandError = async (output, context) => {
4215
- const parsedOutput = {
4216
- ...output,
4217
- body: await parseErrorBody(output.body, context),
4218
- };
4219
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4220
- switch (errorCode) {
4221
- case "InvalidParameterValueException":
4222
- case "com.amazonaws.backup#InvalidParameterValueException":
4223
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4224
- case "ServiceUnavailableException":
4225
- case "com.amazonaws.backup#ServiceUnavailableException":
4226
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4227
- default:
4228
- const parsedBody = parsedOutput.body;
4229
- return throwDefaultError({
4230
- output,
4231
- parsedBody,
4232
- errorCode,
4233
- });
4234
- }
4235
- };
4236
2321
  export const de_ListRestoreTestingSelectionsCommand = async (output, context) => {
4237
2322
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4238
- return de_ListRestoreTestingSelectionsCommandError(output, context);
2323
+ return de_CommandError(output, context);
4239
2324
  }
4240
2325
  const contents = map({
4241
2326
  $metadata: deserializeMetadata(output),
@@ -4248,34 +2333,9 @@ export const de_ListRestoreTestingSelectionsCommand = async (output, context) =>
4248
2333
  Object.assign(contents, doc);
4249
2334
  return contents;
4250
2335
  };
4251
- const de_ListRestoreTestingSelectionsCommandError = async (output, context) => {
4252
- const parsedOutput = {
4253
- ...output,
4254
- body: await parseErrorBody(output.body, context),
4255
- };
4256
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4257
- switch (errorCode) {
4258
- case "InvalidParameterValueException":
4259
- case "com.amazonaws.backup#InvalidParameterValueException":
4260
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4261
- case "ResourceNotFoundException":
4262
- case "com.amazonaws.backup#ResourceNotFoundException":
4263
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4264
- case "ServiceUnavailableException":
4265
- case "com.amazonaws.backup#ServiceUnavailableException":
4266
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4267
- default:
4268
- const parsedBody = parsedOutput.body;
4269
- return throwDefaultError({
4270
- output,
4271
- parsedBody,
4272
- errorCode,
4273
- });
4274
- }
4275
- };
4276
2336
  export const de_ListTagsCommand = async (output, context) => {
4277
2337
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4278
- return de_ListTagsCommandError(output, context);
2338
+ return de_CommandError(output, context);
4279
2339
  }
4280
2340
  const contents = map({
4281
2341
  $metadata: deserializeMetadata(output),
@@ -4288,116 +2348,19 @@ export const de_ListTagsCommand = async (output, context) => {
4288
2348
  Object.assign(contents, doc);
4289
2349
  return contents;
4290
2350
  };
4291
- const de_ListTagsCommandError = async (output, context) => {
4292
- const parsedOutput = {
4293
- ...output,
4294
- body: await parseErrorBody(output.body, context),
4295
- };
4296
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4297
- switch (errorCode) {
4298
- case "InvalidParameterValueException":
4299
- case "com.amazonaws.backup#InvalidParameterValueException":
4300
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4301
- case "MissingParameterValueException":
4302
- case "com.amazonaws.backup#MissingParameterValueException":
4303
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4304
- case "ResourceNotFoundException":
4305
- case "com.amazonaws.backup#ResourceNotFoundException":
4306
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4307
- case "ServiceUnavailableException":
4308
- case "com.amazonaws.backup#ServiceUnavailableException":
4309
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4310
- default:
4311
- const parsedBody = parsedOutput.body;
4312
- return throwDefaultError({
4313
- output,
4314
- parsedBody,
4315
- errorCode,
4316
- });
4317
- }
4318
- };
4319
2351
  export const de_PutBackupVaultAccessPolicyCommand = async (output, context) => {
4320
2352
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4321
- return de_PutBackupVaultAccessPolicyCommandError(output, context);
4322
- }
4323
- const contents = map({
4324
- $metadata: deserializeMetadata(output),
4325
- });
4326
- await collectBody(output.body, context);
4327
- return contents;
4328
- };
4329
- const de_PutBackupVaultAccessPolicyCommandError = async (output, context) => {
4330
- const parsedOutput = {
4331
- ...output,
4332
- body: await parseErrorBody(output.body, context),
4333
- };
4334
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4335
- switch (errorCode) {
4336
- case "InvalidParameterValueException":
4337
- case "com.amazonaws.backup#InvalidParameterValueException":
4338
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4339
- case "MissingParameterValueException":
4340
- case "com.amazonaws.backup#MissingParameterValueException":
4341
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4342
- case "ResourceNotFoundException":
4343
- case "com.amazonaws.backup#ResourceNotFoundException":
4344
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4345
- case "ServiceUnavailableException":
4346
- case "com.amazonaws.backup#ServiceUnavailableException":
4347
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4348
- default:
4349
- const parsedBody = parsedOutput.body;
4350
- return throwDefaultError({
4351
- output,
4352
- parsedBody,
4353
- errorCode,
4354
- });
4355
- }
4356
- };
4357
- export const de_PutBackupVaultLockConfigurationCommand = async (output, context) => {
4358
- if (output.statusCode !== 200 && output.statusCode >= 300) {
4359
- return de_PutBackupVaultLockConfigurationCommandError(output, context);
4360
- }
4361
- const contents = map({
4362
- $metadata: deserializeMetadata(output),
4363
- });
4364
- await collectBody(output.body, context);
4365
- return contents;
4366
- };
4367
- const de_PutBackupVaultLockConfigurationCommandError = async (output, context) => {
4368
- const parsedOutput = {
4369
- ...output,
4370
- body: await parseErrorBody(output.body, context),
4371
- };
4372
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4373
- switch (errorCode) {
4374
- case "InvalidParameterValueException":
4375
- case "com.amazonaws.backup#InvalidParameterValueException":
4376
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4377
- case "InvalidRequestException":
4378
- case "com.amazonaws.backup#InvalidRequestException":
4379
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
4380
- case "MissingParameterValueException":
4381
- case "com.amazonaws.backup#MissingParameterValueException":
4382
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4383
- case "ResourceNotFoundException":
4384
- case "com.amazonaws.backup#ResourceNotFoundException":
4385
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4386
- case "ServiceUnavailableException":
4387
- case "com.amazonaws.backup#ServiceUnavailableException":
4388
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4389
- default:
4390
- const parsedBody = parsedOutput.body;
4391
- return throwDefaultError({
4392
- output,
4393
- parsedBody,
4394
- errorCode,
4395
- });
2353
+ return de_CommandError(output, context);
4396
2354
  }
2355
+ const contents = map({
2356
+ $metadata: deserializeMetadata(output),
2357
+ });
2358
+ await collectBody(output.body, context);
2359
+ return contents;
4397
2360
  };
4398
- export const de_PutBackupVaultNotificationsCommand = async (output, context) => {
2361
+ export const de_PutBackupVaultLockConfigurationCommand = async (output, context) => {
4399
2362
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4400
- return de_PutBackupVaultNotificationsCommandError(output, context);
2363
+ return de_CommandError(output, context);
4401
2364
  }
4402
2365
  const contents = map({
4403
2366
  $metadata: deserializeMetadata(output),
@@ -4405,37 +2368,19 @@ export const de_PutBackupVaultNotificationsCommand = async (output, context) =>
4405
2368
  await collectBody(output.body, context);
4406
2369
  return contents;
4407
2370
  };
4408
- const de_PutBackupVaultNotificationsCommandError = async (output, context) => {
4409
- const parsedOutput = {
4410
- ...output,
4411
- body: await parseErrorBody(output.body, context),
4412
- };
4413
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4414
- switch (errorCode) {
4415
- case "InvalidParameterValueException":
4416
- case "com.amazonaws.backup#InvalidParameterValueException":
4417
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4418
- case "MissingParameterValueException":
4419
- case "com.amazonaws.backup#MissingParameterValueException":
4420
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4421
- case "ResourceNotFoundException":
4422
- case "com.amazonaws.backup#ResourceNotFoundException":
4423
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4424
- case "ServiceUnavailableException":
4425
- case "com.amazonaws.backup#ServiceUnavailableException":
4426
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4427
- default:
4428
- const parsedBody = parsedOutput.body;
4429
- return throwDefaultError({
4430
- output,
4431
- parsedBody,
4432
- errorCode,
4433
- });
2371
+ export const de_PutBackupVaultNotificationsCommand = async (output, context) => {
2372
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2373
+ return de_CommandError(output, context);
4434
2374
  }
2375
+ const contents = map({
2376
+ $metadata: deserializeMetadata(output),
2377
+ });
2378
+ await collectBody(output.body, context);
2379
+ return contents;
4435
2380
  };
4436
2381
  export const de_PutRestoreValidationResultCommand = async (output, context) => {
4437
2382
  if (output.statusCode !== 204 && output.statusCode >= 300) {
4438
- return de_PutRestoreValidationResultCommandError(output, context);
2383
+ return de_CommandError(output, context);
4439
2384
  }
4440
2385
  const contents = map({
4441
2386
  $metadata: deserializeMetadata(output),
@@ -4443,40 +2388,9 @@ export const de_PutRestoreValidationResultCommand = async (output, context) => {
4443
2388
  await collectBody(output.body, context);
4444
2389
  return contents;
4445
2390
  };
4446
- const de_PutRestoreValidationResultCommandError = async (output, context) => {
4447
- const parsedOutput = {
4448
- ...output,
4449
- body: await parseErrorBody(output.body, context),
4450
- };
4451
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4452
- switch (errorCode) {
4453
- case "InvalidParameterValueException":
4454
- case "com.amazonaws.backup#InvalidParameterValueException":
4455
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4456
- case "InvalidRequestException":
4457
- case "com.amazonaws.backup#InvalidRequestException":
4458
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
4459
- case "MissingParameterValueException":
4460
- case "com.amazonaws.backup#MissingParameterValueException":
4461
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4462
- case "ResourceNotFoundException":
4463
- case "com.amazonaws.backup#ResourceNotFoundException":
4464
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4465
- case "ServiceUnavailableException":
4466
- case "com.amazonaws.backup#ServiceUnavailableException":
4467
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4468
- default:
4469
- const parsedBody = parsedOutput.body;
4470
- return throwDefaultError({
4471
- output,
4472
- parsedBody,
4473
- errorCode,
4474
- });
4475
- }
4476
- };
4477
2391
  export const de_StartBackupJobCommand = async (output, context) => {
4478
2392
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4479
- return de_StartBackupJobCommandError(output, context);
2393
+ return de_CommandError(output, context);
4480
2394
  }
4481
2395
  const contents = map({
4482
2396
  $metadata: deserializeMetadata(output),
@@ -4491,43 +2405,9 @@ export const de_StartBackupJobCommand = async (output, context) => {
4491
2405
  Object.assign(contents, doc);
4492
2406
  return contents;
4493
2407
  };
4494
- const de_StartBackupJobCommandError = async (output, context) => {
4495
- const parsedOutput = {
4496
- ...output,
4497
- body: await parseErrorBody(output.body, context),
4498
- };
4499
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4500
- switch (errorCode) {
4501
- case "InvalidParameterValueException":
4502
- case "com.amazonaws.backup#InvalidParameterValueException":
4503
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4504
- case "InvalidRequestException":
4505
- case "com.amazonaws.backup#InvalidRequestException":
4506
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
4507
- case "LimitExceededException":
4508
- case "com.amazonaws.backup#LimitExceededException":
4509
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
4510
- case "MissingParameterValueException":
4511
- case "com.amazonaws.backup#MissingParameterValueException":
4512
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4513
- case "ResourceNotFoundException":
4514
- case "com.amazonaws.backup#ResourceNotFoundException":
4515
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4516
- case "ServiceUnavailableException":
4517
- case "com.amazonaws.backup#ServiceUnavailableException":
4518
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4519
- default:
4520
- const parsedBody = parsedOutput.body;
4521
- return throwDefaultError({
4522
- output,
4523
- parsedBody,
4524
- errorCode,
4525
- });
4526
- }
4527
- };
4528
2408
  export const de_StartCopyJobCommand = async (output, context) => {
4529
2409
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4530
- return de_StartCopyJobCommandError(output, context);
2410
+ return de_CommandError(output, context);
4531
2411
  }
4532
2412
  const contents = map({
4533
2413
  $metadata: deserializeMetadata(output),
@@ -4541,43 +2421,9 @@ export const de_StartCopyJobCommand = async (output, context) => {
4541
2421
  Object.assign(contents, doc);
4542
2422
  return contents;
4543
2423
  };
4544
- const de_StartCopyJobCommandError = async (output, context) => {
4545
- const parsedOutput = {
4546
- ...output,
4547
- body: await parseErrorBody(output.body, context),
4548
- };
4549
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4550
- switch (errorCode) {
4551
- case "InvalidParameterValueException":
4552
- case "com.amazonaws.backup#InvalidParameterValueException":
4553
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4554
- case "InvalidRequestException":
4555
- case "com.amazonaws.backup#InvalidRequestException":
4556
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
4557
- case "LimitExceededException":
4558
- case "com.amazonaws.backup#LimitExceededException":
4559
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
4560
- case "MissingParameterValueException":
4561
- case "com.amazonaws.backup#MissingParameterValueException":
4562
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4563
- case "ResourceNotFoundException":
4564
- case "com.amazonaws.backup#ResourceNotFoundException":
4565
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4566
- case "ServiceUnavailableException":
4567
- case "com.amazonaws.backup#ServiceUnavailableException":
4568
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4569
- default:
4570
- const parsedBody = parsedOutput.body;
4571
- return throwDefaultError({
4572
- output,
4573
- parsedBody,
4574
- errorCode,
4575
- });
4576
- }
4577
- };
4578
2424
  export const de_StartReportJobCommand = async (output, context) => {
4579
2425
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4580
- return de_StartReportJobCommandError(output, context);
2426
+ return de_CommandError(output, context);
4581
2427
  }
4582
2428
  const contents = map({
4583
2429
  $metadata: deserializeMetadata(output),
@@ -4589,37 +2435,9 @@ export const de_StartReportJobCommand = async (output, context) => {
4589
2435
  Object.assign(contents, doc);
4590
2436
  return contents;
4591
2437
  };
4592
- const de_StartReportJobCommandError = async (output, context) => {
4593
- const parsedOutput = {
4594
- ...output,
4595
- body: await parseErrorBody(output.body, context),
4596
- };
4597
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4598
- switch (errorCode) {
4599
- case "InvalidParameterValueException":
4600
- case "com.amazonaws.backup#InvalidParameterValueException":
4601
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4602
- case "MissingParameterValueException":
4603
- case "com.amazonaws.backup#MissingParameterValueException":
4604
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4605
- case "ResourceNotFoundException":
4606
- case "com.amazonaws.backup#ResourceNotFoundException":
4607
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4608
- case "ServiceUnavailableException":
4609
- case "com.amazonaws.backup#ServiceUnavailableException":
4610
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4611
- default:
4612
- const parsedBody = parsedOutput.body;
4613
- return throwDefaultError({
4614
- output,
4615
- parsedBody,
4616
- errorCode,
4617
- });
4618
- }
4619
- };
4620
2438
  export const de_StartRestoreJobCommand = async (output, context) => {
4621
2439
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4622
- return de_StartRestoreJobCommandError(output, context);
2440
+ return de_CommandError(output, context);
4623
2441
  }
4624
2442
  const contents = map({
4625
2443
  $metadata: deserializeMetadata(output),
@@ -4631,40 +2449,9 @@ export const de_StartRestoreJobCommand = async (output, context) => {
4631
2449
  Object.assign(contents, doc);
4632
2450
  return contents;
4633
2451
  };
4634
- const de_StartRestoreJobCommandError = async (output, context) => {
4635
- const parsedOutput = {
4636
- ...output,
4637
- body: await parseErrorBody(output.body, context),
4638
- };
4639
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4640
- switch (errorCode) {
4641
- case "InvalidParameterValueException":
4642
- case "com.amazonaws.backup#InvalidParameterValueException":
4643
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4644
- case "InvalidRequestException":
4645
- case "com.amazonaws.backup#InvalidRequestException":
4646
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
4647
- case "MissingParameterValueException":
4648
- case "com.amazonaws.backup#MissingParameterValueException":
4649
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4650
- case "ResourceNotFoundException":
4651
- case "com.amazonaws.backup#ResourceNotFoundException":
4652
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4653
- case "ServiceUnavailableException":
4654
- case "com.amazonaws.backup#ServiceUnavailableException":
4655
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4656
- default:
4657
- const parsedBody = parsedOutput.body;
4658
- return throwDefaultError({
4659
- output,
4660
- parsedBody,
4661
- errorCode,
4662
- });
4663
- }
4664
- };
4665
2452
  export const de_StopBackupJobCommand = async (output, context) => {
4666
2453
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4667
- return de_StopBackupJobCommandError(output, context);
2454
+ return de_CommandError(output, context);
4668
2455
  }
4669
2456
  const contents = map({
4670
2457
  $metadata: deserializeMetadata(output),
@@ -4672,81 +2459,19 @@ export const de_StopBackupJobCommand = async (output, context) => {
4672
2459
  await collectBody(output.body, context);
4673
2460
  return contents;
4674
2461
  };
4675
- const de_StopBackupJobCommandError = async (output, context) => {
4676
- const parsedOutput = {
4677
- ...output,
4678
- body: await parseErrorBody(output.body, context),
4679
- };
4680
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4681
- switch (errorCode) {
4682
- case "InvalidParameterValueException":
4683
- case "com.amazonaws.backup#InvalidParameterValueException":
4684
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4685
- case "InvalidRequestException":
4686
- case "com.amazonaws.backup#InvalidRequestException":
4687
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
4688
- case "MissingParameterValueException":
4689
- case "com.amazonaws.backup#MissingParameterValueException":
4690
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4691
- case "ResourceNotFoundException":
4692
- case "com.amazonaws.backup#ResourceNotFoundException":
4693
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4694
- case "ServiceUnavailableException":
4695
- case "com.amazonaws.backup#ServiceUnavailableException":
4696
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4697
- default:
4698
- const parsedBody = parsedOutput.body;
4699
- return throwDefaultError({
4700
- output,
4701
- parsedBody,
4702
- errorCode,
4703
- });
4704
- }
4705
- };
4706
2462
  export const de_TagResourceCommand = async (output, context) => {
4707
2463
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4708
- return de_TagResourceCommandError(output, context);
2464
+ return de_CommandError(output, context);
4709
2465
  }
4710
2466
  const contents = map({
4711
- $metadata: deserializeMetadata(output),
4712
- });
4713
- await collectBody(output.body, context);
4714
- return contents;
4715
- };
4716
- const de_TagResourceCommandError = async (output, context) => {
4717
- const parsedOutput = {
4718
- ...output,
4719
- body: await parseErrorBody(output.body, context),
4720
- };
4721
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4722
- switch (errorCode) {
4723
- case "InvalidParameterValueException":
4724
- case "com.amazonaws.backup#InvalidParameterValueException":
4725
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4726
- case "LimitExceededException":
4727
- case "com.amazonaws.backup#LimitExceededException":
4728
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
4729
- case "MissingParameterValueException":
4730
- case "com.amazonaws.backup#MissingParameterValueException":
4731
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4732
- case "ResourceNotFoundException":
4733
- case "com.amazonaws.backup#ResourceNotFoundException":
4734
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4735
- case "ServiceUnavailableException":
4736
- case "com.amazonaws.backup#ServiceUnavailableException":
4737
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4738
- default:
4739
- const parsedBody = parsedOutput.body;
4740
- return throwDefaultError({
4741
- output,
4742
- parsedBody,
4743
- errorCode,
4744
- });
4745
- }
2467
+ $metadata: deserializeMetadata(output),
2468
+ });
2469
+ await collectBody(output.body, context);
2470
+ return contents;
4746
2471
  };
4747
2472
  export const de_UntagResourceCommand = async (output, context) => {
4748
2473
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4749
- return de_UntagResourceCommandError(output, context);
2474
+ return de_CommandError(output, context);
4750
2475
  }
4751
2476
  const contents = map({
4752
2477
  $metadata: deserializeMetadata(output),
@@ -4754,37 +2479,9 @@ export const de_UntagResourceCommand = async (output, context) => {
4754
2479
  await collectBody(output.body, context);
4755
2480
  return contents;
4756
2481
  };
4757
- const de_UntagResourceCommandError = async (output, context) => {
4758
- const parsedOutput = {
4759
- ...output,
4760
- body: await parseErrorBody(output.body, context),
4761
- };
4762
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4763
- switch (errorCode) {
4764
- case "InvalidParameterValueException":
4765
- case "com.amazonaws.backup#InvalidParameterValueException":
4766
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4767
- case "MissingParameterValueException":
4768
- case "com.amazonaws.backup#MissingParameterValueException":
4769
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4770
- case "ResourceNotFoundException":
4771
- case "com.amazonaws.backup#ResourceNotFoundException":
4772
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4773
- case "ServiceUnavailableException":
4774
- case "com.amazonaws.backup#ServiceUnavailableException":
4775
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4776
- default:
4777
- const parsedBody = parsedOutput.body;
4778
- return throwDefaultError({
4779
- output,
4780
- parsedBody,
4781
- errorCode,
4782
- });
4783
- }
4784
- };
4785
2482
  export const de_UpdateBackupPlanCommand = async (output, context) => {
4786
2483
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4787
- return de_UpdateBackupPlanCommandError(output, context);
2484
+ return de_CommandError(output, context);
4788
2485
  }
4789
2486
  const contents = map({
4790
2487
  $metadata: deserializeMetadata(output),
@@ -4800,37 +2497,9 @@ export const de_UpdateBackupPlanCommand = async (output, context) => {
4800
2497
  Object.assign(contents, doc);
4801
2498
  return contents;
4802
2499
  };
4803
- const de_UpdateBackupPlanCommandError = async (output, context) => {
4804
- const parsedOutput = {
4805
- ...output,
4806
- body: await parseErrorBody(output.body, context),
4807
- };
4808
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4809
- switch (errorCode) {
4810
- case "InvalidParameterValueException":
4811
- case "com.amazonaws.backup#InvalidParameterValueException":
4812
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4813
- case "MissingParameterValueException":
4814
- case "com.amazonaws.backup#MissingParameterValueException":
4815
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4816
- case "ResourceNotFoundException":
4817
- case "com.amazonaws.backup#ResourceNotFoundException":
4818
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4819
- case "ServiceUnavailableException":
4820
- case "com.amazonaws.backup#ServiceUnavailableException":
4821
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4822
- default:
4823
- const parsedBody = parsedOutput.body;
4824
- return throwDefaultError({
4825
- output,
4826
- parsedBody,
4827
- errorCode,
4828
- });
4829
- }
4830
- };
4831
2500
  export const de_UpdateFrameworkCommand = async (output, context) => {
4832
2501
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4833
- return de_UpdateFrameworkCommandError(output, context);
2502
+ return de_CommandError(output, context);
4834
2503
  }
4835
2504
  const contents = map({
4836
2505
  $metadata: deserializeMetadata(output),
@@ -4844,46 +2513,9 @@ export const de_UpdateFrameworkCommand = async (output, context) => {
4844
2513
  Object.assign(contents, doc);
4845
2514
  return contents;
4846
2515
  };
4847
- const de_UpdateFrameworkCommandError = async (output, context) => {
4848
- const parsedOutput = {
4849
- ...output,
4850
- body: await parseErrorBody(output.body, context),
4851
- };
4852
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4853
- switch (errorCode) {
4854
- case "AlreadyExistsException":
4855
- case "com.amazonaws.backup#AlreadyExistsException":
4856
- throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
4857
- case "ConflictException":
4858
- case "com.amazonaws.backup#ConflictException":
4859
- throw await de_ConflictExceptionRes(parsedOutput, context);
4860
- case "InvalidParameterValueException":
4861
- case "com.amazonaws.backup#InvalidParameterValueException":
4862
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4863
- case "LimitExceededException":
4864
- case "com.amazonaws.backup#LimitExceededException":
4865
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
4866
- case "MissingParameterValueException":
4867
- case "com.amazonaws.backup#MissingParameterValueException":
4868
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4869
- case "ResourceNotFoundException":
4870
- case "com.amazonaws.backup#ResourceNotFoundException":
4871
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4872
- case "ServiceUnavailableException":
4873
- case "com.amazonaws.backup#ServiceUnavailableException":
4874
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4875
- default:
4876
- const parsedBody = parsedOutput.body;
4877
- return throwDefaultError({
4878
- output,
4879
- parsedBody,
4880
- errorCode,
4881
- });
4882
- }
4883
- };
4884
2516
  export const de_UpdateGlobalSettingsCommand = async (output, context) => {
4885
2517
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4886
- return de_UpdateGlobalSettingsCommandError(output, context);
2518
+ return de_CommandError(output, context);
4887
2519
  }
4888
2520
  const contents = map({
4889
2521
  $metadata: deserializeMetadata(output),
@@ -4891,37 +2523,9 @@ export const de_UpdateGlobalSettingsCommand = async (output, context) => {
4891
2523
  await collectBody(output.body, context);
4892
2524
  return contents;
4893
2525
  };
4894
- const de_UpdateGlobalSettingsCommandError = async (output, context) => {
4895
- const parsedOutput = {
4896
- ...output,
4897
- body: await parseErrorBody(output.body, context),
4898
- };
4899
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4900
- switch (errorCode) {
4901
- case "InvalidParameterValueException":
4902
- case "com.amazonaws.backup#InvalidParameterValueException":
4903
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4904
- case "InvalidRequestException":
4905
- case "com.amazonaws.backup#InvalidRequestException":
4906
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
4907
- case "MissingParameterValueException":
4908
- case "com.amazonaws.backup#MissingParameterValueException":
4909
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4910
- case "ServiceUnavailableException":
4911
- case "com.amazonaws.backup#ServiceUnavailableException":
4912
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4913
- default:
4914
- const parsedBody = parsedOutput.body;
4915
- return throwDefaultError({
4916
- output,
4917
- parsedBody,
4918
- errorCode,
4919
- });
4920
- }
4921
- };
4922
2526
  export const de_UpdateRecoveryPointLifecycleCommand = async (output, context) => {
4923
2527
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4924
- return de_UpdateRecoveryPointLifecycleCommandError(output, context);
2528
+ return de_CommandError(output, context);
4925
2529
  }
4926
2530
  const contents = map({
4927
2531
  $metadata: deserializeMetadata(output),
@@ -4936,40 +2540,9 @@ export const de_UpdateRecoveryPointLifecycleCommand = async (output, context) =>
4936
2540
  Object.assign(contents, doc);
4937
2541
  return contents;
4938
2542
  };
4939
- const de_UpdateRecoveryPointLifecycleCommandError = async (output, context) => {
4940
- const parsedOutput = {
4941
- ...output,
4942
- body: await parseErrorBody(output.body, context),
4943
- };
4944
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4945
- switch (errorCode) {
4946
- case "InvalidParameterValueException":
4947
- case "com.amazonaws.backup#InvalidParameterValueException":
4948
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4949
- case "InvalidRequestException":
4950
- case "com.amazonaws.backup#InvalidRequestException":
4951
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
4952
- case "MissingParameterValueException":
4953
- case "com.amazonaws.backup#MissingParameterValueException":
4954
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4955
- case "ResourceNotFoundException":
4956
- case "com.amazonaws.backup#ResourceNotFoundException":
4957
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
4958
- case "ServiceUnavailableException":
4959
- case "com.amazonaws.backup#ServiceUnavailableException":
4960
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4961
- default:
4962
- const parsedBody = parsedOutput.body;
4963
- return throwDefaultError({
4964
- output,
4965
- parsedBody,
4966
- errorCode,
4967
- });
4968
- }
4969
- };
4970
2543
  export const de_UpdateRegionSettingsCommand = async (output, context) => {
4971
2544
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4972
- return de_UpdateRegionSettingsCommandError(output, context);
2545
+ return de_CommandError(output, context);
4973
2546
  }
4974
2547
  const contents = map({
4975
2548
  $metadata: deserializeMetadata(output),
@@ -4977,34 +2550,9 @@ export const de_UpdateRegionSettingsCommand = async (output, context) => {
4977
2550
  await collectBody(output.body, context);
4978
2551
  return contents;
4979
2552
  };
4980
- const de_UpdateRegionSettingsCommandError = async (output, context) => {
4981
- const parsedOutput = {
4982
- ...output,
4983
- body: await parseErrorBody(output.body, context),
4984
- };
4985
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4986
- switch (errorCode) {
4987
- case "InvalidParameterValueException":
4988
- case "com.amazonaws.backup#InvalidParameterValueException":
4989
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
4990
- case "MissingParameterValueException":
4991
- case "com.amazonaws.backup#MissingParameterValueException":
4992
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
4993
- case "ServiceUnavailableException":
4994
- case "com.amazonaws.backup#ServiceUnavailableException":
4995
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
4996
- default:
4997
- const parsedBody = parsedOutput.body;
4998
- return throwDefaultError({
4999
- output,
5000
- parsedBody,
5001
- errorCode,
5002
- });
5003
- }
5004
- };
5005
2553
  export const de_UpdateReportPlanCommand = async (output, context) => {
5006
2554
  if (output.statusCode !== 200 && output.statusCode >= 300) {
5007
- return de_UpdateReportPlanCommandError(output, context);
2555
+ return de_CommandError(output, context);
5008
2556
  }
5009
2557
  const contents = map({
5010
2558
  $metadata: deserializeMetadata(output),
@@ -5018,40 +2566,9 @@ export const de_UpdateReportPlanCommand = async (output, context) => {
5018
2566
  Object.assign(contents, doc);
5019
2567
  return contents;
5020
2568
  };
5021
- const de_UpdateReportPlanCommandError = async (output, context) => {
5022
- const parsedOutput = {
5023
- ...output,
5024
- body: await parseErrorBody(output.body, context),
5025
- };
5026
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
5027
- switch (errorCode) {
5028
- case "ConflictException":
5029
- case "com.amazonaws.backup#ConflictException":
5030
- throw await de_ConflictExceptionRes(parsedOutput, context);
5031
- case "InvalidParameterValueException":
5032
- case "com.amazonaws.backup#InvalidParameterValueException":
5033
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
5034
- case "MissingParameterValueException":
5035
- case "com.amazonaws.backup#MissingParameterValueException":
5036
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
5037
- case "ResourceNotFoundException":
5038
- case "com.amazonaws.backup#ResourceNotFoundException":
5039
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
5040
- case "ServiceUnavailableException":
5041
- case "com.amazonaws.backup#ServiceUnavailableException":
5042
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
5043
- default:
5044
- const parsedBody = parsedOutput.body;
5045
- return throwDefaultError({
5046
- output,
5047
- parsedBody,
5048
- errorCode,
5049
- });
5050
- }
5051
- };
5052
2569
  export const de_UpdateRestoreTestingPlanCommand = async (output, context) => {
5053
2570
  if (output.statusCode !== 200 && output.statusCode >= 300) {
5054
- return de_UpdateRestoreTestingPlanCommandError(output, context);
2571
+ return de_CommandError(output, context);
5055
2572
  }
5056
2573
  const contents = map({
5057
2574
  $metadata: deserializeMetadata(output),
@@ -5066,40 +2583,9 @@ export const de_UpdateRestoreTestingPlanCommand = async (output, context) => {
5066
2583
  Object.assign(contents, doc);
5067
2584
  return contents;
5068
2585
  };
5069
- const de_UpdateRestoreTestingPlanCommandError = async (output, context) => {
5070
- const parsedOutput = {
5071
- ...output,
5072
- body: await parseErrorBody(output.body, context),
5073
- };
5074
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
5075
- switch (errorCode) {
5076
- case "ConflictException":
5077
- case "com.amazonaws.backup#ConflictException":
5078
- throw await de_ConflictExceptionRes(parsedOutput, context);
5079
- case "InvalidParameterValueException":
5080
- case "com.amazonaws.backup#InvalidParameterValueException":
5081
- throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
5082
- case "MissingParameterValueException":
5083
- case "com.amazonaws.backup#MissingParameterValueException":
5084
- throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
5085
- case "ResourceNotFoundException":
5086
- case "com.amazonaws.backup#ResourceNotFoundException":
5087
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
5088
- case "ServiceUnavailableException":
5089
- case "com.amazonaws.backup#ServiceUnavailableException":
5090
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
5091
- default:
5092
- const parsedBody = parsedOutput.body;
5093
- return throwDefaultError({
5094
- output,
5095
- parsedBody,
5096
- errorCode,
5097
- });
5098
- }
5099
- };
5100
2586
  export const de_UpdateRestoreTestingSelectionCommand = async (output, context) => {
5101
2587
  if (output.statusCode !== 200 && output.statusCode >= 300) {
5102
- return de_UpdateRestoreTestingSelectionCommandError(output, context);
2588
+ return de_CommandError(output, context);
5103
2589
  }
5104
2590
  const contents = map({
5105
2591
  $metadata: deserializeMetadata(output),
@@ -5115,19 +2601,19 @@ export const de_UpdateRestoreTestingSelectionCommand = async (output, context) =
5115
2601
  Object.assign(contents, doc);
5116
2602
  return contents;
5117
2603
  };
5118
- const de_UpdateRestoreTestingSelectionCommandError = async (output, context) => {
2604
+ const de_CommandError = async (output, context) => {
5119
2605
  const parsedOutput = {
5120
2606
  ...output,
5121
2607
  body: await parseErrorBody(output.body, context),
5122
2608
  };
5123
2609
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
5124
2610
  switch (errorCode) {
5125
- case "ConflictException":
5126
- case "com.amazonaws.backup#ConflictException":
5127
- throw await de_ConflictExceptionRes(parsedOutput, context);
5128
2611
  case "InvalidParameterValueException":
5129
2612
  case "com.amazonaws.backup#InvalidParameterValueException":
5130
2613
  throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
2614
+ case "InvalidResourceStateException":
2615
+ case "com.amazonaws.backup#InvalidResourceStateException":
2616
+ throw await de_InvalidResourceStateExceptionRes(parsedOutput, context);
5131
2617
  case "MissingParameterValueException":
5132
2618
  case "com.amazonaws.backup#MissingParameterValueException":
5133
2619
  throw await de_MissingParameterValueExceptionRes(parsedOutput, context);
@@ -5137,6 +2623,21 @@ const de_UpdateRestoreTestingSelectionCommandError = async (output, context) =>
5137
2623
  case "ServiceUnavailableException":
5138
2624
  case "com.amazonaws.backup#ServiceUnavailableException":
5139
2625
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
2626
+ case "AlreadyExistsException":
2627
+ case "com.amazonaws.backup#AlreadyExistsException":
2628
+ throw await de_AlreadyExistsExceptionRes(parsedOutput, context);
2629
+ case "LimitExceededException":
2630
+ case "com.amazonaws.backup#LimitExceededException":
2631
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
2632
+ case "InvalidRequestException":
2633
+ case "com.amazonaws.backup#InvalidRequestException":
2634
+ throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2635
+ case "ConflictException":
2636
+ case "com.amazonaws.backup#ConflictException":
2637
+ throw await de_ConflictExceptionRes(parsedOutput, context);
2638
+ case "DependencyFailureException":
2639
+ case "com.amazonaws.backup#DependencyFailureException":
2640
+ throw await de_DependencyFailureExceptionRes(parsedOutput, context);
5140
2641
  default:
5141
2642
  const parsedBody = parsedOutput.body;
5142
2643
  return throwDefaultError({