@aws-sdk/client-iottwinmaker 3.51.0 → 3.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ exports.deserializeAws_restJson1UpdateEntityCommand = exports.deserializeAws_res
4
4
  exports.deserializeAws_restJson1UpdateWorkspaceCommand = exports.deserializeAws_restJson1UpdateSceneCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ const IoTTwinMakerServiceException_1 = require("../models/IoTTwinMakerServiceException");
7
8
  const models_0_1 = require("../models/models_0");
8
9
  const serializeAws_restJson1BatchPutPropertyValuesCommand = async (input, context) => {
9
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -1153,51 +1154,25 @@ const deserializeAws_restJson1BatchPutPropertyValuesCommandError = async (output
1153
1154
  switch (errorCode) {
1154
1155
  case "InternalServerException":
1155
1156
  case "com.amazonaws.iottwinmaker#InternalServerException":
1156
- response = {
1157
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1158
- name: errorCode,
1159
- $metadata: deserializeMetadata(output),
1160
- };
1161
- break;
1157
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1162
1158
  case "ResourceNotFoundException":
1163
1159
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
1164
- response = {
1165
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1166
- name: errorCode,
1167
- $metadata: deserializeMetadata(output),
1168
- };
1169
- break;
1160
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1170
1161
  case "ThrottlingException":
1171
1162
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1172
- response = {
1173
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1174
- name: errorCode,
1175
- $metadata: deserializeMetadata(output),
1176
- };
1177
- break;
1163
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1178
1164
  case "ValidationException":
1179
1165
  case "com.amazonaws.iottwinmaker#ValidationException":
1180
- response = {
1181
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1182
- name: errorCode,
1183
- $metadata: deserializeMetadata(output),
1184
- };
1185
- break;
1166
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1186
1167
  default:
1187
1168
  const parsedBody = parsedOutput.body;
1188
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1189
- response = {
1190
- ...parsedBody,
1191
- name: `${errorCode}`,
1192
- message: parsedBody.message || parsedBody.Message || errorCode,
1169
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1170
+ name: parsedBody.code || parsedBody.Code || errorCode,
1193
1171
  $fault: "client",
1194
1172
  $metadata: deserializeMetadata(output),
1195
- };
1173
+ });
1174
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1196
1175
  }
1197
- const message = response.message || response.Message || errorCode;
1198
- response.message = message;
1199
- delete response.Message;
1200
- return Promise.reject(Object.assign(new Error(message), response));
1201
1176
  };
1202
1177
  const deserializeAws_restJson1CreateComponentTypeCommand = async (output, context) => {
1203
1178
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1233,67 +1208,31 @@ const deserializeAws_restJson1CreateComponentTypeCommandError = async (output, c
1233
1208
  switch (errorCode) {
1234
1209
  case "AccessDeniedException":
1235
1210
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
1236
- response = {
1237
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1238
- name: errorCode,
1239
- $metadata: deserializeMetadata(output),
1240
- };
1241
- break;
1211
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1242
1212
  case "ConflictException":
1243
1213
  case "com.amazonaws.iottwinmaker#ConflictException":
1244
- response = {
1245
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1246
- name: errorCode,
1247
- $metadata: deserializeMetadata(output),
1248
- };
1249
- break;
1214
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1250
1215
  case "InternalServerException":
1251
1216
  case "com.amazonaws.iottwinmaker#InternalServerException":
1252
- response = {
1253
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1254
- name: errorCode,
1255
- $metadata: deserializeMetadata(output),
1256
- };
1257
- break;
1217
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1258
1218
  case "ServiceQuotaExceededException":
1259
1219
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
1260
- response = {
1261
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1262
- name: errorCode,
1263
- $metadata: deserializeMetadata(output),
1264
- };
1265
- break;
1220
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1266
1221
  case "ThrottlingException":
1267
1222
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1268
- response = {
1269
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1270
- name: errorCode,
1271
- $metadata: deserializeMetadata(output),
1272
- };
1273
- break;
1223
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1274
1224
  case "ValidationException":
1275
1225
  case "com.amazonaws.iottwinmaker#ValidationException":
1276
- response = {
1277
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1278
- name: errorCode,
1279
- $metadata: deserializeMetadata(output),
1280
- };
1281
- break;
1226
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1282
1227
  default:
1283
1228
  const parsedBody = parsedOutput.body;
1284
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1285
- response = {
1286
- ...parsedBody,
1287
- name: `${errorCode}`,
1288
- message: parsedBody.message || parsedBody.Message || errorCode,
1229
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1230
+ name: parsedBody.code || parsedBody.Code || errorCode,
1289
1231
  $fault: "client",
1290
1232
  $metadata: deserializeMetadata(output),
1291
- };
1233
+ });
1234
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1292
1235
  }
1293
- const message = response.message || response.Message || errorCode;
1294
- response.message = message;
1295
- delete response.Message;
1296
- return Promise.reject(Object.assign(new Error(message), response));
1297
1236
  };
1298
1237
  const deserializeAws_restJson1CreateEntityCommand = async (output, context) => {
1299
1238
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1333,67 +1272,31 @@ const deserializeAws_restJson1CreateEntityCommandError = async (output, context)
1333
1272
  switch (errorCode) {
1334
1273
  case "AccessDeniedException":
1335
1274
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
1336
- response = {
1337
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1338
- name: errorCode,
1339
- $metadata: deserializeMetadata(output),
1340
- };
1341
- break;
1275
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1342
1276
  case "ConflictException":
1343
1277
  case "com.amazonaws.iottwinmaker#ConflictException":
1344
- response = {
1345
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1346
- name: errorCode,
1347
- $metadata: deserializeMetadata(output),
1348
- };
1349
- break;
1278
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1350
1279
  case "InternalServerException":
1351
1280
  case "com.amazonaws.iottwinmaker#InternalServerException":
1352
- response = {
1353
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1354
- name: errorCode,
1355
- $metadata: deserializeMetadata(output),
1356
- };
1357
- break;
1281
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1358
1282
  case "ServiceQuotaExceededException":
1359
1283
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
1360
- response = {
1361
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1362
- name: errorCode,
1363
- $metadata: deserializeMetadata(output),
1364
- };
1365
- break;
1284
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1366
1285
  case "ThrottlingException":
1367
1286
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1368
- response = {
1369
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1370
- name: errorCode,
1371
- $metadata: deserializeMetadata(output),
1372
- };
1373
- break;
1287
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1374
1288
  case "ValidationException":
1375
1289
  case "com.amazonaws.iottwinmaker#ValidationException":
1376
- response = {
1377
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1378
- name: errorCode,
1379
- $metadata: deserializeMetadata(output),
1380
- };
1381
- break;
1290
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1382
1291
  default:
1383
1292
  const parsedBody = parsedOutput.body;
1384
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1385
- response = {
1386
- ...parsedBody,
1387
- name: `${errorCode}`,
1388
- message: parsedBody.message || parsedBody.Message || errorCode,
1293
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1294
+ name: parsedBody.code || parsedBody.Code || errorCode,
1389
1295
  $fault: "client",
1390
1296
  $metadata: deserializeMetadata(output),
1391
- };
1297
+ });
1298
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1392
1299
  }
1393
- const message = response.message || response.Message || errorCode;
1394
- response.message = message;
1395
- delete response.Message;
1396
- return Promise.reject(Object.assign(new Error(message), response));
1397
1300
  };
1398
1301
  const deserializeAws_restJson1CreateSceneCommand = async (output, context) => {
1399
1302
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1425,67 +1328,31 @@ const deserializeAws_restJson1CreateSceneCommandError = async (output, context)
1425
1328
  switch (errorCode) {
1426
1329
  case "AccessDeniedException":
1427
1330
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
1428
- response = {
1429
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1430
- name: errorCode,
1431
- $metadata: deserializeMetadata(output),
1432
- };
1433
- break;
1331
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1434
1332
  case "ConflictException":
1435
1333
  case "com.amazonaws.iottwinmaker#ConflictException":
1436
- response = {
1437
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1438
- name: errorCode,
1439
- $metadata: deserializeMetadata(output),
1440
- };
1441
- break;
1334
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1442
1335
  case "InternalServerException":
1443
1336
  case "com.amazonaws.iottwinmaker#InternalServerException":
1444
- response = {
1445
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1446
- name: errorCode,
1447
- $metadata: deserializeMetadata(output),
1448
- };
1449
- break;
1337
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1450
1338
  case "ServiceQuotaExceededException":
1451
1339
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
1452
- response = {
1453
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1454
- name: errorCode,
1455
- $metadata: deserializeMetadata(output),
1456
- };
1457
- break;
1340
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1458
1341
  case "ThrottlingException":
1459
1342
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1460
- response = {
1461
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1462
- name: errorCode,
1463
- $metadata: deserializeMetadata(output),
1464
- };
1465
- break;
1343
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1466
1344
  case "ValidationException":
1467
1345
  case "com.amazonaws.iottwinmaker#ValidationException":
1468
- response = {
1469
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1470
- name: errorCode,
1471
- $metadata: deserializeMetadata(output),
1472
- };
1473
- break;
1346
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1474
1347
  default:
1475
1348
  const parsedBody = parsedOutput.body;
1476
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1477
- response = {
1478
- ...parsedBody,
1479
- name: `${errorCode}`,
1480
- message: parsedBody.message || parsedBody.Message || errorCode,
1349
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1350
+ name: parsedBody.code || parsedBody.Code || errorCode,
1481
1351
  $fault: "client",
1482
1352
  $metadata: deserializeMetadata(output),
1483
- };
1353
+ });
1354
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1484
1355
  }
