@aws-sdk/client-workdocs 3.118.1 → 3.128.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.
@@ -93,12 +93,12 @@ const serializeAws_restJson1AddResourcePermissionsCommand = async (input, contex
93
93
  }
94
94
  let body;
95
95
  body = JSON.stringify({
96
- ...(input.NotificationOptions !== undefined &&
97
- input.NotificationOptions !== null && {
96
+ ...(input.NotificationOptions != null && {
98
97
  NotificationOptions: serializeAws_restJson1NotificationOptions(input.NotificationOptions, context),
99
98
  }),
100
- ...(input.Principals !== undefined &&
101
- input.Principals !== null && { Principals: serializeAws_restJson1SharePrincipalList(input.Principals, context) }),
99
+ ...(input.Principals != null && {
100
+ Principals: serializeAws_restJson1SharePrincipalList(input.Principals, context),
101
+ }),
102
102
  });
103
103
  return new protocol_http_1.HttpRequest({
104
104
  protocol,
@@ -141,12 +141,11 @@ const serializeAws_restJson1CreateCommentCommand = async (input, context) => {
141
141
  }
142
142
  let body;
143
143
  body = JSON.stringify({
144
- ...(input.NotifyCollaborators !== undefined &&
145
- input.NotifyCollaborators !== null && { NotifyCollaborators: input.NotifyCollaborators }),
146
- ...(input.ParentId !== undefined && input.ParentId !== null && { ParentId: input.ParentId }),
147
- ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }),
148
- ...(input.ThreadId !== undefined && input.ThreadId !== null && { ThreadId: input.ThreadId }),
149
- ...(input.Visibility !== undefined && input.Visibility !== null && { Visibility: input.Visibility }),
144
+ ...(input.NotifyCollaborators != null && { NotifyCollaborators: input.NotifyCollaborators }),
145
+ ...(input.ParentId != null && { ParentId: input.ParentId }),
146
+ ...(input.Text != null && { Text: input.Text }),
147
+ ...(input.ThreadId != null && { ThreadId: input.ThreadId }),
148
+ ...(input.Visibility != null && { Visibility: input.Visibility }),
150
149
  });
151
150
  return new protocol_http_1.HttpRequest({
152
151
  protocol,
@@ -182,8 +181,7 @@ const serializeAws_restJson1CreateCustomMetadataCommand = async (input, context)
182
181
  };
183
182
  let body;
184
183
  body = JSON.stringify({
185
- ...(input.CustomMetadata !== undefined &&
186
- input.CustomMetadata !== null && {
184
+ ...(input.CustomMetadata != null && {
187
185
  CustomMetadata: serializeAws_restJson1CustomMetadataMap(input.CustomMetadata, context),
188
186
  }),
189
187
  });
@@ -208,9 +206,8 @@ const serializeAws_restJson1CreateFolderCommand = async (input, context) => {
208
206
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/api/v1/folders";
209
207
  let body;
210
208
  body = JSON.stringify({
211
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
212
- ...(input.ParentFolderId !== undefined &&
213
- input.ParentFolderId !== null && { ParentFolderId: input.ParentFolderId }),
209
+ ...(input.Name != null && { Name: input.Name }),
210
+ ...(input.ParentFolderId != null && { ParentFolderId: input.ParentFolderId }),
214
211
  });
215
212
  return new protocol_http_1.HttpRequest({
216
213
  protocol,
@@ -242,8 +239,7 @@ const serializeAws_restJson1CreateLabelsCommand = async (input, context) => {
242
239
  }
243
240
  let body;
244
241
  body = JSON.stringify({
245
- ...(input.Labels !== undefined &&
246
- input.Labels !== null && { Labels: serializeAws_restJson1SharedLabels(input.Labels, context) }),
242
+ ...(input.Labels != null && { Labels: serializeAws_restJson1SharedLabels(input.Labels, context) }),
247
243
  });
248
244
  return new protocol_http_1.HttpRequest({
249
245
  protocol,
@@ -275,10 +271,9 @@ const serializeAws_restJson1CreateNotificationSubscriptionCommand = async (input
275
271
  }
276
272
  let body;
277
273
  body = JSON.stringify({
278
- ...(input.Endpoint !== undefined && input.Endpoint !== null && { Endpoint: input.Endpoint }),
279
- ...(input.Protocol !== undefined && input.Protocol !== null && { Protocol: input.Protocol }),
280
- ...(input.SubscriptionType !== undefined &&
281
- input.SubscriptionType !== null && { SubscriptionType: input.SubscriptionType }),
274
+ ...(input.Endpoint != null && { Endpoint: input.Endpoint }),
275
+ ...(input.Protocol != null && { Protocol: input.Protocol }),
276
+ ...(input.SubscriptionType != null && { SubscriptionType: input.SubscriptionType }),
282
277
  });
283
278
  return new protocol_http_1.HttpRequest({
284
279
  protocol,
@@ -300,16 +295,16 @@ const serializeAws_restJson1CreateUserCommand = async (input, context) => {
300
295
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/api/v1/users";
301
296
  let body;
302
297
  body = JSON.stringify({
303
- ...(input.EmailAddress !== undefined && input.EmailAddress !== null && { EmailAddress: input.EmailAddress }),
304
- ...(input.GivenName !== undefined && input.GivenName !== null && { GivenName: input.GivenName }),
305
- ...(input.OrganizationId !== undefined &&
306
- input.OrganizationId !== null && { OrganizationId: input.OrganizationId }),
307
- ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }),
308
- ...(input.StorageRule !== undefined &&
309
- input.StorageRule !== null && { StorageRule: serializeAws_restJson1StorageRuleType(input.StorageRule, context) }),
310
- ...(input.Surname !== undefined && input.Surname !== null && { Surname: input.Surname }),
311
- ...(input.TimeZoneId !== undefined && input.TimeZoneId !== null && { TimeZoneId: input.TimeZoneId }),
312
- ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }),
298
+ ...(input.EmailAddress != null && { EmailAddress: input.EmailAddress }),
299
+ ...(input.GivenName != null && { GivenName: input.GivenName }),
300
+ ...(input.OrganizationId != null && { OrganizationId: input.OrganizationId }),
301
+ ...(input.Password != null && { Password: input.Password }),
302
+ ...(input.StorageRule != null && {
303
+ StorageRule: serializeAws_restJson1StorageRuleType(input.StorageRule, context),
304
+ }),
305
+ ...(input.Surname != null && { Surname: input.Surname }),
306
+ ...(input.TimeZoneId != null && { TimeZoneId: input.TimeZoneId }),
307
+ ...(input.Username != null && { Username: input.Username }),
313
308
  });
314
309
  return new protocol_http_1.HttpRequest({
315
310
  protocol,
@@ -1137,21 +1132,17 @@ const serializeAws_restJson1InitiateDocumentVersionUploadCommand = async (input,
1137
1132
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/api/v1/documents";
1138
1133
  let body;
1139
1134
  body = JSON.stringify({
1140
- ...(input.ContentCreatedTimestamp !== undefined &&
1141
- input.ContentCreatedTimestamp !== null && {
1135
+ ...(input.ContentCreatedTimestamp != null && {
1142
1136
  ContentCreatedTimestamp: Math.round(input.ContentCreatedTimestamp.getTime() / 1000),
1143
1137
  }),
1144
- ...(input.ContentModifiedTimestamp !== undefined &&
1145
- input.ContentModifiedTimestamp !== null && {
1138
+ ...(input.ContentModifiedTimestamp != null && {
1146
1139
  ContentModifiedTimestamp: Math.round(input.ContentModifiedTimestamp.getTime() / 1000),
1147
1140
  }),
1148
- ...(input.ContentType !== undefined && input.ContentType !== null && { ContentType: input.ContentType }),
1149
- ...(input.DocumentSizeInBytes !== undefined &&
1150
- input.DocumentSizeInBytes !== null && { DocumentSizeInBytes: input.DocumentSizeInBytes }),
1151
- ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }),
1152
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
1153
- ...(input.ParentFolderId !== undefined &&
1154
- input.ParentFolderId !== null && { ParentFolderId: input.ParentFolderId }),
1141
+ ...(input.ContentType != null && { ContentType: input.ContentType }),
1142
+ ...(input.DocumentSizeInBytes != null && { DocumentSizeInBytes: input.DocumentSizeInBytes }),
1143
+ ...(input.Id != null && { Id: input.Id }),
1144
+ ...(input.Name != null && { Name: input.Name }),
1145
+ ...(input.ParentFolderId != null && { ParentFolderId: input.ParentFolderId }),
1155
1146
  });
1156
1147
  return new protocol_http_1.HttpRequest({
1157
1148
  protocol,
@@ -1255,10 +1246,9 @@ const serializeAws_restJson1UpdateDocumentCommand = async (input, context) => {
1255
1246
  }
1256
1247
  let body;
1257
1248
  body = JSON.stringify({
1258
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
1259
- ...(input.ParentFolderId !== undefined &&
1260
- input.ParentFolderId !== null && { ParentFolderId: input.ParentFolderId }),
1261
- ...(input.ResourceState !== undefined && input.ResourceState !== null && { ResourceState: input.ResourceState }),
1249
+ ...(input.Name != null && { Name: input.Name }),
1250
+ ...(input.ParentFolderId != null && { ParentFolderId: input.ParentFolderId }),
1251
+ ...(input.ResourceState != null && { ResourceState: input.ResourceState }),
1262
1252
  });
1263
1253
  return new protocol_http_1.HttpRequest({
1264
1254
  protocol,
@@ -1301,7 +1291,7 @@ const serializeAws_restJson1UpdateDocumentVersionCommand = async (input, context
1301
1291
  }
1302
1292
  let body;
1303
1293
  body = JSON.stringify({
1304
- ...(input.VersionStatus !== undefined && input.VersionStatus !== null && { VersionStatus: input.VersionStatus }),
1294
+ ...(input.VersionStatus != null && { VersionStatus: input.VersionStatus }),
1305
1295
  });
1306
1296
  return new protocol_http_1.HttpRequest({
1307
1297
  protocol,
@@ -1333,10 +1323,9 @@ const serializeAws_restJson1UpdateFolderCommand = async (input, context) => {
1333
1323
  }
1334
1324
  let body;
1335
1325
  body = JSON.stringify({
1336
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
1337
- ...(input.ParentFolderId !== undefined &&
1338
- input.ParentFolderId !== null && { ParentFolderId: input.ParentFolderId }),
1339
- ...(input.ResourceState !== undefined && input.ResourceState !== null && { ResourceState: input.ResourceState }),
1326
+ ...(input.Name != null && { Name: input.Name }),
1327
+ ...(input.ParentFolderId != null && { ParentFolderId: input.ParentFolderId }),
1328
+ ...(input.ResourceState != null && { ResourceState: input.ResourceState }),
1340
1329
  });
1341
1330
  return new protocol_http_1.HttpRequest({
1342
1331
  protocol,
@@ -1368,15 +1357,15 @@ const serializeAws_restJson1UpdateUserCommand = async (input, context) => {
1368
1357
  }
1369
1358
  let body;
1370
1359
  body = JSON.stringify({
1371
- ...(input.GivenName !== undefined && input.GivenName !== null && { GivenName: input.GivenName }),
1372
- ...(input.GrantPoweruserPrivileges !== undefined &&
1373
- input.GrantPoweruserPrivileges !== null && { GrantPoweruserPrivileges: input.GrantPoweruserPrivileges }),
1374
- ...(input.Locale !== undefined && input.Locale !== null && { Locale: input.Locale }),
1375
- ...(input.StorageRule !== undefined &&
1376
- input.StorageRule !== null && { StorageRule: serializeAws_restJson1StorageRuleType(input.StorageRule, context) }),
1377
- ...(input.Surname !== undefined && input.Surname !== null && { Surname: input.Surname }),
1378
- ...(input.TimeZoneId !== undefined && input.TimeZoneId !== null && { TimeZoneId: input.TimeZoneId }),
1379
- ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }),
1360
+ ...(input.GivenName != null && { GivenName: input.GivenName }),
1361
+ ...(input.GrantPoweruserPrivileges != null && { GrantPoweruserPrivileges: input.GrantPoweruserPrivileges }),
1362
+ ...(input.Locale != null && { Locale: input.Locale }),
1363
+ ...(input.StorageRule != null && {
1364
+ StorageRule: serializeAws_restJson1StorageRuleType(input.StorageRule, context),
1365
+ }),
1366
+ ...(input.Surname != null && { Surname: input.Surname }),
1367
+ ...(input.TimeZoneId != null && { TimeZoneId: input.TimeZoneId }),
1368
+ ...(input.Type != null && { Type: input.Type }),
1380
1369
  });
1381
1370
  return new protocol_http_1.HttpRequest({
1382
1371
  protocol,
@@ -1406,8 +1395,7 @@ const deserializeAws_restJson1AbortDocumentVersionUploadCommandError = async (ou
1406
1395
  body: await parseBody(output.body, context),
1407
1396
  };
1408
1397
  let response;
1409
- let errorCode = "UnknownError";
1410
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1398
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1411
1399
  switch (errorCode) {
1412
1400
  case "EntityNotExistsException":
1413
1401
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -1429,10 +1417,12 @@ const deserializeAws_restJson1AbortDocumentVersionUploadCommandError = async (ou
1429
1417
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1430
1418
  default:
1431
1419
  const parsedBody = parsedOutput.body;
1420
+ const $metadata = deserializeMetadata(output);
1421
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1432
1422
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1433
- name: parsedBody.code || parsedBody.Code || errorCode,
1423
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1434
1424
  $fault: "client",
1435
- $metadata: deserializeMetadata(output),
1425
+ $metadata,
1436
1426
  });
1437
1427
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1438
1428
  }
@@ -1458,8 +1448,7 @@ const deserializeAws_restJson1ActivateUserCommandError = async (output, context)
1458
1448
  body: await parseBody(output.body, context),
1459
1449
  };
1460
1450
  let response;
1461
- let errorCode = "UnknownError";
1462
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1451
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1463
1452
  switch (errorCode) {
1464
1453
  case "EntityNotExistsException":
1465
1454
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -1478,10 +1467,12 @@ const deserializeAws_restJson1ActivateUserCommandError = async (output, context)
1478
1467
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1479
1468
  default:
1480
1469
  const parsedBody = parsedOutput.body;
1470
+ const $metadata = deserializeMetadata(output);
1471
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1481
1472
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1482
- name: parsedBody.code || parsedBody.Code || errorCode,
1473
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1483
1474
  $fault: "client",
1484
- $metadata: deserializeMetadata(output),
1475
+ $metadata,
1485
1476
  });
1486
1477
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1487
1478
  }
@@ -1507,8 +1498,7 @@ const deserializeAws_restJson1AddResourcePermissionsCommandError = async (output
1507
1498
  body: await parseBody(output.body, context),
1508
1499
  };
1509
1500
  let response;
1510
- let errorCode = "UnknownError";
1511
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1501
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1512
1502
  switch (errorCode) {
1513
1503
  case "FailedDependencyException":
1514
1504
  case "com.amazonaws.workdocs#FailedDependencyException":
@@ -1524,10 +1514,12 @@ const deserializeAws_restJson1AddResourcePermissionsCommandError = async (output
1524
1514
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1525
1515
  default:
1526
1516
  const parsedBody = parsedOutput.body;
1517
+ const $metadata = deserializeMetadata(output);
1518
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1527
1519
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1528
- name: parsedBody.code || parsedBody.Code || errorCode,
1520
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1529
1521
  $fault: "client",
1530
- $metadata: deserializeMetadata(output),
1522
+ $metadata,
1531
1523
  });
1532
1524
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1533
1525
  }
@@ -1553,8 +1545,7 @@ const deserializeAws_restJson1CreateCommentCommandError = async (output, context
1553
1545
  body: await parseBody(output.body, context),
1554
1546
  };
1555
1547
  let response;
1556
- let errorCode = "UnknownError";
1557
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1548
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1558
1549
  switch (errorCode) {
1559
1550
  case "DocumentLockedForCommentsException":
1560
1551
  case "com.amazonaws.workdocs#DocumentLockedForCommentsException":
@@ -1582,10 +1573,12 @@ const deserializeAws_restJson1CreateCommentCommandError = async (output, context
1582
1573
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1583
1574
  default:
1584
1575
  const parsedBody = parsedOutput.body;
1576
+ const $metadata = deserializeMetadata(output);
1577
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1585
1578
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1586
- name: parsedBody.code || parsedBody.Code || errorCode,
1579
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1587
1580
  $fault: "client",
1588
- $metadata: deserializeMetadata(output),
1581
+ $metadata,
1589
1582
  });
1590
1583
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1591
1584
  }
@@ -1607,8 +1600,7 @@ const deserializeAws_restJson1CreateCustomMetadataCommandError = async (output,
1607
1600
  body: await parseBody(output.body, context),
1608
1601
  };
1609
1602
  let response;
1610
- let errorCode = "UnknownError";
1611
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1603
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1612
1604
  switch (errorCode) {
1613
1605
  case "CustomMetadataLimitExceededException":
1614
1606
  case "com.amazonaws.workdocs#CustomMetadataLimitExceededException":
@@ -1633,10 +1625,12 @@ const deserializeAws_restJson1CreateCustomMetadataCommandError = async (output,
1633
1625
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1634
1626
  default:
1635
1627
  const parsedBody = parsedOutput.body;
1628
+ const $metadata = deserializeMetadata(output);
1629
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1636
1630
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1637
- name: parsedBody.code || parsedBody.Code || errorCode,
1631
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1638
1632
  $fault: "client",
1639
- $metadata: deserializeMetadata(output),
1633
+ $metadata,
1640
1634
  });
1641
1635
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1642
1636
  }
@@ -1662,8 +1656,7 @@ const deserializeAws_restJson1CreateFolderCommandError = async (output, context)
1662
1656
  body: await parseBody(output.body, context),
1663
1657
  };
1664
1658
  let response;
1665
- let errorCode = "UnknownError";
1666
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1659
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1667
1660
  switch (errorCode) {
1668
1661
  case "ConflictingOperationException":
1669
1662
  case "com.amazonaws.workdocs#ConflictingOperationException":
@@ -1694,10 +1687,12 @@ const deserializeAws_restJson1CreateFolderCommandError = async (output, context)
1694
1687
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1695
1688
  default:
1696
1689
  const parsedBody = parsedOutput.body;
1690
+ const $metadata = deserializeMetadata(output);
1691
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1697
1692
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1698
- name: parsedBody.code || parsedBody.Code || errorCode,
1693
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1699
1694
  $fault: "client",
1700
- $metadata: deserializeMetadata(output),
1695
+ $metadata,
1701
1696
  });
1702
1697
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1703
1698
  }
@@ -1719,8 +1714,7 @@ const deserializeAws_restJson1CreateLabelsCommandError = async (output, context)
1719
1714
  body: await parseBody(output.body, context),
1720
1715
  };
1721
1716
  let response;
1722
- let errorCode = "UnknownError";
1723
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1717
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1724
1718
  switch (errorCode) {
1725
1719
  case "EntityNotExistsException":
1726
1720
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -1742,10 +1736,12 @@ const deserializeAws_restJson1CreateLabelsCommandError = async (output, context)
1742
1736
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1743
1737
  default:
1744
1738
  const parsedBody = parsedOutput.body;
1739
+ const $metadata = deserializeMetadata(output);
1740
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1745
1741
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1746
- name: parsedBody.code || parsedBody.Code || errorCode,
1742
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1747
1743
  $fault: "client",
1748
- $metadata: deserializeMetadata(output),
1744
+ $metadata,
1749
1745
  });
1750
1746
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1751
1747
  }
@@ -1771,8 +1767,7 @@ const deserializeAws_restJson1CreateNotificationSubscriptionCommandError = async
1771
1767
  body: await parseBody(output.body, context),
1772
1768
  };
1773
1769
  let response;
1774
- let errorCode = "UnknownError";
1775
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1770
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1776
1771
  switch (errorCode) {
1777
1772
  case "ServiceUnavailableException":
1778
1773
  case "com.amazonaws.workdocs#ServiceUnavailableException":
@@ -1785,10 +1780,12 @@ const deserializeAws_restJson1CreateNotificationSubscriptionCommandError = async
1785
1780
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1786
1781
  default:
1787
1782
  const parsedBody = parsedOutput.body;
1783
+ const $metadata = deserializeMetadata(output);
1784
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1788
1785
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1789
- name: parsedBody.code || parsedBody.Code || errorCode,
1786
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1790
1787
  $fault: "client",
1791
- $metadata: deserializeMetadata(output),
1788
+ $metadata,
1792
1789
  });
1793
1790
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1794
1791
  }
@@ -1814,8 +1811,7 @@ const deserializeAws_restJson1CreateUserCommandError = async (output, context) =
1814
1811
  body: await parseBody(output.body, context),
1815
1812
  };
1816
1813
  let response;
1817
- let errorCode = "UnknownError";
1818
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1814
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1819
1815
  switch (errorCode) {
1820
1816
  case "EntityAlreadyExistsException":
1821
1817
  case "com.amazonaws.workdocs#EntityAlreadyExistsException":
@@ -1834,10 +1830,12 @@ const deserializeAws_restJson1CreateUserCommandError = async (output, context) =
1834
1830
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1835
1831
  default:
1836
1832
  const parsedBody = parsedOutput.body;
1833
+ const $metadata = deserializeMetadata(output);
1834
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1837
1835
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1838
- name: parsedBody.code || parsedBody.Code || errorCode,
1836
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1839
1837
  $fault: "client",
1840
- $metadata: deserializeMetadata(output),
1838
+ $metadata,
1841
1839
  });
1842
1840
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1843
1841
  }
@@ -1859,8 +1857,7 @@ const deserializeAws_restJson1DeactivateUserCommandError = async (output, contex
1859
1857
  body: await parseBody(output.body, context),
1860
1858
  };
1861
1859
  let response;
1862
- let errorCode = "UnknownError";
1863
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1860
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1864
1861
  switch (errorCode) {
1865
1862
  case "EntityNotExistsException":
1866
1863
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -1879,10 +1876,12 @@ const deserializeAws_restJson1DeactivateUserCommandError = async (output, contex
1879
1876
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1880
1877
  default:
1881
1878
  const parsedBody = parsedOutput.body;
1879
+ const $metadata = deserializeMetadata(output);
1880
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1882
1881
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1883
- name: parsedBody.code || parsedBody.Code || errorCode,
1882
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1884
1883
  $fault: "client",
1885
- $metadata: deserializeMetadata(output),
1884
+ $metadata,
1886
1885
  });
1887
1886
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1888
1887
  }
@@ -1904,8 +1903,7 @@ const deserializeAws_restJson1DeleteCommentCommandError = async (output, context
1904
1903
  body: await parseBody(output.body, context),
1905
1904
  };
1906
1905
  let response;
1907
- let errorCode = "UnknownError";
1908
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1906
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1909
1907
  switch (errorCode) {
1910
1908
  case "DocumentLockedForCommentsException":
1911
1909
  case "com.amazonaws.workdocs#DocumentLockedForCommentsException":
@@ -1930,10 +1928,12 @@ const deserializeAws_restJson1DeleteCommentCommandError = async (output, context
1930
1928
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1931
1929
  default:
1932
1930
  const parsedBody = parsedOutput.body;
1931
+ const $metadata = deserializeMetadata(output);
1932
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1933
1933
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1934
- name: parsedBody.code || parsedBody.Code || errorCode,
1934
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1935
1935
  $fault: "client",
1936
- $metadata: deserializeMetadata(output),
1936
+ $metadata,
1937
1937
  });
1938
1938
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1939
1939
  }
@@ -1955,8 +1955,7 @@ const deserializeAws_restJson1DeleteCustomMetadataCommandError = async (output,
1955
1955
  body: await parseBody(output.body, context),
1956
1956
  };
1957
1957
  let response;
1958
- let errorCode = "UnknownError";
1959
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1958
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1960
1959
  switch (errorCode) {
1961
1960
  case "EntityNotExistsException":
1962
1961
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -1978,10 +1977,12 @@ const deserializeAws_restJson1DeleteCustomMetadataCommandError = async (output,
1978
1977
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
1979
1978
  default:
1980
1979
  const parsedBody = parsedOutput.body;
1980
+ const $metadata = deserializeMetadata(output);
1981
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1981
1982
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
1982
- name: parsedBody.code || parsedBody.Code || errorCode,
1983
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1983
1984
  $fault: "client",
1984
- $metadata: deserializeMetadata(output),
1985
+ $metadata,
1985
1986
  });
1986
1987
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1987
1988
  }
