@aws-sdk/client-cognito-sync 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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.128.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.127.0...v3.128.0) (2022-07-12)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-cognito-sync
9
+
10
+
11
+
12
+
13
+
14
+ # [3.127.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.126.0...v3.127.0) (2022-07-11)
15
+
16
+ **Note:** Version bump only for package @aws-sdk/client-cognito-sync
17
+
18
+
19
+
20
+
21
+
22
+ # [3.121.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.120.0...v3.121.0) (2022-06-30)
23
+
24
+
25
+ ### Features
26
+
27
+ * **clients:** fallback to status code for unmodeled errors ([#3752](https://github.com/aws/aws-sdk-js-v3/issues/3752)) ([49bcc4f](https://github.com/aws/aws-sdk-js-v3/commit/49bcc4f153e890e798a8e82fd5fc397b2dcc449f))
28
+
29
+
30
+
31
+
32
+
6
33
  ## [3.118.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.118.0...v3.118.1) (2022-06-27)
7
34
 
8
35
  **Note:** Version bump only for package @aws-sdk/client-cognito-sync
@@ -415,8 +415,8 @@ const serializeAws_restJson1RegisterDeviceCommand = async (input, context) => {
415
415
  }
416
416
  let body;
417
417
  body = JSON.stringify({
418
- ...(input.Platform !== undefined && input.Platform !== null && { Platform: input.Platform }),
419
- ...(input.Token !== undefined && input.Token !== null && { Token: input.Token }),
418
+ ...(input.Platform != null && { Platform: input.Platform }),
419
+ ...(input.Token != null && { Token: input.Token }),
420
420
  });
421
421
  return new protocol_http_1.HttpRequest({
422
422
  protocol,
@@ -447,8 +447,7 @@ const serializeAws_restJson1SetCognitoEventsCommand = async (input, context) =>
447
447
  }
448
448
  let body;
449
449
  body = JSON.stringify({
450
- ...(input.Events !== undefined &&
451
- input.Events !== null && { Events: serializeAws_restJson1Events(input.Events, context) }),
450
+ ...(input.Events != null && { Events: serializeAws_restJson1Events(input.Events, context) }),
452
451
  });
453
452
  return new protocol_http_1.HttpRequest({
454
453
  protocol,
@@ -480,12 +479,10 @@ const serializeAws_restJson1SetIdentityPoolConfigurationCommand = async (input,
480
479
  }
481
480
  let body;
482
481
  body = JSON.stringify({
483
- ...(input.CognitoStreams !== undefined &&
484
- input.CognitoStreams !== null && {
482
+ ...(input.CognitoStreams != null && {
485
483
  CognitoStreams: serializeAws_restJson1CognitoStreams(input.CognitoStreams, context),
486
484
  }),
487
- ...(input.PushSync !== undefined &&
488
- input.PushSync !== null && { PushSync: serializeAws_restJson1PushSync(input.PushSync, context) }),
485
+ ...(input.PushSync != null && { PushSync: serializeAws_restJson1PushSync(input.PushSync, context) }),
489
486
  });
490
487
  return new protocol_http_1.HttpRequest({
491
488
  protocol,
@@ -652,13 +649,11 @@ const serializeAws_restJson1UpdateRecordsCommand = async (input, context) => {
652
649
  }
653
650
  let body;
654
651
  body = JSON.stringify({
655
- ...(input.DeviceId !== undefined && input.DeviceId !== null && { DeviceId: input.DeviceId }),
656
- ...(input.RecordPatches !== undefined &&
657
- input.RecordPatches !== null && {
652
+ ...(input.DeviceId != null && { DeviceId: input.DeviceId }),
653
+ ...(input.RecordPatches != null && {
658
654
  RecordPatches: serializeAws_restJson1RecordPatchList(input.RecordPatches, context),
659
655
  }),
660
- ...(input.SyncSessionToken !== undefined &&
661
- input.SyncSessionToken !== null && { SyncSessionToken: input.SyncSessionToken }),
656
+ ...(input.SyncSessionToken != null && { SyncSessionToken: input.SyncSessionToken }),
662
657
  });
663
658
  return new protocol_http_1.HttpRequest({
664
659
  protocol,
@@ -692,8 +687,7 @@ const deserializeAws_restJson1BulkPublishCommandError = async (output, context)
692
687
  body: await parseBody(output.body, context),
693
688
  };
694
689
  let response;
695
- let errorCode = "UnknownError";
696
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
697
691
  switch (errorCode) {
698
692
  case "AlreadyStreamedException":
699
693
  case "com.amazonaws.cognitosync#AlreadyStreamedException":
@@ -715,10 +709,12 @@ const deserializeAws_restJson1BulkPublishCommandError = async (output, context)
715
709
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
716
710
  default:
717
711
  const parsedBody = parsedOutput.body;
712
+ const $metadata = deserializeMetadata(output);
713
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
718
714
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
719
- name: parsedBody.code || parsedBody.Code || errorCode,
715
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
720
716
  $fault: "client",
721
- $metadata: deserializeMetadata(output),
717
+ $metadata,
722
718
  });
723
719
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
724
720
  }
@@ -744,8 +740,7 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async (output, context
744
740
  body: await parseBody(output.body, context),
745
741
  };
746
742
  let response;
747
- let errorCode = "UnknownError";
748
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
743
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
749
744
  switch (errorCode) {
750
745
  case "InternalErrorException":
751
746
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -767,10 +762,12 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async (output, context
767
762
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
768
763
  default:
769
764
  const parsedBody = parsedOutput.body;
765
+ const $metadata = deserializeMetadata(output);
766
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
770
767
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
771
- name: parsedBody.code || parsedBody.Code || errorCode,
768
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
772
769
  $fault: "client",
773
- $metadata: deserializeMetadata(output),
770
+ $metadata,
774
771
  });
775
772
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
776
773
  }
@@ -796,8 +793,7 @@ const deserializeAws_restJson1DescribeDatasetCommandError = async (output, conte
796
793
  body: await parseBody(output.body, context),
797
794
  };
798
795
  let response;
799
- let errorCode = "UnknownError";
800
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
796
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
801
797
  switch (errorCode) {
802
798
  case "InternalErrorException":
803
799
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -816,10 +812,12 @@ const deserializeAws_restJson1DescribeDatasetCommandError = async (output, conte
816
812
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
817
813
  default:
818
814
  const parsedBody = parsedOutput.body;
815
+ const $metadata = deserializeMetadata(output);
816
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
819
817
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
820
- name: parsedBody.code || parsedBody.Code || errorCode,
818
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
821
819
  $fault: "client",
822
- $metadata: deserializeMetadata(output),
820
+ $metadata,
823
821
  });
824
822
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
825
823
  }
@@ -845,8 +843,7 @@ const deserializeAws_restJson1DescribeIdentityPoolUsageCommandError = async (out
845
843
  body: await parseBody(output.body, context),
846
844
  };
847
845
  let response;
848
- let errorCode = "UnknownError";
849
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
846
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
850
847
  switch (errorCode) {
851
848
  case "InternalErrorException":
852
849
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -865,10 +862,12 @@ const deserializeAws_restJson1DescribeIdentityPoolUsageCommandError = async (out
865
862
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
866
863
  default:
867
864
  const parsedBody = parsedOutput.body;
865
+ const $metadata = deserializeMetadata(output);
866
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
868
867
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
869
- name: parsedBody.code || parsedBody.Code || errorCode,
868
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
870
869
  $fault: "client",
871
- $metadata: deserializeMetadata(output),
870
+ $metadata,
872
871
  });
873
872
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
874
873
  }
@@ -894,8 +893,7 @@ const deserializeAws_restJson1DescribeIdentityUsageCommandError = async (output,
894
893
  body: await parseBody(output.body, context),
895
894
  };
896
895
  let response;
897
- let errorCode = "UnknownError";
898
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
896
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
899
897
  switch (errorCode) {
900
898
  case "InternalErrorException":
901
899
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -914,10 +912,12 @@ const deserializeAws_restJson1DescribeIdentityUsageCommandError = async (output,
914
912
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
915
913
  default:
916
914
  const parsedBody = parsedOutput.body;
915
+ const $metadata = deserializeMetadata(output);
916
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
917
917
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
918
- name: parsedBody.code || parsedBody.Code || errorCode,
918
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
919
919
  $fault: "client",
920
- $metadata: deserializeMetadata(output),
920
+ $metadata,
921
921
  });
922
922
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
923
923
  }
@@ -959,8 +959,7 @@ const deserializeAws_restJson1GetBulkPublishDetailsCommandError = async (output,
959
959
  body: await parseBody(output.body, context),
960
960
  };
961
961
  let response;
962
- let errorCode = "UnknownError";
963
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
962
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
964
963
  switch (errorCode) {
965
964
  case "InternalErrorException":
966
965
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -976,10 +975,12 @@ const deserializeAws_restJson1GetBulkPublishDetailsCommandError = async (output,
976
975
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
977
976
  default:
978
977
  const parsedBody = parsedOutput.body;
978
+ const $metadata = deserializeMetadata(output);
979
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
979
980
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
980
- name: parsedBody.code || parsedBody.Code || errorCode,
981
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
981
982
  $fault: "client",
982
- $metadata: deserializeMetadata(output),
983
+ $metadata,
983
984
  });
984
985
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
985
986
  }
@@ -1005,8 +1006,7 @@ const deserializeAws_restJson1GetCognitoEventsCommandError = async (output, cont
1005
1006
  body: await parseBody(output.body, context),
1006
1007
  };
1007
1008
  let response;
1008
- let errorCode = "UnknownError";
1009
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1009
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1010
1010
  switch (errorCode) {
1011
1011
  case "InternalErrorException":
1012
1012
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1025,10 +1025,12 @@ const deserializeAws_restJson1GetCognitoEventsCommandError = async (output, cont
1025
1025
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1026
1026
  default:
1027
1027
  const parsedBody = parsedOutput.body;
1028
+ const $metadata = deserializeMetadata(output);
1029
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1028
1030
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1029
- name: parsedBody.code || parsedBody.Code || errorCode,
1031
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1030
1032
  $fault: "client",
1031
- $metadata: deserializeMetadata(output),
1033
+ $metadata,
1032
1034
  });
1033
1035
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1034
1036
  }
@@ -1062,8 +1064,7 @@ const deserializeAws_restJson1GetIdentityPoolConfigurationCommandError = async (
1062
1064
  body: await parseBody(output.body, context),
1063
1065
  };
1064
1066
  let response;
1065
- let errorCode = "UnknownError";
1066
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1067
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1067
1068
  switch (errorCode) {
1068
1069
  case "InternalErrorException":
1069
1070
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1082,10 +1083,12 @@ const deserializeAws_restJson1GetIdentityPoolConfigurationCommandError = async (
1082
1083
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1083
1084
  default:
1084
1085
  const parsedBody = parsedOutput.body;
1086
+ const $metadata = deserializeMetadata(output);
1087
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1085
1088
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1086
- name: parsedBody.code || parsedBody.Code || errorCode,
1089
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1087
1090
  $fault: "client",
1088
- $metadata: deserializeMetadata(output),
1091
+ $metadata,
1089
1092
  });
1090
1093
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1091
1094
  }
@@ -1119,8 +1122,7 @@ const deserializeAws_restJson1ListDatasetsCommandError = async (output, context)
1119
1122
  body: await parseBody(output.body, context),
1120
1123
  };
1121
1124
  let response;
1122
- let errorCode = "UnknownError";
1123
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1125
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1124
1126
  switch (errorCode) {
1125
1127
  case "InternalErrorException":
1126
1128
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1136,10 +1138,12 @@ const deserializeAws_restJson1ListDatasetsCommandError = async (output, context)
1136
1138
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1137
1139
  default:
1138
1140
  const parsedBody = parsedOutput.body;
1141
+ const $metadata = deserializeMetadata(output);
1142
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1139
1143
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1140
- name: parsedBody.code || parsedBody.Code || errorCode,
1144
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1141
1145
  $fault: "client",
1142
- $metadata: deserializeMetadata(output),
1146
+ $metadata,
1143
1147
  });
1144
1148
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1145
1149
  }
