@aws-sdk/client-iotdeviceadvisor 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.
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { IotDeviceAdvisorServiceException as __BaseException } from "../models/IotDeviceAdvisorServiceException";
4
4
  import { ConflictException, InternalServerException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
5
5
  export const se_CreateSuiteDefinitionCommand = async (input, context) => {
@@ -9,12 +9,10 @@ export const se_CreateSuiteDefinitionCommand = async (input, context) => {
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/suiteDefinitions";
11
11
  let body;
12
- body = JSON.stringify({
13
- ...(input.suiteDefinitionConfiguration != null && {
14
- suiteDefinitionConfiguration: se_SuiteDefinitionConfiguration(input.suiteDefinitionConfiguration, context),
15
- }),
16
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
17
- });
12
+ body = JSON.stringify(take(input, {
13
+ suiteDefinitionConfiguration: (_) => _json(_),
14
+ tags: (_) => _json(_),
15
+ }));
18
16
  return new __HttpRequest({
19
17
  protocol,
20
18
  hostname,
@@ -184,13 +182,11 @@ export const se_StartSuiteRunCommand = async (input, context) => {
184
182
  "/suiteDefinitions/{suiteDefinitionId}/suiteRuns";
185
183
  resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", () => input.suiteDefinitionId, "{suiteDefinitionId}", false);
186
184
  let body;
187
- body = JSON.stringify({
188
- ...(input.suiteDefinitionVersion != null && { suiteDefinitionVersion: input.suiteDefinitionVersion }),
189
- ...(input.suiteRunConfiguration != null && {
190
- suiteRunConfiguration: se_SuiteRunConfiguration(input.suiteRunConfiguration, context),
191
- }),
192
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
193
- });
185
+ body = JSON.stringify(take(input, {
186
+ suiteDefinitionVersion: [],
187
+ suiteRunConfiguration: (_) => _json(_),
188
+ tags: (_) => _json(_),
189
+ }));
194
190
  return new __HttpRequest({
195
191
  protocol,
196
192
  hostname,
@@ -227,9 +223,9 @@ export const se_TagResourceCommand = async (input, context) => {
227
223
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
228
224
  resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
229
225
  let body;
230
- body = JSON.stringify({
231
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
232
- });
226
+ body = JSON.stringify(take(input, {
227
+ tags: (_) => _json(_),
228
+ }));
233
229
  return new __HttpRequest({
234
230
  protocol,
235
231
  hostname,
@@ -271,11 +267,9 @@ export const se_UpdateSuiteDefinitionCommand = async (input, context) => {
271
267
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/suiteDefinitions/{suiteDefinitionId}";
272
268
  resolvedPath = __resolvedPath(resolvedPath, input, "suiteDefinitionId", () => input.suiteDefinitionId, "{suiteDefinitionId}", false);
273
269
  let body;
274
- body = JSON.stringify({
275
- ...(input.suiteDefinitionConfiguration != null && {
276
- suiteDefinitionConfiguration: se_SuiteDefinitionConfiguration(input.suiteDefinitionConfiguration, context),
277
- }),
278
- });
270
+ body = JSON.stringify(take(input, {
271
+ suiteDefinitionConfiguration: (_) => _json(_),
272
+ }));
279
273
  return new __HttpRequest({
280
274
  protocol,
281
275
  hostname,
@@ -294,18 +288,13 @@ export const de_CreateSuiteDefinitionCommand = async (output, context) => {
294
288
  $metadata: deserializeMetadata(output),
295
289
  });
296
290
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
297
- if (data.createdAt != null) {
298
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
299
- }
300
- if (data.suiteDefinitionArn != null) {
301
- contents.suiteDefinitionArn = __expectString(data.suiteDefinitionArn);
302
- }
303
- if (data.suiteDefinitionId != null) {
304
- contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
305
- }
306
- if (data.suiteDefinitionName != null) {
307
- contents.suiteDefinitionName = __expectString(data.suiteDefinitionName);
308
- }
291
+ const doc = take(data, {
292
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
293
+ suiteDefinitionArn: __expectString,
294
+ suiteDefinitionId: __expectString,
295
+ suiteDefinitionName: __expectString,
296
+ });
297
+ Object.assign(contents, doc);
309
298
  return contents;
310
299
  };
311
300
  const de_CreateSuiteDefinitionCommandError = async (output, context) => {
@@ -323,10 +312,9 @@ const de_CreateSuiteDefinitionCommandError = async (output, context) => {
323
312
  throw await de_ValidationExceptionRes(parsedOutput, context);
324
313
  default:
325
314
  const parsedBody = parsedOutput.body;
326
- throwDefaultError({
315
+ return throwDefaultError({
327
316
  output,
328
317
  parsedBody,
329
- exceptionCtor: __BaseException,
330
318
  errorCode,
331
319
  });
332
320
  }
@@ -356,10 +344,9 @@ const de_DeleteSuiteDefinitionCommandError = async (output, context) => {
356
344
  throw await de_ValidationExceptionRes(parsedOutput, context);
357
345
  default:
358
346
  const parsedBody = parsedOutput.body;
359
- throwDefaultError({
347
+ return throwDefaultError({
360
348
  output,
361
349
  parsedBody,
362
- exceptionCtor: __BaseException,
363
350
  errorCode,
364
351
  });
365
352
  }
@@ -372,9 +359,10 @@ export const de_GetEndpointCommand = async (output, context) => {
372
359
  $metadata: deserializeMetadata(output),
373
360
  });
374
361
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
375
- if (data.endpoint != null) {
376
- contents.endpoint = __expectString(data.endpoint);
377
- }
362
+ const doc = take(data, {
363
+ endpoint: __expectString,
364
+ });
365
+ Object.assign(contents, doc);
378
366
  return contents;
379
367
  };
380
368
  const de_GetEndpointCommandError = async (output, context) => {
@@ -395,10 +383,9 @@ const de_GetEndpointCommandError = async (output, context) => {
395
383
  throw await de_ValidationExceptionRes(parsedOutput, context);
396
384
  default:
397
385
  const parsedBody = parsedOutput.body;
398
- throwDefaultError({
386
+ return throwDefaultError({
399
387
  output,
400
388
  parsedBody,
401
- exceptionCtor: __BaseException,
402
389
  errorCode,
403
390
  });
404
391
  }
@@ -411,30 +398,17 @@ export const de_GetSuiteDefinitionCommand = async (output, context) => {
411
398
  $metadata: deserializeMetadata(output),
412
399
  });
413
400
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
414
- if (data.createdAt != null) {
415
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
416
- }
417
- if (data.lastModifiedAt != null) {
418
- contents.lastModifiedAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.lastModifiedAt)));
419
- }
420
- if (data.latestVersion != null) {
421
- contents.latestVersion = __expectString(data.latestVersion);
422
- }
423
- if (data.suiteDefinitionArn != null) {
424
- contents.suiteDefinitionArn = __expectString(data.suiteDefinitionArn);
425
- }
426
- if (data.suiteDefinitionConfiguration != null) {
427
- contents.suiteDefinitionConfiguration = de_SuiteDefinitionConfiguration(data.suiteDefinitionConfiguration, context);
428
- }
429
- if (data.suiteDefinitionId != null) {
430
- contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
431
- }
432
- if (data.suiteDefinitionVersion != null) {
433
- contents.suiteDefinitionVersion = __expectString(data.suiteDefinitionVersion);
434
- }
435
- if (data.tags != null) {
436
- contents.tags = de_TagMap(data.tags, context);
437
- }
401
+ const doc = take(data, {
402
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
403
+ lastModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
404
+ latestVersion: __expectString,
405
+ suiteDefinitionArn: __expectString,
406
+ suiteDefinitionConfiguration: _json,
407
+ suiteDefinitionId: __expectString,
408
+ suiteDefinitionVersion: __expectString,
409
+ tags: _json,
410
+ });
411
+ Object.assign(contents, doc);
438
412
  return contents;
439
413
  };
440
414
  const de_GetSuiteDefinitionCommandError = async (output, context) => {
@@ -455,10 +429,9 @@ const de_GetSuiteDefinitionCommandError = async (output, context) => {
455
429
  throw await de_ValidationExceptionRes(parsedOutput, context);
456
430
  default:
457
431
  const parsedBody = parsedOutput.body;
458
- throwDefaultError({
432
+ return throwDefaultError({
459
433
  output,
460
434
  parsedBody,
461
- exceptionCtor: __BaseException,
462
435
  errorCode,
463
436
  });
464
437
  }
@@ -471,39 +444,20 @@ export const de_GetSuiteRunCommand = async (output, context) => {
471
444
  $metadata: deserializeMetadata(output),
472
445
  });
473
446
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
474
- if (data.endTime != null) {
475
- contents.endTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.endTime)));
476
- }
477
- if (data.errorReason != null) {
478
- contents.errorReason = __expectString(data.errorReason);
479
- }
480
- if (data.startTime != null) {
481
- contents.startTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.startTime)));
482
- }
483
- if (data.status != null) {
484
- contents.status = __expectString(data.status);
485
- }
486
- if (data.suiteDefinitionId != null) {
487
- contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
488
- }
489
- if (data.suiteDefinitionVersion != null) {
490
- contents.suiteDefinitionVersion = __expectString(data.suiteDefinitionVersion);
491
- }
492
- if (data.suiteRunArn != null) {
493
- contents.suiteRunArn = __expectString(data.suiteRunArn);
494
- }
495
- if (data.suiteRunConfiguration != null) {
496
- contents.suiteRunConfiguration = de_SuiteRunConfiguration(data.suiteRunConfiguration, context);
497
- }
498
- if (data.suiteRunId != null) {
499
- contents.suiteRunId = __expectString(data.suiteRunId);
500
- }
501
- if (data.tags != null) {
502
- contents.tags = de_TagMap(data.tags, context);
503
- }
504
- if (data.testResult != null) {
505
- contents.testResult = de_TestResult(data.testResult, context);
506
- }
447
+ const doc = take(data, {
448
+ endTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
449
+ errorReason: __expectString,
450
+ startTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
451
+ status: __expectString,
452
+ suiteDefinitionId: __expectString,
453
+ suiteDefinitionVersion: __expectString,
454
+ suiteRunArn: __expectString,
455
+ suiteRunConfiguration: _json,
456
+ suiteRunId: __expectString,
457
+ tags: _json,
458
+ testResult: (_) => de_TestResult(_, context),
459
+ });
460
+ Object.assign(contents, doc);
507
461
  return contents;
508
462
  };
509
463
  const de_GetSuiteRunCommandError = async (output, context) => {
@@ -524,10 +478,9 @@ const de_GetSuiteRunCommandError = async (output, context) => {
524
478
  throw await de_ValidationExceptionRes(parsedOutput, context);
525
479
  default:
526
480
  const parsedBody = parsedOutput.body;
527
- throwDefaultError({
481
+ return throwDefaultError({
528
482
  output,
529
483
  parsedBody,
530
- exceptionCtor: __BaseException,
531
484
  errorCode,
532
485
  });
533
486
  }
@@ -540,9 +493,10 @@ export const de_GetSuiteRunReportCommand = async (output, context) => {
540
493
  $metadata: deserializeMetadata(output),
541
494
  });
542
495
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
543
- if (data.qualificationReportDownloadUrl != null) {
544
- contents.qualificationReportDownloadUrl = __expectString(data.qualificationReportDownloadUrl);
545
- }
496
+ const doc = take(data, {
497
+ qualificationReportDownloadUrl: __expectString,
498
+ });
499
+ Object.assign(contents, doc);
546
500
  return contents;
547
501
  };
548
502
  const de_GetSuiteRunReportCommandError = async (output, context) => {
@@ -563,10 +517,9 @@ const de_GetSuiteRunReportCommandError = async (output, context) => {
563
517
  throw await de_ValidationExceptionRes(parsedOutput, context);
564
518
  default:
565
519
  const parsedBody = parsedOutput.body;
566
- throwDefaultError({
520
+ return throwDefaultError({
567
521
  output,
568
522
  parsedBody,
569
- exceptionCtor: __BaseException,
570
523
  errorCode,
571
524
  });
572
525
  }
@@ -579,12 +532,11 @@ export const de_ListSuiteDefinitionsCommand = async (output, context) => {
579
532
  $metadata: deserializeMetadata(output),
580
533
  });
581
534
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
582
- if (data.nextToken != null) {
583
- contents.nextToken = __expectString(data.nextToken);
584
- }
585
- if (data.suiteDefinitionInformationList != null) {
586
- contents.suiteDefinitionInformationList = de_SuiteDefinitionInformationList(data.suiteDefinitionInformationList, context);
587
- }
535
+ const doc = take(data, {
536
+ nextToken: __expectString,
537
+ suiteDefinitionInformationList: (_) => de_SuiteDefinitionInformationList(_, context),
538
+ });
539
+ Object.assign(contents, doc);
588
540
  return contents;
589
541
  };
590
542
  const de_ListSuiteDefinitionsCommandError = async (output, context) => {
@@ -602,10 +554,9 @@ const de_ListSuiteDefinitionsCommandError = async (output, context) => {
602
554
  throw await de_ValidationExceptionRes(parsedOutput, context);
603
555
  default:
604
556
  const parsedBody = parsedOutput.body;
605
- throwDefaultError({
557
+ return throwDefaultError({
606
558
  output,
607
559
  parsedBody,
608
- exceptionCtor: __BaseException,
609
560
  errorCode,
610
561
  });
611
562
  }
@@ -618,12 +569,11 @@ export const de_ListSuiteRunsCommand = async (output, context) => {
618
569
  $metadata: deserializeMetadata(output),
619
570
  });
620
571
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
621
- if (data.nextToken != null) {
622
- contents.nextToken = __expectString(data.nextToken);
623
- }
624
- if (data.suiteRunsList != null) {
625
- contents.suiteRunsList = de_SuiteRunsList(data.suiteRunsList, context);
626
- }
572
+ const doc = take(data, {
573
+ nextToken: __expectString,
574
+ suiteRunsList: (_) => de_SuiteRunsList(_, context),
575
+ });
576
+ Object.assign(contents, doc);
627
577
  return contents;
628
578
  };
629
579
  const de_ListSuiteRunsCommandError = async (output, context) => {
@@ -641,10 +591,9 @@ const de_ListSuiteRunsCommandError = async (output, context) => {
641
591
  throw await de_ValidationExceptionRes(parsedOutput, context);
642
592
  default:
643
593
  const parsedBody = parsedOutput.body;
644
- throwDefaultError({
594
+ return throwDefaultError({
645
595
  output,
646
596
  parsedBody,
647
- exceptionCtor: __BaseException,
648
597
  errorCode,
649
598
  });
650
599
  }
@@ -657,9 +606,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
657
606
  $metadata: deserializeMetadata(output),
658
607
  });
659
608
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
660
- if (data.tags != null) {
661
- contents.tags = de_TagMap(data.tags, context);
662
- }
609
+ const doc = take(data, {
610
+ tags: _json,
611
+ });
612
+ Object.assign(contents, doc);
663
613
  return contents;
664
614
  };
665
615
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -680,10 +630,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
680
630
  throw await de_ValidationExceptionRes(parsedOutput, context);
681
631
  default:
682
632
  const parsedBody = parsedOutput.body;
683
- throwDefaultError({
633
+ return throwDefaultError({
684
634
  output,
685
635
  parsedBody,
686
- exceptionCtor: __BaseException,
687
636
  errorCode,
688
637
  });
689
638
  }
@@ -696,18 +645,13 @@ export const de_StartSuiteRunCommand = async (output, context) => {
696
645
  $metadata: deserializeMetadata(output),
697
646
  });
698
647
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
699
- if (data.createdAt != null) {
700
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
701
- }
702
- if (data.endpoint != null) {
703
- contents.endpoint = __expectString(data.endpoint);
704
- }
705
- if (data.suiteRunArn != null) {
706
- contents.suiteRunArn = __expectString(data.suiteRunArn);
707
- }
708
- if (data.suiteRunId != null) {
709
- contents.suiteRunId = __expectString(data.suiteRunId);
710
- }
648
+ const doc = take(data, {
649
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
650
+ endpoint: __expectString,
651
+ suiteRunArn: __expectString,
652
+ suiteRunId: __expectString,
653
+ });
654
+ Object.assign(contents, doc);
711
655
  return contents;
712
656
  };
713
657
  const de_StartSuiteRunCommandError = async (output, context) => {
@@ -728,10 +672,9 @@ const de_StartSuiteRunCommandError = async (output, context) => {
728
672
  throw await de_ValidationExceptionRes(parsedOutput, context);
729
673
  default:
730
674
  const parsedBody = parsedOutput.body;
731
- throwDefaultError({
675
+ return throwDefaultError({
732
676
  output,
733
677
  parsedBody,
734
- exceptionCtor: __BaseException,
735
678
  errorCode,
736
679
  });
737
680
  }
@@ -764,10 +707,9 @@ const de_StopSuiteRunCommandError = async (output, context) => {
764
707
  throw await de_ValidationExceptionRes(parsedOutput, context);
765
708
  default:
766
709
  const parsedBody = parsedOutput.body;
767
- throwDefaultError({
710
+ return throwDefaultError({
768
711
  output,
769
712
  parsedBody,
770
- exceptionCtor: __BaseException,
771
713
  errorCode,
772
714
  });
773
715
  }
@@ -800,10 +742,9 @@ const de_TagResourceCommandError = async (output, context) => {
800
742
  throw await de_ValidationExceptionRes(parsedOutput, context);
801
743
  default:
802
744
  const parsedBody = parsedOutput.body;
803
- throwDefaultError({
745
+ return throwDefaultError({
804
746
  output,
805
747
  parsedBody,
806
- exceptionCtor: __BaseException,
807
748
  errorCode,
808
749
  });
809
750
  }
@@ -836,10 +777,9 @@ const de_UntagResourceCommandError = async (output, context) => {
836
777
  throw await de_ValidationExceptionRes(parsedOutput, context);
837
778
  default:
838
779
  const parsedBody = parsedOutput.body;
839
- throwDefaultError({
780
+ return throwDefaultError({
840
781
  output,
841
782
  parsedBody,
842
- exceptionCtor: __BaseException,
843
783
  errorCode,
844
784
  });
845
785
  }
@@ -852,24 +792,15 @@ export const de_UpdateSuiteDefinitionCommand = async (output, context) => {
852
792
  $metadata: deserializeMetadata(output),
853
793
  });
854
794
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
855
- if (data.createdAt != null) {
856
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
857
- }
858
- if (data.lastUpdatedAt != null) {
859
- contents.lastUpdatedAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.lastUpdatedAt)));
860
- }
861
- if (data.suiteDefinitionArn != null) {
862
- contents.suiteDefinitionArn = __expectString(data.suiteDefinitionArn);
863
- }
864
- if (data.suiteDefinitionId != null) {
865
- contents.suiteDefinitionId = __expectString(data.suiteDefinitionId);
866
- }
867
- if (data.suiteDefinitionName != null) {
868
- contents.suiteDefinitionName = __expectString(data.suiteDefinitionName);
869
- }
870
- if (data.suiteDefinitionVersion != null) {
871
- contents.suiteDefinitionVersion = __expectString(data.suiteDefinitionVersion);
872
- }
795
+ const doc = take(data, {
796
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
797
+ lastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
798
+ suiteDefinitionArn: __expectString,
799
+ suiteDefinitionId: __expectString,
800
+ suiteDefinitionName: __expectString,
801
+ suiteDefinitionVersion: __expectString,
802
+ });
803
+ Object.assign(contents, doc);
873
804
  return contents;
874
805
  };
875
806
  const de_UpdateSuiteDefinitionCommandError = async (output, context) => {
@@ -887,21 +818,21 @@ const de_UpdateSuiteDefinitionCommandError = async (output, context) => {
887
818
  throw await de_ValidationExceptionRes(parsedOutput, context);
888
819
  default:
889
820
  const parsedBody = parsedOutput.body;
890
- throwDefaultError({
821
+ return throwDefaultError({
891
822
  output,
892
823
  parsedBody,
893
- exceptionCtor: __BaseException,
894
824
  errorCode,
895
825
  });
896
826
  }
897
827
  };
898
- const map = __map;
828
+ const throwDefaultError = withBaseException(__BaseException);
899
829
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
900
830
  const contents = map({});
901
831
  const data = parsedOutput.body;
902
- if (data.message != null) {
903
- contents.message = __expectString(data.message);
904
- }
832
+ const doc = take(data, {
833
+ message: __expectString,
834
+ });
835
+ Object.assign(contents, doc);
905
836
  const exception = new ConflictException({
906
837
  $metadata: deserializeMetadata(parsedOutput),
907
838
  ...contents,
@@ -911,9 +842,10 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
911
842
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
912
843
  const contents = map({});
913
844
  const data = parsedOutput.body;
914
- if (data.message != null) {
915
- contents.message = __expectString(data.message);
916
- }
845
+ const doc = take(data, {
846
+ message: __expectString,
847
+ });
848
+ Object.assign(contents, doc);
917
849
  const exception = new InternalServerException({
918
850
  $metadata: deserializeMetadata(parsedOutput),
919
851
  ...contents,
@@ -923,9 +855,10 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
923
855
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
924
856
  const contents = map({});
925
857
  const data = parsedOutput.body;
926
- if (data.message != null) {
927
- contents.message = __expectString(data.message);
928
- }
858
+ const doc = take(data, {
859
+ message: __expectString,
860
+ });
861
+ Object.assign(contents, doc);
929
862
  const exception = new ResourceNotFoundException({
930
863
  $metadata: deserializeMetadata(parsedOutput),
931
864
  ...contents,
@@ -935,231 +868,98 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
935
868
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
936
869
  const contents = map({});
937
870
  const data = parsedOutput.body;
938
- if (data.message != null) {
939
- contents.message = __expectString(data.message);
940
- }
871
+ const doc = take(data, {
872
+ message: __expectString,
873
+ });
874
+ Object.assign(contents, doc);
941
875
  const exception = new ValidationException({
942
876
  $metadata: deserializeMetadata(parsedOutput),
943
877
  ...contents,
944
878
  });
945
879
  return __decorateServiceException(exception, parsedOutput.body);
946
880
  };
947
- const se_DeviceUnderTest = (input, context) => {
948
- return {
949
- ...(input.certificateArn != null && { certificateArn: input.certificateArn }),
950
- ...(input.thingArn != null && { thingArn: input.thingArn }),
951
- };
952
- };
953
- const se_DeviceUnderTestList = (input, context) => {
954
- return input
955
- .filter((e) => e != null)
956
- .map((entry) => {
957
- return se_DeviceUnderTest(entry, context);
958
- });
959
- };
960
- const se_SelectedTestList = (input, context) => {
961
- return input
962
- .filter((e) => e != null)
963
- .map((entry) => {
964
- return entry;
965
- });
966
- };
967
- const se_SuiteDefinitionConfiguration = (input, context) => {
968
- return {
969
- ...(input.devicePermissionRoleArn != null && { devicePermissionRoleArn: input.devicePermissionRoleArn }),
970
- ...(input.devices != null && { devices: se_DeviceUnderTestList(input.devices, context) }),
971
- ...(input.intendedForQualification != null && { intendedForQualification: input.intendedForQualification }),
972
- ...(input.isLongDurationTest != null && { isLongDurationTest: input.isLongDurationTest }),
973
- ...(input.protocol != null && { protocol: input.protocol }),
974
- ...(input.rootGroup != null && { rootGroup: input.rootGroup }),
975
- ...(input.suiteDefinitionName != null && { suiteDefinitionName: input.suiteDefinitionName }),
976
- };
977
- };
978
- const se_SuiteRunConfiguration = (input, context) => {
979
- return {
980
- ...(input.parallelRun != null && { parallelRun: input.parallelRun }),
981
- ...(input.primaryDevice != null && { primaryDevice: se_DeviceUnderTest(input.primaryDevice, context) }),
982
- ...(input.selectedTestList != null && { selectedTestList: se_SelectedTestList(input.selectedTestList, context) }),
983
- };
984
- };
985
- const se_TagMap = (input, context) => {
986
- return Object.entries(input).reduce((acc, [key, value]) => {
987
- if (value === null) {
988
- return acc;
989
- }
990
- acc[key] = value;
991
- return acc;
992
- }, {});
993
- };
994
- const de_DeviceUnderTest = (output, context) => {
995
- return {
996
- certificateArn: __expectString(output.certificateArn),
997
- thingArn: __expectString(output.thingArn),
998
- };
999
- };
1000
- const de_DeviceUnderTestList = (output, context) => {
1001
- const retVal = (output || [])
1002
- .filter((e) => e != null)
1003
- .map((entry) => {
1004
- if (entry === null) {
1005
- return null;
1006
- }
1007
- return de_DeviceUnderTest(entry, context);
1008
- });
1009
- return retVal;
1010
- };
1011
881
  const de_GroupResult = (output, context) => {
1012
- return {
1013
- groupId: __expectString(output.groupId),
1014
- groupName: __expectString(output.groupName),
1015
- tests: output.tests != null ? de_TestCaseRuns(output.tests, context) : undefined,
1016
- };
882
+ return take(output, {
883
+ groupId: __expectString,
884
+ groupName: __expectString,
885
+ tests: (_) => de_TestCaseRuns(_, context),
886
+ });
1017
887
  };
1018
888
  const de_GroupResultList = (output, context) => {
1019
889
  const retVal = (output || [])
1020
890
  .filter((e) => e != null)
1021
891
  .map((entry) => {
1022
- if (entry === null) {
1023
- return null;
1024
- }
1025
892
  return de_GroupResult(entry, context);
1026
893
  });
1027
894
  return retVal;
1028
895
  };
1029
- const de_SelectedTestList = (output, context) => {
1030
- const retVal = (output || [])
1031
- .filter((e) => e != null)
1032
- .map((entry) => {
1033
- if (entry === null) {
1034
- return null;
1035
- }
1036
- return __expectString(entry);
1037
- });
1038
- return retVal;
1039
- };
1040
- const de_SuiteDefinitionConfiguration = (output, context) => {
1041
- return {
1042
- devicePermissionRoleArn: __expectString(output.devicePermissionRoleArn),
1043
- devices: output.devices != null ? de_DeviceUnderTestList(output.devices, context) : undefined,
1044
- intendedForQualification: __expectBoolean(output.intendedForQualification),
1045
- isLongDurationTest: __expectBoolean(output.isLongDurationTest),
1046
- protocol: __expectString(output.protocol),
1047
- rootGroup: __expectString(output.rootGroup),
1048
- suiteDefinitionName: __expectString(output.suiteDefinitionName),
1049
- };
1050
- };
1051
896
  const de_SuiteDefinitionInformation = (output, context) => {
1052
- return {
1053
- createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
1054
- defaultDevices: output.defaultDevices != null ? de_DeviceUnderTestList(output.defaultDevices, context) : undefined,
1055
- intendedForQualification: __expectBoolean(output.intendedForQualification),
1056
- isLongDurationTest: __expectBoolean(output.isLongDurationTest),
1057
- protocol: __expectString(output.protocol),
1058
- suiteDefinitionId: __expectString(output.suiteDefinitionId),
1059
- suiteDefinitionName: __expectString(output.suiteDefinitionName),
1060
- };
897
+ return take(output, {
898
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
899
+ defaultDevices: _json,
900
+ intendedForQualification: __expectBoolean,
901
+ isLongDurationTest: __expectBoolean,
902
+ protocol: __expectString,
903
+ suiteDefinitionId: __expectString,
904
+ suiteDefinitionName: __expectString,
905
+ });
1061
906
  };
1062
907
  const de_SuiteDefinitionInformationList = (output, context) => {
1063
908
  const retVal = (output || [])
1064
909
  .filter((e) => e != null)
1065
910
  .map((entry) => {
1066
- if (entry === null) {
1067
- return null;
1068
- }
1069
911
  return de_SuiteDefinitionInformation(entry, context);
1070
912
  });
1071
913
  return retVal;
1072
914
  };
1073
- const de_SuiteRunConfiguration = (output, context) => {
1074
- return {
1075
- parallelRun: __expectBoolean(output.parallelRun),
1076
- primaryDevice: output.primaryDevice != null ? de_DeviceUnderTest(output.primaryDevice, context) : undefined,
1077
- selectedTestList: output.selectedTestList != null ? de_SelectedTestList(output.selectedTestList, context) : undefined,
1078
- };
1079
- };
1080
915
  const de_SuiteRunInformation = (output, context) => {
1081
- return {
1082
- createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
1083
- endAt: output.endAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.endAt))) : undefined,
1084
- failed: __expectInt32(output.failed),
1085
- passed: __expectInt32(output.passed),
1086
- startedAt: output.startedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.startedAt))) : undefined,
1087
- status: __expectString(output.status),
1088
- suiteDefinitionId: __expectString(output.suiteDefinitionId),
1089
- suiteDefinitionName: __expectString(output.suiteDefinitionName),
1090
- suiteDefinitionVersion: __expectString(output.suiteDefinitionVersion),
1091
- suiteRunId: __expectString(output.suiteRunId),
1092
- };
916
+ return take(output, {
917
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
918
+ endAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
919
+ failed: __expectInt32,
920
+ passed: __expectInt32,
921
+ startedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
922
+ status: __expectString,
923
+ suiteDefinitionId: __expectString,
924
+ suiteDefinitionName: __expectString,
925
+ suiteDefinitionVersion: __expectString,
926
+ suiteRunId: __expectString,
927
+ });
1093
928
  };
1094
929
  const de_SuiteRunsList = (output, context) => {
1095
930
  const retVal = (output || [])
1096
931
  .filter((e) => e != null)
1097
932
  .map((entry) => {
1098
- if (entry === null) {
1099
- return null;
1100
- }
1101
933
  return de_SuiteRunInformation(entry, context);
1102
934
  });
1103
935
  return retVal;
1104
936
  };
1105
- const de_TagMap = (output, context) => {
1106
- return Object.entries(output).reduce((acc, [key, value]) => {
1107
- if (value === null) {
1108
- return acc;
1109
- }
1110
- acc[key] = __expectString(value);
1111
- return acc;
1112
- }, {});
1113
- };
1114
937
  const de_TestCaseRun = (output, context) => {
1115
- return {
1116
- endTime: output.endTime != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.endTime))) : undefined,
1117
- failure: __expectString(output.failure),
1118
- logUrl: __expectString(output.logUrl),
1119
- startTime: output.startTime != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.startTime))) : undefined,
1120
- status: __expectString(output.status),
1121
- testCaseDefinitionId: __expectString(output.testCaseDefinitionId),
1122
- testCaseDefinitionName: __expectString(output.testCaseDefinitionName),
1123
- testCaseRunId: __expectString(output.testCaseRunId),
1124
- testScenarios: output.testScenarios != null ? de_TestCaseScenariosList(output.testScenarios, context) : undefined,
1125
- warnings: __expectString(output.warnings),
1126
- };
938
+ return take(output, {
939
+ endTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
940
+ failure: __expectString,
941
+ logUrl: __expectString,
942
+ startTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
943
+ status: __expectString,
944
+ testCaseDefinitionId: __expectString,
945
+ testCaseDefinitionName: __expectString,
946
+ testCaseRunId: __expectString,
947
+ testScenarios: _json,
948
+ warnings: __expectString,
949
+ });
1127
950
  };
1128
951
  const de_TestCaseRuns = (output, context) => {
1129
952
  const retVal = (output || [])
1130
953
  .filter((e) => e != null)
1131
954
  .map((entry) => {
1132
- if (entry === null) {
1133
- return null;
1134
- }
1135
955
  return de_TestCaseRun(entry, context);
1136
956
  });
1137
957
  return retVal;
1138
958
  };
1139
- const de_TestCaseScenario = (output, context) => {
1140
- return {
1141
- failure: __expectString(output.failure),
1142
- status: __expectString(output.status),
1143
- systemMessage: __expectString(output.systemMessage),
1144
- testCaseScenarioId: __expectString(output.testCaseScenarioId),
1145
- testCaseScenarioType: __expectString(output.testCaseScenarioType),
1146
- };
1147
- };
1148
- const de_TestCaseScenariosList = (output, context) => {
1149
- const retVal = (output || [])
1150
- .filter((e) => e != null)
1151
- .map((entry) => {
1152
- if (entry === null) {
1153
- return null;
1154
- }
1155
- return de_TestCaseScenario(entry, context);
1156
- });
1157
- return retVal;
1158
- };
1159
959
  const de_TestResult = (output, context) => {
1160
- return {
1161
- groups: output.groups != null ? de_GroupResultList(output.groups, context) : undefined,
1162
- };
960
+ return take(output, {
961
+ groups: (_) => de_GroupResultList(_, context),
962
+ });
1163
963
  };
1164
964
  const deserializeMetadata = (output) => ({
1165
965
  httpStatusCode: output.statusCode,