@@ -2003,8 +2004,7 @@ const deserializeAws_restJson1DeleteDocumentCommandError = async (output, contex
2003
2004
  body: await parseBody(output.body, context),
2004
2005
  };
2005
2006
  let response;
2006
- let errorCode = "UnknownError";
2007
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2007
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2008
2008
  switch (errorCode) {
2009
2009
  case "ConcurrentModificationException":
2010
2010
  case "com.amazonaws.workdocs#ConcurrentModificationException":
@@ -2032,10 +2032,12 @@ const deserializeAws_restJson1DeleteDocumentCommandError = async (output, contex
2032
2032
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2033
2033
  default:
2034
2034
  const parsedBody = parsedOutput.body;
2035
+ const $metadata = deserializeMetadata(output);
2036
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2035
2037
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2036
- name: parsedBody.code || parsedBody.Code || errorCode,
2038
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2037
2039
  $fault: "client",
2038
- $metadata: deserializeMetadata(output),
2040
+ $metadata,
2039
2041
  });
2040
2042
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2041
2043
  }
@@ -2057,8 +2059,7 @@ const deserializeAws_restJson1DeleteFolderCommandError = async (output, context)
2057
2059
  body: await parseBody(output.body, context),
2058
2060
  };
2059
2061
  let response;
2060
- let errorCode = "UnknownError";
2061
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2062
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2062
2063
  switch (errorCode) {
2063
2064
  case "ConcurrentModificationException":
2064
2065
  case "com.amazonaws.workdocs#ConcurrentModificationException":
@@ -2086,10 +2087,12 @@ const deserializeAws_restJson1DeleteFolderCommandError = async (output, context)
2086
2087
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2087
2088
  default:
2088
2089
  const parsedBody = parsedOutput.body;
2090
+ const $metadata = deserializeMetadata(output);
2091
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2089
2092
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2090
- name: parsedBody.code || parsedBody.Code || errorCode,
2093
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2091
2094
  $fault: "client",
2092
- $metadata: deserializeMetadata(output),
2095
+ $metadata,
2093
2096
  });