1485
- const message = response.message || response.Message || errorCode;
1486
- response.message = message;
1487
- delete response.Message;
1488
- return Promise.reject(Object.assign(new Error(message), response));
1489
1356
  };
1490
1357
  const deserializeAws_restJson1CreateWorkspaceCommand = async (output, context) => {
1491
1358
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1517,67 +1384,31 @@ const deserializeAws_restJson1CreateWorkspaceCommandError = async (output, conte
1517
1384
  switch (errorCode) {
1518
1385
  case "AccessDeniedException":
1519
1386
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
1520
- response = {
1521
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1522
- name: errorCode,
1523
- $metadata: deserializeMetadata(output),
1524
- };
1525
- break;
1387
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1526
1388
  case "ConflictException":
1527
1389
  case "com.amazonaws.iottwinmaker#ConflictException":
1528
- response = {
1529
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1530
- name: errorCode,
1531
- $metadata: deserializeMetadata(output),
1532
- };
1533
- break;
1390
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1534
1391
  case "InternalServerException":
1535
1392
  case "com.amazonaws.iottwinmaker#InternalServerException":
1536
- response = {
1537
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1538
- name: errorCode,
1539
- $metadata: deserializeMetadata(output),
1540
- };
1541
- break;
1393
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1542
1394
  case "ServiceQuotaExceededException":
1543
1395
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
1544
- response = {
1545
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1546
- name: errorCode,
1547
- $metadata: deserializeMetadata(output),
1548
- };
1549
- break;
1396
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1550
1397
  case "ThrottlingException":
1551
1398
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1552
- response = {
1553
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1554
- name: errorCode,
1555
- $metadata: deserializeMetadata(output),
1556
- };
1557
- break;
1399
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1558
1400
  case "ValidationException":
1559
1401
  case "com.amazonaws.iottwinmaker#ValidationException":
1560
- response = {
1561
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1562
- name: errorCode,
1563
- $metadata: deserializeMetadata(output),
1564
- };
1565
- break;
1402
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1566
1403
  default:
1567
1404
  const parsedBody = parsedOutput.body;
1568
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1569
- response = {
1570
- ...parsedBody,
1571
- name: `${errorCode}`,
1572
- message: parsedBody.message || parsedBody.Message || errorCode,
1405
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1406
+ name: parsedBody.code || parsedBody.Code || errorCode,
1573
1407
  $fault: "client",
1574
1408
  $metadata: deserializeMetadata(output),
1575
- };
1409
+ });
1410
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1576
1411
  }
1577
- const message = response.message || response.Message || errorCode;
1578
- response.message = message;
1579
- delete response.Message;
1580
- return Promise.reject(Object.assign(new Error(message), response));
1581
1412
  };
1582
1413
  const deserializeAws_restJson1DeleteComponentTypeCommand = async (output, context) => {
1583
1414
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1605,59 +1436,28 @@ const deserializeAws_restJson1DeleteComponentTypeCommandError = async (output, c
1605
1436
  switch (errorCode) {
1606
1437
  case "AccessDeniedException":
1607
1438
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
1608
- response = {
1609
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1610
- name: errorCode,
1611
- $metadata: deserializeMetadata(output),
1612
- };
1613
- break;
1439
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1614
1440
  case "InternalServerException":
1615
1441
  case "com.amazonaws.iottwinmaker#InternalServerException":
1616
- response = {
1617
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1618
- name: errorCode,
1619
- $metadata: deserializeMetadata(output),
1620
- };
1621
- break;
1442
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1622
1443
  case "ResourceNotFoundException":
1623
1444
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
1624
- response = {
1625
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1626
- name: errorCode,
1627
- $metadata: deserializeMetadata(output),
1628
- };
1629
- break;
1445
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1630
1446
  case "ThrottlingException":
1631
1447
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1632
- response = {
1633
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1634
- name: errorCode,
1635
- $metadata: deserializeMetadata(output),
1636
- };
1637
- break;
1448
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1638
1449
  case "ValidationException":
1639
1450
  case "com.amazonaws.iottwinmaker#ValidationException":
1640
- response = {
1641
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1642
- name: errorCode,
1643
- $metadata: deserializeMetadata(output),
1644
- };
1645
- break;
1451
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1646
1452
  default:
1647
1453
  const parsedBody = parsedOutput.body;
1648
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1649
- response = {
1650
- ...parsedBody,
1651
- name: `${errorCode}`,
1652
- message: parsedBody.message || parsedBody.Message || errorCode,
1454
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1455
+ name: parsedBody.code || parsedBody.Code || errorCode,
1653
1456
  $fault: "client",
1654
1457
  $metadata: deserializeMetadata(output),
1655
- };
1458
+ });
1459
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1656
1460
  }
1657
- const message = response.message || response.Message || errorCode;
1658
- response.message = message;
1659
- delete response.Message;
1660
- return Promise.reject(Object.assign(new Error(message), response));
1661
1461
  };
1662
1462
  const deserializeAws_restJson1DeleteEntityCommand = async (output, context) => {
1663
1463
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1685,59 +1485,28 @@ const deserializeAws_restJson1DeleteEntityCommandError = async (output, context)
1685
1485
  switch (errorCode) {
1686
1486
  case "InternalServerException":
1687
1487
  case "com.amazonaws.iottwinmaker#InternalServerException":
1688
- response = {
1689
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1690
- name: errorCode,
1691
- $metadata: deserializeMetadata(output),
1692
- };
1693
- break;
1488
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1694
1489
  case "ResourceNotFoundException":
1695
1490
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
1696
- response = {
1697
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1698
- name: errorCode,
1699
- $metadata: deserializeMetadata(output),
1700
- };
1701
- break;
1491
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1702
1492
  case "ServiceQuotaExceededException":
1703
1493
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
1704
- response = {
1705
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1706
- name: errorCode,
1707
- $metadata: deserializeMetadata(output),
1708
- };
1709
- break;
1494
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1710
1495
  case "ThrottlingException":
1711
1496
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1712
- response = {
1713
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1714
- name: errorCode,
1715
- $metadata: deserializeMetadata(output),
1716
- };
1717
- break;
1497
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1718
1498
  case "ValidationException":
1719
1499
  case "com.amazonaws.iottwinmaker#ValidationException":
1720
- response = {
1721
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1722
- name: errorCode,
1723
- $metadata: deserializeMetadata(output),
1724
- };
1725
- break;
1500
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1726
1501
  default:
1727
1502
  const parsedBody = parsedOutput.body;
1728
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1729
- response = {
1730
- ...parsedBody,
1731
- name: `${errorCode}`,
1732
- message: parsedBody.message || parsedBody.Message || errorCode,
1503
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1504
+ name: parsedBody.code || parsedBody.Code || errorCode,
1733
1505
  $fault: "client",
1734
1506
  $metadata: deserializeMetadata(output),
1735
- };
1507
+ });
1508
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1736
1509
  }
1737
- const message = response.message || response.Message || errorCode;
1738
- response.message = message;
1739
- delete response.Message;
1740
- return Promise.reject(Object.assign(new Error(message), response));
1741
1510
  };
1742
1511
  const deserializeAws_restJson1DeleteSceneCommand = async (output, context) => {
1743
1512
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1761,59 +1530,28 @@ const deserializeAws_restJson1DeleteSceneCommandError = async (output, context)
1761
1530
  switch (errorCode) {
1762
1531
  case "AccessDeniedException":
1763
1532
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
1764
- response = {
1765
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1766
- name: errorCode,
1767
- $metadata: deserializeMetadata(output),
1768
- };
1769
- break;
1533
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1770
1534
  case "InternalServerException":
1771
1535
  case "com.amazonaws.iottwinmaker#InternalServerException":
1772
- response = {
1773
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1774
- name: errorCode,
1775
- $metadata: deserializeMetadata(output),
1776
- };
1777
- break;
1536
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1778
1537
  case "ResourceNotFoundException":
1779
1538
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
1780
- response = {
1781
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1782
- name: errorCode,
1783
- $metadata: deserializeMetadata(output),
1784
- };
1785
- break;
1539
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1786
1540
  case "ThrottlingException":
1787
1541
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1788
- response = {
1789
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1790
- name: errorCode,
1791
- $metadata: deserializeMetadata(output),
1792
- };
1793
- break;
1542
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1794
1543
  case "ValidationException":
1795
1544
  case "com.amazonaws.iottwinmaker#ValidationException":
1796
- response = {
1797
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1798
- name: errorCode,
1799
- $metadata: deserializeMetadata(output),
1800
- };
1801
- break;
1545
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1802
1546
  default:
1803
1547
  const parsedBody = parsedOutput.body;
1804
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1805
- response = {
1806
- ...parsedBody,
1807
- name: `${errorCode}`,
1808
- message: parsedBody.message || parsedBody.Message || errorCode,
1548
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1549
+ name: parsedBody.code || parsedBody.Code || errorCode,
1809
1550
  $fault: "client",
1810
1551
  $metadata: deserializeMetadata(output),
1811
- };
1552
+ });
1553
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1812
1554
  }
1813
- const message = response.message || response.Message || errorCode;
1814
- response.message = message;
1815
- delete response.Message;
1816
- return Promise.reject(Object.assign(new Error(message), response));
1817
1555
  };