@@ -1177,8 +1181,7 @@ const deserializeAws_restJson1ListIdentityPoolUsageCommandError = async (output,
1177
1181
  body: await parseBody(output.body, context),
1178
1182
  };
1179
1183
  let response;
1180
- let errorCode = "UnknownError";
1181
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1184
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1182
1185
  switch (errorCode) {
1183
1186
  case "InternalErrorException":
1184
1187
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1194,10 +1197,12 @@ const deserializeAws_restJson1ListIdentityPoolUsageCommandError = async (output,
1194
1197
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1195
1198
  default:
1196
1199
  const parsedBody = parsedOutput.body;
1200
+ const $metadata = deserializeMetadata(output);
1201
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1197
1202
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1198
- name: parsedBody.code || parsedBody.Code || errorCode,
1203
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1199
1204
  $fault: "client",
1200
- $metadata: deserializeMetadata(output),
1205
+ $metadata,
1201
1206
  });
1202
1207
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1203
1208
  }
@@ -1255,8 +1260,7 @@ const deserializeAws_restJson1ListRecordsCommandError = async (output, context)
1255
1260
  body: await parseBody(output.body, context),
1256
1261
  };
1257
1262
  let response;
1258
- let errorCode = "UnknownError";
1259
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1263
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1260
1264
  switch (errorCode) {
1261
1265
  case "InternalErrorException":
1262
1266
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1272,10 +1276,12 @@ const deserializeAws_restJson1ListRecordsCommandError = async (output, context)
1272
1276
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1273
1277
  default:
1274
1278
  const parsedBody = parsedOutput.body;
1279
+ const $metadata = deserializeMetadata(output);
1280
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1275
1281
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1276
- name: parsedBody.code || parsedBody.Code || errorCode,
1282
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1277
1283
  $fault: "client",
1278
- $metadata: deserializeMetadata(output),
1284
+ $metadata,
1279
1285
  });