2094
2097
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2095
2098
  }
@@ -2111,8 +2114,7 @@ const deserializeAws_restJson1DeleteFolderContentsCommandError = async (output,
2111
2114
  body: await parseBody(output.body, context),
2112
2115
  };
2113
2116
  let response;
2114
- let errorCode = "UnknownError";
2115
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2117
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2116
2118
  switch (errorCode) {
2117
2119
  case "ConflictingOperationException":
2118
2120
  case "com.amazonaws.workdocs#ConflictingOperationException":
@@ -2137,10 +2139,12 @@ const deserializeAws_restJson1DeleteFolderContentsCommandError = async (output,
2137
2139
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2138
2140
  default:
2139
2141
  const parsedBody = parsedOutput.body;
2142
+ const $metadata = deserializeMetadata(output);
2143
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2140
2144
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2141
- name: parsedBody.code || parsedBody.Code || errorCode,
2145
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2142
2146
  $fault: "client",
2143
- $metadata: deserializeMetadata(output),
2147
+ $metadata,
2144
2148
  });
2145
2149
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2146
2150
  }
@@ -2162,8 +2166,7 @@ const deserializeAws_restJson1DeleteLabelsCommandError = async (output, context)
2162
2166
  body: await parseBody(output.body, context),
2163
2167
  };