1818
1556
  const deserializeAws_restJson1DeleteWorkspaceCommand = async (output, context) => {
1819
1557
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1837,59 +1575,28 @@ const deserializeAws_restJson1DeleteWorkspaceCommandError = async (output, conte
1837
1575
  switch (errorCode) {
1838
1576
  case "AccessDeniedException":
1839
1577
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
1840
- response = {
1841
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1842
- name: errorCode,
1843
- $metadata: deserializeMetadata(output),
1844
- };
1845
- break;
1578
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1846
1579
  case "InternalServerException":
1847
1580
  case "com.amazonaws.iottwinmaker#InternalServerException":
1848
- response = {
1849
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1850
- name: errorCode,
1851
- $metadata: deserializeMetadata(output),
1852
- };
1853
- break;
1581
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1854
1582
  case "ResourceNotFoundException":
1855
1583
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
1856
- response = {
1857
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1858
- name: errorCode,
1859
- $metadata: deserializeMetadata(output),
1860
- };
1861
- break;
1584
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1862
1585
  case "ThrottlingException":
1863
1586
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1864
- response = {
1865
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1866
- name: errorCode,
1867
- $metadata: deserializeMetadata(output),
1868
- };
1869
- break;
1587
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1870
1588
  case "ValidationException":
1871
1589
  case "com.amazonaws.iottwinmaker#ValidationException":
1872
- response = {
1873
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1874
- name: errorCode,
1875
- $metadata: deserializeMetadata(output),
1876
- };
1877
- break;
1590
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1878
1591
  default:
1879
1592
  const parsedBody = parsedOutput.body;
1880
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1881
- response = {
1882
- ...parsedBody,
1883
- name: `${errorCode}`,
1884
- message: parsedBody.message || parsedBody.Message || errorCode,
1593
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1594
+ name: parsedBody.code || parsedBody.Code || errorCode,
1885
1595
  $fault: "client",
1886
1596
  $metadata: deserializeMetadata(output),
1887
- };
1597
+ });
1598
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1888
1599
  }
1889
- const message = response.message || response.Message || errorCode;
1890
- response.message = message;
1891
- delete response.Message;
1892
- return Promise.reject(Object.assign(new Error(message), response));
1893
1600
  };
1894
1601
  const deserializeAws_restJson1GetComponentTypeCommand = async (output, context) => {
1895
1602
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1965,51 +1672,25 @@ const deserializeAws_restJson1GetComponentTypeCommandError = async (output, cont
1965
1672
  switch (errorCode) {
1966
1673
  case "AccessDeniedException":
1967
1674
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
1968
- response = {
1969
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1970
- name: errorCode,
1971
- $metadata: deserializeMetadata(output),
1972
- };
1973
- break;
1675
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1974
1676
  case "InternalServerException":
1975
1677
  case "com.amazonaws.iottwinmaker#InternalServerException":
1976
- response = {
1977
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1978
- name: errorCode,
1979
- $metadata: deserializeMetadata(output),
1980
- };
1981
- break;
1678
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1982
1679
  case "ResourceNotFoundException":
1983
1680
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
1984
- response = {
1985
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1986
- name: errorCode,
1987
- $metadata: deserializeMetadata(output),
1988
- };
1989
- break;
1681
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1990
1682
  case "ThrottlingException":
1991
1683
  case "com.amazonaws.iottwinmaker#ThrottlingException":
1992
- response = {
1993
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1994
- name: errorCode,
1995
- $metadata: deserializeMetadata(output),
1996
- };
1997
- break;
1684
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1998
1685
  default:
1999
1686
  const parsedBody = parsedOutput.body;
2000
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2001
- response = {
2002
- ...parsedBody,
2003
- name: `${errorCode}`,
2004
- message: parsedBody.message || parsedBody.Message || errorCode,
1687
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1688
+ name: parsedBody.code || parsedBody.Code || errorCode,
2005
1689
  $fault: "client",
2006
1690
  $metadata: deserializeMetadata(output),
2007
- };
1691
+ });
1692
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2008
1693
  }
2009
- const message = response.message || response.Message || errorCode;
2010
- response.message = message;
2011
- delete response.Message;
2012
- return Promise.reject(Object.assign(new Error(message), response));
2013
1694
  };
2014
1695
  const deserializeAws_restJson1GetEntityCommand = async (output, context) => {
2015
1696
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2077,59 +1758,28 @@ const deserializeAws_restJson1GetEntityCommandError = async (output, context) =>
2077
1758
  switch (errorCode) {
2078
1759
  case "InternalServerException":
2079
1760
  case "com.amazonaws.iottwinmaker#InternalServerException":
2080
- response = {
2081
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2082
- name: errorCode,
2083
- $metadata: deserializeMetadata(output),
2084
- };
2085
- break;
1761
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2086
1762
  case "ResourceNotFoundException":
2087
1763
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
2088
- response = {
2089
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2090
- name: errorCode,
2091
- $metadata: deserializeMetadata(output),
2092
- };
2093
- break;
1764
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2094
1765
  case "ServiceQuotaExceededException":
2095
1766
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
2096
- response = {
2097
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
2098
- name: errorCode,
2099
- $metadata: deserializeMetadata(output),
2100
- };
2101
- break;
1767
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
2102
1768
  case "ThrottlingException":
2103
1769
  case "com.amazonaws.iottwinmaker#ThrottlingException":
2104
- response = {
2105
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2106
- name: errorCode,
2107
- $metadata: deserializeMetadata(output),
2108
- };
2109
- break;
1770
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2110
1771
  case "ValidationException":
2111
1772
  case "com.amazonaws.iottwinmaker#ValidationException":
2112
- response = {
2113
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2114
- name: errorCode,
2115
- $metadata: deserializeMetadata(output),
2116
- };
2117
- break;
1773
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2118
1774
  default:
2119
1775
  const parsedBody = parsedOutput.body;
2120
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2121
- response = {
2122
- ...parsedBody,
2123
- name: `${errorCode}`,
2124
- message: parsedBody.message || parsedBody.Message || errorCode,
1776
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1777
+ name: parsedBody.code || parsedBody.Code || errorCode,
2125
1778
  $fault: "client",
2126
1779
  $metadata: deserializeMetadata(output),
2127
- };
1780
+ });
1781
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2128
1782
  }
2129
- const message = response.message || response.Message || errorCode;
2130
- response.message = message;
2131
- delete response.Message;
2132
- return Promise.reject(Object.assign(new Error(message), response));
2133
1783
  };
2134
1784
  const deserializeAws_restJson1GetPropertyValueCommand = async (output, context) => {
2135
1785
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2157,75 +1807,34 @@ const deserializeAws_restJson1GetPropertyValueCommandError = async (output, cont
2157
1807
  switch (errorCode) {
2158
1808
  case "AccessDeniedException":
2159
1809
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
2160
- response = {
2161
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2162
- name: errorCode,
2163
- $metadata: deserializeMetadata(output),
2164
- };
2165
- break;
1810
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2166
1811
  case "ConnectorFailureException":
2167
1812
  case "com.amazonaws.iottwinmaker#ConnectorFailureException":
2168
- response = {
2169
- ...(await deserializeAws_restJson1ConnectorFailureExceptionResponse(parsedOutput, context)),
2170
- name: errorCode,
2171
- $metadata: deserializeMetadata(output),
2172
- };
2173
- break;
1813
+ throw await deserializeAws_restJson1ConnectorFailureExceptionResponse(parsedOutput, context);
2174
1814
  case "ConnectorTimeoutException":
2175
1815
  case "com.amazonaws.iottwinmaker#ConnectorTimeoutException":
2176
- response = {
2177
- ...(await deserializeAws_restJson1ConnectorTimeoutExceptionResponse(parsedOutput, context)),
2178
- name: errorCode,
2179
- $metadata: deserializeMetadata(output),
2180
- };
2181
- break;
1816
+ throw await deserializeAws_restJson1ConnectorTimeoutExceptionResponse(parsedOutput, context);
2182
1817
  case "InternalServerException":
2183
1818
  case "com.amazonaws.iottwinmaker#InternalServerException":
2184
- response = {
2185
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2186
- name: errorCode,
2187
- $metadata: deserializeMetadata(output),
2188
- };
2189
- break;
1819
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2190
1820
  case "ResourceNotFoundException":
2191
1821
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
2192
- response = {
2193
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2194
- name: errorCode,
2195
- $metadata: deserializeMetadata(output),
2196
- };
2197
- break;
1822
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2198
1823
  case "ThrottlingException":
2199
1824
  case "com.amazonaws.iottwinmaker#ThrottlingException":
2200
- response = {
2201
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2202
- name: errorCode,
2203
- $metadata: deserializeMetadata(output),
2204
- };
2205
- break;
1825
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2206
1826
  case "ValidationException":
2207
1827
  case "com.amazonaws.iottwinmaker#ValidationException":
2208
- response = {
2209
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2210
- name: errorCode,
2211
- $metadata: deserializeMetadata(output),
2212
- };
2213
- break;
1828
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2214
1829
  default:
2215
1830
  const parsedBody = parsedOutput.body;
2216
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2217
- response = {
2218
- ...parsedBody,
2219
- name: `${errorCode}`,
2220
- message: parsedBody.message || parsedBody.Message || errorCode,
1831
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1832
+ name: parsedBody.code || parsedBody.Code || errorCode,
2221
1833
  $fault: "client",
2222
1834
  $metadata: deserializeMetadata(output),
2223
- };
1835
+ });
1836
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2224
1837
  }