1280
1286
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1281
1287
  }
@@ -1301,8 +1307,7 @@ const deserializeAws_restJson1RegisterDeviceCommandError = async (output, contex
1301
1307
  body: await parseBody(output.body, context),
1302
1308
  };
1303
1309
  let response;
1304
- let errorCode = "UnknownError";
1305
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1310
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1306
1311
  switch (errorCode) {
1307
1312
  case "InternalErrorException":
1308
1313
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1324,10 +1329,12 @@ const deserializeAws_restJson1RegisterDeviceCommandError = async (output, contex
1324
1329
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1325
1330
  default:
1326
1331
  const parsedBody = parsedOutput.body;
1332
+ const $metadata = deserializeMetadata(output);
1333
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1327
1334
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1328
- name: parsedBody.code || parsedBody.Code || errorCode,
1335
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1329
1336
  $fault: "client",
1330
- $metadata: deserializeMetadata(output),
1337
+ $metadata,
1331
1338
  });
1332
1339
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1333
1340
  }
@@ -1349,8 +1356,7 @@ const deserializeAws_restJson1SetCognitoEventsCommandError = async (output, cont
1349
1356
  body: await parseBody(output.body, context),
1350
1357
  };
1351
1358
  let response;
1352
- let errorCode = "UnknownError";
1353
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1359
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1354
1360
  switch (errorCode) {
1355
1361
  case "InternalErrorException":
1356
1362
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1369,10 +1375,12 @@ const deserializeAws_restJson1SetCognitoEventsCommandError = async (output, cont
1369
1375
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1370
1376
  default:
1371
1377
  const parsedBody = parsedOutput.body;
1378
+ const $metadata = deserializeMetadata(output);
1379
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1372
1380
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1373
- name: parsedBody.code || parsedBody.Code || errorCode,
1381
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1374
1382
  $fault: "client",
1375
- $metadata: deserializeMetadata(output),
1383
+ $metadata,
1376
1384
  });