2164
2168
  let response;
2165
- let errorCode = "UnknownError";
2166
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2169
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2167
2170
  switch (errorCode) {
2168
2171
  case "EntityNotExistsException":
2169
2172
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2182,10 +2185,12 @@ const deserializeAws_restJson1DeleteLabelsCommandError = async (output, context)
2182
2185
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2183
2186
  default:
2184
2187
  const parsedBody = parsedOutput.body;
2188
+ const $metadata = deserializeMetadata(output);
2189
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2185
2190
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2186
- name: parsedBody.code || parsedBody.Code || errorCode,
2191
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2187
2192
  $fault: "client",
2188
- $metadata: deserializeMetadata(output),
2193
+ $metadata,
2189
2194
  });
2190
2195
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2191
2196
  }
@@ -2207,8 +2212,7 @@ const deserializeAws_restJson1DeleteNotificationSubscriptionCommandError = async
2207
2212
  body: await parseBody(output.body, context),
2208
2213
  };
2209
2214
  let response;
2210
- let errorCode = "UnknownError";
2211
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2215
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2212
2216
  switch (errorCode) {
2213
2217
  case "EntityNotExistsException":
2214
2218
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2224,10 +2228,12 @@ const deserializeAws_restJson1DeleteNotificationSubscriptionCommandError = async
2224
2228
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2225
2229
  default:
2226
2230
  const parsedBody = parsedOutput.body;
2231
+ const $metadata = deserializeMetadata(output);
2232
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2227
2233
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2228
- name: parsedBody.code || parsedBody.Code || errorCode,
2234
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2229
2235
  $fault: "client",
2230
- $metadata: deserializeMetadata(output),
2236
+ $metadata,
2231
2237
  });
2232
2238
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2233
2239
  }
@@ -2249,8 +2255,7 @@ const deserializeAws_restJson1DeleteUserCommandError = async (output, context) =
2249
2255
  body: await parseBody(output.body, context),
2250
2256
  };
2251
2257
  let response;
2252
- let errorCode = "UnknownError";
2253
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2258
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2254
2259
  switch (errorCode) {
2255
2260
  case "EntityNotExistsException":
2256
2261
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2269,10 +2274,12 @@ const deserializeAws_restJson1DeleteUserCommandError = async (output, context) =
2269
2274
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2270
2275
  default:
2271
2276
  const parsedBody = parsedOutput.body;
2277
+ const $metadata = deserializeMetadata(output);
2278
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2272
2279
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2273
- name: parsedBody.code || parsedBody.Code || errorCode,
2280
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2274
2281
  $fault: "client",
2275
- $metadata: deserializeMetadata(output),
2282
+ $metadata,
2276
2283
  });
2277
2284
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2278
2285
  }
@@ -2302,8 +2309,7 @@ const deserializeAws_restJson1DescribeActivitiesCommandError = async (output, co
2302
2309
  body: await parseBody(output.body, context),
2303
2310
  };
2304
2311
  let response;
2305
- let errorCode = "UnknownError";
2306
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2312
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2307
2313
  switch (errorCode) {
2308
2314
  case "FailedDependencyException":
2309
2315
  case "com.amazonaws.workdocs#FailedDependencyException":
@@ -2322,10 +2328,12 @@ const deserializeAws_restJson1DescribeActivitiesCommandError = async (output, co
2322
2328
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2323
2329
  default:
2324
2330
  const parsedBody = parsedOutput.body;
2331
+ const $metadata = deserializeMetadata(output);
2332
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2325
2333
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2326
- name: parsedBody.code || parsedBody.Code || errorCode,
2334
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2327
2335
  $fault: "client",
2328
- $metadata: deserializeMetadata(output),
2336
+ $metadata,
2329
2337
  });
2330
2338
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2331
2339
  }
@@ -2355,8 +2363,7 @@ const deserializeAws_restJson1DescribeCommentsCommandError = async (output, cont
2355
2363
  body: await parseBody(output.body, context),
2356
2364
  };
2357
2365
  let response;
2358
- let errorCode = "UnknownError";
2359
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2366
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2360
2367
  switch (errorCode) {
2361
2368
  case "EntityNotExistsException":
2362
2369
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2378,10 +2385,12 @@ const deserializeAws_restJson1DescribeCommentsCommandError = async (output, cont
2378
2385
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2379
2386
  default:
2380
2387
  const parsedBody = parsedOutput.body;
2388
+ const $metadata = deserializeMetadata(output);
2389
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2381
2390
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2382
- name: parsedBody.code || parsedBody.Code || errorCode,
2391
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2383
2392
  $fault: "client",
2384
- $metadata: deserializeMetadata(output),
2393
+ $metadata,
2385
2394
  });
2386
2395
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2387
2396
  }
@@ -2411,8 +2420,7 @@ const deserializeAws_restJson1DescribeDocumentVersionsCommandError = async (outp
2411
2420
  body: await parseBody(output.body, context),
2412
2421
  };
2413
2422
  let response;
2414
- let errorCode = "UnknownError";
2415
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2423
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2416
2424
  switch (errorCode) {
2417
2425
  case "EntityNotExistsException":
2418
2426
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2437,10 +2445,12 @@ const deserializeAws_restJson1DescribeDocumentVersionsCommandError = async (outp
2437
2445
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2438
2446
  default:
2439
2447
  const parsedBody = parsedOutput.body;
2448
+ const $metadata = deserializeMetadata(output);
2449
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2440
2450
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2441
- name: parsedBody.code || parsedBody.Code || errorCode,
2451
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2442
2452
  $fault: "client",
2443
- $metadata: deserializeMetadata(output),
2453
+ $metadata,
2444
2454
  });
2445
2455
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2446
2456
  }
@@ -2474,8 +2484,7 @@ const deserializeAws_restJson1DescribeFolderContentsCommandError = async (output
2474
2484
  body: await parseBody(output.body, context),
2475
2485
  };
2476
2486
  let response;
2477
- let errorCode = "UnknownError";
2478
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2487
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2479
2488
  switch (errorCode) {
2480
2489
  case "EntityNotExistsException":
2481
2490
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2497,10 +2506,12 @@ const deserializeAws_restJson1DescribeFolderContentsCommandError = async (output
2497
2506
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2498
2507
  default:
2499
2508
  const parsedBody = parsedOutput.body;
2509
+ const $metadata = deserializeMetadata(output);
2510
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2500
2511
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2501
- name: parsedBody.code || parsedBody.Code || errorCode,
2512
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2502
2513
  $fault: "client",
2503
- $metadata: deserializeMetadata(output),
2514
+ $metadata,
2504
2515
  });
2505
2516
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2506
2517
  }
@@ -2530,8 +2541,7 @@ const deserializeAws_restJson1DescribeGroupsCommandError = async (output, contex
2530
2541
  body: await parseBody(output.body, context),
2531
2542
  };
2532
2543
  let response;
2533
- let errorCode = "UnknownError";
2534
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2544
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2535
2545
  switch (errorCode) {
2536
2546
  case "FailedDependencyException":
2537
2547
  case "com.amazonaws.workdocs#FailedDependencyException":
@@ -2547,10 +2557,12 @@ const deserializeAws_restJson1DescribeGroupsCommandError = async (output, contex
2547
2557
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2548
2558
  default:
2549
2559
  const parsedBody = parsedOutput.body;
2560
+ const $metadata = deserializeMetadata(output);
2561
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2550
2562
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2551
- name: parsedBody.code || parsedBody.Code || errorCode,
2563
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2552
2564
  $fault: "client",
2553
- $metadata: deserializeMetadata(output),
2565
+ $metadata,
2554
2566
  });
2555
2567
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2556
2568
  }
@@ -2580,8 +2592,7 @@ const deserializeAws_restJson1DescribeNotificationSubscriptionsCommandError = as
2580
2592
  body: await parseBody(output.body, context),
2581
2593
  };
2582
2594
  let response;
2583
- let errorCode = "UnknownError";
2584
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2595
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2585
2596
  switch (errorCode) {
2586
2597
  case "EntityNotExistsException":
2587
2598
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2594,10 +2605,12 @@ const deserializeAws_restJson1DescribeNotificationSubscriptionsCommandError = as
2594
2605
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2595
2606
  default:
2596
2607
  const parsedBody = parsedOutput.body;
2608
+ const $metadata = deserializeMetadata(output);
2609
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2597
2610
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2598
- name: parsedBody.code || parsedBody.Code || errorCode,
2611
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2599
2612
  $fault: "client",
2600
- $metadata: deserializeMetadata(output),
2613
+ $metadata,
2601
2614
  });