2225
- const message = response.message || response.Message || errorCode;
2226
- response.message = message;
2227
- delete response.Message;
2228
- return Promise.reject(Object.assign(new Error(message), response));
2229
1838
  };
2230
1839
  const deserializeAws_restJson1GetPropertyValueHistoryCommand = async (output, context) => {
2231
1840
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2257,75 +1866,34 @@ const deserializeAws_restJson1GetPropertyValueHistoryCommandError = async (outpu
2257
1866
  switch (errorCode) {
2258
1867
  case "AccessDeniedException":
2259
1868
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
2260
- response = {
2261
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2262
- name: errorCode,
2263
- $metadata: deserializeMetadata(output),
2264
- };
2265
- break;
1869
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2266
1870
  case "ConnectorFailureException":
2267
1871
  case "com.amazonaws.iottwinmaker#ConnectorFailureException":
2268
- response = {
2269
- ...(await deserializeAws_restJson1ConnectorFailureExceptionResponse(parsedOutput, context)),
2270
- name: errorCode,
2271
- $metadata: deserializeMetadata(output),
2272
- };
2273
- break;
1872
+ throw await deserializeAws_restJson1ConnectorFailureExceptionResponse(parsedOutput, context);
2274
1873
  case "ConnectorTimeoutException":
2275
1874
  case "com.amazonaws.iottwinmaker#ConnectorTimeoutException":
2276
- response = {
2277
- ...(await deserializeAws_restJson1ConnectorTimeoutExceptionResponse(parsedOutput, context)),
2278
- name: errorCode,
2279
- $metadata: deserializeMetadata(output),
2280
- };
2281
- break;
1875
+ throw await deserializeAws_restJson1ConnectorTimeoutExceptionResponse(parsedOutput, context);
2282
1876
  case "InternalServerException":
2283
1877
  case "com.amazonaws.iottwinmaker#InternalServerException":
2284
- response = {
2285
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2286
- name: errorCode,
2287
- $metadata: deserializeMetadata(output),
2288
- };
2289
- break;
1878
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2290
1879
  case "ResourceNotFoundException":
2291
1880
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
2292
- response = {
2293
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2294
- name: errorCode,
2295
- $metadata: deserializeMetadata(output),
2296
- };
2297
- break;
1881
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2298
1882
  case "ThrottlingException":
2299
1883
  case "com.amazonaws.iottwinmaker#ThrottlingException":
2300
- response = {
2301
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2302
- name: errorCode,
2303
- $metadata: deserializeMetadata(output),
2304
- };
2305
- break;
1884
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2306
1885
  case "ValidationException":
2307
1886
  case "com.amazonaws.iottwinmaker#ValidationException":
2308
- response = {
2309
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2310
- name: errorCode,
2311
- $metadata: deserializeMetadata(output),
2312
- };
2313
- break;
1887
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2314
1888
  default:
2315
1889
  const parsedBody = parsedOutput.body;
2316
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2317
- response = {
2318
- ...parsedBody,
2319
- name: `${errorCode}`,
2320
- message: parsedBody.message || parsedBody.Message || errorCode,
1890
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1891
+ name: parsedBody.code || parsedBody.Code || errorCode,
2321
1892
  $fault: "client",
2322
1893
  $metadata: deserializeMetadata(output),
2323
- };
1894
+ });
1895
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2324
1896
  }
2325
- const message = response.message || response.Message || errorCode;
2326
- response.message = message;
2327
- delete response.Message;
2328
- return Promise.reject(Object.assign(new Error(message), response));
2329
1897
  };
2330
1898
  const deserializeAws_restJson1GetSceneCommand = async (output, context) => {
2331
1899
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2381,59 +1949,28 @@ const deserializeAws_restJson1GetSceneCommandError = async (output, context) =>
2381
1949
  switch (errorCode) {
2382
1950
  case "AccessDeniedException":
2383
1951
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
2384
- response = {
2385
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2386
- name: errorCode,
2387
- $metadata: deserializeMetadata(output),
2388
- };
2389
- break;
1952
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2390
1953
  case "InternalServerException":
2391
1954
  case "com.amazonaws.iottwinmaker#InternalServerException":
2392
- response = {
2393
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2394
- name: errorCode,
2395
- $metadata: deserializeMetadata(output),
2396
- };
2397
- break;
1955
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2398
1956
  case "ResourceNotFoundException":
2399
1957
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
2400
- response = {
2401
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2402
- name: errorCode,
2403
- $metadata: deserializeMetadata(output),
2404
- };
2405
- break;
1958
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2406
1959
  case "ThrottlingException":
2407
1960
  case "com.amazonaws.iottwinmaker#ThrottlingException":
2408
- response = {
2409
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2410
- name: errorCode,
2411
- $metadata: deserializeMetadata(output),
2412
- };
2413
- break;
1961
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2414
1962
  case "ValidationException":
2415
1963
  case "com.amazonaws.iottwinmaker#ValidationException":
2416
- response = {
2417
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2418
- name: errorCode,
2419
- $metadata: deserializeMetadata(output),
2420
- };
2421
- break;
1964
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2422
1965
  default:
2423
1966
  const parsedBody = parsedOutput.body;
2424
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2425
- response = {
2426
- ...parsedBody,
2427
- name: `${errorCode}`,
2428
- message: parsedBody.message || parsedBody.Message || errorCode,
1967
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
1968
+ name: parsedBody.code || parsedBody.Code || errorCode,
2429
1969
  $fault: "client",
2430
1970
  $metadata: deserializeMetadata(output),
2431
- };
1971
+ });
1972
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2432
1973
  }
2433
- const message = response.message || response.Message || errorCode;
2434
- response.message = message;
2435
- delete response.Message;
2436
- return Promise.reject(Object.assign(new Error(message), response));
2437
1974
  };
2438
1975
  const deserializeAws_restJson1GetWorkspaceCommand = async (output, context) => {
2439
1976
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2485,59 +2022,28 @@ const deserializeAws_restJson1GetWorkspaceCommandError = async (output, context)
2485
2022
  switch (errorCode) {
2486
2023
  case "InternalServerException":
2487
2024
  case "com.amazonaws.iottwinmaker#InternalServerException":
2488
- response = {
2489
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2490
- name: errorCode,
2491
- $metadata: deserializeMetadata(output),
2492
- };
2493
- break;
2025
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2494
2026
  case "ResourceNotFoundException":
2495
2027
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
2496
- response = {
2497
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2498
- name: errorCode,
2499
- $metadata: deserializeMetadata(output),
2500
- };
2501
- break;
2028
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2502
2029
  case "ServiceQuotaExceededException":
2503
2030
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
2504
- response = {
2505
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
2506
- name: errorCode,
2507
- $metadata: deserializeMetadata(output),
2508
- };
2509
- break;
2031
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
2510
2032
  case "ThrottlingException":
2511
2033
  case "com.amazonaws.iottwinmaker#ThrottlingException":
2512
- response = {
2513
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2514
- name: errorCode,
2515
- $metadata: deserializeMetadata(output),
2516
- };
2517
- break;
2034
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2518
2035
  case "ValidationException":
2519
2036
  case "com.amazonaws.iottwinmaker#ValidationException":
2520
- response = {
2521
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2522
- name: errorCode,
2523
- $metadata: deserializeMetadata(output),
2524
- };
2525
- break;
2037
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2526
2038
  default:
2527
2039
  const parsedBody = parsedOutput.body;
2528
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2529
- response = {
2530
- ...parsedBody,
2531
- name: `${errorCode}`,
2532
- message: parsedBody.message || parsedBody.Message || errorCode,
2040
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2041
+ name: parsedBody.code || parsedBody.Code || errorCode,
2533
2042
  $fault: "client",
2534
2043
  $metadata: deserializeMetadata(output),
2535
- };
2044
+ });
2045
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2536
2046
  }
2537
- const message = response.message || response.Message || errorCode;
2538
- response.message = message;
2539
- delete response.Message;
2540
- return Promise.reject(Object.assign(new Error(message), response));
2541
2047
  };
2542
2048
  const deserializeAws_restJson1ListComponentTypesCommand = async (output, context) => {
2543
2049
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2577,51 +2083,25 @@ const deserializeAws_restJson1ListComponentTypesCommandError = async (output, co
2577
2083
  switch (errorCode) {
2578
2084
  case "AccessDeniedException":
2579
2085
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
2580
- response = {
2581
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2582
- name: errorCode,
2583
- $metadata: deserializeMetadata(output),
2584
- };
2585
- break;
2086
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2586
2087
  case "InternalServerException":
2587
2088
  case "com.amazonaws.iottwinmaker#InternalServerException":
2588
- response = {
2589
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2590
- name: errorCode,
2591
- $metadata: deserializeMetadata(output),
2592
- };
2593
- break;
2089
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2594
2090
  case "ThrottlingException":
2595
2091
  case "com.amazonaws.iottwinmaker#ThrottlingException":
2596
- response = {
2597
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2598
- name: errorCode,
2599
- $metadata: deserializeMetadata(output),
2600
- };
2601
- break;
2092
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2602
2093
  case "ValidationException":
2603
2094
  case "com.amazonaws.iottwinmaker#ValidationException":
2604
- response = {
2605
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2606
- name: errorCode,
2607
- $metadata: deserializeMetadata(output),
2608
- };
2609
- break;
2095
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2610
2096
  default:
2611
2097
  const parsedBody = parsedOutput.body;
2612
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2613
- response = {
2614
- ...parsedBody,
2615
- name: `${errorCode}`,
2616
- message: parsedBody.message || parsedBody.Message || errorCode,
2098
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2099
+ name: parsedBody.code || parsedBody.Code || errorCode,
2617
2100
  $fault: "client",
2618
2101
  $metadata: deserializeMetadata(output),
2619
- };
2102
+ });
2103
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2620
2104
  }