1377
1385
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1378
1386
  }
@@ -1406,8 +1414,7 @@ const deserializeAws_restJson1SetIdentityPoolConfigurationCommandError = async (
1406
1414
  body: await parseBody(output.body, context),
1407
1415
  };
1408
1416
  let response;
1409
- let errorCode = "UnknownError";
1410
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1417
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1411
1418
  switch (errorCode) {
1412
1419
  case "ConcurrentModificationException":
1413
1420
  case "com.amazonaws.cognitosync#ConcurrentModificationException":
@@ -1429,10 +1436,12 @@ const deserializeAws_restJson1SetIdentityPoolConfigurationCommandError = async (
1429
1436
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1430
1437
  default:
1431
1438
  const parsedBody = parsedOutput.body;
1439
+ const $metadata = deserializeMetadata(output);
1440
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1432
1441
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1433
- name: parsedBody.code || parsedBody.Code || errorCode,
1442
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1434
1443
  $fault: "client",
1435
- $metadata: deserializeMetadata(output),
1444
+ $metadata,
1436
1445
  });
1437
1446
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1438
1447
  }
@@ -1454,8 +1463,7 @@ const deserializeAws_restJson1SubscribeToDatasetCommandError = async (output, co
1454
1463
  body: await parseBody(output.body, context),
1455
1464
  };