2602
2615
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2603
2616
  }
@@ -2627,8 +2640,7 @@ const deserializeAws_restJson1DescribeResourcePermissionsCommandError = async (o
2627
2640
  body: await parseBody(output.body, context),
2628
2641
  };
2629
2642
  let response;
2630
- let errorCode = "UnknownError";
2631
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2643
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2632
2644
  switch (errorCode) {
2633
2645
  case "FailedDependencyException":
2634
2646
  case "com.amazonaws.workdocs#FailedDependencyException":
@@ -2644,10 +2656,12 @@ const deserializeAws_restJson1DescribeResourcePermissionsCommandError = async (o
2644
2656
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2645
2657
  default:
2646
2658
  const parsedBody = parsedOutput.body;
2659
+ const $metadata = deserializeMetadata(output);
2660
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2647
2661
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2648
- name: parsedBody.code || parsedBody.Code || errorCode,
2662
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2649
2663
  $fault: "client",
2650
- $metadata: deserializeMetadata(output),
2664
+ $metadata,
2651
2665
  });
2652
2666
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2653
2667
  }
@@ -2677,8 +2691,7 @@ const deserializeAws_restJson1DescribeRootFoldersCommandError = async (output, c
2677
2691
  body: await parseBody(output.body, context),
2678
2692
  };
2679
2693
  let response;
2680
- let errorCode = "UnknownError";
2681
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2694
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2682
2695
  switch (errorCode) {
2683
2696
  case "FailedDependencyException":
2684
2697
  case "com.amazonaws.workdocs#FailedDependencyException":
@@ -2697,10 +2710,12 @@ const deserializeAws_restJson1DescribeRootFoldersCommandError = async (output, c
2697
2710
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2698
2711
  default:
2699
2712
  const parsedBody = parsedOutput.body;
2713
+ const $metadata = deserializeMetadata(output);
2714
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2700
2715
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2701
- name: parsedBody.code || parsedBody.Code || errorCode,
2716
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2702
2717
  $fault: "client",
2703
- $metadata: deserializeMetadata(output),
2718
+ $metadata,
2704
2719
  });
2705
2720
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2706
2721
  }
@@ -2734,8 +2749,7 @@ const deserializeAws_restJson1DescribeUsersCommandError = async (output, context
2734
2749
  body: await parseBody(output.body, context),
2735
2750
  };
2736
2751
  let response;
2737
- let errorCode = "UnknownError";
2738
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2752
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2739
2753
  switch (errorCode) {
2740
2754
  case "EntityNotExistsException":
2741
2755
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2760,10 +2774,12 @@ const deserializeAws_restJson1DescribeUsersCommandError = async (output, context
2760
2774
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2761
2775
  default:
2762
2776
  const parsedBody = parsedOutput.body;
2777
+ const $metadata = deserializeMetadata(output);
2778
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2763
2779
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2764
- name: parsedBody.code || parsedBody.Code || errorCode,
2780
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2765
2781
  $fault: "client",
2766
- $metadata: deserializeMetadata(output),
2782
+ $metadata,
2767
2783
  });
2768
2784
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2769
2785
  }
@@ -2789,8 +2805,7 @@ const deserializeAws_restJson1GetCurrentUserCommandError = async (output, contex
2789
2805
  body: await parseBody(output.body, context),
2790
2806
  };
2791
2807
  let response;
2792
- let errorCode = "UnknownError";
2793
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2808
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2794
2809
  switch (errorCode) {
2795
2810
  case "EntityNotExistsException":
2796
2811
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2809,10 +2824,12 @@ const deserializeAws_restJson1GetCurrentUserCommandError = async (output, contex
2809
2824
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2810
2825
  default:
2811
2826
  const parsedBody = parsedOutput.body;
2827
+ const $metadata = deserializeMetadata(output);
2828
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2812
2829
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2813
- name: parsedBody.code || parsedBody.Code || errorCode,
2830
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2814
2831
  $fault: "client",
2815
- $metadata: deserializeMetadata(output),
2832
+ $metadata,
2816
2833
  });
2817
2834
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2818
2835
  }
@@ -2842,8 +2859,7 @@ const deserializeAws_restJson1GetDocumentCommandError = async (output, context)
2842
2859
  body: await parseBody(output.body, context),
2843
2860
  };
2844
2861
  let response;
2845
- let errorCode = "UnknownError";
2846
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2862
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2847
2863
  switch (errorCode) {
2848
2864
  case "EntityNotExistsException":
2849
2865
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2868,10 +2884,12 @@ const deserializeAws_restJson1GetDocumentCommandError = async (output, context)
2868
2884
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2869
2885
  default:
2870
2886
  const parsedBody = parsedOutput.body;
2887
+ const $metadata = deserializeMetadata(output);
2888
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2871
2889
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2872
- name: parsedBody.code || parsedBody.Code || errorCode,
2890
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2873
2891
  $fault: "client",
2874
- $metadata: deserializeMetadata(output),
2892
+ $metadata,
2875
2893
  });
2876
2894
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2877
2895
  }
@@ -2897,8 +2915,7 @@ const deserializeAws_restJson1GetDocumentPathCommandError = async (output, conte
2897
2915
  body: await parseBody(output.body, context),
2898
2916
  };
2899
2917
  let response;
2900
- let errorCode = "UnknownError";
2901
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2918
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2902
2919
  switch (errorCode) {
2903
2920
  case "EntityNotExistsException":
2904
2921
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2917,10 +2934,12 @@ const deserializeAws_restJson1GetDocumentPathCommandError = async (output, conte
2917
2934
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2918
2935
  default:
2919
2936
  const parsedBody = parsedOutput.body;
2937
+ const $metadata = deserializeMetadata(output);
2938
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2920
2939
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2921
- name: parsedBody.code || parsedBody.Code || errorCode,
2940
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2922
2941
  $fault: "client",
2923
- $metadata: deserializeMetadata(output),
2942
+ $metadata,
2924
2943
  });
2925
2944
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2926
2945
  }
@@ -2950,8 +2969,7 @@ const deserializeAws_restJson1GetDocumentVersionCommandError = async (output, co
2950
2969
  body: await parseBody(output.body, context),
2951
2970
  };
2952
2971
  let response;
2953
- let errorCode = "UnknownError";
2954
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2972
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2955
2973
  switch (errorCode) {
2956
2974
  case "EntityNotExistsException":
2957
2975
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -2976,10 +2994,12 @@ const deserializeAws_restJson1GetDocumentVersionCommandError = async (output, co
2976
2994
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
2977
2995
  default:
2978
2996
  const parsedBody = parsedOutput.body;
2997
+ const $metadata = deserializeMetadata(output);
2998
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2979
2999
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
2980
- name: parsedBody.code || parsedBody.Code || errorCode,
3000
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2981
3001
  $fault: "client",
2982
- $metadata: deserializeMetadata(output),
3002
+ $metadata,
2983
3003
  });
2984
3004
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2985
3005
  }
@@ -3009,8 +3029,7 @@ const deserializeAws_restJson1GetFolderCommandError = async (output, context) =>
3009
3029
  body: await parseBody(output.body, context),
3010
3030
  };
3011
3031
  let response;
3012
- let errorCode = "UnknownError";
3013
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3032
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3014
3033
  switch (errorCode) {
3015
3034
  case "EntityNotExistsException":
3016
3035
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -3035,10 +3054,12 @@ const deserializeAws_restJson1GetFolderCommandError = async (output, context) =>
3035
3054
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3036
3055
  default:
3037
3056
  const parsedBody = parsedOutput.body;
3057
+ const $metadata = deserializeMetadata(output);
3058
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3038
3059
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3039
- name: parsedBody.code || parsedBody.Code || errorCode,
3060
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3040
3061
  $fault: "client",
3041
- $metadata: deserializeMetadata(output),
3062
+ $metadata,
3042
3063
  });
3043
3064
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3044
3065
  }
@@ -3064,8 +3085,7 @@ const deserializeAws_restJson1GetFolderPathCommandError = async (output, context
3064
3085
  body: await parseBody(output.body, context),
3065
3086
  };
3066
3087
  let response;
3067
- let errorCode = "UnknownError";
3068
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3088
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3069
3089
  switch (errorCode) {
3070
3090
  case "EntityNotExistsException":
3071
3091
  case "com.amazonaws.workdocs#EntityNotExistsException":
@@ -3084,10 +3104,12 @@ const deserializeAws_restJson1GetFolderPathCommandError = async (output, context
3084
3104
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3085
3105
  default:
3086
3106
  const parsedBody = parsedOutput.body;
3107
+ const $metadata = deserializeMetadata(output);
3108
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3087
3109
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3088
- name: parsedBody.code || parsedBody.Code || errorCode,
3110
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3089
3111
  $fault: "client",
3090
- $metadata: deserializeMetadata(output),
3112
+ $metadata,
3091
3113
  });
3092
3114
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3093
3115
  }
@@ -3121,8 +3143,7 @@ const deserializeAws_restJson1GetResourcesCommandError = async (output, context)
3121
3143
  body: await parseBody(output.body, context),