2621
- const message = response.message || response.Message || errorCode;
2622
- response.message = message;
2623
- delete response.Message;
2624
- return Promise.reject(Object.assign(new Error(message), response));
2625
2105
  };
2626
2106
  const deserializeAws_restJson1ListEntitiesCommand = async (output, context) => {
2627
2107
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2653,51 +2133,25 @@ const deserializeAws_restJson1ListEntitiesCommandError = async (output, context)
2653
2133
  switch (errorCode) {
2654
2134
  case "InternalServerException":
2655
2135
  case "com.amazonaws.iottwinmaker#InternalServerException":
2656
- response = {
2657
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2658
- name: errorCode,
2659
- $metadata: deserializeMetadata(output),
2660
- };
2661
- break;
2136
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2662
2137
  case "ServiceQuotaExceededException":
2663
2138
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
2664
- response = {
2665
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
2666
- name: errorCode,
2667
- $metadata: deserializeMetadata(output),
2668
- };
2669
- break;
2139
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
2670
2140
  case "ThrottlingException":
2671
2141
  case "com.amazonaws.iottwinmaker#ThrottlingException":
2672
- response = {
2673
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2674
- name: errorCode,
2675
- $metadata: deserializeMetadata(output),
2676
- };
2677
- break;
2142
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2678
2143
  case "ValidationException":
2679
2144
  case "com.amazonaws.iottwinmaker#ValidationException":
2680
- response = {
2681
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2682
- name: errorCode,
2683
- $metadata: deserializeMetadata(output),
2684
- };
2685
- break;
2145
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2686
2146
  default:
2687
2147
  const parsedBody = parsedOutput.body;
2688
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2689
- response = {
2690
- ...parsedBody,
2691
- name: `${errorCode}`,
2692
- message: parsedBody.message || parsedBody.Message || errorCode,
2148
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2149
+ name: parsedBody.code || parsedBody.Code || errorCode,
2693
2150
  $fault: "client",
2694
2151
  $metadata: deserializeMetadata(output),
2695
- };
2152
+ });
2153
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2696
2154
  }
2697
- const message = response.message || response.Message || errorCode;
2698
- response.message = message;
2699
- delete response.Message;
2700
- return Promise.reject(Object.assign(new Error(message), response));
2701
2155
  };
2702
2156
  const deserializeAws_restJson1ListScenesCommand = async (output, context) => {
2703
2157
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2729,51 +2183,25 @@ const deserializeAws_restJson1ListScenesCommandError = async (output, context) =
2729
2183
  switch (errorCode) {
2730
2184
  case "AccessDeniedException":
2731
2185
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
2732
- response = {
2733
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2734
- name: errorCode,
2735
- $metadata: deserializeMetadata(output),
2736
- };
2737
- break;
2186
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2738
2187
  case "InternalServerException":
2739
2188
  case "com.amazonaws.iottwinmaker#InternalServerException":
2740
- response = {
2741
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2742
- name: errorCode,
2743
- $metadata: deserializeMetadata(output),
2744
- };
2745
- break;
2189
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2746
2190
  case "ThrottlingException":
2747
2191
  case "com.amazonaws.iottwinmaker#ThrottlingException":
2748
- response = {
2749
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2750
- name: errorCode,
2751
- $metadata: deserializeMetadata(output),
2752
- };
2753
- break;
2192
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2754
2193
  case "ValidationException":
2755
2194
  case "com.amazonaws.iottwinmaker#ValidationException":
2756
- response = {
2757
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2758
- name: errorCode,
2759
- $metadata: deserializeMetadata(output),
2760
- };
2761
- break;
2195
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2762
2196
  default:
2763
2197
  const parsedBody = parsedOutput.body;
2764
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2765
- response = {
2766
- ...parsedBody,
2767
- name: `${errorCode}`,
2768
- message: parsedBody.message || parsedBody.Message || errorCode,
2198
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2199
+ name: parsedBody.code || parsedBody.Code || errorCode,
2769
2200
  $fault: "client",
2770
2201
  $metadata: deserializeMetadata(output),
2771
- };
2202
+ });
2203
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2772
2204
  }
2773
- const message = response.message || response.Message || errorCode;
2774
- response.message = message;
2775
- delete response.Message;
2776
- return Promise.reject(Object.assign(new Error(message), response));
2777
2205
  };
2778
2206
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2779
2207
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2805,35 +2233,19 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2805
2233
  switch (errorCode) {
2806
2234
  case "AccessDeniedException":
2807
2235
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
2808
- response = {
2809
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2810
- name: errorCode,
2811
- $metadata: deserializeMetadata(output),
2812
- };
2813
- break;
2236
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2814
2237
  case "ResourceNotFoundException":
2815
2238
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
2816
- response = {
2817
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2818
- name: errorCode,
2819
- $metadata: deserializeMetadata(output),
2820
- };
2821
- break;
2239
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2822
2240
  default:
2823
2241
  const parsedBody = parsedOutput.body;
2824
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2825
- response = {
2826
- ...parsedBody,
2827
- name: `${errorCode}`,
2828
- message: parsedBody.message || parsedBody.Message || errorCode,
2242
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2243
+ name: parsedBody.code || parsedBody.Code || errorCode,
2829
2244
  $fault: "client",
2830
2245
  $metadata: deserializeMetadata(output),
2831
- };
2246
+ });
2247
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2832
2248
  }
2833
- const message = response.message || response.Message || errorCode;
2834
- response.message = message;
2835
- delete response.Message;
2836
- return Promise.reject(Object.assign(new Error(message), response));
2837
2249
  };
2838
2250
  const deserializeAws_restJson1ListWorkspacesCommand = async (output, context) => {
2839
2251
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2865,51 +2277,25 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async (output, contex
2865
2277
  switch (errorCode) {
2866
2278
  case "InternalServerException":
2867
2279
  case "com.amazonaws.iottwinmaker#InternalServerException":
2868
- response = {
2869
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2870
- name: errorCode,
2871
- $metadata: deserializeMetadata(output),
2872
- };
2873
- break;
2280
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2874
2281
  case "ServiceQuotaExceededException":
2875
2282
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
2876
- response = {
2877
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
2878
- name: errorCode,
2879
- $metadata: deserializeMetadata(output),
2880
- };
2881
- break;
2283
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
2882
2284
  case "ThrottlingException":
2883
2285
  case "com.amazonaws.iottwinmaker#ThrottlingException":
2884
- response = {
2885
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2886
- name: errorCode,
2887
- $metadata: deserializeMetadata(output),
2888
- };
2889
- break;
2286
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2890
2287
  case "ValidationException":
2891
2288
  case "com.amazonaws.iottwinmaker#ValidationException":
2892
- response = {
2893
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2894
- name: errorCode,
2895
- $metadata: deserializeMetadata(output),
2896
- };
2897
- break;
2289
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2898
2290
  default:
2899
2291
  const parsedBody = parsedOutput.body;
2900
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2901
- response = {
2902
- ...parsedBody,
2903
- name: `${errorCode}`,
2904
- message: parsedBody.message || parsedBody.Message || errorCode,
2292
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2293
+ name: parsedBody.code || parsedBody.Code || errorCode,
2905
2294
  $fault: "client",
2906
2295
  $metadata: deserializeMetadata(output),
2907
- };
2296
+ });
2297
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2908
2298
  }
2909
- const message = response.message || response.Message || errorCode;
2910
- response.message = message;
2911
- delete response.Message;
2912
- return Promise.reject(Object.assign(new Error(message), response));
2913
2299
  };
2914
2300
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
2915
2301
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2933,43 +2319,22 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2933
2319
  switch (errorCode) {
2934
2320
  case "AccessDeniedException":
2935
2321
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
2936
- response = {
2937
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2938
- name: errorCode,
2939
- $metadata: deserializeMetadata(output),
2940
- };
2941
- break;
2322
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2942
2323
  case "ResourceNotFoundException":
2943
2324
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
2944
- response = {
2945
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2946
- name: errorCode,
2947
- $metadata: deserializeMetadata(output),
2948
- };
2949
- break;
2325
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2950
2326
  case "TooManyTagsException":
2951
2327
  case "com.amazonaws.iottwinmaker#TooManyTagsException":
2952
- response = {
2953
- ...(await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context)),
2954
- name: errorCode,
2955
- $metadata: deserializeMetadata(output),
2956
- };
2957
- break;
2328
+ throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
2958
2329
  default:
2959
2330
  const parsedBody = parsedOutput.body;
2960
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2961
- response = {
2962
- ...parsedBody,
2963
- name: `${errorCode}`,
2964
- message: parsedBody.message || parsedBody.Message || errorCode,
2331
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2332
+ name: parsedBody.code || parsedBody.Code || errorCode,
2965
2333
  $fault: "client",
2966
2334
  $metadata: deserializeMetadata(output),
2967
- };
2335
+ });
2336
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2968
2337
  }
2969
- const message = response.message || response.Message || errorCode;
2970
- response.message = message;
2971
- delete response.Message;
2972
- return Promise.reject(Object.assign(new Error(message), response));
2973
2338
  };