1456
1465
  let response;
1457
- let errorCode = "UnknownError";
1458
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1466
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1459
1467
  switch (errorCode) {
1460
1468
  case "InternalErrorException":
1461
1469
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1477,10 +1485,12 @@ const deserializeAws_restJson1SubscribeToDatasetCommandError = async (output, co
1477
1485
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1478
1486
  default:
1479
1487
  const parsedBody = parsedOutput.body;
1488
+ const $metadata = deserializeMetadata(output);
1489
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1480
1490
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1481
- name: parsedBody.code || parsedBody.Code || errorCode,
1491
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1482
1492
  $fault: "client",
1483
- $metadata: deserializeMetadata(output),
1493
+ $metadata,
1484
1494
  });
1485
1495
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1486
1496
  }
@@ -1502,8 +1512,7 @@ const deserializeAws_restJson1UnsubscribeFromDatasetCommandError = async (output
1502
1512
  body: await parseBody(output.body, context),
1503
1513
  };
1504
1514
  let response;
1505
- let errorCode = "UnknownError";
1506
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1515
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1507
1516
  switch (errorCode) {
1508
1517
  case "InternalErrorException":
1509
1518
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1525,10 +1534,12 @@ const deserializeAws_restJson1UnsubscribeFromDatasetCommandError = async (output
1525
1534
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1526
1535
  default:
1527
1536
  const parsedBody = parsedOutput.body;
1537
+ const $metadata = deserializeMetadata(output);
1538
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1528
1539
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1529
- name: parsedBody.code || parsedBody.Code || errorCode,
1540
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1530
1541
  $fault: "client",
1531
- $metadata: deserializeMetadata(output),
1542
+ $metadata,
1532
1543
  });
1533
1544
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1534
1545
  }
@@ -1554,8 +1565,7 @@ const deserializeAws_restJson1UpdateRecordsCommandError = async (output, context
1554
1565
  body: await parseBody(output.body, context),
1555
1566
  };
1556
1567
  let response;