3122
3144
  };
3123
3145
  let response;
3124
- let errorCode = "UnknownError";
3125
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3146
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3126
3147
  switch (errorCode) {
3127
3148
  case "FailedDependencyException":
3128
3149
  case "com.amazonaws.workdocs#FailedDependencyException":
@@ -3141,10 +3162,12 @@ const deserializeAws_restJson1GetResourcesCommandError = async (output, context)
3141
3162
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3142
3163
  default:
3143
3164
  const parsedBody = parsedOutput.body;
3165
+ const $metadata = deserializeMetadata(output);
3166
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3144
3167
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3145
- name: parsedBody.code || parsedBody.Code || errorCode,
3168
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3146
3169
  $fault: "client",
3147
- $metadata: deserializeMetadata(output),
3170
+ $metadata,
3148
3171
  });
3149
3172
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3150
3173
  }
@@ -3174,8 +3197,7 @@ const deserializeAws_restJson1InitiateDocumentVersionUploadCommandError = async
3174
3197
  body: await parseBody(output.body, context),
3175
3198
  };
3176
3199
  let response;
3177
- let errorCode = "UnknownError";
3178
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3200
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3179
3201
  switch (errorCode) {
3180
3202
  case "DraftUploadOutOfSyncException":
3181
3203
  case "com.amazonaws.workdocs#DraftUploadOutOfSyncException":
@@ -3212,10 +3234,12 @@ const deserializeAws_restJson1InitiateDocumentVersionUploadCommandError = async
3212
3234
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3213
3235
  default:
3214
3236
  const parsedBody = parsedOutput.body;
3237
+ const $metadata = deserializeMetadata(output);
3238
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3215
3239
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3216
- name: parsedBody.code || parsedBody.Code || errorCode,
3240
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3217
3241
  $fault: "client",
3218
- $metadata: deserializeMetadata(output),
3242
+ $metadata,
3219
3243
  });
3220
3244
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3221
3245
  }
@@ -3237,8 +3261,7 @@ const deserializeAws_restJson1RemoveAllResourcePermissionsCommandError = async (
3237
3261
  body: await parseBody(output.body, context),
3238
3262
  };
3239
3263
  let response;
3240
- let errorCode = "UnknownError";
3241
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3264
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3242
3265
  switch (errorCode) {
3243
3266
  case "FailedDependencyException":
3244
3267
  case "com.amazonaws.workdocs#FailedDependencyException":
@@ -3254,10 +3277,12 @@ const deserializeAws_restJson1RemoveAllResourcePermissionsCommandError = async (
3254
3277
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3255
3278
  default:
3256
3279
  const parsedBody = parsedOutput.body;
3280
+ const $metadata = deserializeMetadata(output);
3281
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3257
3282
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3258
- name: parsedBody.code || parsedBody.Code || errorCode,
3283
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3259
3284
  $fault: "client",
3260
- $metadata: deserializeMetadata(output),
3285
+ $metadata,
3261
3286
  });
3262
3287
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3263
3288
  }
@@ -3279,8 +3304,7 @@ const deserializeAws_restJson1RemoveResourcePermissionCommandError = async (outp
3279
3304
  body: await parseBody(output.body, context),
3280
3305
  };
3281
3306
  let response;
3282
- let errorCode = "UnknownError";
3283
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3307
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3284
3308
  switch (errorCode) {
3285
3309
  case "FailedDependencyException":
3286
3310
  case "com.amazonaws.workdocs#FailedDependencyException":
@@ -3296,10 +3320,12 @@ const deserializeAws_restJson1RemoveResourcePermissionCommandError = async (outp
3296
3320
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3297
3321
  default:
3298
3322
  const parsedBody = parsedOutput.body;
3323
+ const $metadata = deserializeMetadata(output);
3324
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3299
3325
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3300
- name: parsedBody.code || parsedBody.Code || errorCode,
3326
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3301
3327
  $fault: "client",
3302
- $metadata: deserializeMetadata(output),
3328
+ $metadata,
3303
3329
  });
3304
3330
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3305
3331
  }
@@ -3321,8 +3347,7 @@ const deserializeAws_restJson1UpdateDocumentCommandError = async (output, contex
3321
3347
  body: await parseBody(output.body, context),
3322
3348
  };
3323
3349
  let response;
3324
- let errorCode = "UnknownError";
3325
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3350
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3326
3351
  switch (errorCode) {
3327
3352
  case "ConcurrentModificationException":
3328
3353
  case "com.amazonaws.workdocs#ConcurrentModificationException":
@@ -3356,10 +3381,12 @@ const deserializeAws_restJson1UpdateDocumentCommandError = async (output, contex
3356
3381
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3357
3382
  default:
3358
3383
  const parsedBody = parsedOutput.body;
3384
+ const $metadata = deserializeMetadata(output);
3385
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3359
3386
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3360
- name: parsedBody.code || parsedBody.Code || errorCode,
3387
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3361
3388
  $fault: "client",
3362
- $metadata: deserializeMetadata(output),
3389
+ $metadata,
3363
3390
  });
3364
3391
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3365
3392
  }
@@ -3381,8 +3408,7 @@ const deserializeAws_restJson1UpdateDocumentVersionCommandError = async (output,
3381
3408
  body: await parseBody(output.body, context),
3382
3409
  };
3383
3410
  let response;
3384
- let errorCode = "UnknownError";
3385
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3411
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3386
3412
  switch (errorCode) {
3387
3413
  case "ConcurrentModificationException":
3388
3414
  case "com.amazonaws.workdocs#ConcurrentModificationException":
@@ -3410,10 +3436,12 @@ const deserializeAws_restJson1UpdateDocumentVersionCommandError = async (output,
3410
3436
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3411
3437
  default:
3412
3438
  const parsedBody = parsedOutput.body;
3439
+ const $metadata = deserializeMetadata(output);
3440
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3413
3441
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3414
- name: parsedBody.code || parsedBody.Code || errorCode,
3442
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3415
3443
  $fault: "client",
3416
- $metadata: deserializeMetadata(output),
3444
+ $metadata,
3417
3445
  });
3418
3446
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3419
3447
  }
@@ -3435,8 +3463,7 @@ const deserializeAws_restJson1UpdateFolderCommandError = async (output, context)
3435
3463
  body: await parseBody(output.body, context),
3436
3464
  };
3437
3465
  let response;
3438
- let errorCode = "UnknownError";
3439
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3466
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3440
3467
  switch (errorCode) {
3441
3468
  case "ConcurrentModificationException":
3442
3469
  case "com.amazonaws.workdocs#ConcurrentModificationException":
@@ -3470,10 +3497,12 @@ const deserializeAws_restJson1UpdateFolderCommandError = async (output, context)
3470
3497
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3471
3498
  default:
3472
3499
  const parsedBody = parsedOutput.body;
3500
+ const $metadata = deserializeMetadata(output);
3501
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3473
3502
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3474
- name: parsedBody.code || parsedBody.Code || errorCode,
3503
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3475
3504
  $fault: "client",
3476
- $metadata: deserializeMetadata(output),
3505
+ $metadata,
3477
3506
  });
3478
3507
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3479
3508
  }
@@ -3499,8 +3528,7 @@ const deserializeAws_restJson1UpdateUserCommandError = async (output, context) =
3499
3528
  body: await parseBody(output.body, context),
3500
3529
  };
3501
3530
  let response;
3502
- let errorCode = "UnknownError";
3503
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3531
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3504
3532
  switch (errorCode) {
3505
3533
  case "DeactivatingLastSystemUserException":
3506
3534
  case "com.amazonaws.workdocs#DeactivatingLastSystemUserException":
@@ -3528,10 +3556,12 @@ const deserializeAws_restJson1UpdateUserCommandError = async (output, context) =
3528
3556
  throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context);
3529
3557
  default:
3530
3558
  const parsedBody = parsedOutput.body;
3559
+ const $metadata = deserializeMetadata(output);
3560
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3531
3561
  response = new WorkDocsServiceException_1.WorkDocsServiceException({
3532
- name: parsedBody.code || parsedBody.Code || errorCode,
3562
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3533
3563
  $fault: "client",
3534
- $metadata: deserializeMetadata(output),
3564
+ $metadata,
3535
3565
  });
3536
3566
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3537
3567
  }
@@ -3858,8 +3888,8 @@ const serializeAws_restJson1CustomMetadataMap = (input, context) => {
3858
3888
  };
3859
3889
  const serializeAws_restJson1NotificationOptions = (input, context) => {
3860
3890
  return {
3861
- ...(input.EmailMessage !== undefined && input.EmailMessage !== null && { EmailMessage: input.EmailMessage }),
3862
- ...(input.SendEmail !== undefined && input.SendEmail !== null && { SendEmail: input.SendEmail }),
3891
+ ...(input.EmailMessage != null && { EmailMessage: input.EmailMessage }),
3892
+ ...(input.SendEmail != null && { SendEmail: input.SendEmail }),
3863
3893
  };
3864
3894
  };