2974
2339
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
2975
2340
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2993,35 +2358,19 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2993
2358
  switch (errorCode) {
2994
2359
  case "AccessDeniedException":
2995
2360
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
2996
- response = {
2997
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2998
- name: errorCode,
2999
- $metadata: deserializeMetadata(output),
3000
- };
3001
- break;
2361
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3002
2362
  case "ResourceNotFoundException":
3003
2363
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
3004
- response = {
3005
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3006
- name: errorCode,
3007
- $metadata: deserializeMetadata(output),
3008
- };
3009
- break;
2364
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3010
2365
  default:
3011
2366
  const parsedBody = parsedOutput.body;
3012
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3013
- response = {
3014
- ...parsedBody,
3015
- name: `${errorCode}`,
3016
- message: parsedBody.message || parsedBody.Message || errorCode,
2367
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2368
+ name: parsedBody.code || parsedBody.Code || errorCode,
3017
2369
  $fault: "client",
3018
2370
  $metadata: deserializeMetadata(output),
3019
- };
2371
+ });
2372
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3020
2373
  }
3021
- const message = response.message || response.Message || errorCode;
3022
- response.message = message;
3023
- delete response.Message;
3024
- return Promise.reject(Object.assign(new Error(message), response));
3025
2374
  };
3026
2375
  const deserializeAws_restJson1UpdateComponentTypeCommand = async (output, context) => {
3027
2376
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3061,67 +2410,31 @@ const deserializeAws_restJson1UpdateComponentTypeCommandError = async (output, c
3061
2410
  switch (errorCode) {
3062
2411
  case "AccessDeniedException":
3063
2412
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
3064
- response = {
3065
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3066
- name: errorCode,
3067
- $metadata: deserializeMetadata(output),
3068
- };
3069
- break;
2413
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3070
2414
  case "InternalServerException":
3071
2415
  case "com.amazonaws.iottwinmaker#InternalServerException":
3072
- response = {
3073
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3074
- name: errorCode,
3075
- $metadata: deserializeMetadata(output),
3076
- };
3077
- break;
2416
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3078
2417
  case "ResourceNotFoundException":
3079
2418
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
3080
- response = {
3081
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3082
- name: errorCode,
3083
- $metadata: deserializeMetadata(output),
3084
- };
3085
- break;
2419
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3086
2420
  case "ServiceQuotaExceededException":
3087
2421
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
3088
- response = {
3089
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
3090
- name: errorCode,
3091
- $metadata: deserializeMetadata(output),
3092
- };
3093
- break;
2422
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
3094
2423
  case "ThrottlingException":
3095
2424
  case "com.amazonaws.iottwinmaker#ThrottlingException":
3096
- response = {
3097
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3098
- name: errorCode,
3099
- $metadata: deserializeMetadata(output),
3100
- };
3101
- break;
2425
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3102
2426
  case "ValidationException":
3103
2427
  case "com.amazonaws.iottwinmaker#ValidationException":
3104
- response = {
3105
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3106
- name: errorCode,
3107
- $metadata: deserializeMetadata(output),
3108
- };
3109
- break;
2428
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3110
2429
  default:
3111
2430
  const parsedBody = parsedOutput.body;
3112
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3113
- response = {
3114
- ...parsedBody,
3115
- name: `${errorCode}`,
3116
- message: parsedBody.message || parsedBody.Message || errorCode,
2431
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2432
+ name: parsedBody.code || parsedBody.Code || errorCode,
3117
2433
  $fault: "client",
3118
2434
  $metadata: deserializeMetadata(output),
3119
- };
2435
+ });
2436
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3120
2437
  }
3121
- const message = response.message || response.Message || errorCode;
3122
- response.message = message;
3123
- delete response.Message;
3124
- return Promise.reject(Object.assign(new Error(message), response));
3125
2438
  };
3126
2439
  const deserializeAws_restJson1UpdateEntityCommand = async (output, context) => {
3127
2440
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3153,75 +2466,34 @@ const deserializeAws_restJson1UpdateEntityCommandError = async (output, context)
3153
2466
  switch (errorCode) {
3154
2467
  case "AccessDeniedException":
3155
2468
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
3156
- response = {
3157
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3158
- name: errorCode,
3159
- $metadata: deserializeMetadata(output),
3160
- };
3161
- break;
2469
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3162
2470
  case "ConflictException":
3163
2471
  case "com.amazonaws.iottwinmaker#ConflictException":
3164
- response = {
3165
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
3166
- name: errorCode,
3167
- $metadata: deserializeMetadata(output),
3168
- };
3169
- break;
2472
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3170
2473
  case "InternalServerException":
3171
2474
  case "com.amazonaws.iottwinmaker#InternalServerException":
3172
- response = {
3173
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3174
- name: errorCode,
3175
- $metadata: deserializeMetadata(output),
3176
- };
3177
- break;
2475
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3178
2476
  case "ResourceNotFoundException":
3179
2477
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
3180
- response = {
3181
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3182
- name: errorCode,
3183
- $metadata: deserializeMetadata(output),
3184
- };
3185
- break;
2478
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3186
2479
  case "ServiceQuotaExceededException":
3187
2480
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
3188
- response = {
3189
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
3190
- name: errorCode,
3191
- $metadata: deserializeMetadata(output),
3192
- };
3193
- break;
2481
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
3194
2482
  case "ThrottlingException":
3195
2483
  case "com.amazonaws.iottwinmaker#ThrottlingException":
3196
- response = {
3197
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3198
- name: errorCode,
3199
- $metadata: deserializeMetadata(output),
3200
- };
3201
- break;
2484
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3202
2485
  case "ValidationException":
3203
2486
  case "com.amazonaws.iottwinmaker#ValidationException":
3204
- response = {
3205
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3206
- name: errorCode,
3207
- $metadata: deserializeMetadata(output),
3208
- };
3209
- break;
2487
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3210
2488
  default:
3211
2489
  const parsedBody = parsedOutput.body;
3212
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3213
- response = {
3214
- ...parsedBody,
3215
- name: `${errorCode}`,
3216
- message: parsedBody.message || parsedBody.Message || errorCode,
2490
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2491
+ name: parsedBody.code || parsedBody.Code || errorCode,
3217
2492
  $fault: "client",
3218
2493
  $metadata: deserializeMetadata(output),
3219
- };
2494
+ });
2495
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3220
2496
  }
3221
- const message = response.message || response.Message || errorCode;
3222
- response.message = message;
3223
- delete response.Message;
3224
- return Promise.reject(Object.assign(new Error(message), response));
3225
2497
  };
3226
2498
  const deserializeAws_restJson1UpdateSceneCommand = async (output, context) => {
3227
2499
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3249,59 +2521,28 @@ const deserializeAws_restJson1UpdateSceneCommandError = async (output, context)
3249
2521
  switch (errorCode) {
3250
2522
  case "AccessDeniedException":
3251
2523
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
3252
- response = {
3253
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3254
- name: errorCode,
3255
- $metadata: deserializeMetadata(output),
3256
- };
3257
- break;
2524
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3258
2525
  case "InternalServerException":
3259
2526
  case "com.amazonaws.iottwinmaker#InternalServerException":
3260
- response = {
3261
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3262
- name: errorCode,
3263
- $metadata: deserializeMetadata(output),
3264
- };
3265
- break;
2527
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3266
2528
  case "ResourceNotFoundException":
3267
2529
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
3268
- response = {
3269
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3270
- name: errorCode,
3271
- $metadata: deserializeMetadata(output),
3272
- };
3273
- break;
2530
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3274
2531
  case "ThrottlingException":
3275
2532
  case "com.amazonaws.iottwinmaker#ThrottlingException":
3276
- response = {
3277
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3278
- name: errorCode,
3279
- $metadata: deserializeMetadata(output),
3280
- };
3281
- break;
2533
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3282
2534
  case "ValidationException":
3283
2535
  case "com.amazonaws.iottwinmaker#ValidationException":
3284
- response = {
3285
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3286
- name: errorCode,
3287
- $metadata: deserializeMetadata(output),
3288
- };
3289
- break;
2536
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3290
2537
  default:
3291
2538
  const parsedBody = parsedOutput.body;
3292
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3293
- response = {
3294
- ...parsedBody,
3295
- name: `${errorCode}`,
3296
- message: parsedBody.message || parsedBody.Message || errorCode,
2539
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2540
+ name: parsedBody.code || parsedBody.Code || errorCode,
3297
2541
  $fault: "client",
3298
2542
  $metadata: deserializeMetadata(output),
3299
- };
2543
+ });
2544
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3300
2545
  }
3301
- const message = response.message || response.Message || errorCode;
3302
- response.message = message;
3303
- delete response.Message;
3304
- return Promise.reject(Object.assign(new Error(message), response));
3305
2546
  };