1557
- let errorCode = "UnknownError";
1558
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1568
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1559
1569
  switch (errorCode) {
1560
1570
  case "InternalErrorException":
1561
1571
  case "com.amazonaws.cognitosync#InternalErrorException":
@@ -1586,10 +1596,12 @@ const deserializeAws_restJson1UpdateRecordsCommandError = async (output, context
1586
1596
  throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1587
1597
  default:
1588
1598
  const parsedBody = parsedOutput.body;
1599
+ const $metadata = deserializeMetadata(output);
1600
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1589
1601
  response = new CognitoSyncServiceException_1.CognitoSyncServiceException({
1590
- name: parsedBody.code || parsedBody.Code || errorCode,
1602
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1591
1603
  $fault: "client",
1592
- $metadata: deserializeMetadata(output),
1604
+ $metadata,
1593
1605
  });
1594
1606
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1595
1607
  }
@@ -1762,10 +1774,9 @@ const serializeAws_restJson1ApplicationArnList = (input, context) => {
1762
1774
  };
1763
1775
  const serializeAws_restJson1CognitoStreams = (input, context) => {
1764
1776
  return {
1765
- ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }),
1766
- ...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }),
1767
- ...(input.StreamingStatus !== undefined &&
1768
- input.StreamingStatus !== null && { StreamingStatus: input.StreamingStatus }),
1777
+ ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
1778
+ ...(input.StreamName != null && { StreamName: input.StreamName }),
1779
+ ...(input.StreamingStatus != null && { StreamingStatus: input.StreamingStatus }),
1769
1780
  };
1770
1781
  };
1771
1782
  const serializeAws_restJson1Events = (input, context) => {
@@ -1781,23 +1792,21 @@ const serializeAws_restJson1Events = (input, context) => {
1781
1792
  };
1782
1793
  const serializeAws_restJson1PushSync = (input, context) => {
1783
1794
  return {
1784
- ...(input.ApplicationArns !== undefined &&
1785
- input.ApplicationArns !== null && {
1795
+ ...(input.ApplicationArns != null && {
1786
1796
  ApplicationArns: serializeAws_restJson1ApplicationArnList(input.ApplicationArns, context),
1787
1797
  }),
1788
- ...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }),
1798
+ ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
1789
1799
  };
1790
1800
  };
1791
1801
  const serializeAws_restJson1RecordPatch = (input, context) => {
1792
1802
  return {
1793
- ...(input.DeviceLastModifiedDate !== undefined &&
1794
- input.DeviceLastModifiedDate !== null && {
1803
+ ...(input.DeviceLastModifiedDate != null && {
1795
1804
  DeviceLastModifiedDate: Math.round(input.DeviceLastModifiedDate.getTime() / 1000),
1796
1805
  }),
1797
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
1798
- ...(input.Op !== undefined && input.Op !== null && { Op: input.Op }),
1799
- ...(input.SyncCount !== undefined && input.SyncCount !== null && { SyncCount: input.SyncCount }),
1800
- ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }),
1806
+ ...(input.Key != null && { Key: input.Key }),
1807
+ ...(input.Op != null && { Op: input.Op }),
1808
+ ...(input.SyncCount != null && { SyncCount: input.SyncCount }),
1809
+ ...(input.Value != null && { Value: input.Value }),
1801
1810
  };
1802
1811
  };
1803
1812
  const serializeAws_restJson1RecordPatchList = (input, context) => {
@@ -1830,14 +1839,14 @@ const deserializeAws_restJson1CognitoStreams = (output, context) => {
1830
1839
  };
1831
1840
  const deserializeAws_restJson1Dataset = (output, context) => {
1832
1841
  return {
1833
- CreationDate: output.CreationDate !== undefined && output.CreationDate !== null
1842
+ CreationDate: output.CreationDate != null
1834
1843
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationDate)))
1835
1844
  : undefined,
1836
1845
  DataStorage: (0, smithy_client_1.expectLong)(output.DataStorage),
1837
1846
  DatasetName: (0, smithy_client_1.expectString)(output.DatasetName),
1838
1847
  IdentityId: (0, smithy_client_1.expectString)(output.IdentityId),
1839
1848
  LastModifiedBy: (0, smithy_client_1.expectString)(output.LastModifiedBy),
1840
- LastModifiedDate: output.LastModifiedDate !== undefined && output.LastModifiedDate !== null
1849
+ LastModifiedDate: output.LastModifiedDate != null
1841
1850
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModifiedDate)))
1842
1851
  : undefined,