3865
3895
  const serializeAws_restJson1SharedLabels = (input, context) => {
@@ -3874,9 +3904,9 @@ const serializeAws_restJson1SharedLabels = (input, context) => {
3874
3904
  };
3875
3905
  const serializeAws_restJson1SharePrincipal = (input, context) => {
3876
3906
  return {
3877
- ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }),
3878
- ...(input.Role !== undefined && input.Role !== null && { Role: input.Role }),
3879
- ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }),
3907
+ ...(input.Id != null && { Id: input.Id }),
3908
+ ...(input.Role != null && { Role: input.Role }),
3909
+ ...(input.Type != null && { Type: input.Type }),
3880
3910
  };
3881
3911
  };
3882
3912
  const serializeAws_restJson1SharePrincipalList = (input, context) => {
@@ -3891,43 +3921,34 @@ const serializeAws_restJson1SharePrincipalList = (input, context) => {
3891
3921
  };
3892
3922
  const serializeAws_restJson1StorageRuleType = (input, context) => {
3893
3923
  return {
3894
- ...(input.StorageAllocatedInBytes !== undefined &&
3895
- input.StorageAllocatedInBytes !== null && { StorageAllocatedInBytes: input.StorageAllocatedInBytes }),
3896
- ...(input.StorageType !== undefined && input.StorageType !== null && { StorageType: input.StorageType }),
3924
+ ...(input.StorageAllocatedInBytes != null && { StorageAllocatedInBytes: input.StorageAllocatedInBytes }),
3925
+ ...(input.StorageType != null && { StorageType: input.StorageType }),
3897
3926
  };
3898
3927
  };
3899
3928
  const deserializeAws_restJson1Activity = (output, context) => {
3900
3929
  return {
3901
- CommentMetadata: output.CommentMetadata !== undefined && output.CommentMetadata !== null
3930
+ CommentMetadata: output.CommentMetadata != null
3902
3931
  ? deserializeAws_restJson1CommentMetadata(output.CommentMetadata, context)
3903
3932
  : undefined,
3904
- Initiator: output.Initiator !== undefined && output.Initiator !== null
3905
- ? deserializeAws_restJson1UserMetadata(output.Initiator, context)
3906
- : undefined,
3933
+ Initiator: output.Initiator != null ? deserializeAws_restJson1UserMetadata(output.Initiator, context) : undefined,
3907
3934
  IsIndirectActivity: (0, smithy_client_1.expectBoolean)(output.IsIndirectActivity),
3908
3935
  OrganizationId: (0, smithy_client_1.expectString)(output.OrganizationId),
3909
- OriginalParent: output.OriginalParent !== undefined && output.OriginalParent !== null
3936
+ OriginalParent: output.OriginalParent != null
3910
3937
  ? deserializeAws_restJson1ResourceMetadata(output.OriginalParent, context)
3911
3938
  : undefined,
3912
- Participants: output.Participants !== undefined && output.Participants !== null
3913
- ? deserializeAws_restJson1Participants(output.Participants, context)
3914
- : undefined,
3915
- ResourceMetadata: output.ResourceMetadata !== undefined && output.ResourceMetadata !== null
3939
+ Participants: output.Participants != null ? deserializeAws_restJson1Participants(output.Participants, context) : undefined,
3940
+ ResourceMetadata: output.ResourceMetadata != null
3916
3941
  ? deserializeAws_restJson1ResourceMetadata(output.ResourceMetadata, context)
3917
3942
  : undefined,
3918
- TimeStamp: output.TimeStamp !== undefined && output.TimeStamp !== null
3919
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.TimeStamp)))
3920
- : undefined,
3943
+ TimeStamp: output.TimeStamp != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.TimeStamp))) : undefined,
3921
3944
  Type: (0, smithy_client_1.expectString)(output.Type),
3922
3945
  };
3923
3946
  };
3924
3947
  const deserializeAws_restJson1Comment = (output, context) => {
3925
3948
  return {
3926
3949
  CommentId: (0, smithy_client_1.expectString)(output.CommentId),
3927
- Contributor: output.Contributor !== undefined && output.Contributor !== null
3928
- ? deserializeAws_restJson1User(output.Contributor, context)
3929
- : undefined,
3930
- CreatedTimestamp: output.CreatedTimestamp !== undefined && output.CreatedTimestamp !== null
3950
+ Contributor: output.Contributor != null ? deserializeAws_restJson1User(output.Contributor, context) : undefined,
3951
+ CreatedTimestamp: output.CreatedTimestamp != null
3931
3952
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreatedTimestamp)))
3932
3953
  : undefined,
3933
3954
  ParentId: (0, smithy_client_1.expectString)(output.ParentId),
@@ -3953,10 +3974,8 @@ const deserializeAws_restJson1CommentMetadata = (output, context) => {
3953
3974
  return {
3954
3975
  CommentId: (0, smithy_client_1.expectString)(output.CommentId),
3955
3976
  CommentStatus: (0, smithy_client_1.expectString)(output.CommentStatus),
3956
- Contributor: output.Contributor !== undefined && output.Contributor !== null
3957
- ? deserializeAws_restJson1User(output.Contributor, context)
3958
- : undefined,
3959
- CreatedTimestamp: output.CreatedTimestamp !== undefined && output.CreatedTimestamp !== null
3977
+ Contributor: output.Contributor != null ? deserializeAws_restJson1User(output.Contributor, context) : undefined,
3978
+ CreatedTimestamp: output.CreatedTimestamp != null
3960
3979
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreatedTimestamp)))
3961
3980
  : undefined,
3962
3981
  RecipientId: (0, smithy_client_1.expectString)(output.RecipientId),
@@ -3975,18 +3994,16 @@ const deserializeAws_restJson1CustomMetadataMap = (output, context) => {
3975
3994
  };
3976
3995
  const deserializeAws_restJson1DocumentMetadata = (output, context) => {
3977
3996
  return {
3978
- CreatedTimestamp: output.CreatedTimestamp !== undefined && output.CreatedTimestamp !== null
3997
+ CreatedTimestamp: output.CreatedTimestamp != null
3979
3998
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreatedTimestamp)))
3980
3999
  : undefined,
3981
4000
  CreatorId: (0, smithy_client_1.expectString)(output.CreatorId),
3982
4001
  Id: (0, smithy_client_1.expectString)(output.Id),
3983
- Labels: output.Labels !== undefined && output.Labels !== null
3984
- ? deserializeAws_restJson1SharedLabels(output.Labels, context)
3985
- : undefined,
3986
- LatestVersionMetadata: output.LatestVersionMetadata !== undefined && output.LatestVersionMetadata !== null
4002
+ Labels: output.Labels != null ? deserializeAws_restJson1SharedLabels(output.Labels, context) : undefined,
4003
+ LatestVersionMetadata: output.LatestVersionMetadata != null
3987
4004
  ? deserializeAws_restJson1DocumentVersionMetadata(output.LatestVersionMetadata, context)
3988
4005
  : undefined,
3989
- ModifiedTimestamp: output.ModifiedTimestamp !== undefined && output.ModifiedTimestamp !== null
4006
+ ModifiedTimestamp: output.ModifiedTimestamp != null
3990
4007
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ModifiedTimestamp)))
3991
4008
  : undefined,
3992
4009
  ParentFolderId: (0, smithy_client_1.expectString)(output.ParentFolderId),
@@ -4028,31 +4045,27 @@ const deserializeAws_restJson1DocumentThumbnailUrlMap = (output, context) => {
4028
4045
  };
4029
4046
  const deserializeAws_restJson1DocumentVersionMetadata = (output, context) => {
4030
4047
  return {
4031
- ContentCreatedTimestamp: output.ContentCreatedTimestamp !== undefined && output.ContentCreatedTimestamp !== null
4048
+ ContentCreatedTimestamp: output.ContentCreatedTimestamp != null
4032
4049
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ContentCreatedTimestamp)))
4033
4050
  : undefined,
4034
- ContentModifiedTimestamp: output.ContentModifiedTimestamp !== undefined && output.ContentModifiedTimestamp !== null
4051
+ ContentModifiedTimestamp: output.ContentModifiedTimestamp != null
4035
4052
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ContentModifiedTimestamp)))
4036
4053
  : undefined,
4037
4054
  ContentType: (0, smithy_client_1.expectString)(output.ContentType),
4038
- CreatedTimestamp: output.CreatedTimestamp !== undefined && output.CreatedTimestamp !== null
4055
+ CreatedTimestamp: output.CreatedTimestamp != null
4039
4056
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreatedTimestamp)))
4040
4057
  : undefined,
4041
4058
  CreatorId: (0, smithy_client_1.expectString)(output.CreatorId),
4042
4059
  Id: (0, smithy_client_1.expectString)(output.Id),
4043
- ModifiedTimestamp: output.ModifiedTimestamp !== undefined && output.ModifiedTimestamp !== null
4060
+ ModifiedTimestamp: output.ModifiedTimestamp != null
4044
4061
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ModifiedTimestamp)))
4045
4062
  : undefined,
4046
4063
  Name: (0, smithy_client_1.expectString)(output.Name),
4047
4064
  Signature: (0, smithy_client_1.expectString)(output.Signature),
4048
4065
  Size: (0, smithy_client_1.expectLong)(output.Size),