3306
2547
  const deserializeAws_restJson1UpdateWorkspaceCommand = async (output, context) => {
3307
2548
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3329,197 +2570,151 @@ const deserializeAws_restJson1UpdateWorkspaceCommandError = async (output, conte
3329
2570
  switch (errorCode) {
3330
2571
  case "AccessDeniedException":
3331
2572
  case "com.amazonaws.iottwinmaker#AccessDeniedException":
3332
- response = {
3333
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3334
- name: errorCode,
3335
- $metadata: deserializeMetadata(output),
3336
- };
3337
- break;
2573
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3338
2574
  case "InternalServerException":
3339
2575
  case "com.amazonaws.iottwinmaker#InternalServerException":
3340
- response = {
3341
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3342
- name: errorCode,
3343
- $metadata: deserializeMetadata(output),
3344
- };
3345
- break;
2576
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3346
2577
  case "ResourceNotFoundException":
3347
2578
  case "com.amazonaws.iottwinmaker#ResourceNotFoundException":
3348
- response = {
3349
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3350
- name: errorCode,
3351
- $metadata: deserializeMetadata(output),
3352
- };
3353
- break;
2579
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3354
2580
  case "ServiceQuotaExceededException":
3355
2581
  case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException":
3356
- response = {
3357
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
3358
- name: errorCode,
3359
- $metadata: deserializeMetadata(output),
3360
- };
3361
- break;
2582
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
3362
2583
  case "ThrottlingException":
3363
2584
  case "com.amazonaws.iottwinmaker#ThrottlingException":
3364
- response = {
3365
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
3366
- name: errorCode,
3367
- $metadata: deserializeMetadata(output),
3368
- };
3369
- break;
2585
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3370
2586
  case "ValidationException":
3371
2587
  case "com.amazonaws.iottwinmaker#ValidationException":
3372
- response = {
3373
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3374
- name: errorCode,
3375
- $metadata: deserializeMetadata(output),
3376
- };
3377
- break;
2588
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3378
2589
  default:
3379
2590
  const parsedBody = parsedOutput.body;
3380
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3381
- response = {
3382
- ...parsedBody,
3383
- name: `${errorCode}`,
3384
- message: parsedBody.message || parsedBody.Message || errorCode,
2591
+ response = new IoTTwinMakerServiceException_1.IoTTwinMakerServiceException({
2592
+ name: parsedBody.code || parsedBody.Code || errorCode,
3385
2593
  $fault: "client",
3386
2594
  $metadata: deserializeMetadata(output),
3387
- };
2595
+ });
2596
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3388
2597
  }
3389
- const message = response.message || response.Message || errorCode;
3390
- response.message = message;
3391
- delete response.Message;
3392
- return Promise.reject(Object.assign(new Error(message), response));
3393
2598
  };
3394
2599
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
3395
- const contents = {
3396
- name: "AccessDeniedException",
3397
- $fault: "client",
3398
- $metadata: deserializeMetadata(parsedOutput),
3399
- message: undefined,
3400
- };
2600
+ const contents = {};
3401
2601
  const data = parsedOutput.body;
3402
2602
  if (data.message !== undefined && data.message !== null) {
3403
2603
  contents.message = smithy_client_1.expectString(data.message);
3404
2604
  }
3405
- return contents;
2605
+ const exception = new models_0_1.AccessDeniedException({
2606
+ $metadata: deserializeMetadata(parsedOutput),
2607
+ ...contents,
2608
+ });
2609
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3406
2610
  };
3407
2611
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
3408
- const contents = {
3409
- name: "ConflictException",
3410
- $fault: "client",
3411
- $metadata: deserializeMetadata(parsedOutput),
3412
- message: undefined,
3413
- };
2612
+ const contents = {};
3414
2613
  const data = parsedOutput.body;
3415
2614
  if (data.message !== undefined && data.message !== null) {
3416
2615
  contents.message = smithy_client_1.expectString(data.message);
3417
2616
  }
3418
- return contents;
2617
+ const exception = new models_0_1.ConflictException({
2618
+ $metadata: deserializeMetadata(parsedOutput),
2619
+ ...contents,
2620
+ });
2621
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3419
2622
  };
3420
2623
  const deserializeAws_restJson1ConnectorFailureExceptionResponse = async (parsedOutput, context) => {
3421
- const contents = {
3422
- name: "ConnectorFailureException",
3423
- $fault: "client",
3424
- $metadata: deserializeMetadata(parsedOutput),
3425
- message: undefined,
3426
- };
2624
+ const contents = {};
3427
2625
  const data = parsedOutput.body;
3428
2626
  if (data.message !== undefined && data.message !== null) {
3429
2627
  contents.message = smithy_client_1.expectString(data.message);
3430
2628
  }
3431
- return contents;
2629
+ const exception = new models_0_1.ConnectorFailureException({
2630
+ $metadata: deserializeMetadata(parsedOutput),
2631
+ ...contents,
2632
+ });
2633
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3432
2634
  };
3433
2635
  const deserializeAws_restJson1ConnectorTimeoutExceptionResponse = async (parsedOutput, context) => {
3434
- const contents = {
3435
- name: "ConnectorTimeoutException",
3436
- $fault: "client",
3437
- $metadata: deserializeMetadata(parsedOutput),
3438
- message: undefined,
3439
- };
2636
+ const contents = {};
3440
2637
  const data = parsedOutput.body;
3441
2638
  if (data.message !== undefined && data.message !== null) {
3442
2639
  contents.message = smithy_client_1.expectString(data.message);
3443
2640
  }
3444
- return contents;
2641
+ const exception = new models_0_1.ConnectorTimeoutException({
2642
+ $metadata: deserializeMetadata(parsedOutput),
2643
+ ...contents,
2644
+ });
2645
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3445
2646
  };
3446
2647
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
3447
- const contents = {
3448
- name: "InternalServerException",
3449
- $fault: "server",
3450
- $metadata: deserializeMetadata(parsedOutput),
3451
- message: undefined,
3452
- };
2648
+ const contents = {};
3453
2649
  const data = parsedOutput.body;
3454
2650
  if (data.message !== undefined && data.message !== null) {
3455
2651
  contents.message = smithy_client_1.expectString(data.message);
3456
2652
  }
3457
- return contents;
2653
+ const exception = new models_0_1.InternalServerException({
2654
+ $metadata: deserializeMetadata(parsedOutput),
2655
+ ...contents,
2656
+ });
2657
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3458
2658
  };
3459
2659
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
3460
- const contents = {
3461
- name: "ResourceNotFoundException",
3462
- $fault: "client",
3463
- $metadata: deserializeMetadata(parsedOutput),
3464
- message: undefined,
3465
- };
2660
+ const contents = {};
3466
2661
  const data = parsedOutput.body;
3467
2662
  if (data.message !== undefined && data.message !== null) {
3468
2663
  contents.message = smithy_client_1.expectString(data.message);
3469
2664
  }
3470
- return contents;
2665
+ const exception = new models_0_1.ResourceNotFoundException({
2666
+ $metadata: deserializeMetadata(parsedOutput),
2667
+ ...contents,
2668
+ });
2669
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3471
2670
  };
3472
2671
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
3473
- const contents = {
3474
- name: "ServiceQuotaExceededException",
3475
- $fault: "client",
3476
- $metadata: deserializeMetadata(parsedOutput),
3477
- message: undefined,
3478
- };
2672
+ const contents = {};
3479
2673
  const data = parsedOutput.body;
3480
2674
  if (data.message !== undefined && data.message !== null) {
3481
2675
  contents.message = smithy_client_1.expectString(data.message);
3482
2676
  }
3483
- return contents;
2677
+ const exception = new models_0_1.ServiceQuotaExceededException({
2678
+ $metadata: deserializeMetadata(parsedOutput),
2679
+ ...contents,
2680
+ });
2681
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3484
2682
  };
3485
2683
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
3486
- const contents = {
3487
- name: "ThrottlingException",
3488
- $fault: "client",
3489
- $metadata: deserializeMetadata(parsedOutput),
3490
- message: undefined,
3491
- };
2684
+ const contents = {};
3492
2685
  const data = parsedOutput.body;
3493
2686
  if (data.message !== undefined && data.message !== null) {
3494
2687
  contents.message = smithy_client_1.expectString(data.message);
3495
2688
  }
3496
- return contents;
2689
+ const exception = new models_0_1.ThrottlingException({
2690
+ $metadata: deserializeMetadata(parsedOutput),
2691
+ ...contents,
2692
+ });
2693
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3497
2694
  };
3498
2695
  const deserializeAws_restJson1TooManyTagsExceptionResponse = async (parsedOutput, context) => {
3499
- const contents = {
3500
- name: "TooManyTagsException",
3501
- $fault: "client",
3502
- $metadata: deserializeMetadata(parsedOutput),
3503
- message: undefined,
3504
- };
2696
+ const contents = {};
3505
2697
  const data = parsedOutput.body;
3506
2698
  if (data.message !== undefined && data.message !== null) {
3507
2699
  contents.message = smithy_client_1.expectString(data.message);
3508
2700
  }
3509
- return contents;
2701
+ const exception = new models_0_1.TooManyTagsException({
2702
+ $metadata: deserializeMetadata(parsedOutput),
2703
+ ...contents,
2704
+ });
2705
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3510
2706
  };
3511
2707
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
3512
- const contents = {
3513
- name: "ValidationException",
3514
- $fault: "client",
3515
- $metadata: deserializeMetadata(parsedOutput),
3516
- message: undefined,
3517
- };
2708
+ const contents = {};
3518
2709
  const data = parsedOutput.body;
3519
2710
  if (data.message !== undefined && data.message !== null) {
3520
2711
  contents.message = smithy_client_1.expectString(data.message);
3521
2712
  }
3522
- return contents;
2713
+ const exception = new models_0_1.ValidationException({
2714
+ $metadata: deserializeMetadata(parsedOutput),
2715
+ ...contents,
2716
+ });
2717
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
3523
2718
  };
3524
2719
  const serializeAws_restJson1ComponentRequest = (input, context) => {
3525
2720
  return {
@@ -3955,7 +3150,7 @@ const deserializeAws_restJson1ComponentsMap = (output, context) => {
3955
3150
  }, {});
3956
3151
  };
