@aws-sdk/client-codeguru-reviewer 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, expectInt32 as __expectInt32, expectLong as __expectLong, 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, 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 { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { CodeGuruReviewerServiceException as __BaseException } from "../models/CodeGuruReviewerServiceException";
5
5
  import { AccessDeniedException, ConflictException, InternalServerException, NotFoundException, ResourceNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
@@ -10,12 +10,12 @@ export const se_AssociateRepositoryCommand = async (input, context) => {
10
10
  };
11
11
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/associations";
12
12
  let body;
13
- body = JSON.stringify({
14
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
15
- ...(input.KMSKeyDetails != null && { KMSKeyDetails: se_KMSKeyDetails(input.KMSKeyDetails, context) }),
16
- ...(input.Repository != null && { Repository: se_Repository(input.Repository, context) }),
17
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
18
- });
13
+ body = JSON.stringify(take(input, {
14
+ ClientRequestToken: (_) => _ ?? generateIdempotencyToken(),
15
+ KMSKeyDetails: (_) => _json(_),
16
+ Repository: (_) => _json(_),
17
+ Tags: (_) => _json(_),
18
+ }));
19
19
  return new __HttpRequest({
20
20
  protocol,
21
21
  hostname,
@@ -33,12 +33,12 @@ export const se_CreateCodeReviewCommand = async (input, context) => {
33
33
  };
34
34
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/codereviews";
35
35
  let body;
36
- body = JSON.stringify({
37
- ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(),
38
- ...(input.Name != null && { Name: input.Name }),
39
- ...(input.RepositoryAssociationArn != null && { RepositoryAssociationArn: input.RepositoryAssociationArn }),
40
- ...(input.Type != null && { Type: se_CodeReviewType(input.Type, context) }),
41
- });
36
+ body = JSON.stringify(take(input, {
37
+ ClientRequestToken: (_) => _ ?? generateIdempotencyToken(),
38
+ Name: [],
39
+ RepositoryAssociationArn: [],
40
+ Type: (_) => _json(_),
41
+ }));
42
42
  return new __HttpRequest({
43
43
  protocol,
44
44
  hostname,
@@ -247,11 +247,11 @@ export const se_PutRecommendationFeedbackCommand = async (input, context) => {
247
247
  };
248
248
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/feedback";
249
249
  let body;
250
- body = JSON.stringify({
251
- ...(input.CodeReviewArn != null && { CodeReviewArn: input.CodeReviewArn }),
252
- ...(input.Reactions != null && { Reactions: se_Reactions(input.Reactions, context) }),
253
- ...(input.RecommendationId != null && { RecommendationId: input.RecommendationId }),
254
- });
250
+ body = JSON.stringify(take(input, {
251
+ CodeReviewArn: [],
252
+ Reactions: (_) => _json(_),
253
+ RecommendationId: [],
254
+ }));
255
255
  return new __HttpRequest({
256
256
  protocol,
257
257
  hostname,
@@ -270,9 +270,9 @@ export const se_TagResourceCommand = async (input, context) => {
270
270
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
271
271
  resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
272
272
  let body;
273
- body = JSON.stringify({
274
- ...(input.Tags != null && { Tags: se_TagMap(input.Tags, context) }),
275
- });
273
+ body = JSON.stringify(take(input, {
274
+ Tags: (_) => _json(_),
275
+ }));
276
276
  return new __HttpRequest({
277
277
  protocol,
278
278
  hostname,
@@ -314,12 +314,11 @@ export const de_AssociateRepositoryCommand = async (output, context) => {
314
314
  $metadata: deserializeMetadata(output),
315
315
  });
316
316
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
317
- if (data.RepositoryAssociation != null) {
318
- contents.RepositoryAssociation = de_RepositoryAssociation(data.RepositoryAssociation, context);
319
- }
320
- if (data.Tags != null) {
321
- contents.Tags = de_TagMap(data.Tags, context);
322
- }
317
+ const doc = take(data, {
318
+ RepositoryAssociation: (_) => de_RepositoryAssociation(_, context),
319
+ Tags: _json,
320
+ });
321
+ Object.assign(contents, doc);
323
322
  return contents;
324
323
  };
325
324
  const de_AssociateRepositoryCommandError = async (output, context) => {
@@ -346,10 +345,9 @@ const de_AssociateRepositoryCommandError = async (output, context) => {
346
345
  throw await de_ValidationExceptionRes(parsedOutput, context);
347
346
  default:
348
347
  const parsedBody = parsedOutput.body;
349
- throwDefaultError({
348
+ return throwDefaultError({
350
349
  output,
351
350
  parsedBody,
352
- exceptionCtor: __BaseException,
353
351
  errorCode,
354
352
  });
355
353
  }
@@ -362,9 +360,10 @@ export const de_CreateCodeReviewCommand = async (output, context) => {
362
360
  $metadata: deserializeMetadata(output),
363
361
  });
364
362
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
365
- if (data.CodeReview != null) {
366
- contents.CodeReview = de_CodeReview(data.CodeReview, context);
367
- }
363
+ const doc = take(data, {
364
+ CodeReview: (_) => de_CodeReview(_, context),
365
+ });
366
+ Object.assign(contents, doc);
368
367
  return contents;
369
368
  };
370
369
  const de_CreateCodeReviewCommandError = async (output, context) => {
@@ -394,10 +393,9 @@ const de_CreateCodeReviewCommandError = async (output, context) => {
394
393
  throw await de_ValidationExceptionRes(parsedOutput, context);
395
394
  default:
396
395
  const parsedBody = parsedOutput.body;
397
- throwDefaultError({
396
+ return throwDefaultError({
398
397
  output,
399
398
  parsedBody,
400
- exceptionCtor: __BaseException,
401
399
  errorCode,
402
400
  });
403
401
  }
@@ -410,9 +408,10 @@ export const de_DescribeCodeReviewCommand = async (output, context) => {
410
408
  $metadata: deserializeMetadata(output),
411
409
  });
412
410
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
413
- if (data.CodeReview != null) {
414
- contents.CodeReview = de_CodeReview(data.CodeReview, context);
415
- }
411
+ const doc = take(data, {
412
+ CodeReview: (_) => de_CodeReview(_, context),
413
+ });
414
+ Object.assign(contents, doc);
416
415
  return contents;
417
416
  };
418
417
  const de_DescribeCodeReviewCommandError = async (output, context) => {
@@ -439,10 +438,9 @@ const de_DescribeCodeReviewCommandError = async (output, context) => {
439
438
  throw await de_ValidationExceptionRes(parsedOutput, context);
440
439
  default:
441
440
  const parsedBody = parsedOutput.body;
442
- throwDefaultError({
441
+ return throwDefaultError({
443
442
  output,
444
443
  parsedBody,
445
- exceptionCtor: __BaseException,
446
444
  errorCode,
447
445
  });
448
446
  }
@@ -455,9 +453,10 @@ export const de_DescribeRecommendationFeedbackCommand = async (output, context)
455
453
  $metadata: deserializeMetadata(output),
456
454
  });
457
455
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
458
- if (data.RecommendationFeedback != null) {
459
- contents.RecommendationFeedback = de_RecommendationFeedback(data.RecommendationFeedback, context);
460
- }
456
+ const doc = take(data, {
457
+ RecommendationFeedback: (_) => de_RecommendationFeedback(_, context),
458
+ });
459
+ Object.assign(contents, doc);
461
460
  return contents;
462
461
  };
463
462
  const de_DescribeRecommendationFeedbackCommandError = async (output, context) => {
@@ -484,10 +483,9 @@ const de_DescribeRecommendationFeedbackCommandError = async (output, context) =>
484
483
  throw await de_ValidationExceptionRes(parsedOutput, context);
485
484
  default:
486
485
  const parsedBody = parsedOutput.body;
487
- throwDefaultError({
486
+ return throwDefaultError({
488
487
  output,
489
488
  parsedBody,
490
- exceptionCtor: __BaseException,
491
489
  errorCode,
492
490
  });
493
491
  }
@@ -500,12 +498,11 @@ export const de_DescribeRepositoryAssociationCommand = async (output, context) =
500
498
  $metadata: deserializeMetadata(output),
501
499
  });
502
500
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
503
- if (data.RepositoryAssociation != null) {
504
- contents.RepositoryAssociation = de_RepositoryAssociation(data.RepositoryAssociation, context);
505
- }
506
- if (data.Tags != null) {
507
- contents.Tags = de_TagMap(data.Tags, context);
508
- }
501
+ const doc = take(data, {
502
+ RepositoryAssociation: (_) => de_RepositoryAssociation(_, context),
503
+ Tags: _json,
504
+ });
505
+ Object.assign(contents, doc);
509
506
  return contents;
510
507
  };
511
508
  const de_DescribeRepositoryAssociationCommandError = async (output, context) => {
@@ -532,10 +529,9 @@ const de_DescribeRepositoryAssociationCommandError = async (output, context) =>
532
529
  throw await de_ValidationExceptionRes(parsedOutput, context);
533
530
  default:
534
531
  const parsedBody = parsedOutput.body;
535
- throwDefaultError({
532
+ return throwDefaultError({
536
533
  output,
537
534
  parsedBody,
538
- exceptionCtor: __BaseException,
539
535
  errorCode,
540
536
  });
541
537
  }
@@ -548,12 +544,11 @@ export const de_DisassociateRepositoryCommand = async (output, context) => {
548
544
  $metadata: deserializeMetadata(output),
549
545
  });
550
546
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
551
- if (data.RepositoryAssociation != null) {
552
- contents.RepositoryAssociation = de_RepositoryAssociation(data.RepositoryAssociation, context);
553
- }
554
- if (data.Tags != null) {
555
- contents.Tags = de_TagMap(data.Tags, context);
556
- }
547
+ const doc = take(data, {
548
+ RepositoryAssociation: (_) => de_RepositoryAssociation(_, context),
549
+ Tags: _json,
550
+ });
551
+ Object.assign(contents, doc);
557
552
  return contents;
558
553
  };
559
554
  const de_DisassociateRepositoryCommandError = async (output, context) => {
@@ -583,10 +578,9 @@ const de_DisassociateRepositoryCommandError = async (output, context) => {
583
578
  throw await de_ValidationExceptionRes(parsedOutput, context);
584
579
  default:
585
580
  const parsedBody = parsedOutput.body;
586
- throwDefaultError({
581
+ return throwDefaultError({
587
582
  output,
588
583
  parsedBody,
589
- exceptionCtor: __BaseException,
590
584
  errorCode,
591
585
  });
592
586
  }
@@ -599,12 +593,11 @@ export const de_ListCodeReviewsCommand = async (output, context) => {
599
593
  $metadata: deserializeMetadata(output),
600
594
  });
601
595
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
602
- if (data.CodeReviewSummaries != null) {
603
- contents.CodeReviewSummaries = de_CodeReviewSummaries(data.CodeReviewSummaries, context);
604
- }
605
- if (data.NextToken != null) {
606
- contents.NextToken = __expectString(data.NextToken);
607
- }
596
+ const doc = take(data, {
597
+ CodeReviewSummaries: (_) => de_CodeReviewSummaries(_, context),
598
+ NextToken: __expectString,
599
+ });
600
+ Object.assign(contents, doc);
608
601
  return contents;
609
602
  };
610
603
  const de_ListCodeReviewsCommandError = async (output, context) => {
@@ -628,10 +621,9 @@ const de_ListCodeReviewsCommandError = async (output, context) => {
628
621
  throw await de_ValidationExceptionRes(parsedOutput, context);
629
622
  default:
630
623
  const parsedBody = parsedOutput.body;
631
- throwDefaultError({
624
+ return throwDefaultError({
632
625
  output,
633
626
  parsedBody,
634
- exceptionCtor: __BaseException,
635
627
  errorCode,
636
628
  });
637
629
  }
@@ -644,12 +636,11 @@ export const de_ListRecommendationFeedbackCommand = async (output, context) => {
644
636
  $metadata: deserializeMetadata(output),
645
637
  });
646
638
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
647
- if (data.NextToken != null) {
648
- contents.NextToken = __expectString(data.NextToken);
649
- }
650
- if (data.RecommendationFeedbackSummaries != null) {
651
- contents.RecommendationFeedbackSummaries = de_RecommendationFeedbackSummaries(data.RecommendationFeedbackSummaries, context);
652
- }
639
+ const doc = take(data, {
640
+ NextToken: __expectString,
641
+ RecommendationFeedbackSummaries: _json,
642
+ });
643
+ Object.assign(contents, doc);
653
644
  return contents;
654
645
  };
655
646
  const de_ListRecommendationFeedbackCommandError = async (output, context) => {
@@ -676,10 +667,9 @@ const de_ListRecommendationFeedbackCommandError = async (output, context) => {
676
667
  throw await de_ValidationExceptionRes(parsedOutput, context);
677
668
  default:
678
669
  const parsedBody = parsedOutput.body;
679
- throwDefaultError({
670
+ return throwDefaultError({
680
671
  output,
681
672
  parsedBody,
682
- exceptionCtor: __BaseException,
683
673
  errorCode,
684
674
  });
685
675
  }
@@ -692,12 +682,11 @@ export const de_ListRecommendationsCommand = async (output, context) => {
692
682
  $metadata: deserializeMetadata(output),
693
683
  });
694
684
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
695
- if (data.NextToken != null) {
696
- contents.NextToken = __expectString(data.NextToken);
697
- }
698
- if (data.RecommendationSummaries != null) {
699
- contents.RecommendationSummaries = de_RecommendationSummaries(data.RecommendationSummaries, context);
700
- }
685
+ const doc = take(data, {
686
+ NextToken: __expectString,
687
+ RecommendationSummaries: _json,
688
+ });
689
+ Object.assign(contents, doc);
701
690
  return contents;
702
691
  };
703
692
  const de_ListRecommendationsCommandError = async (output, context) => {
@@ -724,10 +713,9 @@ const de_ListRecommendationsCommandError = async (output, context) => {
724
713
  throw await de_ValidationExceptionRes(parsedOutput, context);
725
714
  default:
726
715
  const parsedBody = parsedOutput.body;
727
- throwDefaultError({
716
+ return throwDefaultError({
728
717
  output,
729
718
  parsedBody,
730
- exceptionCtor: __BaseException,
731
719
  errorCode,
732
720
  });
733
721
  }
@@ -740,12 +728,11 @@ export const de_ListRepositoryAssociationsCommand = async (output, context) => {
740
728
  $metadata: deserializeMetadata(output),
741
729
  });
742
730
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
743
- if (data.NextToken != null) {
744
- contents.NextToken = __expectString(data.NextToken);
745
- }
746
- if (data.RepositoryAssociationSummaries != null) {
747
- contents.RepositoryAssociationSummaries = de_RepositoryAssociationSummaries(data.RepositoryAssociationSummaries, context);
748
- }
731
+ const doc = take(data, {
732
+ NextToken: __expectString,
733
+ RepositoryAssociationSummaries: (_) => de_RepositoryAssociationSummaries(_, context),
734
+ });
735
+ Object.assign(contents, doc);
749
736
  return contents;
750
737
  };
751
738
  const de_ListRepositoryAssociationsCommandError = async (output, context) => {
@@ -766,10 +753,9 @@ const de_ListRepositoryAssociationsCommandError = async (output, context) => {
766
753
  throw await de_ValidationExceptionRes(parsedOutput, context);
767
754
  default:
768
755
  const parsedBody = parsedOutput.body;
769
- throwDefaultError({
756
+ return throwDefaultError({
770
757
  output,
771
758
  parsedBody,
772
- exceptionCtor: __BaseException,
773
759
  errorCode,
774
760
  });
775
761
  }
@@ -782,9 +768,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
782
768
  $metadata: deserializeMetadata(output),
783
769
  });
784
770
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
785
- if (data.Tags != null) {
786
- contents.Tags = de_TagMap(data.Tags, context);
787
- }
771
+ const doc = take(data, {
772
+ Tags: _json,
773
+ });
774
+ Object.assign(contents, doc);
788
775
  return contents;
789
776
  };
790
777
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -805,10 +792,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
805
792
  throw await de_ValidationExceptionRes(parsedOutput, context);
806
793
  default:
807
794
  const parsedBody = parsedOutput.body;
808
- throwDefaultError({
795
+ return throwDefaultError({
809
796
  output,
810
797
  parsedBody,
811
- exceptionCtor: __BaseException,
812
798
  errorCode,
813
799
  });
814
800
  }
@@ -847,10 +833,9 @@ const de_PutRecommendationFeedbackCommandError = async (output, context) => {
847
833
  throw await de_ValidationExceptionRes(parsedOutput, context);
848
834
  default:
849
835
  const parsedBody = parsedOutput.body;
850
- throwDefaultError({
836
+ return throwDefaultError({
851
837
  output,
852
838
  parsedBody,
853
- exceptionCtor: __BaseException,
854
839
  errorCode,
855
840
  });
856
841
  }
@@ -883,10 +868,9 @@ const de_TagResourceCommandError = async (output, context) => {
883
868
  throw await de_ValidationExceptionRes(parsedOutput, context);
884
869
  default:
885
870
  const parsedBody = parsedOutput.body;
886
- throwDefaultError({
871
+ return throwDefaultError({
887
872
  output,
888
873
  parsedBody,
889
- exceptionCtor: __BaseException,
890
874
  errorCode,
891
875
  });
892
876
  }
@@ -919,21 +903,21 @@ const de_UntagResourceCommandError = async (output, context) => {
919
903
  throw await de_ValidationExceptionRes(parsedOutput, context);
920
904
  default:
921
905
  const parsedBody = parsedOutput.body;
922
- throwDefaultError({
906
+ return throwDefaultError({
923
907
  output,
924
908
  parsedBody,
925
- exceptionCtor: __BaseException,
926
909
  errorCode,
927
910
  });
928
911
  }
929
912
  };
930
- const map = __map;
913
+ const throwDefaultError = withBaseException(__BaseException);
931
914
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
932
915
  const contents = map({});
933
916
  const data = parsedOutput.body;
934
- if (data.Message != null) {
935
- contents.Message = __expectString(data.Message);
936
- }
917
+ const doc = take(data, {
918
+ Message: __expectString,
919
+ });
920
+ Object.assign(contents, doc);
937
921
  const exception = new AccessDeniedException({
938
922
  $metadata: deserializeMetadata(parsedOutput),
939
923
  ...contents,
@@ -943,9 +927,10 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
943
927
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
944
928
  const contents = map({});
945
929
  const data = parsedOutput.body;
946
- if (data.Message != null) {
947
- contents.Message = __expectString(data.Message);
948
- }
930
+ const doc = take(data, {
931
+ Message: __expectString,
932
+ });
933
+ Object.assign(contents, doc);
949
934
  const exception = new ConflictException({
950
935
  $metadata: deserializeMetadata(parsedOutput),
951
936
  ...contents,
@@ -955,9 +940,10 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
955
940
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
956
941
  const contents = map({});
957
942
  const data = parsedOutput.body;
958
- if (data.Message != null) {
959
- contents.Message = __expectString(data.Message);
960
- }
943
+ const doc = take(data, {
944
+ Message: __expectString,
945
+ });
946
+ Object.assign(contents, doc);
961
947
  const exception = new InternalServerException({
962
948
  $metadata: deserializeMetadata(parsedOutput),
963
949
  ...contents,
@@ -967,9 +953,10 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
967
953
  const de_NotFoundExceptionRes = async (parsedOutput, context) => {
968
954
  const contents = map({});
969
955
  const data = parsedOutput.body;
970
- if (data.Message != null) {
971
- contents.Message = __expectString(data.Message);
972
- }
956
+ const doc = take(data, {
957
+ Message: __expectString,
958
+ });
959
+ Object.assign(contents, doc);
973
960
  const exception = new NotFoundException({
974
961
  $metadata: deserializeMetadata(parsedOutput),
975
962
  ...contents,
@@ -979,9 +966,10 @@ const de_NotFoundExceptionRes = async (parsedOutput, context) => {
979
966
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
980
967
  const contents = map({});
981
968
  const data = parsedOutput.body;
982
- if (data.Message != null) {
983
- contents.Message = __expectString(data.Message);
984
- }
969
+ const doc = take(data, {
970
+ Message: __expectString,
971
+ });
972
+ Object.assign(contents, doc);
985
973
  const exception = new ResourceNotFoundException({
986
974
  $metadata: deserializeMetadata(parsedOutput),
987
975
  ...contents,
@@ -991,9 +979,10 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
991
979
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
992
980
  const contents = map({});
993
981
  const data = parsedOutput.body;
994
- if (data.Message != null) {
995
- contents.Message = __expectString(data.Message);
996
- }
982
+ const doc = take(data, {
983
+ Message: __expectString,
984
+ });
985
+ Object.assign(contents, doc);
997
986
  const exception = new ThrottlingException({
998
987
  $metadata: deserializeMetadata(parsedOutput),
999
988
  ...contents,
@@ -1003,437 +992,105 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1003
992
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
1004
993
  const contents = map({});
1005
994
  const data = parsedOutput.body;
1006
- if (data.Message != null) {
1007
- contents.Message = __expectString(data.Message);
1008
- }
995
+ const doc = take(data, {
996
+ Message: __expectString,
997
+ });
998
+ Object.assign(contents, doc);
1009
999
  const exception = new ValidationException({
1010
1000
  $metadata: deserializeMetadata(parsedOutput),
1011
1001
  ...contents,
1012
1002
  });
1013
1003
  return __decorateServiceException(exception, parsedOutput.body);
1014
1004
  };
1015
- const se_AnalysisTypes = (input, context) => {
1016
- return input
1017
- .filter((e) => e != null)
1018
- .map((entry) => {
1019
- return entry;
1020
- });
1021
- };
1022
- const se_BranchDiffSourceCodeType = (input, context) => {
1023
- return {
1024
- ...(input.DestinationBranchName != null && { DestinationBranchName: input.DestinationBranchName }),
1025
- ...(input.SourceBranchName != null && { SourceBranchName: input.SourceBranchName }),
1026
- };
1027
- };
1028
- const se_CodeArtifacts = (input, context) => {
1029
- return {
1030
- ...(input.BuildArtifactsObjectKey != null && { BuildArtifactsObjectKey: input.BuildArtifactsObjectKey }),
1031
- ...(input.SourceCodeArtifactsObjectKey != null && {
1032
- SourceCodeArtifactsObjectKey: input.SourceCodeArtifactsObjectKey,
1033
- }),
1034
- };
1035
- };
1036
- const se_CodeCommitRepository = (input, context) => {
1037
- return {
1038
- ...(input.Name != null && { Name: input.Name }),
1039
- };
1040
- };
1041
- const se_CodeReviewType = (input, context) => {
1042
- return {
1043
- ...(input.AnalysisTypes != null && { AnalysisTypes: se_AnalysisTypes(input.AnalysisTypes, context) }),
1044
- ...(input.RepositoryAnalysis != null && {
1045
- RepositoryAnalysis: se_RepositoryAnalysis(input.RepositoryAnalysis, context),
1046
- }),
1047
- };
1048
- };
1049
- const se_CommitDiffSourceCodeType = (input, context) => {
1050
- return {
1051
- ...(input.DestinationCommit != null && { DestinationCommit: input.DestinationCommit }),
1052
- ...(input.MergeBaseCommit != null && { MergeBaseCommit: input.MergeBaseCommit }),
1053
- ...(input.SourceCommit != null && { SourceCommit: input.SourceCommit }),
1054
- };
1055
- };
1056
- const se_EventInfo = (input, context) => {
1057
- return {
1058
- ...(input.Name != null && { Name: input.Name }),
1059
- ...(input.State != null && { State: input.State }),
1060
- };
1061
- };
1062
- const se_KMSKeyDetails = (input, context) => {
1063
- return {
1064
- ...(input.EncryptionOption != null && { EncryptionOption: input.EncryptionOption }),
1065
- ...(input.KMSKeyId != null && { KMSKeyId: input.KMSKeyId }),
1066
- };
1067
- };
1068
- const se_Reactions = (input, context) => {
1069
- return input
1070
- .filter((e) => e != null)
1071
- .map((entry) => {
1072
- return entry;
1073
- });
1074
- };
1075
- const se_Repository = (input, context) => {
1076
- return {
1077
- ...(input.Bitbucket != null && { Bitbucket: se_ThirdPartySourceRepository(input.Bitbucket, context) }),
1078
- ...(input.CodeCommit != null && { CodeCommit: se_CodeCommitRepository(input.CodeCommit, context) }),
1079
- ...(input.GitHubEnterpriseServer != null && {
1080
- GitHubEnterpriseServer: se_ThirdPartySourceRepository(input.GitHubEnterpriseServer, context),
1081
- }),
1082
- ...(input.S3Bucket != null && { S3Bucket: se_S3Repository(input.S3Bucket, context) }),
1083
- };
1084
- };
1085
- const se_RepositoryAnalysis = (input, context) => {
1086
- return {
1087
- ...(input.RepositoryHead != null && {
1088
- RepositoryHead: se_RepositoryHeadSourceCodeType(input.RepositoryHead, context),
1089
- }),
1090
- ...(input.SourceCodeType != null && { SourceCodeType: se_SourceCodeType(input.SourceCodeType, context) }),
1091
- };
1092
- };
1093
- const se_RepositoryHeadSourceCodeType = (input, context) => {
1094
- return {
1095
- ...(input.BranchName != null && { BranchName: input.BranchName }),
1096
- };
1097
- };
1098
- const se_RequestMetadata = (input, context) => {
1099
- return {
1100
- ...(input.EventInfo != null && { EventInfo: se_EventInfo(input.EventInfo, context) }),
1101
- ...(input.RequestId != null && { RequestId: input.RequestId }),
1102
- ...(input.Requester != null && { Requester: input.Requester }),
1103
- ...(input.VendorName != null && { VendorName: input.VendorName }),
1104
- };
1105
- };
1106
- const se_S3BucketRepository = (input, context) => {
1107
- return {
1108
- ...(input.Details != null && { Details: se_S3RepositoryDetails(input.Details, context) }),
1109
- ...(input.Name != null && { Name: input.Name }),
1110
- };
1111
- };
1112
- const se_S3Repository = (input, context) => {
1113
- return {
1114
- ...(input.BucketName != null && { BucketName: input.BucketName }),
1115
- ...(input.Name != null && { Name: input.Name }),
1116
- };
1117
- };
1118
- const se_S3RepositoryDetails = (input, context) => {
1119
- return {
1120
- ...(input.BucketName != null && { BucketName: input.BucketName }),
1121
- ...(input.CodeArtifacts != null && { CodeArtifacts: se_CodeArtifacts(input.CodeArtifacts, context) }),
1122
- };
1123
- };
1124
- const se_SourceCodeType = (input, context) => {
1125
- return {
1126
- ...(input.BranchDiff != null && { BranchDiff: se_BranchDiffSourceCodeType(input.BranchDiff, context) }),
1127
- ...(input.CommitDiff != null && { CommitDiff: se_CommitDiffSourceCodeType(input.CommitDiff, context) }),
1128
- ...(input.RepositoryHead != null && {
1129
- RepositoryHead: se_RepositoryHeadSourceCodeType(input.RepositoryHead, context),
1130
- }),
1131
- ...(input.RequestMetadata != null && { RequestMetadata: se_RequestMetadata(input.RequestMetadata, context) }),
1132
- ...(input.S3BucketRepository != null && {
1133
- S3BucketRepository: se_S3BucketRepository(input.S3BucketRepository, context),
1134
- }),
1135
- };
1136
- };
1137
- const se_TagMap = (input, context) => {
1138
- return Object.entries(input).reduce((acc, [key, value]) => {
1139
- if (value === null) {
1140
- return acc;
1141
- }
1142
- acc[key] = value;
1143
- return acc;
1144
- }, {});
1145
- };
1146
- const se_ThirdPartySourceRepository = (input, context) => {
1147
- return {
1148
- ...(input.ConnectionArn != null && { ConnectionArn: input.ConnectionArn }),
1149
- ...(input.Name != null && { Name: input.Name }),
1150
- ...(input.Owner != null && { Owner: input.Owner }),
1151
- };
1152
- };
1153
- const de_AnalysisTypes = (output, context) => {
1154
- const retVal = (output || [])
1155
- .filter((e) => e != null)
1156
- .map((entry) => {
1157
- if (entry === null) {
1158
- return null;
1159
- }
1160
- return __expectString(entry);
1161
- });
1162
- return retVal;
1163
- };
1164
- const de_BranchDiffSourceCodeType = (output, context) => {
1165
- return {
1166
- DestinationBranchName: __expectString(output.DestinationBranchName),
1167
- SourceBranchName: __expectString(output.SourceBranchName),
1168
- };
1169
- };
1170
- const de_CodeArtifacts = (output, context) => {
1171
- return {
1172
- BuildArtifactsObjectKey: __expectString(output.BuildArtifactsObjectKey),
1173
- SourceCodeArtifactsObjectKey: __expectString(output.SourceCodeArtifactsObjectKey),
1174
- };
1175
- };
1176
1005
  const de_CodeReview = (output, context) => {
1177
- return {
1178
- AnalysisTypes: output.AnalysisTypes != null ? de_AnalysisTypes(output.AnalysisTypes, context) : undefined,
1179
- AssociationArn: __expectString(output.AssociationArn),
1180
- CodeReviewArn: __expectString(output.CodeReviewArn),
1181
- ConfigFileState: __expectString(output.ConfigFileState),
1182
- CreatedTimeStamp: output.CreatedTimeStamp != null
1183
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTimeStamp)))
1184
- : undefined,
1185
- LastUpdatedTimeStamp: output.LastUpdatedTimeStamp != null
1186
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTimeStamp)))
1187
- : undefined,
1188
- Metrics: output.Metrics != null ? de_Metrics(output.Metrics, context) : undefined,
1189
- Name: __expectString(output.Name),
1190
- Owner: __expectString(output.Owner),
1191
- ProviderType: __expectString(output.ProviderType),
1192
- PullRequestId: __expectString(output.PullRequestId),
1193
- RepositoryName: __expectString(output.RepositoryName),
1194
- SourceCodeType: output.SourceCodeType != null ? de_SourceCodeType(output.SourceCodeType, context) : undefined,
1195
- State: __expectString(output.State),
1196
- StateReason: __expectString(output.StateReason),
1197
- Type: __expectString(output.Type),
1198
- };
1006
+ return take(output, {
1007
+ AnalysisTypes: _json,
1008
+ AssociationArn: __expectString,
1009
+ CodeReviewArn: __expectString,
1010
+ ConfigFileState: __expectString,
1011
+ CreatedTimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1012
+ LastUpdatedTimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1013
+ Metrics: _json,
1014
+ Name: __expectString,
1015
+ Owner: __expectString,
1016
+ ProviderType: __expectString,
1017
+ PullRequestId: __expectString,
1018
+ RepositoryName: __expectString,
1019
+ SourceCodeType: _json,
1020
+ State: __expectString,
1021
+ StateReason: __expectString,
1022
+ Type: __expectString,
1023
+ });
1199
1024
  };
1200
1025
  const de_CodeReviewSummaries = (output, context) => {
1201
1026
  const retVal = (output || [])
1202
1027
  .filter((e) => e != null)
1203
1028
  .map((entry) => {
1204
- if (entry === null) {
1205
- return null;
1206
- }
1207
1029
  return de_CodeReviewSummary(entry, context);
1208
1030
  });
1209
1031
  return retVal;
1210
1032
  };
1211
1033
  const de_CodeReviewSummary = (output, context) => {
1212
- return {
1213
- CodeReviewArn: __expectString(output.CodeReviewArn),
1214
- CreatedTimeStamp: output.CreatedTimeStamp != null
1215
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTimeStamp)))
1216
- : undefined,
1217
- LastUpdatedTimeStamp: output.LastUpdatedTimeStamp != null
1218
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTimeStamp)))
1219
- : undefined,
1220
- MetricsSummary: output.MetricsSummary != null ? de_MetricsSummary(output.MetricsSummary, context) : undefined,
1221
- Name: __expectString(output.Name),
1222
- Owner: __expectString(output.Owner),
1223
- ProviderType: __expectString(output.ProviderType),
1224
- PullRequestId: __expectString(output.PullRequestId),
1225
- RepositoryName: __expectString(output.RepositoryName),
1226
- SourceCodeType: output.SourceCodeType != null ? de_SourceCodeType(output.SourceCodeType, context) : undefined,
1227
- State: __expectString(output.State),
1228
- Type: __expectString(output.Type),
1229
- };
1230
- };
1231
- const de_CommitDiffSourceCodeType = (output, context) => {
1232
- return {
1233
- DestinationCommit: __expectString(output.DestinationCommit),
1234
- MergeBaseCommit: __expectString(output.MergeBaseCommit),
1235
- SourceCommit: __expectString(output.SourceCommit),
1236
- };
1237
- };
1238
- const de_EventInfo = (output, context) => {
1239
- return {
1240
- Name: __expectString(output.Name),
1241
- State: __expectString(output.State),
1242
- };
1243
- };
1244
- const de_KMSKeyDetails = (output, context) => {
1245
- return {
1246
- EncryptionOption: __expectString(output.EncryptionOption),
1247
- KMSKeyId: __expectString(output.KMSKeyId),
1248
- };
1249
- };
1250
- const de_Metrics = (output, context) => {
1251
- return {
1252
- FindingsCount: __expectLong(output.FindingsCount),
1253
- MeteredLinesOfCodeCount: __expectLong(output.MeteredLinesOfCodeCount),
1254
- SuppressedLinesOfCodeCount: __expectLong(output.SuppressedLinesOfCodeCount),
1255
- };
1256
- };
1257
- const de_MetricsSummary = (output, context) => {
1258
- return {
1259
- FindingsCount: __expectLong(output.FindingsCount),
1260
- MeteredLinesOfCodeCount: __expectLong(output.MeteredLinesOfCodeCount),
1261
- SuppressedLinesOfCodeCount: __expectLong(output.SuppressedLinesOfCodeCount),
1262
- };
1263
- };
1264
- const de_Reactions = (output, context) => {
1265
- const retVal = (output || [])
1266
- .filter((e) => e != null)
1267
- .map((entry) => {
1268
- if (entry === null) {
1269
- return null;
1270
- }
1271
- return __expectString(entry);
1034
+ return take(output, {
1035
+ CodeReviewArn: __expectString,
1036
+ CreatedTimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1037
+ LastUpdatedTimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1038
+ MetricsSummary: _json,
1039
+ Name: __expectString,
1040
+ Owner: __expectString,
1041
+ ProviderType: __expectString,
1042
+ PullRequestId: __expectString,
1043
+ RepositoryName: __expectString,
1044
+ SourceCodeType: _json,
1045
+ State: __expectString,
1046
+ Type: __expectString,
1272
1047
  });
1273
- return retVal;
1274
1048
  };
1275
1049
  const de_RecommendationFeedback = (output, context) => {
1276
- return {
1277
- CodeReviewArn: __expectString(output.CodeReviewArn),
1278
- CreatedTimeStamp: output.CreatedTimeStamp != null
1279
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTimeStamp)))
1280
- : undefined,
1281
- LastUpdatedTimeStamp: output.LastUpdatedTimeStamp != null
1282
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTimeStamp)))
1283
- : undefined,
1284
- Reactions: output.Reactions != null ? de_Reactions(output.Reactions, context) : undefined,
1285
- RecommendationId: __expectString(output.RecommendationId),
1286
- UserId: __expectString(output.UserId),
1287
- };
1288
- };
1289
- const de_RecommendationFeedbackSummaries = (output, context) => {
1290
- const retVal = (output || [])
1291
- .filter((e) => e != null)
1292
- .map((entry) => {
1293
- if (entry === null) {
1294
- return null;
1295
- }
1296
- return de_RecommendationFeedbackSummary(entry, context);
1297
- });
1298
- return retVal;
1299
- };
1300
- const de_RecommendationFeedbackSummary = (output, context) => {
1301
- return {
1302
- Reactions: output.Reactions != null ? de_Reactions(output.Reactions, context) : undefined,
1303
- RecommendationId: __expectString(output.RecommendationId),
1304
- UserId: __expectString(output.UserId),
1305
- };
1306
- };
1307
- const de_RecommendationSummaries = (output, context) => {
1308
- const retVal = (output || [])
1309
- .filter((e) => e != null)
1310
- .map((entry) => {
1311
- if (entry === null) {
1312
- return null;
1313
- }
1314
- return de_RecommendationSummary(entry, context);
1050
+ return take(output, {
1051
+ CodeReviewArn: __expectString,
1052
+ CreatedTimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1053
+ LastUpdatedTimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1054
+ Reactions: _json,
1055
+ RecommendationId: __expectString,
1056
+ UserId: __expectString,
1315
1057
  });
1316
- return retVal;
1317
- };
1318
- const de_RecommendationSummary = (output, context) => {
1319
- return {
1320
- Description: __expectString(output.Description),
1321
- EndLine: __expectInt32(output.EndLine),
1322
- FilePath: __expectString(output.FilePath),
1323
- RecommendationCategory: __expectString(output.RecommendationCategory),
1324
- RecommendationId: __expectString(output.RecommendationId),
1325
- RuleMetadata: output.RuleMetadata != null ? de_RuleMetadata(output.RuleMetadata, context) : undefined,
1326
- Severity: __expectString(output.Severity),
1327
- StartLine: __expectInt32(output.StartLine),
1328
- };
1329
1058
  };
1330
1059
  const de_RepositoryAssociation = (output, context) => {
1331
- return {
1332
- AssociationArn: __expectString(output.AssociationArn),
1333
- AssociationId: __expectString(output.AssociationId),
1334
- ConnectionArn: __expectString(output.ConnectionArn),
1335
- CreatedTimeStamp: output.CreatedTimeStamp != null
1336
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTimeStamp)))
1337
- : undefined,
1338
- KMSKeyDetails: output.KMSKeyDetails != null ? de_KMSKeyDetails(output.KMSKeyDetails, context) : undefined,
1339
- LastUpdatedTimeStamp: output.LastUpdatedTimeStamp != null
1340
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTimeStamp)))
1341
- : undefined,
1342
- Name: __expectString(output.Name),
1343
- Owner: __expectString(output.Owner),
1344
- ProviderType: __expectString(output.ProviderType),
1345
- S3RepositoryDetails: output.S3RepositoryDetails != null ? de_S3RepositoryDetails(output.S3RepositoryDetails, context) : undefined,
1346
- State: __expectString(output.State),
1347
- StateReason: __expectString(output.StateReason),
1348
- };
1060
+ return take(output, {
1061
+ AssociationArn: __expectString,
1062
+ AssociationId: __expectString,
1063
+ ConnectionArn: __expectString,
1064
+ CreatedTimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1065
+ KMSKeyDetails: _json,
1066
+ LastUpdatedTimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1067
+ Name: __expectString,
1068
+ Owner: __expectString,
1069
+ ProviderType: __expectString,
1070
+ S3RepositoryDetails: _json,
1071
+ State: __expectString,
1072
+ StateReason: __expectString,
1073
+ });
1349
1074
  };
1350
1075
  const de_RepositoryAssociationSummaries = (output, context) => {
1351
1076
  const retVal = (output || [])
1352
1077
  .filter((e) => e != null)
1353
1078
  .map((entry) => {
1354
- if (entry === null) {
1355
- return null;
1356
- }
1357
1079
  return de_RepositoryAssociationSummary(entry, context);
1358
1080
  });
1359
1081
  return retVal;
1360
1082
  };
1361
1083
  const de_RepositoryAssociationSummary = (output, context) => {
1362
- return {
1363
- AssociationArn: __expectString(output.AssociationArn),
1364
- AssociationId: __expectString(output.AssociationId),
1365
- ConnectionArn: __expectString(output.ConnectionArn),
1366
- LastUpdatedTimeStamp: output.LastUpdatedTimeStamp != null
1367
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTimeStamp)))
1368
- : undefined,
1369
- Name: __expectString(output.Name),
1370
- Owner: __expectString(output.Owner),
1371
- ProviderType: __expectString(output.ProviderType),
1372
- State: __expectString(output.State),
1373
- };
1374
- };
1375
- const de_RepositoryHeadSourceCodeType = (output, context) => {
1376
- return {
1377
- BranchName: __expectString(output.BranchName),
1378
- };
1379
- };
1380
- const de_RequestMetadata = (output, context) => {
1381
- return {
1382
- EventInfo: output.EventInfo != null ? de_EventInfo(output.EventInfo, context) : undefined,
1383
- RequestId: __expectString(output.RequestId),
1384
- Requester: __expectString(output.Requester),
1385
- VendorName: __expectString(output.VendorName),
1386
- };
1387
- };
1388
- const de_RuleMetadata = (output, context) => {
1389
- return {
1390
- LongDescription: __expectString(output.LongDescription),
1391
- RuleId: __expectString(output.RuleId),
1392
- RuleName: __expectString(output.RuleName),
1393
- RuleTags: output.RuleTags != null ? de_RuleTags(output.RuleTags, context) : undefined,
1394
- ShortDescription: __expectString(output.ShortDescription),
1395
- };
1396
- };
1397
- const de_RuleTags = (output, context) => {
1398
- const retVal = (output || [])
1399
- .filter((e) => e != null)
1400
- .map((entry) => {
1401
- if (entry === null) {
1402
- return null;
1403
- }
1404
- return __expectString(entry);
1084
+ return take(output, {
1085
+ AssociationArn: __expectString,
1086
+ AssociationId: __expectString,
1087
+ ConnectionArn: __expectString,
1088
+ LastUpdatedTimeStamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1089
+ Name: __expectString,
1090
+ Owner: __expectString,
1091
+ ProviderType: __expectString,
1092
+ State: __expectString,
1405
1093
  });
1406
- return retVal;
1407
- };
1408
- const de_S3BucketRepository = (output, context) => {
1409
- return {
1410
- Details: output.Details != null ? de_S3RepositoryDetails(output.Details, context) : undefined,
1411
- Name: __expectString(output.Name),
1412
- };
1413
- };
1414
- const de_S3RepositoryDetails = (output, context) => {
1415
- return {
1416
- BucketName: __expectString(output.BucketName),
1417
- CodeArtifacts: output.CodeArtifacts != null ? de_CodeArtifacts(output.CodeArtifacts, context) : undefined,
1418
- };
1419
- };
1420
- const de_SourceCodeType = (output, context) => {
1421
- return {
1422
- BranchDiff: output.BranchDiff != null ? de_BranchDiffSourceCodeType(output.BranchDiff, context) : undefined,
1423
- CommitDiff: output.CommitDiff != null ? de_CommitDiffSourceCodeType(output.CommitDiff, context) : undefined,
1424
- RepositoryHead: output.RepositoryHead != null ? de_RepositoryHeadSourceCodeType(output.RepositoryHead, context) : undefined,
1425
- RequestMetadata: output.RequestMetadata != null ? de_RequestMetadata(output.RequestMetadata, context) : undefined,
1426
- S3BucketRepository: output.S3BucketRepository != null ? de_S3BucketRepository(output.S3BucketRepository, context) : undefined,
1427
- };
1428
- };
1429
- const de_TagMap = (output, context) => {
1430
- return Object.entries(output).reduce((acc, [key, value]) => {
1431
- if (value === null) {
1432
- return acc;
1433
- }
1434
- acc[key] = __expectString(value);
1435
- return acc;
1436
- }, {});
1437
1094
  };
1438
1095
  const deserializeMetadata = (output) => ({
1439
1096
  httpStatusCode: output.statusCode,