4049
- Source: output.Source !== undefined && output.Source !== null
4050
- ? deserializeAws_restJson1DocumentSourceUrlMap(output.Source, context)
4051
- : undefined,
4066
+ Source: output.Source != null ? deserializeAws_restJson1DocumentSourceUrlMap(output.Source, context) : undefined,
4052
4067
  Status: (0, smithy_client_1.expectString)(output.Status),
4053
- Thumbnail: output.Thumbnail !== undefined && output.Thumbnail !== null
4054
- ? deserializeAws_restJson1DocumentThumbnailUrlMap(output.Thumbnail, context)
4055
- : undefined,
4068
+ Thumbnail: output.Thumbnail != null ? deserializeAws_restJson1DocumentThumbnailUrlMap(output.Thumbnail, context) : undefined,
4056
4069
  };
4057
4070
  };
4058
4071
  const deserializeAws_restJson1DocumentVersionMetadataList = (output, context) => {
@@ -4079,16 +4092,14 @@ const deserializeAws_restJson1EntityIdList = (output, context) => {
4079
4092
  };
4080
4093
  const deserializeAws_restJson1FolderMetadata = (output, context) => {
4081
4094
  return {
4082
- CreatedTimestamp: output.CreatedTimestamp !== undefined && output.CreatedTimestamp !== null
4095
+ CreatedTimestamp: output.CreatedTimestamp != null
4083
4096
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreatedTimestamp)))
4084
4097
  : undefined,
4085
4098
  CreatorId: (0, smithy_client_1.expectString)(output.CreatorId),
4086
4099
  Id: (0, smithy_client_1.expectString)(output.Id),
4087
- Labels: output.Labels !== undefined && output.Labels !== null
4088
- ? deserializeAws_restJson1SharedLabels(output.Labels, context)
4089
- : undefined,
4100
+ Labels: output.Labels != null ? deserializeAws_restJson1SharedLabels(output.Labels, context) : undefined,
4090
4101
  LatestVersionSize: (0, smithy_client_1.expectLong)(output.LatestVersionSize),
4091
- ModifiedTimestamp: output.ModifiedTimestamp !== undefined && output.ModifiedTimestamp !== null
4102
+ ModifiedTimestamp: output.ModifiedTimestamp != null
4092
4103
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ModifiedTimestamp)))
4093
4104
  : undefined,
4094
4105
  Name: (0, smithy_client_1.expectString)(output.Name),
@@ -4139,12 +4150,8 @@ const deserializeAws_restJson1OrganizationUserList = (output, context) => {
4139
4150
  };
4140
4151
  const deserializeAws_restJson1Participants = (output, context) => {
4141
4152
  return {
4142
- Groups: output.Groups !== undefined && output.Groups !== null
4143
- ? deserializeAws_restJson1GroupMetadataList(output.Groups, context)
4144
- : undefined,
4145
- Users: output.Users !== undefined && output.Users !== null
4146
- ? deserializeAws_restJson1UserMetadataList(output.Users, context)
4147
- : undefined,
4153
+ Groups: output.Groups != null ? deserializeAws_restJson1GroupMetadataList(output.Groups, context) : undefined,
4154
+ Users: output.Users != null ? deserializeAws_restJson1UserMetadataList(output.Users, context) : undefined,
4148
4155
  };
4149
4156
  };
4150
4157
  const deserializeAws_restJson1PermissionInfo = (output, context) => {
@@ -4167,9 +4174,7 @@ const deserializeAws_restJson1PermissionInfoList = (output, context) => {
4167
4174
  const deserializeAws_restJson1Principal = (output, context) => {
4168
4175
  return {
4169
4176
  Id: (0, smithy_client_1.expectString)(output.Id),
4170
- Roles: output.Roles !== undefined && output.Roles !== null
4171
- ? deserializeAws_restJson1PermissionInfoList(output.Roles, context)
4172
- : undefined,
4177
+ Roles: output.Roles != null ? deserializeAws_restJson1PermissionInfoList(output.Roles, context) : undefined,
4173
4178
  Type: (0, smithy_client_1.expectString)(output.Type),
4174
4179
  };
4175
4180
  };
@@ -4189,9 +4194,7 @@ const deserializeAws_restJson1ResourceMetadata = (output, context) => {
4189
4194
  Id: (0, smithy_client_1.expectString)(output.Id),
4190
4195
  Name: (0, smithy_client_1.expectString)(output.Name),
4191
4196
  OriginalName: (0, smithy_client_1.expectString)(output.OriginalName),
4192
- Owner: output.Owner !== undefined && output.Owner !== null
4193
- ? deserializeAws_restJson1UserMetadata(output.Owner, context)
4194
- : undefined,
4197
+ Owner: output.Owner != null ? deserializeAws_restJson1UserMetadata(output.Owner, context) : undefined,
4195
4198
  ParentId: (0, smithy_client_1.expectString)(output.ParentId),
4196
4199
  Type: (0, smithy_client_1.expectString)(output.Type),
4197
4200
  VersionId: (0, smithy_client_1.expectString)(output.VersionId),
@@ -4199,7 +4202,7 @@ const deserializeAws_restJson1ResourceMetadata = (output, context) => {
4199
4202
  };
4200
4203
  const deserializeAws_restJson1ResourcePath = (output, context) => {
4201
4204
  return {
4202
- Components: output.Components !== undefined && output.Components !== null
4205
+ Components: output.Components != null
4203
4206
  ? deserializeAws_restJson1ResourcePathComponentList(output.Components, context)
4204
4207
  : undefined,
4205
4208
  };
@@ -4290,31 +4293,27 @@ const deserializeAws_restJson1SubscriptionList = (output, context) => {
4290
4293
  };
4291
4294
  const deserializeAws_restJson1UploadMetadata = (output, context) => {
4292
4295
  return {
4293
- SignedHeaders: output.SignedHeaders !== undefined && output.SignedHeaders !== null
4294
- ? deserializeAws_restJson1SignedHeaderMap(output.SignedHeaders, context)
4295
- : undefined,
4296
+ SignedHeaders: output.SignedHeaders != null ? deserializeAws_restJson1SignedHeaderMap(output.SignedHeaders, context) : undefined,
4296
4297
  UploadUrl: (0, smithy_client_1.expectString)(output.UploadUrl),
4297
4298
  };
4298
4299
  };
4299
4300
  const deserializeAws_restJson1User = (output, context) => {
4300
4301
  return {
4301
- CreatedTimestamp: output.CreatedTimestamp !== undefined && output.CreatedTimestamp !== null
4302
+ CreatedTimestamp: output.CreatedTimestamp != null
4302
4303
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreatedTimestamp)))
4303
4304
  : undefined,
4304
4305
  EmailAddress: (0, smithy_client_1.expectString)(output.EmailAddress),
4305
4306
  GivenName: (0, smithy_client_1.expectString)(output.GivenName),
4306
4307
  Id: (0, smithy_client_1.expectString)(output.Id),
4307
4308
  Locale: (0, smithy_client_1.expectString)(output.Locale),
4308
- ModifiedTimestamp: output.ModifiedTimestamp !== undefined && output.ModifiedTimestamp !== null
4309
+ ModifiedTimestamp: output.ModifiedTimestamp != null
4309
4310
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ModifiedTimestamp)))
4310
4311
  : undefined,
4311
4312
  OrganizationId: (0, smithy_client_1.expectString)(output.OrganizationId),
4312
4313
  RecycleBinFolderId: (0, smithy_client_1.expectString)(output.RecycleBinFolderId),
4313
4314
  RootFolderId: (0, smithy_client_1.expectString)(output.RootFolderId),
4314
4315
  Status: (0, smithy_client_1.expectString)(output.Status),
4315
- Storage: output.Storage !== undefined && output.Storage !== null
4316
- ? deserializeAws_restJson1UserStorageMetadata(output.Storage, context)
4317
- : undefined,
4316
+ Storage: output.Storage != null ? deserializeAws_restJson1UserStorageMetadata(output.Storage, context) : undefined,
4318
4317
  Surname: (0, smithy_client_1.expectString)(output.Surname),
4319
4318
  TimeZoneId: (0, smithy_client_1.expectString)(output.TimeZoneId),
4320
4319
  Type: (0, smithy_client_1.expectString)(output.Type),
@@ -4354,9 +4353,7 @@ const deserializeAws_restJson1UserMetadataList = (output, context) => {
4354
4353
  };
4355
4354
  const deserializeAws_restJson1UserStorageMetadata = (output, context) => {
4356
4355
  return {
4357
- StorageRule: output.StorageRule !== undefined && output.StorageRule !== null
4358
- ? deserializeAws_restJson1StorageRuleType(output.StorageRule, context)
4359
- : undefined,
4356
+ StorageRule: output.StorageRule != null ? deserializeAws_restJson1StorageRuleType(output.StorageRule, context) : undefined,
4360
4357
  StorageUtilizedInBytes: (0, smithy_client_1.expectLong)(output.StorageUtilizedInBytes),
4361
4358
  };
4362
4359
  };
@@ -4409,5 +4406,4 @@ const loadRestJsonErrorCode = (output, data) => {
4409
4406
  if (data["__type"] !== undefined) {
4410
4407
  return sanitizeErrorCode(data["__type"]);
4411
4408
  }
4412
- return "";
4413
4409
  };