3957
3152
  const deserializeAws_restJson1ComponentTypeSummaries = (output, context) => {
3958
- return (output || [])
3153
+ const retVal = (output || [])
3959
3154
  .filter((e) => e != null)
3960
3155
  .map((entry) => {
3961
3156
  if (entry === null) {
@@ -3963,6 +3158,7 @@ const deserializeAws_restJson1ComponentTypeSummaries = (output, context) => {
3963
3158
  }
3964
3159
  return deserializeAws_restJson1ComponentTypeSummary(entry, context);
3965
3160
  });
3161
+ return retVal;
3966
3162
  };
3967
3163
  const deserializeAws_restJson1ComponentTypeSummary = (output, context) => {
3968
3164
  return {
@@ -4034,7 +3230,7 @@ const deserializeAws_restJson1DataValue = (output, context) => {
4034
3230
  };
4035
3231
  };
4036
3232
  const deserializeAws_restJson1DataValueList = (output, context) => {
4037
- return (output || [])
3233
+ const retVal = (output || [])
4038
3234
  .filter((e) => e != null)
4039
3235
  .map((entry) => {
4040
3236
  if (entry === null) {
@@ -4042,6 +3238,7 @@ const deserializeAws_restJson1DataValueList = (output, context) => {
4042
3238
  }
4043
3239
  return deserializeAws_restJson1DataValue(entry, context);
4044
3240
  });
3241
+ return retVal;
4045
3242
  };
4046
3243
  const deserializeAws_restJson1DataValueMap = (output, context) => {
4047
3244
  return Object.entries(output).reduce((acc, [key, value]) => {
@@ -4065,7 +3262,7 @@ const deserializeAws_restJson1EntityPropertyReference = (output, context) => {
4065
3262
  };
4066
3263
  };
4067
3264
  const deserializeAws_restJson1EntitySummaries = (output, context) => {
4068
- return (output || [])
3265
+ const retVal = (output || [])
4069
3266
  .filter((e) => e != null)
4070
3267
  .map((entry) => {
4071
3268
  if (entry === null) {
@@ -4073,6 +3270,7 @@ const deserializeAws_restJson1EntitySummaries = (output, context) => {
4073
3270
  }
4074
3271
  return deserializeAws_restJson1EntitySummary(entry, context);
4075
3272
  });
3273
+ return retVal;
4076
3274
  };
4077
3275
  const deserializeAws_restJson1EntitySummary = (output, context) => {
4078
3276
  return {
@@ -4100,7 +3298,7 @@ const deserializeAws_restJson1ErrorDetails = (output, context) => {
4100
3298
  };
4101
3299
  };
4102
3300
  const deserializeAws_restJson1ErrorEntries = (output, context) => {
4103
- return (output || [])
3301
+ const retVal = (output || [])
4104
3302
  .filter((e) => e != null)
4105
3303
  .map((entry) => {
4106
3304
  if (entry === null) {
@@ -4108,9 +3306,10 @@ const deserializeAws_restJson1ErrorEntries = (output, context) => {
4108
3306
  }
4109
3307
  return deserializeAws_restJson1BatchPutPropertyErrorEntry(entry, context);
4110
3308
  });
3309
+ return retVal;
4111
3310
  };
4112
3311
  const deserializeAws_restJson1Errors = (output, context) => {
4113
- return (output || [])
3312
+ const retVal = (output || [])
4114
3313
  .filter((e) => e != null)
4115
3314
  .map((entry) => {
4116
3315
  if (entry === null) {
@@ -4118,9 +3317,10 @@ const deserializeAws_restJson1Errors = (output, context) => {
4118
3317
  }
4119
3318
  return deserializeAws_restJson1BatchPutPropertyError(entry, context);
4120
3319
  });
3320
+ return retVal;
4121
3321
  };
4122
3322
  const deserializeAws_restJson1ExtendsFrom = (output, context) => {
4123
- return (output || [])
3323
+ const retVal = (output || [])
4124
3324
  .filter((e) => e != null)
4125
3325
  .map((entry) => {
4126
3326
  if (entry === null) {
@@ -4128,6 +3328,7 @@ const deserializeAws_restJson1ExtendsFrom = (output, context) => {
4128
3328
  }
4129
3329
  return smithy_client_1.expectString(entry);
4130
3330
  });
3331
+ return retVal;
4131
3332
  };
4132
3333
  const deserializeAws_restJson1ExternalIdProperty = (output, context) => {
4133
3334
  return Object.entries(output).reduce((acc, [key, value]) => {
@@ -4272,7 +3473,7 @@ const deserializeAws_restJson1PropertyValueHistory = (output, context) => {
4272
3473
  };
4273
3474
  };
4274
3475
  const deserializeAws_restJson1PropertyValueList = (output, context) => {
4275
- return (output || [])
3476
+ const retVal = (output || [])
4276
3477
  .filter((e) => e != null)
4277
3478
  .map((entry) => {
4278
3479
  if (entry === null) {
@@ -4280,9 +3481,10 @@ const deserializeAws_restJson1PropertyValueList = (output, context) => {
4280
3481
  }
4281
3482
  return deserializeAws_restJson1PropertyValueHistory(entry, context);
4282
3483
  });
3484
+ return retVal;
4283
3485
  };
4284
3486
  const deserializeAws_restJson1PropertyValues = (output, context) => {
4285
- return (output || [])
3487
+ const retVal = (output || [])
4286
3488
  .filter((e) => e != null)
4287
3489
  .map((entry) => {
4288
3490
  if (entry === null) {
@@ -4290,6 +3492,7 @@ const deserializeAws_restJson1PropertyValues = (output, context) => {
4290
3492
  }
4291
3493
  return deserializeAws_restJson1PropertyValue(entry, context);
4292
3494
  });
3495
+ return retVal;
4293
3496
  };
4294
3497
  const deserializeAws_restJson1Relationship = (output, context) => {
4295
3498
  return {
@@ -4304,25 +3507,18 @@ const deserializeAws_restJson1RelationshipValue = (output, context) => {
4304
3507
  };
4305
3508
  };
4306
3509
  const deserializeAws_restJson1RequiredProperties = (output, context) => {
4307
- const uniqueValues = new Set();
4308
- return (output || [])
3510
+ const retVal = (output || [])
4309
3511
  .filter((e) => e != null)
4310
3512
  .map((entry) => {
4311
3513
  if (entry === null) {
4312
3514
  return null;
4313
3515
  }
4314
- const parsedEntry = smithy_client_1.expectString(entry);
4315
- if (uniqueValues.has(parsedEntry)) {
4316
- throw new TypeError('All elements of the set "com.amazonaws.iottwinmaker#RequiredProperties" must be unique.');
4317
- }
4318
- else {
4319
- uniqueValues.add(parsedEntry);
4320
- return parsedEntry;
4321
- }
3516
+ return smithy_client_1.expectString(entry);
4322
3517
  });
3518
+ return retVal;
4323
3519
  };
4324
3520
  const deserializeAws_restJson1SceneCapabilities = (output, context) => {
4325
- return (output || [])
3521
+ const retVal = (output || [])
4326
3522
  .filter((e) => e != null)
4327
3523
  .map((entry) => {
4328
3524
  if (entry === null) {
@@ -4330,9 +3526,10 @@ const deserializeAws_restJson1SceneCapabilities = (output, context) => {
4330
3526
  }
4331
3527
  return smithy_client_1.expectString(entry);
4332
3528
  });
3529
+ return retVal;
4333
3530
  };
4334
3531
  const deserializeAws_restJson1SceneSummaries = (output, context) => {
4335
- return (output || [])
3532
+ const retVal = (output || [])
4336
3533
  .filter((e) => e != null)
4337
3534
  .map((entry) => {
4338
3535
  if (entry === null) {
@@ -4340,6 +3537,7 @@ const deserializeAws_restJson1SceneSummaries = (output, context) => {
4340
3537
  }
4341
3538
  return deserializeAws_restJson1SceneSummary(entry, context);
4342
3539
  });
3540
+ return retVal;
4343
3541
  };
4344
3542
  const deserializeAws_restJson1SceneSummary = (output, context) => {
4345
3543
  return {
@@ -4375,7 +3573,7 @@ const deserializeAws_restJson1TagMap = (output, context) => {
4375
3573
  }, {});
4376
3574
  };
4377
3575
  const deserializeAws_restJson1Values = (output, context) => {
4378
- return (output || [])
3576
+ const retVal = (output || [])
4379
3577
  .filter((e) => e != null)
4380
3578
  .map((entry) => {
4381
3579
  if (entry === null) {
@@ -4383,9 +3581,10 @@ const deserializeAws_restJson1Values = (output, context) => {
4383
3581
  }
4384
3582
  return deserializeAws_restJson1PropertyValue(entry, context);
4385
3583
  });
3584
+ return retVal;
4386
3585
  };
4387
3586
  const deserializeAws_restJson1WorkspaceSummaries = (output, context) => {
4388
- return (output || [])
3587
+ const retVal = (output || [])
4389
3588
  .filter((e) => e != null)
4390
3589
  .map((entry) => {
4391
3590
  if (entry === null) {
@@ -4393,6 +3592,7 @@ const deserializeAws_restJson1WorkspaceSummaries = (output, context) => {
4393
3592
  }
4394
3593
  return deserializeAws_restJson1WorkspaceSummary(entry, context);
4395
3594
  });
3595
+ return retVal;
4396
3596
  };
4397
3597
  const deserializeAws_restJson1WorkspaceSummary = (output, context) => {
4398
3598
  return {