@aws-sdk/client-cognito-sync 3.312.0 → 3.315.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.
@@ -159,7 +159,7 @@ const se_ListDatasetsCommand = async (input, context) => {
159
159
  "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets";
160
160
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
161
161
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IdentityId", () => input.IdentityId, "{IdentityId}", false);
162
- const query = map({
162
+ const query = (0, smithy_client_1.map)({
163
163
  nextToken: [, input.NextToken],
164
164
  maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
165
165
  });
@@ -180,7 +180,7 @@ const se_ListIdentityPoolUsageCommand = async (input, context) => {
180
180
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
181
181
  const headers = {};
182
182
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/identitypools";
183
- const query = map({
183
+ const query = (0, smithy_client_1.map)({
184
184
  nextToken: [, input.NextToken],
185
185
  maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
186
186
  });
@@ -205,7 +205,7 @@ const se_ListRecordsCommand = async (input, context) => {
205
205
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
206
206
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IdentityId", () => input.IdentityId, "{IdentityId}", false);
207
207
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DatasetName", () => input.DatasetName, "{DatasetName}", false);
208
- const query = map({
208
+ const query = (0, smithy_client_1.map)({
209
209
  lastSyncCount: [() => input.LastSyncCount !== void 0, () => input.LastSyncCount.toString()],
210
210
  nextToken: [, input.NextToken],
211
211
  maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
@@ -234,10 +234,10 @@ const se_RegisterDeviceCommand = async (input, context) => {
234
234
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
235
235
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IdentityId", () => input.IdentityId, "{IdentityId}", false);
236
236
  let body;
237
- body = JSON.stringify({
238
- ...(input.Platform != null && { Platform: input.Platform }),
239
- ...(input.Token != null && { Token: input.Token }),
240
- });
237
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
238
+ Platform: [],
239
+ Token: [],
240
+ }));
241
241
  return new protocol_http_1.HttpRequest({
242
242
  protocol,
243
243
  hostname,
@@ -257,9 +257,9 @@ const se_SetCognitoEventsCommand = async (input, context) => {
257
257
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/identitypools/{IdentityPoolId}/events";
258
258
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
259
259
  let body;
260
- body = JSON.stringify({
261
- ...(input.Events != null && { Events: se_Events(input.Events, context) }),
262
- });
260
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
261
+ Events: (_) => (0, smithy_client_1._json)(_),
262
+ }));
263
263
  return new protocol_http_1.HttpRequest({
264
264
  protocol,
265
265
  hostname,
@@ -280,10 +280,10 @@ const se_SetIdentityPoolConfigurationCommand = async (input, context) => {
280
280
  "/identitypools/{IdentityPoolId}/configuration";
281
281
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
282
282
  let body;
283
- body = JSON.stringify({
284
- ...(input.CognitoStreams != null && { CognitoStreams: se_CognitoStreams(input.CognitoStreams, context) }),
285
- ...(input.PushSync != null && { PushSync: se_PushSync(input.PushSync, context) }),
286
- });
283
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
284
+ CognitoStreams: (_) => (0, smithy_client_1._json)(_),
285
+ PushSync: (_) => (0, smithy_client_1._json)(_),
286
+ }));
287
287
  return new protocol_http_1.HttpRequest({
288
288
  protocol,
289
289
  hostname,
@@ -339,7 +339,7 @@ const se_UnsubscribeFromDatasetCommand = async (input, context) => {
339
339
  exports.se_UnsubscribeFromDatasetCommand = se_UnsubscribeFromDatasetCommand;
340
340
  const se_UpdateRecordsCommand = async (input, context) => {
341
341
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
342
- const headers = map({}, isSerializableHeaderValue, {
342
+ const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
343
343
  "content-type": "application/json",
344
344
  "x-amz-client-context": input.ClientContext,
345
345
  });
@@ -349,11 +349,11 @@ const se_UpdateRecordsCommand = async (input, context) => {
349
349
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "IdentityId", () => input.IdentityId, "{IdentityId}", false);
350
350
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "DatasetName", () => input.DatasetName, "{DatasetName}", false);
351
351
  let body;
352
- body = JSON.stringify({
353
- ...(input.DeviceId != null && { DeviceId: input.DeviceId }),
354
- ...(input.RecordPatches != null && { RecordPatches: se_RecordPatchList(input.RecordPatches, context) }),
355
- ...(input.SyncSessionToken != null && { SyncSessionToken: input.SyncSessionToken }),
356
- });
352
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
353
+ DeviceId: [],
354
+ RecordPatches: (_) => se_RecordPatchList(_, context),
355
+ SyncSessionToken: [],
356
+ }));
357
357
  return new protocol_http_1.HttpRequest({
358
358
  protocol,
359
359
  hostname,
@@ -369,13 +369,14 @@ const de_BulkPublishCommand = async (output, context) => {
369
369
  if (output.statusCode !== 200 && output.statusCode >= 300) {
370
370
  return de_BulkPublishCommandError(output, context);
371
371
  }
372
- const contents = map({
372
+ const contents = (0, smithy_client_1.map)({
373
373
  $metadata: deserializeMetadata(output),
374
374
  });
375
375
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
376
- if (data.IdentityPoolId != null) {
377
- contents.IdentityPoolId = (0, smithy_client_1.expectString)(data.IdentityPoolId);
378
- }
376
+ const doc = (0, smithy_client_1.take)(data, {
377
+ IdentityPoolId: smithy_client_1.expectString,
378
+ });
379
+ Object.assign(contents, doc);
379
380
  return contents;
380
381
  };
381
382
  exports.de_BulkPublishCommand = de_BulkPublishCommand;
@@ -406,10 +407,9 @@ const de_BulkPublishCommandError = async (output, context) => {
406
407
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
407
408
  default:
408
409
  const parsedBody = parsedOutput.body;
409
- (0, smithy_client_1.throwDefaultError)({
410
+ return throwDefaultError({
410
411
  output,
411
412
  parsedBody,
412
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
413
413
  errorCode,
414
414
  });
415
415
  }
@@ -418,13 +418,14 @@ const de_DeleteDatasetCommand = async (output, context) => {
418
418
  if (output.statusCode !== 200 && output.statusCode >= 300) {
419
419
  return de_DeleteDatasetCommandError(output, context);
420
420
  }
421
- const contents = map({
421
+ const contents = (0, smithy_client_1.map)({
422
422
  $metadata: deserializeMetadata(output),
423
423
  });
424
424
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
425
- if (data.Dataset != null) {
426
- contents.Dataset = de_Dataset(data.Dataset, context);
427
- }
425
+ const doc = (0, smithy_client_1.take)(data, {
426
+ Dataset: (_) => de_Dataset(_, context),
427
+ });
428
+ Object.assign(contents, doc);
428
429
  return contents;
429
430
  };
430
431
  exports.de_DeleteDatasetCommand = de_DeleteDatasetCommand;
@@ -455,10 +456,9 @@ const de_DeleteDatasetCommandError = async (output, context) => {
455
456
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
456
457
  default:
457
458
  const parsedBody = parsedOutput.body;
458
- (0, smithy_client_1.throwDefaultError)({
459
+ return throwDefaultError({
459
460
  output,
460
461
  parsedBody,
461
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
462
462
  errorCode,
463
463
  });
464
464
  }
@@ -467,13 +467,14 @@ const de_DescribeDatasetCommand = async (output, context) => {
467
467
  if (output.statusCode !== 200 && output.statusCode >= 300) {
468
468
  return de_DescribeDatasetCommandError(output, context);
469
469
  }
470
- const contents = map({
470
+ const contents = (0, smithy_client_1.map)({
471
471
  $metadata: deserializeMetadata(output),
472
472
  });
473
473
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
474
- if (data.Dataset != null) {
475
- contents.Dataset = de_Dataset(data.Dataset, context);
476
- }
474
+ const doc = (0, smithy_client_1.take)(data, {
475
+ Dataset: (_) => de_Dataset(_, context),
476
+ });
477
+ Object.assign(contents, doc);
477
478
  return contents;
478
479
  };
479
480
  exports.de_DescribeDatasetCommand = de_DescribeDatasetCommand;
@@ -501,10 +502,9 @@ const de_DescribeDatasetCommandError = async (output, context) => {
501
502
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
502
503
  default:
503
504
  const parsedBody = parsedOutput.body;
504
- (0, smithy_client_1.throwDefaultError)({
505
+ return throwDefaultError({
505
506
  output,
506
507
  parsedBody,
507
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
508
508
  errorCode,
509
509
  });
510
510
  }
@@ -513,13 +513,14 @@ const de_DescribeIdentityPoolUsageCommand = async (output, context) => {
513
513
  if (output.statusCode !== 200 && output.statusCode >= 300) {
514
514
  return de_DescribeIdentityPoolUsageCommandError(output, context);
515
515
  }
516
- const contents = map({
516
+ const contents = (0, smithy_client_1.map)({
517
517
  $metadata: deserializeMetadata(output),
518
518
  });
519
519
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
520
- if (data.IdentityPoolUsage != null) {
521
- contents.IdentityPoolUsage = de_IdentityPoolUsage(data.IdentityPoolUsage, context);
522
- }
520
+ const doc = (0, smithy_client_1.take)(data, {
521
+ IdentityPoolUsage: (_) => de_IdentityPoolUsage(_, context),
522
+ });
523
+ Object.assign(contents, doc);
523
524
  return contents;
524
525
  };
525
526
  exports.de_DescribeIdentityPoolUsageCommand = de_DescribeIdentityPoolUsageCommand;
@@ -547,10 +548,9 @@ const de_DescribeIdentityPoolUsageCommandError = async (output, context) => {
547
548
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
548
549
  default:
549
550
  const parsedBody = parsedOutput.body;
550
- (0, smithy_client_1.throwDefaultError)({
551
+ return throwDefaultError({
551
552
  output,
552
553
  parsedBody,
553
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
554
554
  errorCode,
555
555
  });
556
556
  }
@@ -559,13 +559,14 @@ const de_DescribeIdentityUsageCommand = async (output, context) => {
559
559
  if (output.statusCode !== 200 && output.statusCode >= 300) {
560
560
  return de_DescribeIdentityUsageCommandError(output, context);
561
561
  }
562
- const contents = map({
562
+ const contents = (0, smithy_client_1.map)({
563
563
  $metadata: deserializeMetadata(output),
564
564
  });
565
565
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
566
- if (data.IdentityUsage != null) {
567
- contents.IdentityUsage = de_IdentityUsage(data.IdentityUsage, context);
568
- }
566
+ const doc = (0, smithy_client_1.take)(data, {
567
+ IdentityUsage: (_) => de_IdentityUsage(_, context),
568
+ });
569
+ Object.assign(contents, doc);
569
570
  return contents;
570
571
  };
571
572
  exports.de_DescribeIdentityUsageCommand = de_DescribeIdentityUsageCommand;
@@ -593,10 +594,9 @@ const de_DescribeIdentityUsageCommandError = async (output, context) => {
593
594
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
594
595
  default:
595
596
  const parsedBody = parsedOutput.body;
596
- (0, smithy_client_1.throwDefaultError)({
597
+ return throwDefaultError({
597
598
  output,
598
599
  parsedBody,
599
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
600
600
  errorCode,
601
601
  });
602
602
  }
@@ -605,25 +605,18 @@ const de_GetBulkPublishDetailsCommand = async (output, context) => {
605
605
  if (output.statusCode !== 200 && output.statusCode >= 300) {
606
606
  return de_GetBulkPublishDetailsCommandError(output, context);
607
607
  }
608
- const contents = map({
608
+ const contents = (0, smithy_client_1.map)({
609
609
  $metadata: deserializeMetadata(output),
610
610
  });
611
611
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
612
- if (data.BulkPublishCompleteTime != null) {
613
- contents.BulkPublishCompleteTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.BulkPublishCompleteTime)));
614
- }
615
- if (data.BulkPublishStartTime != null) {
616
- contents.BulkPublishStartTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.BulkPublishStartTime)));
617
- }
618
- if (data.BulkPublishStatus != null) {
619
- contents.BulkPublishStatus = (0, smithy_client_1.expectString)(data.BulkPublishStatus);
620
- }
621
- if (data.FailureMessage != null) {
622
- contents.FailureMessage = (0, smithy_client_1.expectString)(data.FailureMessage);
623
- }
624
- if (data.IdentityPoolId != null) {
625
- contents.IdentityPoolId = (0, smithy_client_1.expectString)(data.IdentityPoolId);
626
- }
612
+ const doc = (0, smithy_client_1.take)(data, {
613
+ BulkPublishCompleteTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
614
+ BulkPublishStartTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
615
+ BulkPublishStatus: smithy_client_1.expectString,
616
+ FailureMessage: smithy_client_1.expectString,
617
+ IdentityPoolId: smithy_client_1.expectString,
618
+ });
619
+ Object.assign(contents, doc);
627
620
  return contents;
628
621
  };
629
622
  exports.de_GetBulkPublishDetailsCommand = de_GetBulkPublishDetailsCommand;
@@ -648,10 +641,9 @@ const de_GetBulkPublishDetailsCommandError = async (output, context) => {
648
641
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
649
642
  default:
650
643
  const parsedBody = parsedOutput.body;
651
- (0, smithy_client_1.throwDefaultError)({
644
+ return throwDefaultError({
652
645
  output,
653
646
  parsedBody,
654
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
655
647
  errorCode,
656
648
  });
657
649
  }
@@ -660,13 +652,14 @@ const de_GetCognitoEventsCommand = async (output, context) => {
660
652
  if (output.statusCode !== 200 && output.statusCode >= 300) {
661
653
  return de_GetCognitoEventsCommandError(output, context);
662
654
  }
663
- const contents = map({
655
+ const contents = (0, smithy_client_1.map)({
664
656
  $metadata: deserializeMetadata(output),
665
657
  });
666
658
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
667
- if (data.Events != null) {
668
- contents.Events = de_Events(data.Events, context);
669
- }
659
+ const doc = (0, smithy_client_1.take)(data, {
660
+ Events: smithy_client_1._json,
661
+ });
662
+ Object.assign(contents, doc);
670
663
  return contents;
671
664
  };
672
665
  exports.de_GetCognitoEventsCommand = de_GetCognitoEventsCommand;
@@ -694,10 +687,9 @@ const de_GetCognitoEventsCommandError = async (output, context) => {
694
687
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
695
688
  default:
696
689
  const parsedBody = parsedOutput.body;
697
- (0, smithy_client_1.throwDefaultError)({
690
+ return throwDefaultError({
698
691
  output,
699
692
  parsedBody,
700
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
701
693
  errorCode,
702
694
  });
703
695
  }
@@ -706,19 +698,16 @@ const de_GetIdentityPoolConfigurationCommand = async (output, context) => {
706
698
  if (output.statusCode !== 200 && output.statusCode >= 300) {
707
699
  return de_GetIdentityPoolConfigurationCommandError(output, context);
708
700
  }
709
- const contents = map({
701
+ const contents = (0, smithy_client_1.map)({
710
702
  $metadata: deserializeMetadata(output),
711
703
  });
712
704
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
713
- if (data.CognitoStreams != null) {
714
- contents.CognitoStreams = de_CognitoStreams(data.CognitoStreams, context);
715
- }
716
- if (data.IdentityPoolId != null) {
717
- contents.IdentityPoolId = (0, smithy_client_1.expectString)(data.IdentityPoolId);
718
- }
719
- if (data.PushSync != null) {
720
- contents.PushSync = de_PushSync(data.PushSync, context);
721
- }
705
+ const doc = (0, smithy_client_1.take)(data, {
706
+ CognitoStreams: smithy_client_1._json,
707
+ IdentityPoolId: smithy_client_1.expectString,
708
+ PushSync: smithy_client_1._json,
709
+ });
710
+ Object.assign(contents, doc);
722
711
  return contents;
723
712
  };
724
713
  exports.de_GetIdentityPoolConfigurationCommand = de_GetIdentityPoolConfigurationCommand;
@@ -746,10 +735,9 @@ const de_GetIdentityPoolConfigurationCommandError = async (output, context) => {
746
735
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
747
736
  default:
748
737
  const parsedBody = parsedOutput.body;
749
- (0, smithy_client_1.throwDefaultError)({
738
+ return throwDefaultError({
750
739
  output,
751
740
  parsedBody,
752
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
753
741
  errorCode,
754
742
  });
755
743
  }
@@ -758,19 +746,16 @@ const de_ListDatasetsCommand = async (output, context) => {
758
746
  if (output.statusCode !== 200 && output.statusCode >= 300) {
759
747
  return de_ListDatasetsCommandError(output, context);
760
748
  }
761
- const contents = map({
749
+ const contents = (0, smithy_client_1.map)({
762
750
  $metadata: deserializeMetadata(output),
763
751
  });
764
752
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
765
- if (data.Count != null) {
766
- contents.Count = (0, smithy_client_1.expectInt32)(data.Count);
767
- }
768
- if (data.Datasets != null) {
769
- contents.Datasets = de_DatasetList(data.Datasets, context);
770
- }
771
- if (data.NextToken != null) {
772
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
773
- }
753
+ const doc = (0, smithy_client_1.take)(data, {
754
+ Count: smithy_client_1.expectInt32,
755
+ Datasets: (_) => de_DatasetList(_, context),
756
+ NextToken: smithy_client_1.expectString,
757
+ });
758
+ Object.assign(contents, doc);
774
759
  return contents;
775
760
  };
776
761
  exports.de_ListDatasetsCommand = de_ListDatasetsCommand;
@@ -795,10 +780,9 @@ const de_ListDatasetsCommandError = async (output, context) => {
795
780
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
796
781
  default:
797
782
  const parsedBody = parsedOutput.body;
798
- (0, smithy_client_1.throwDefaultError)({
783
+ return throwDefaultError({
799
784
  output,
800
785
  parsedBody,
801
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
802
786
  errorCode,
803
787
  });
804
788
  }
@@ -807,22 +791,17 @@ const de_ListIdentityPoolUsageCommand = async (output, context) => {
807
791
  if (output.statusCode !== 200 && output.statusCode >= 300) {
808
792
  return de_ListIdentityPoolUsageCommandError(output, context);
809
793
  }
810
- const contents = map({
794
+ const contents = (0, smithy_client_1.map)({
811
795
  $metadata: deserializeMetadata(output),
812
796
  });
813
797
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
814
- if (data.Count != null) {
815
- contents.Count = (0, smithy_client_1.expectInt32)(data.Count);
816
- }
817
- if (data.IdentityPoolUsages != null) {
818
- contents.IdentityPoolUsages = de_IdentityPoolUsageList(data.IdentityPoolUsages, context);
819
- }
820
- if (data.MaxResults != null) {
821
- contents.MaxResults = (0, smithy_client_1.expectInt32)(data.MaxResults);
822
- }
823
- if (data.NextToken != null) {
824
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
825
- }
798
+ const doc = (0, smithy_client_1.take)(data, {
799
+ Count: smithy_client_1.expectInt32,
800
+ IdentityPoolUsages: (_) => de_IdentityPoolUsageList(_, context),
801
+ MaxResults: smithy_client_1.expectInt32,
802
+ NextToken: smithy_client_1.expectString,
803
+ });
804
+ Object.assign(contents, doc);
826
805
  return contents;
827
806
  };
828
807
  exports.de_ListIdentityPoolUsageCommand = de_ListIdentityPoolUsageCommand;
@@ -847,10 +826,9 @@ const de_ListIdentityPoolUsageCommandError = async (output, context) => {
847
826
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
848
827
  default:
849
828
  const parsedBody = parsedOutput.body;
850
- (0, smithy_client_1.throwDefaultError)({
829
+ return throwDefaultError({
851
830
  output,
852
831
  parsedBody,
853
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
854
832
  errorCode,
855
833
  });
856
834
  }
@@ -859,37 +837,22 @@ const de_ListRecordsCommand = async (output, context) => {
859
837
  if (output.statusCode !== 200 && output.statusCode >= 300) {
860
838
  return de_ListRecordsCommandError(output, context);
861
839
  }
862
- const contents = map({
840
+ const contents = (0, smithy_client_1.map)({
863
841
  $metadata: deserializeMetadata(output),
864
842
  });
865
843
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
866
- if (data.Count != null) {
867
- contents.Count = (0, smithy_client_1.expectInt32)(data.Count);
868
- }
869
- if (data.DatasetDeletedAfterRequestedSyncCount != null) {
870
- contents.DatasetDeletedAfterRequestedSyncCount = (0, smithy_client_1.expectBoolean)(data.DatasetDeletedAfterRequestedSyncCount);
871
- }
872
- if (data.DatasetExists != null) {
873
- contents.DatasetExists = (0, smithy_client_1.expectBoolean)(data.DatasetExists);
874
- }
875
- if (data.DatasetSyncCount != null) {
876
- contents.DatasetSyncCount = (0, smithy_client_1.expectLong)(data.DatasetSyncCount);
877
- }
878
- if (data.LastModifiedBy != null) {
879
- contents.LastModifiedBy = (0, smithy_client_1.expectString)(data.LastModifiedBy);
880
- }
881
- if (data.MergedDatasetNames != null) {
882
- contents.MergedDatasetNames = de_MergedDatasetNameList(data.MergedDatasetNames, context);
883
- }
884
- if (data.NextToken != null) {
885
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
886
- }
887
- if (data.Records != null) {
888
- contents.Records = de_RecordList(data.Records, context);
889
- }
890
- if (data.SyncSessionToken != null) {
891
- contents.SyncSessionToken = (0, smithy_client_1.expectString)(data.SyncSessionToken);
892
- }
844
+ const doc = (0, smithy_client_1.take)(data, {
845
+ Count: smithy_client_1.expectInt32,
846
+ DatasetDeletedAfterRequestedSyncCount: smithy_client_1.expectBoolean,
847
+ DatasetExists: smithy_client_1.expectBoolean,
848
+ DatasetSyncCount: smithy_client_1.expectLong,
849
+ LastModifiedBy: smithy_client_1.expectString,
850
+ MergedDatasetNames: smithy_client_1._json,
851
+ NextToken: smithy_client_1.expectString,
852
+ Records: (_) => de_RecordList(_, context),
853
+ SyncSessionToken: smithy_client_1.expectString,
854
+ });
855
+ Object.assign(contents, doc);
893
856
  return contents;
894
857
  };
895
858
  exports.de_ListRecordsCommand = de_ListRecordsCommand;
@@ -914,10 +877,9 @@ const de_ListRecordsCommandError = async (output, context) => {
914
877
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
915
878
  default:
916
879
  const parsedBody = parsedOutput.body;
917
- (0, smithy_client_1.throwDefaultError)({
880
+ return throwDefaultError({
918
881
  output,
919
882
  parsedBody,
920
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
921
883
  errorCode,
922
884
  });
923
885
  }
@@ -926,13 +888,14 @@ const de_RegisterDeviceCommand = async (output, context) => {
926
888
  if (output.statusCode !== 200 && output.statusCode >= 300) {
927
889
  return de_RegisterDeviceCommandError(output, context);
928
890
  }
929
- const contents = map({
891
+ const contents = (0, smithy_client_1.map)({
930
892
  $metadata: deserializeMetadata(output),
931
893
  });
932
894
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
933
- if (data.DeviceId != null) {
934
- contents.DeviceId = (0, smithy_client_1.expectString)(data.DeviceId);
935
- }
895
+ const doc = (0, smithy_client_1.take)(data, {
896
+ DeviceId: smithy_client_1.expectString,
897
+ });
898
+ Object.assign(contents, doc);
936
899
  return contents;
937
900
  };
938
901
  exports.de_RegisterDeviceCommand = de_RegisterDeviceCommand;
@@ -963,10 +926,9 @@ const de_RegisterDeviceCommandError = async (output, context) => {
963
926
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
964
927
  default:
965
928
  const parsedBody = parsedOutput.body;
966
- (0, smithy_client_1.throwDefaultError)({
929
+ return throwDefaultError({
967
930
  output,
968
931
  parsedBody,
969
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
970
932
  errorCode,
971
933
  });
972
934
  }
@@ -975,7 +937,7 @@ const de_SetCognitoEventsCommand = async (output, context) => {
975
937
  if (output.statusCode !== 200 && output.statusCode >= 300) {
976
938
  return de_SetCognitoEventsCommandError(output, context);
977
939
  }
978
- const contents = map({
940
+ const contents = (0, smithy_client_1.map)({
979
941
  $metadata: deserializeMetadata(output),
980
942
  });
981
943
  await collectBody(output.body, context);
@@ -1006,10 +968,9 @@ const de_SetCognitoEventsCommandError = async (output, context) => {
1006
968
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1007
969
  default:
1008
970
  const parsedBody = parsedOutput.body;
1009
- (0, smithy_client_1.throwDefaultError)({
971
+ return throwDefaultError({
1010
972
  output,
1011
973
  parsedBody,
1012
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
1013
974
  errorCode,
1014
975
  });
1015
976
  }
@@ -1018,19 +979,16 @@ const de_SetIdentityPoolConfigurationCommand = async (output, context) => {
1018
979
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1019
980
  return de_SetIdentityPoolConfigurationCommandError(output, context);
1020
981
  }
1021
- const contents = map({
982
+ const contents = (0, smithy_client_1.map)({
1022
983
  $metadata: deserializeMetadata(output),
1023
984
  });
1024
985
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1025
- if (data.CognitoStreams != null) {
1026
- contents.CognitoStreams = de_CognitoStreams(data.CognitoStreams, context);
1027
- }
1028
- if (data.IdentityPoolId != null) {
1029
- contents.IdentityPoolId = (0, smithy_client_1.expectString)(data.IdentityPoolId);
1030
- }
1031
- if (data.PushSync != null) {
1032
- contents.PushSync = de_PushSync(data.PushSync, context);
1033
- }
986
+ const doc = (0, smithy_client_1.take)(data, {
987
+ CognitoStreams: smithy_client_1._json,
988
+ IdentityPoolId: smithy_client_1.expectString,
989
+ PushSync: smithy_client_1._json,
990
+ });
991
+ Object.assign(contents, doc);
1034
992
  return contents;
1035
993
  };
1036
994
  exports.de_SetIdentityPoolConfigurationCommand = de_SetIdentityPoolConfigurationCommand;
@@ -1061,10 +1019,9 @@ const de_SetIdentityPoolConfigurationCommandError = async (output, context) => {
1061
1019
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1062
1020
  default:
1063
1021
  const parsedBody = parsedOutput.body;
1064
- (0, smithy_client_1.throwDefaultError)({
1022
+ return throwDefaultError({
1065
1023
  output,
1066
1024
  parsedBody,
1067
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
1068
1025
  errorCode,
1069
1026
  });
1070
1027
  }
@@ -1073,7 +1030,7 @@ const de_SubscribeToDatasetCommand = async (output, context) => {
1073
1030
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1074
1031
  return de_SubscribeToDatasetCommandError(output, context);
1075
1032
  }
1076
- const contents = map({
1033
+ const contents = (0, smithy_client_1.map)({
1077
1034
  $metadata: deserializeMetadata(output),
1078
1035
  });
1079
1036
  await collectBody(output.body, context);
@@ -1107,10 +1064,9 @@ const de_SubscribeToDatasetCommandError = async (output, context) => {
1107
1064
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1108
1065
  default:
1109
1066
  const parsedBody = parsedOutput.body;
1110
- (0, smithy_client_1.throwDefaultError)({
1067
+ return throwDefaultError({
1111
1068
  output,
1112
1069
  parsedBody,
1113
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
1114
1070
  errorCode,
1115
1071
  });
1116
1072
  }
@@ -1119,7 +1075,7 @@ const de_UnsubscribeFromDatasetCommand = async (output, context) => {
1119
1075
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1120
1076
  return de_UnsubscribeFromDatasetCommandError(output, context);
1121
1077
  }
1122
- const contents = map({
1078
+ const contents = (0, smithy_client_1.map)({
1123
1079
  $metadata: deserializeMetadata(output),
1124
1080
  });
1125
1081
  await collectBody(output.body, context);
@@ -1153,10 +1109,9 @@ const de_UnsubscribeFromDatasetCommandError = async (output, context) => {
1153
1109
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1154
1110
  default:
1155
1111
  const parsedBody = parsedOutput.body;
1156
- (0, smithy_client_1.throwDefaultError)({
1112
+ return throwDefaultError({
1157
1113
  output,
1158
1114
  parsedBody,
1159
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
1160
1115
  errorCode,
1161
1116
  });
1162
1117
  }
@@ -1165,13 +1120,14 @@ const de_UpdateRecordsCommand = async (output, context) => {
1165
1120
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1166
1121
  return de_UpdateRecordsCommandError(output, context);
1167
1122
  }
1168
- const contents = map({
1123
+ const contents = (0, smithy_client_1.map)({
1169
1124
  $metadata: deserializeMetadata(output),
1170
1125
  });
1171
1126
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1172
- if (data.Records != null) {
1173
- contents.Records = de_RecordList(data.Records, context);
1174
- }
1127
+ const doc = (0, smithy_client_1.take)(data, {
1128
+ Records: (_) => de_RecordList(_, context),
1129
+ });
1130
+ Object.assign(contents, doc);
1175
1131
  return contents;
1176
1132
  };
1177
1133
  exports.de_UpdateRecordsCommand = de_UpdateRecordsCommand;
@@ -1211,21 +1167,21 @@ const de_UpdateRecordsCommandError = async (output, context) => {
1211
1167
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1212
1168
  default:
1213
1169
  const parsedBody = parsedOutput.body;
1214
- (0, smithy_client_1.throwDefaultError)({
1170
+ return throwDefaultError({
1215
1171
  output,
1216
1172
  parsedBody,
1217
- exceptionCtor: CognitoSyncServiceException_1.CognitoSyncServiceException,
1218
1173
  errorCode,
1219
1174
  });
1220
1175
  }
1221
1176
  };
1222
- const map = smithy_client_1.map;
1177
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(CognitoSyncServiceException_1.CognitoSyncServiceException);
1223
1178
  const de_AlreadyStreamedExceptionRes = async (parsedOutput, context) => {
1224
- const contents = map({});
1179
+ const contents = (0, smithy_client_1.map)({});
1225
1180
  const data = parsedOutput.body;
1226
- if (data.message != null) {
1227
- contents.message = (0, smithy_client_1.expectString)(data.message);
1228
- }
1181
+ const doc = (0, smithy_client_1.take)(data, {
1182
+ message: smithy_client_1.expectString,
1183
+ });
1184
+ Object.assign(contents, doc);
1229
1185
  const exception = new models_0_1.AlreadyStreamedException({
1230
1186
  $metadata: deserializeMetadata(parsedOutput),
1231
1187
  ...contents,
@@ -1233,11 +1189,12 @@ const de_AlreadyStreamedExceptionRes = async (parsedOutput, context) => {
1233
1189
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1234
1190
  };
1235
1191
  const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
1236
- const contents = map({});
1192
+ const contents = (0, smithy_client_1.map)({});
1237
1193
  const data = parsedOutput.body;
1238
- if (data.message != null) {
1239
- contents.message = (0, smithy_client_1.expectString)(data.message);
1240
- }
1194
+ const doc = (0, smithy_client_1.take)(data, {
1195
+ message: smithy_client_1.expectString,
1196
+ });
1197
+ Object.assign(contents, doc);
1241
1198
  const exception = new models_0_1.ConcurrentModificationException({
1242
1199
  $metadata: deserializeMetadata(parsedOutput),
1243
1200
  ...contents,
@@ -1245,11 +1202,12 @@ const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
1245
1202
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1246
1203
  };
1247
1204
  const de_DuplicateRequestExceptionRes = async (parsedOutput, context) => {
1248
- const contents = map({});
1205
+ const contents = (0, smithy_client_1.map)({});
1249
1206
  const data = parsedOutput.body;
1250
- if (data.message != null) {
1251
- contents.message = (0, smithy_client_1.expectString)(data.message);
1252
- }
1207
+ const doc = (0, smithy_client_1.take)(data, {
1208
+ message: smithy_client_1.expectString,
1209
+ });
1210
+ Object.assign(contents, doc);
1253
1211
  const exception = new models_0_1.DuplicateRequestException({
1254
1212
  $metadata: deserializeMetadata(parsedOutput),
1255
1213
  ...contents,
@@ -1257,11 +1215,12 @@ const de_DuplicateRequestExceptionRes = async (parsedOutput, context) => {
1257
1215
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1258
1216
  };
1259
1217
  const de_InternalErrorExceptionRes = async (parsedOutput, context) => {
1260
- const contents = map({});
1218
+ const contents = (0, smithy_client_1.map)({});
1261
1219
  const data = parsedOutput.body;
1262
- if (data.message != null) {
1263
- contents.message = (0, smithy_client_1.expectString)(data.message);
1264
- }
1220
+ const doc = (0, smithy_client_1.take)(data, {
1221
+ message: smithy_client_1.expectString,
1222
+ });
1223
+ Object.assign(contents, doc);
1265
1224
  const exception = new models_0_1.InternalErrorException({
1266
1225
  $metadata: deserializeMetadata(parsedOutput),
1267
1226
  ...contents,
@@ -1269,11 +1228,12 @@ const de_InternalErrorExceptionRes = async (parsedOutput, context) => {
1269
1228
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1270
1229
  };
1271
1230
  const de_InvalidConfigurationExceptionRes = async (parsedOutput, context) => {
1272
- const contents = map({});
1231
+ const contents = (0, smithy_client_1.map)({});
1273
1232
  const data = parsedOutput.body;
1274
- if (data.message != null) {
1275
- contents.message = (0, smithy_client_1.expectString)(data.message);
1276
- }
1233
+ const doc = (0, smithy_client_1.take)(data, {
1234
+ message: smithy_client_1.expectString,
1235
+ });
1236
+ Object.assign(contents, doc);
1277
1237
  const exception = new models_0_1.InvalidConfigurationException({
1278
1238
  $metadata: deserializeMetadata(parsedOutput),
1279
1239
  ...contents,
@@ -1281,11 +1241,12 @@ const de_InvalidConfigurationExceptionRes = async (parsedOutput, context) => {
1281
1241
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1282
1242
  };
1283
1243
  const de_InvalidLambdaFunctionOutputExceptionRes = async (parsedOutput, context) => {
1284
- const contents = map({});
1244
+ const contents = (0, smithy_client_1.map)({});
1285
1245
  const data = parsedOutput.body;
1286
- if (data.message != null) {
1287
- contents.message = (0, smithy_client_1.expectString)(data.message);
1288
- }
1246
+ const doc = (0, smithy_client_1.take)(data, {
1247
+ message: smithy_client_1.expectString,
1248
+ });
1249
+ Object.assign(contents, doc);
1289
1250
  const exception = new models_0_1.InvalidLambdaFunctionOutputException({
1290
1251
  $metadata: deserializeMetadata(parsedOutput),
1291
1252
  ...contents,
@@ -1293,11 +1254,12 @@ const de_InvalidLambdaFunctionOutputExceptionRes = async (parsedOutput, context)
1293
1254
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1294
1255
  };
1295
1256
  const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
1296
- const contents = map({});
1257
+ const contents = (0, smithy_client_1.map)({});
1297
1258
  const data = parsedOutput.body;
1298
- if (data.message != null) {
1299
- contents.message = (0, smithy_client_1.expectString)(data.message);
1300
- }
1259
+ const doc = (0, smithy_client_1.take)(data, {
1260
+ message: smithy_client_1.expectString,
1261
+ });
1262
+ Object.assign(contents, doc);
1301
1263
  const exception = new models_0_1.InvalidParameterException({
1302
1264
  $metadata: deserializeMetadata(parsedOutput),
1303
1265
  ...contents,
@@ -1305,11 +1267,12 @@ const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
1305
1267
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1306
1268
  };
1307
1269
  const de_LambdaThrottledExceptionRes = async (parsedOutput, context) => {
1308
- const contents = map({});
1270
+ const contents = (0, smithy_client_1.map)({});
1309
1271
  const data = parsedOutput.body;
1310
- if (data.message != null) {
1311
- contents.message = (0, smithy_client_1.expectString)(data.message);
1312
- }
1272
+ const doc = (0, smithy_client_1.take)(data, {
1273
+ message: smithy_client_1.expectString,
1274
+ });
1275
+ Object.assign(contents, doc);
1313
1276
  const exception = new models_0_1.LambdaThrottledException({
1314
1277
  $metadata: deserializeMetadata(parsedOutput),
1315
1278
  ...contents,
@@ -1317,11 +1280,12 @@ const de_LambdaThrottledExceptionRes = async (parsedOutput, context) => {
1317
1280
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1318
1281
  };
1319
1282
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
1320
- const contents = map({});
1283
+ const contents = (0, smithy_client_1.map)({});
1321
1284
  const data = parsedOutput.body;
1322
- if (data.message != null) {
1323
- contents.message = (0, smithy_client_1.expectString)(data.message);
1324
- }
1285
+ const doc = (0, smithy_client_1.take)(data, {
1286
+ message: smithy_client_1.expectString,
1287
+ });
1288
+ Object.assign(contents, doc);
1325
1289
  const exception = new models_0_1.LimitExceededException({
1326
1290
  $metadata: deserializeMetadata(parsedOutput),
1327
1291
  ...contents,
@@ -1329,11 +1293,12 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
1329
1293
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1330
1294
  };
1331
1295
  const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
1332
- const contents = map({});
1296
+ const contents = (0, smithy_client_1.map)({});
1333
1297
  const data = parsedOutput.body;
1334
- if (data.message != null) {
1335
- contents.message = (0, smithy_client_1.expectString)(data.message);
1336
- }
1298
+ const doc = (0, smithy_client_1.take)(data, {
1299
+ message: smithy_client_1.expectString,
1300
+ });
1301
+ Object.assign(contents, doc);
1337
1302
  const exception = new models_0_1.NotAuthorizedException({
1338
1303
  $metadata: deserializeMetadata(parsedOutput),
1339
1304
  ...contents,
@@ -1341,11 +1306,12 @@ const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
1341
1306
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1342
1307
  };
1343
1308
  const de_ResourceConflictExceptionRes = async (parsedOutput, context) => {
1344
- const contents = map({});
1309
+ const contents = (0, smithy_client_1.map)({});
1345
1310
  const data = parsedOutput.body;
1346
- if (data.message != null) {
1347
- contents.message = (0, smithy_client_1.expectString)(data.message);
1348
- }
1311
+ const doc = (0, smithy_client_1.take)(data, {
1312
+ message: smithy_client_1.expectString,
1313
+ });
1314
+ Object.assign(contents, doc);
1349
1315
  const exception = new models_0_1.ResourceConflictException({
1350
1316
  $metadata: deserializeMetadata(parsedOutput),
1351
1317
  ...contents,
@@ -1353,11 +1319,12 @@ const de_ResourceConflictExceptionRes = async (parsedOutput, context) => {
1353
1319
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1354
1320
  };
1355
1321
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1356
- const contents = map({});
1322
+ const contents = (0, smithy_client_1.map)({});
1357
1323
  const data = parsedOutput.body;
1358
- if (data.message != null) {
1359
- contents.message = (0, smithy_client_1.expectString)(data.message);
1360
- }
1324
+ const doc = (0, smithy_client_1.take)(data, {
1325
+ message: smithy_client_1.expectString,
1326
+ });
1327
+ Object.assign(contents, doc);
1361
1328
  const exception = new models_0_1.ResourceNotFoundException({
1362
1329
  $metadata: deserializeMetadata(parsedOutput),
1363
1330
  ...contents,
@@ -1365,56 +1332,26 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1365
1332
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1366
1333
  };
1367
1334
  const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
1368
- const contents = map({});
1335
+ const contents = (0, smithy_client_1.map)({});
1369
1336
  const data = parsedOutput.body;
1370
- if (data.message != null) {
1371
- contents.message = (0, smithy_client_1.expectString)(data.message);
1372
- }
1337
+ const doc = (0, smithy_client_1.take)(data, {
1338
+ message: smithy_client_1.expectString,
1339
+ });
1340
+ Object.assign(contents, doc);
1373
1341
  const exception = new models_0_1.TooManyRequestsException({
1374
1342
  $metadata: deserializeMetadata(parsedOutput),
1375
1343
  ...contents,
1376
1344
  });
1377
1345
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1378
1346
  };
1379
- const se_ApplicationArnList = (input, context) => {
1380
- return input
1381
- .filter((e) => e != null)
1382
- .map((entry) => {
1383
- return entry;
1384
- });
1385
- };
1386
- const se_CognitoStreams = (input, context) => {
1387
- return {
1388
- ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
1389
- ...(input.StreamName != null && { StreamName: input.StreamName }),
1390
- ...(input.StreamingStatus != null && { StreamingStatus: input.StreamingStatus }),
1391
- };
1392
- };
1393
- const se_Events = (input, context) => {
1394
- return Object.entries(input).reduce((acc, [key, value]) => {
1395
- if (value === null) {
1396
- return acc;
1397
- }
1398
- acc[key] = value;
1399
- return acc;
1400
- }, {});
1401
- };
1402
- const se_PushSync = (input, context) => {
1403
- return {
1404
- ...(input.ApplicationArns != null && { ApplicationArns: se_ApplicationArnList(input.ApplicationArns, context) }),
1405
- ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
1406
- };
1407
- };
1408
1347
  const se_RecordPatch = (input, context) => {
1409
- return {
1410
- ...(input.DeviceLastModifiedDate != null && {
1411
- DeviceLastModifiedDate: Math.round(input.DeviceLastModifiedDate.getTime() / 1000),
1412
- }),
1413
- ...(input.Key != null && { Key: input.Key }),
1414
- ...(input.Op != null && { Op: input.Op }),
1415
- ...(input.SyncCount != null && { SyncCount: input.SyncCount }),
1416
- ...(input.Value != null && { Value: input.Value }),
1417
- };
1348
+ return (0, smithy_client_1.take)(input, {
1349
+ DeviceLastModifiedDate: (_) => Math.round(_.getTime() / 1000),
1350
+ Key: [],
1351
+ Op: [],
1352
+ SyncCount: [],
1353
+ Value: [],
1354
+ });
1418
1355
  };
1419
1356
  const se_RecordPatchList = (input, context) => {
1420
1357
  return input
@@ -1423,129 +1360,64 @@ const se_RecordPatchList = (input, context) => {
1423
1360
  return se_RecordPatch(entry, context);
1424
1361
  });
1425
1362
  };
1426
- const de_ApplicationArnList = (output, context) => {
1427
- const retVal = (output || [])
1428
- .filter((e) => e != null)
1429
- .map((entry) => {
1430
- if (entry === null) {
1431
- return null;
1432
- }
1433
- return (0, smithy_client_1.expectString)(entry);
1434
- });
1435
- return retVal;
1436
- };
1437
- const de_CognitoStreams = (output, context) => {
1438
- return {
1439
- RoleArn: (0, smithy_client_1.expectString)(output.RoleArn),
1440
- StreamName: (0, smithy_client_1.expectString)(output.StreamName),
1441
- StreamingStatus: (0, smithy_client_1.expectString)(output.StreamingStatus),
1442
- };
1443
- };
1444
1363
  const de_Dataset = (output, context) => {
1445
- return {
1446
- CreationDate: output.CreationDate != null
1447
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationDate)))
1448
- : undefined,
1449
- DataStorage: (0, smithy_client_1.expectLong)(output.DataStorage),
1450
- DatasetName: (0, smithy_client_1.expectString)(output.DatasetName),
1451
- IdentityId: (0, smithy_client_1.expectString)(output.IdentityId),
1452
- LastModifiedBy: (0, smithy_client_1.expectString)(output.LastModifiedBy),
1453
- LastModifiedDate: output.LastModifiedDate != null
1454
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModifiedDate)))
1455
- : undefined,
1456
- NumRecords: (0, smithy_client_1.expectLong)(output.NumRecords),
1457
- };
1364
+ return (0, smithy_client_1.take)(output, {
1365
+ CreationDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1366
+ DataStorage: smithy_client_1.expectLong,
1367
+ DatasetName: smithy_client_1.expectString,
1368
+ IdentityId: smithy_client_1.expectString,
1369
+ LastModifiedBy: smithy_client_1.expectString,
1370
+ LastModifiedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1371
+ NumRecords: smithy_client_1.expectLong,
1372
+ });
1458
1373
  };
1459
1374
  const de_DatasetList = (output, context) => {
1460
1375
  const retVal = (output || [])
1461
1376
  .filter((e) => e != null)
1462
1377
  .map((entry) => {
1463
- if (entry === null) {
1464
- return null;
1465
- }
1466
1378
  return de_Dataset(entry, context);
1467
1379
  });
1468
1380
  return retVal;
1469
1381
  };
1470
- const de_Events = (output, context) => {
1471
- return Object.entries(output).reduce((acc, [key, value]) => {
1472
- if (value === null) {
1473
- return acc;
1474
- }
1475
- acc[key] = (0, smithy_client_1.expectString)(value);
1476
- return acc;
1477
- }, {});
1478
- };
1479
1382
  const de_IdentityPoolUsage = (output, context) => {
1480
- return {
1481
- DataStorage: (0, smithy_client_1.expectLong)(output.DataStorage),
1482
- IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId),
1483
- LastModifiedDate: output.LastModifiedDate != null
1484
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModifiedDate)))
1485
- : undefined,
1486
- SyncSessionsCount: (0, smithy_client_1.expectLong)(output.SyncSessionsCount),
1487
- };
1383
+ return (0, smithy_client_1.take)(output, {
1384
+ DataStorage: smithy_client_1.expectLong,
1385
+ IdentityPoolId: smithy_client_1.expectString,
1386
+ LastModifiedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1387
+ SyncSessionsCount: smithy_client_1.expectLong,
1388
+ });
1488
1389
  };
1489
1390
  const de_IdentityPoolUsageList = (output, context) => {
1490
1391
  const retVal = (output || [])
1491
1392
  .filter((e) => e != null)
1492
1393
  .map((entry) => {
1493
- if (entry === null) {
1494
- return null;
1495
- }
1496
1394
  return de_IdentityPoolUsage(entry, context);
1497
1395
  });
1498
1396
  return retVal;
1499
1397
  };
1500
1398
  const de_IdentityUsage = (output, context) => {
1501
- return {
1502
- DataStorage: (0, smithy_client_1.expectLong)(output.DataStorage),
1503
- DatasetCount: (0, smithy_client_1.expectInt32)(output.DatasetCount),
1504
- IdentityId: (0, smithy_client_1.expectString)(output.IdentityId),
1505
- IdentityPoolId: (0, smithy_client_1.expectString)(output.IdentityPoolId),
1506
- LastModifiedDate: output.LastModifiedDate != null
1507
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModifiedDate)))
1508
- : undefined,
1509
- };
1510
- };
1511
- const de_MergedDatasetNameList = (output, context) => {
1512
- const retVal = (output || [])
1513
- .filter((e) => e != null)
1514
- .map((entry) => {
1515
- if (entry === null) {
1516
- return null;
1517
- }
1518
- return (0, smithy_client_1.expectString)(entry);
1399
+ return (0, smithy_client_1.take)(output, {
1400
+ DataStorage: smithy_client_1.expectLong,
1401
+ DatasetCount: smithy_client_1.expectInt32,
1402
+ IdentityId: smithy_client_1.expectString,
1403
+ IdentityPoolId: smithy_client_1.expectString,
1404
+ LastModifiedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1519
1405
  });
1520
- return retVal;
1521
- };
1522
- const de_PushSync = (output, context) => {
1523
- return {
1524
- ApplicationArns: output.ApplicationArns != null ? de_ApplicationArnList(output.ApplicationArns, context) : undefined,
1525
- RoleArn: (0, smithy_client_1.expectString)(output.RoleArn),
1526
- };
1527
1406
  };
1528
1407
  const de__Record = (output, context) => {
1529
- return {
1530
- DeviceLastModifiedDate: output.DeviceLastModifiedDate != null
1531
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.DeviceLastModifiedDate)))
1532
- : undefined,
1533
- Key: (0, smithy_client_1.expectString)(output.Key),
1534
- LastModifiedBy: (0, smithy_client_1.expectString)(output.LastModifiedBy),
1535
- LastModifiedDate: output.LastModifiedDate != null
1536
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastModifiedDate)))
1537
- : undefined,
1538
- SyncCount: (0, smithy_client_1.expectLong)(output.SyncCount),
1539
- Value: (0, smithy_client_1.expectString)(output.Value),
1540
- };
1408
+ return (0, smithy_client_1.take)(output, {
1409
+ DeviceLastModifiedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1410
+ Key: smithy_client_1.expectString,
1411
+ LastModifiedBy: smithy_client_1.expectString,
1412
+ LastModifiedDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1413
+ SyncCount: smithy_client_1.expectLong,
1414
+ Value: smithy_client_1.expectString,
1415
+ });
1541
1416
  };
1542
1417
  const de_RecordList = (output, context) => {
1543
1418
  const retVal = (output || [])
1544
1419
  .filter((e) => e != null)
1545
1420
  .map((entry) => {
1546
- if (entry === null) {
1547
- return null;
1548
- }
1549
1421
  return de__Record(entry, context);
1550
1422
  });
1551
1423
  return retVal;