1843
1852
  NumRecords: (0, smithy_client_1.expectLong)(output.NumRecords),
@@ -1869,7 +1878,7 @@ const deserializeAws_restJson1IdentityPoolUsage = (output, context) => {
1869
1878
  return {
1870
1879
  DataStorage: (0, smithy_client_1.expectLong)(output.DataStorage),
1871
1880
  IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId),
1872
- LastModifiedDate: output.LastModifiedDate !== undefined && output.LastModifiedDate !== null
1881
+ LastModifiedDate: output.LastModifiedDate != null
1873
1882
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModifiedDate)))
1874
1883
  : undefined,
1875
1884
  SyncSessionsCount: (0, smithy_client_1.expectLong)(output.SyncSessionsCount),
@@ -1892,7 +1901,7 @@ const deserializeAws_restJson1IdentityUsage = (output, context) => {
1892
1901
  DatasetCount: (0, smithy_client_1.expectInt32)(output.DatasetCount),
1893
1902
  IdentityId: (0, smithy_client_1.expectString)(output.IdentityId),
1894
1903
  IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId),
1895
- LastModifiedDate: output.LastModifiedDate !== undefined && output.LastModifiedDate !== null
1904
+ LastModifiedDate: output.LastModifiedDate != null
1896
1905
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModifiedDate)))
1897
1906
  : undefined,
1898
1907
  };
@@ -1910,7 +1919,7 @@ const deserializeAws_restJson1MergedDatasetNameList = (output, context) => {
1910
1919
  };
1911
1920
  const deserializeAws_restJson1PushSync = (output, context) => {
1912
1921
  return {
1913
- ApplicationArns: output.ApplicationArns !== undefined && output.ApplicationArns !== null
1922
+ ApplicationArns: output.ApplicationArns != null
1914
1923
  ? deserializeAws_restJson1ApplicationArnList(output.ApplicationArns, context)
1915
1924
  : undefined,
1916
1925
  RoleArn: (0, smithy_client_1.expectString)(output.RoleArn),
@@ -1918,12 +1927,12 @@ const deserializeAws_restJson1PushSync = (output, context) => {
1918
1927
  };
1919
1928
  const deserializeAws_restJson1_Record = (output, context) => {
1920
1929
  return {
1921
- DeviceLastModifiedDate: output.DeviceLastModifiedDate !== undefined && output.DeviceLastModifiedDate !== null
1930
+ DeviceLastModifiedDate: output.DeviceLastModifiedDate != null
1922
1931
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.DeviceLastModifiedDate)))
1923
1932
  : undefined,
1924
1933
  Key: (0, smithy_client_1.expectString)(output.Key),
1925
1934
  LastModifiedBy: (0, smithy_client_1.expectString)(output.LastModifiedBy),
1926
- LastModifiedDate: output.LastModifiedDate !== undefined && output.LastModifiedDate !== null
1935
+ LastModifiedDate: output.LastModifiedDate != null
1927
1936
  ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModifiedDate)))
1928
1937
  : undefined,
1929
1938
  SyncCount: (0, smithy_client_1.expectLong)(output.SyncCount),
@@ -1990,5 +1999,4 @@ const loadRestJsonErrorCode = (output, data) => {
1990
1999
  if (data["__type"] !== undefined) {
1991
2000
  return sanitizeErrorCode(data["__type"]);
1992
2001
  }
1993
- return "";
1994
2002
  };