@aws-sdk/client-accessanalyzer 3.504.0 → 3.507.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.
@@ -456,7 +456,7 @@ export const se_ValidatePolicyCommand = async (input, context) => {
456
456
  };
457
457
  export const de_ApplyArchiveRuleCommand = async (output, context) => {
458
458
  if (output.statusCode !== 200 && output.statusCode >= 300) {
459
- return de_ApplyArchiveRuleCommandError(output, context);
459
+ return de_CommandError(output, context);
460
460
  }
461
461
  const contents = map({
462
462
  $metadata: deserializeMetadata(output),
@@ -464,40 +464,9 @@ export const de_ApplyArchiveRuleCommand = async (output, context) => {
464
464
  await collectBody(output.body, context);
465
465
  return contents;
466
466
  };
467
- const de_ApplyArchiveRuleCommandError = async (output, context) => {
468
- const parsedOutput = {
469
- ...output,
470
- body: await parseErrorBody(output.body, context),
471
- };
472
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
473
- switch (errorCode) {
474
- case "AccessDeniedException":
475
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
476
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
477
- case "InternalServerException":
478
- case "com.amazonaws.accessanalyzer#InternalServerException":
479
- throw await de_InternalServerExceptionRes(parsedOutput, context);
480
- case "ResourceNotFoundException":
481
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
482
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
483
- case "ThrottlingException":
484
- case "com.amazonaws.accessanalyzer#ThrottlingException":
485
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
486
- case "ValidationException":
487
- case "com.amazonaws.accessanalyzer#ValidationException":
488
- throw await de_ValidationExceptionRes(parsedOutput, context);
489
- default:
490
- const parsedBody = parsedOutput.body;
491
- return throwDefaultError({
492
- output,
493
- parsedBody,
494
- errorCode,
495
- });
496
- }
497
- };
498
467
  export const de_CancelPolicyGenerationCommand = async (output, context) => {
499
468
  if (output.statusCode !== 200 && output.statusCode >= 300) {
500
- return de_CancelPolicyGenerationCommandError(output, context);
469
+ return de_CommandError(output, context);
501
470
  }
502
471
  const contents = map({
503
472
  $metadata: deserializeMetadata(output),
@@ -505,37 +474,9 @@ export const de_CancelPolicyGenerationCommand = async (output, context) => {
505
474
  await collectBody(output.body, context);
506
475
  return contents;
507
476
  };
508
- const de_CancelPolicyGenerationCommandError = async (output, context) => {
509
- const parsedOutput = {
510
- ...output,
511
- body: await parseErrorBody(output.body, context),
512
- };
513
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
514
- switch (errorCode) {
515
- case "AccessDeniedException":
516
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
517
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
518
- case "InternalServerException":
519
- case "com.amazonaws.accessanalyzer#InternalServerException":
520
- throw await de_InternalServerExceptionRes(parsedOutput, context);
521
- case "ThrottlingException":
522
- case "com.amazonaws.accessanalyzer#ThrottlingException":
523
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
524
- case "ValidationException":
525
- case "com.amazonaws.accessanalyzer#ValidationException":
526
- throw await de_ValidationExceptionRes(parsedOutput, context);
527
- default:
528
- const parsedBody = parsedOutput.body;
529
- return throwDefaultError({
530
- output,
531
- parsedBody,
532
- errorCode,
533
- });
534
- }
535
- };
536
477
  export const de_CheckAccessNotGrantedCommand = async (output, context) => {
537
478
  if (output.statusCode !== 200 && output.statusCode >= 300) {
538
- return de_CheckAccessNotGrantedCommandError(output, context);
479
+ return de_CommandError(output, context);
539
480
  }
540
481
  const contents = map({
541
482
  $metadata: deserializeMetadata(output),
@@ -549,43 +490,9 @@ export const de_CheckAccessNotGrantedCommand = async (output, context) => {
549
490
  Object.assign(contents, doc);
550
491
  return contents;
551
492
  };
552
- const de_CheckAccessNotGrantedCommandError = async (output, context) => {
553
- const parsedOutput = {
554
- ...output,
555
- body: await parseErrorBody(output.body, context),
556
- };
557
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
558
- switch (errorCode) {
559
- case "AccessDeniedException":
560
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
561
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
562
- case "InternalServerException":
563
- case "com.amazonaws.accessanalyzer#InternalServerException":
564
- throw await de_InternalServerExceptionRes(parsedOutput, context);
565
- case "InvalidParameterException":
566
- case "com.amazonaws.accessanalyzer#InvalidParameterException":
567
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
568
- case "ThrottlingException":
569
- case "com.amazonaws.accessanalyzer#ThrottlingException":
570
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
571
- case "UnprocessableEntityException":
572
- case "com.amazonaws.accessanalyzer#UnprocessableEntityException":
573
- throw await de_UnprocessableEntityExceptionRes(parsedOutput, context);
574
- case "ValidationException":
575
- case "com.amazonaws.accessanalyzer#ValidationException":
576
- throw await de_ValidationExceptionRes(parsedOutput, context);
577
- default:
578
- const parsedBody = parsedOutput.body;
579
- return throwDefaultError({
580
- output,
581
- parsedBody,
582
- errorCode,
583
- });
584
- }
585
- };
586
493
  export const de_CheckNoNewAccessCommand = async (output, context) => {
587
494
  if (output.statusCode !== 200 && output.statusCode >= 300) {
588
- return de_CheckNoNewAccessCommandError(output, context);
495
+ return de_CommandError(output, context);
589
496
  }
590
497
  const contents = map({
591
498
  $metadata: deserializeMetadata(output),
@@ -599,43 +506,9 @@ export const de_CheckNoNewAccessCommand = async (output, context) => {
599
506
  Object.assign(contents, doc);
600
507
  return contents;
601
508
  };
602
- const de_CheckNoNewAccessCommandError = async (output, context) => {
603
- const parsedOutput = {
604
- ...output,
605
- body: await parseErrorBody(output.body, context),
606
- };
607
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
608
- switch (errorCode) {
609
- case "AccessDeniedException":
610
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
611
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
612
- case "InternalServerException":
613
- case "com.amazonaws.accessanalyzer#InternalServerException":
614
- throw await de_InternalServerExceptionRes(parsedOutput, context);
615
- case "InvalidParameterException":
616
- case "com.amazonaws.accessanalyzer#InvalidParameterException":
617
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
618
- case "ThrottlingException":
619
- case "com.amazonaws.accessanalyzer#ThrottlingException":
620
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
621
- case "UnprocessableEntityException":
622
- case "com.amazonaws.accessanalyzer#UnprocessableEntityException":
623
- throw await de_UnprocessableEntityExceptionRes(parsedOutput, context);
624
- case "ValidationException":
625
- case "com.amazonaws.accessanalyzer#ValidationException":
626
- throw await de_ValidationExceptionRes(parsedOutput, context);
627
- default:
628
- const parsedBody = parsedOutput.body;
629
- return throwDefaultError({
630
- output,
631
- parsedBody,
632
- errorCode,
633
- });
634
- }
635
- };
636
509
  export const de_CreateAccessPreviewCommand = async (output, context) => {
637
510
  if (output.statusCode !== 200 && output.statusCode >= 300) {
638
- return de_CreateAccessPreviewCommandError(output, context);
511
+ return de_CommandError(output, context);
639
512
  }
640
513
  const contents = map({
641
514
  $metadata: deserializeMetadata(output),
@@ -647,46 +520,9 @@ export const de_CreateAccessPreviewCommand = async (output, context) => {
647
520
  Object.assign(contents, doc);
648
521
  return contents;
649
522
  };
650
- const de_CreateAccessPreviewCommandError = async (output, context) => {
651
- const parsedOutput = {
652
- ...output,
653
- body: await parseErrorBody(output.body, context),
654
- };
655
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
656
- switch (errorCode) {
657
- case "AccessDeniedException":
658
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
659
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
660
- case "ConflictException":
661
- case "com.amazonaws.accessanalyzer#ConflictException":
662
- throw await de_ConflictExceptionRes(parsedOutput, context);
663
- case "InternalServerException":
664
- case "com.amazonaws.accessanalyzer#InternalServerException":
665
- throw await de_InternalServerExceptionRes(parsedOutput, context);
666
- case "ResourceNotFoundException":
667
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
668
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
669
- case "ServiceQuotaExceededException":
670
- case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException":
671
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
672
- case "ThrottlingException":
673
- case "com.amazonaws.accessanalyzer#ThrottlingException":
674
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
675
- case "ValidationException":
676
- case "com.amazonaws.accessanalyzer#ValidationException":
677
- throw await de_ValidationExceptionRes(parsedOutput, context);
678
- default:
679
- const parsedBody = parsedOutput.body;
680
- return throwDefaultError({
681
- output,
682
- parsedBody,
683
- errorCode,
684
- });
685
- }
686
- };
687
523
  export const de_CreateAnalyzerCommand = async (output, context) => {
688
524
  if (output.statusCode !== 200 && output.statusCode >= 300) {
689
- return de_CreateAnalyzerCommandError(output, context);
525
+ return de_CommandError(output, context);
690
526
  }
691
527
  const contents = map({
692
528
  $metadata: deserializeMetadata(output),
@@ -698,43 +534,9 @@ export const de_CreateAnalyzerCommand = async (output, context) => {
698
534
  Object.assign(contents, doc);
699
535
  return contents;
700
536
  };
701
- const de_CreateAnalyzerCommandError = async (output, context) => {
702
- const parsedOutput = {
703
- ...output,
704
- body: await parseErrorBody(output.body, context),
705
- };
706
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
707
- switch (errorCode) {
708
- case "AccessDeniedException":
709
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
710
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
711
- case "ConflictException":
712
- case "com.amazonaws.accessanalyzer#ConflictException":
713
- throw await de_ConflictExceptionRes(parsedOutput, context);
714
- case "InternalServerException":
715
- case "com.amazonaws.accessanalyzer#InternalServerException":
716
- throw await de_InternalServerExceptionRes(parsedOutput, context);
717
- case "ServiceQuotaExceededException":
718
- case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException":
719
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
720
- case "ThrottlingException":
721
- case "com.amazonaws.accessanalyzer#ThrottlingException":
722
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
723
- case "ValidationException":
724
- case "com.amazonaws.accessanalyzer#ValidationException":
725
- throw await de_ValidationExceptionRes(parsedOutput, context);
726
- default:
727
- const parsedBody = parsedOutput.body;
728
- return throwDefaultError({
729
- output,
730
- parsedBody,
731
- errorCode,
732
- });
733
- }
734
- };
735
537
  export const de_CreateArchiveRuleCommand = async (output, context) => {
736
538
  if (output.statusCode !== 200 && output.statusCode >= 300) {
737
- return de_CreateArchiveRuleCommandError(output, context);
539
+ return de_CommandError(output, context);
738
540
  }
739
541
  const contents = map({
740
542
  $metadata: deserializeMetadata(output),
@@ -742,46 +544,9 @@ export const de_CreateArchiveRuleCommand = async (output, context) => {
742
544
  await collectBody(output.body, context);
743
545
  return contents;
744
546
  };
745
- const de_CreateArchiveRuleCommandError = async (output, context) => {
746
- const parsedOutput = {
747
- ...output,
748
- body: await parseErrorBody(output.body, context),
749
- };
750
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
751
- switch (errorCode) {
752
- case "AccessDeniedException":
753
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
754
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
755
- case "ConflictException":
756
- case "com.amazonaws.accessanalyzer#ConflictException":
757
- throw await de_ConflictExceptionRes(parsedOutput, context);
758
- case "InternalServerException":
759
- case "com.amazonaws.accessanalyzer#InternalServerException":
760
- throw await de_InternalServerExceptionRes(parsedOutput, context);
761
- case "ResourceNotFoundException":
762
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
763
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
764
- case "ServiceQuotaExceededException":
765
- case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException":
766
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
767
- case "ThrottlingException":
768
- case "com.amazonaws.accessanalyzer#ThrottlingException":
769
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
770
- case "ValidationException":
771
- case "com.amazonaws.accessanalyzer#ValidationException":
772
- throw await de_ValidationExceptionRes(parsedOutput, context);
773
- default:
774
- const parsedBody = parsedOutput.body;
775
- return throwDefaultError({
776
- output,
777
- parsedBody,
778
- errorCode,
779
- });
780
- }
781
- };
782
547
  export const de_DeleteAnalyzerCommand = async (output, context) => {
783
548
  if (output.statusCode !== 200 && output.statusCode >= 300) {
784
- return de_DeleteAnalyzerCommandError(output, context);
549
+ return de_CommandError(output, context);
785
550
  }
786
551
  const contents = map({
787
552
  $metadata: deserializeMetadata(output),
@@ -789,40 +554,9 @@ export const de_DeleteAnalyzerCommand = async (output, context) => {
789
554
  await collectBody(output.body, context);
790
555
  return contents;
791
556
  };
792
- const de_DeleteAnalyzerCommandError = async (output, context) => {
793
- const parsedOutput = {
794
- ...output,
795
- body: await parseErrorBody(output.body, context),
796
- };
797
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
798
- switch (errorCode) {
799
- case "AccessDeniedException":
800
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
801
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
802
- case "InternalServerException":
803
- case "com.amazonaws.accessanalyzer#InternalServerException":
804
- throw await de_InternalServerExceptionRes(parsedOutput, context);
805
- case "ResourceNotFoundException":
806
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
807
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
808
- case "ThrottlingException":
809
- case "com.amazonaws.accessanalyzer#ThrottlingException":
810
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
811
- case "ValidationException":
812
- case "com.amazonaws.accessanalyzer#ValidationException":
813
- throw await de_ValidationExceptionRes(parsedOutput, context);
814
- default:
815
- const parsedBody = parsedOutput.body;
816
- return throwDefaultError({
817
- output,
818
- parsedBody,
819
- errorCode,
820
- });
821
- }
822
- };
823
557
  export const de_DeleteArchiveRuleCommand = async (output, context) => {
824
558
  if (output.statusCode !== 200 && output.statusCode >= 300) {
825
- return de_DeleteArchiveRuleCommandError(output, context);
559
+ return de_CommandError(output, context);
826
560
  }
827
561
  const contents = map({
828
562
  $metadata: deserializeMetadata(output),
@@ -830,40 +564,9 @@ export const de_DeleteArchiveRuleCommand = async (output, context) => {
830
564
  await collectBody(output.body, context);
831
565
  return contents;
832
566
  };
833
- const de_DeleteArchiveRuleCommandError = async (output, context) => {
834
- const parsedOutput = {
835
- ...output,
836
- body: await parseErrorBody(output.body, context),
837
- };
838
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
839
- switch (errorCode) {
840
- case "AccessDeniedException":
841
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
842
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
843
- case "InternalServerException":
844
- case "com.amazonaws.accessanalyzer#InternalServerException":
845
- throw await de_InternalServerExceptionRes(parsedOutput, context);
846
- case "ResourceNotFoundException":
847
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
848
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
849
- case "ThrottlingException":
850
- case "com.amazonaws.accessanalyzer#ThrottlingException":
851
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
852
- case "ValidationException":
853
- case "com.amazonaws.accessanalyzer#ValidationException":
854
- throw await de_ValidationExceptionRes(parsedOutput, context);
855
- default:
856
- const parsedBody = parsedOutput.body;
857
- return throwDefaultError({
858
- output,
859
- parsedBody,
860
- errorCode,
861
- });
862
- }
863
- };
864
567
  export const de_GetAccessPreviewCommand = async (output, context) => {
865
568
  if (output.statusCode !== 200 && output.statusCode >= 300) {
866
- return de_GetAccessPreviewCommandError(output, context);
569
+ return de_CommandError(output, context);
867
570
  }
868
571
  const contents = map({
869
572
  $metadata: deserializeMetadata(output),
@@ -875,40 +578,9 @@ export const de_GetAccessPreviewCommand = async (output, context) => {
875
578
  Object.assign(contents, doc);
876
579
  return contents;
877
580
  };
878
- const de_GetAccessPreviewCommandError = async (output, context) => {
879
- const parsedOutput = {
880
- ...output,
881
- body: await parseErrorBody(output.body, context),
882
- };
883
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
884
- switch (errorCode) {
885
- case "AccessDeniedException":
886
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
887
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
888
- case "InternalServerException":
889
- case "com.amazonaws.accessanalyzer#InternalServerException":
890
- throw await de_InternalServerExceptionRes(parsedOutput, context);
891
- case "ResourceNotFoundException":
892
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
893
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
894
- case "ThrottlingException":
895
- case "com.amazonaws.accessanalyzer#ThrottlingException":
896
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
897
- case "ValidationException":
898
- case "com.amazonaws.accessanalyzer#ValidationException":
899
- throw await de_ValidationExceptionRes(parsedOutput, context);
900
- default:
901
- const parsedBody = parsedOutput.body;
902
- return throwDefaultError({
903
- output,
904
- parsedBody,
905
- errorCode,
906
- });
907
- }
908
- };
909
581
  export const de_GetAnalyzedResourceCommand = async (output, context) => {
910
582
  if (output.statusCode !== 200 && output.statusCode >= 300) {
911
- return de_GetAnalyzedResourceCommandError(output, context);
583
+ return de_CommandError(output, context);
912
584
  }
913
585
  const contents = map({
914
586
  $metadata: deserializeMetadata(output),
@@ -920,40 +592,9 @@ export const de_GetAnalyzedResourceCommand = async (output, context) => {
920
592
  Object.assign(contents, doc);
921
593
  return contents;
922
594
  };
923
- const de_GetAnalyzedResourceCommandError = async (output, context) => {
924
- const parsedOutput = {
925
- ...output,
926
- body: await parseErrorBody(output.body, context),
927
- };
928
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
929
- switch (errorCode) {
930
- case "AccessDeniedException":
931
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
932
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
933
- case "InternalServerException":
934
- case "com.amazonaws.accessanalyzer#InternalServerException":
935
- throw await de_InternalServerExceptionRes(parsedOutput, context);
936
- case "ResourceNotFoundException":
937
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
938
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
939
- case "ThrottlingException":
940
- case "com.amazonaws.accessanalyzer#ThrottlingException":
941
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
942
- case "ValidationException":
943
- case "com.amazonaws.accessanalyzer#ValidationException":
944
- throw await de_ValidationExceptionRes(parsedOutput, context);
945
- default:
946
- const parsedBody = parsedOutput.body;
947
- return throwDefaultError({
948
- output,
949
- parsedBody,
950
- errorCode,
951
- });
952
- }
953
- };
954
595
  export const de_GetAnalyzerCommand = async (output, context) => {
955
596
  if (output.statusCode !== 200 && output.statusCode >= 300) {
956
- return de_GetAnalyzerCommandError(output, context);
597
+ return de_CommandError(output, context);
957
598
  }
958
599
  const contents = map({
959
600
  $metadata: deserializeMetadata(output),
@@ -965,40 +606,9 @@ export const de_GetAnalyzerCommand = async (output, context) => {
965
606
  Object.assign(contents, doc);
966
607
  return contents;
967
608
  };
968
- const de_GetAnalyzerCommandError = async (output, context) => {
969
- const parsedOutput = {
970
- ...output,
971
- body: await parseErrorBody(output.body, context),
972
- };
973
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
974
- switch (errorCode) {
975
- case "AccessDeniedException":
976
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
977
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
978
- case "InternalServerException":
979
- case "com.amazonaws.accessanalyzer#InternalServerException":
980
- throw await de_InternalServerExceptionRes(parsedOutput, context);
981
- case "ResourceNotFoundException":
982
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
983
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
984
- case "ThrottlingException":
985
- case "com.amazonaws.accessanalyzer#ThrottlingException":
986
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
987
- case "ValidationException":
988
- case "com.amazonaws.accessanalyzer#ValidationException":
989
- throw await de_ValidationExceptionRes(parsedOutput, context);
990
- default:
991
- const parsedBody = parsedOutput.body;
992
- return throwDefaultError({
993
- output,
994
- parsedBody,
995
- errorCode,
996
- });
997
- }
998
- };
999
609
  export const de_GetArchiveRuleCommand = async (output, context) => {
1000
610
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1001
- return de_GetArchiveRuleCommandError(output, context);
611
+ return de_CommandError(output, context);
1002
612
  }
1003
613
  const contents = map({
1004
614
  $metadata: deserializeMetadata(output),
@@ -1010,40 +620,9 @@ export const de_GetArchiveRuleCommand = async (output, context) => {
1010
620
  Object.assign(contents, doc);
1011
621
  return contents;
1012
622
  };
1013
- const de_GetArchiveRuleCommandError = async (output, context) => {
1014
- const parsedOutput = {
1015
- ...output,
1016
- body: await parseErrorBody(output.body, context),
1017
- };
1018
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1019
- switch (errorCode) {
1020
- case "AccessDeniedException":
1021
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1022
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1023
- case "InternalServerException":
1024
- case "com.amazonaws.accessanalyzer#InternalServerException":
1025
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1026
- case "ResourceNotFoundException":
1027
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1028
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1029
- case "ThrottlingException":
1030
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1031
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1032
- case "ValidationException":
1033
- case "com.amazonaws.accessanalyzer#ValidationException":
1034
- throw await de_ValidationExceptionRes(parsedOutput, context);
1035
- default:
1036
- const parsedBody = parsedOutput.body;
1037
- return throwDefaultError({
1038
- output,
1039
- parsedBody,
1040
- errorCode,
1041
- });
1042
- }
1043
- };
1044
623
  export const de_GetFindingCommand = async (output, context) => {
1045
624
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1046
- return de_GetFindingCommandError(output, context);
625
+ return de_CommandError(output, context);
1047
626
  }
1048
627
  const contents = map({
1049
628
  $metadata: deserializeMetadata(output),
@@ -1055,96 +634,34 @@ export const de_GetFindingCommand = async (output, context) => {
1055
634
  Object.assign(contents, doc);
1056
635
  return contents;
1057
636
  };
1058
- const de_GetFindingCommandError = async (output, context) => {
1059
- const parsedOutput = {
1060
- ...output,
1061
- body: await parseErrorBody(output.body, context),
1062
- };
1063
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1064
- switch (errorCode) {
1065
- case "AccessDeniedException":
1066
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1067
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1068
- case "InternalServerException":
1069
- case "com.amazonaws.accessanalyzer#InternalServerException":
1070
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1071
- case "ResourceNotFoundException":
1072
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1073
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1074
- case "ThrottlingException":
1075
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1076
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1077
- case "ValidationException":
1078
- case "com.amazonaws.accessanalyzer#ValidationException":
1079
- throw await de_ValidationExceptionRes(parsedOutput, context);
1080
- default:
1081
- const parsedBody = parsedOutput.body;
1082
- return throwDefaultError({
1083
- output,
1084
- parsedBody,
1085
- errorCode,
1086
- });
1087
- }
1088
- };
1089
637
  export const de_GetFindingV2Command = async (output, context) => {
1090
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1091
- return de_GetFindingV2CommandError(output, context);
1092
- }
1093
- const contents = map({
1094
- $metadata: deserializeMetadata(output),
1095
- });
1096
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1097
- const doc = take(data, {
1098
- analyzedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
1099
- createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
1100
- error: __expectString,
1101
- findingDetails: (_) => de_FindingDetailsList(_, context),
1102
- findingType: __expectString,
1103
- id: __expectString,
1104
- nextToken: __expectString,
1105
- resource: __expectString,
1106
- resourceOwnerAccount: __expectString,
1107
- resourceType: __expectString,
1108
- status: __expectString,
1109
- updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
1110
- });
1111
- Object.assign(contents, doc);
1112
- return contents;
1113
- };
1114
- const de_GetFindingV2CommandError = async (output, context) => {
1115
- const parsedOutput = {
1116
- ...output,
1117
- body: await parseErrorBody(output.body, context),
1118
- };
1119
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1120
- switch (errorCode) {
1121
- case "AccessDeniedException":
1122
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1123
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1124
- case "InternalServerException":
1125
- case "com.amazonaws.accessanalyzer#InternalServerException":
1126
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1127
- case "ResourceNotFoundException":
1128
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1129
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1130
- case "ThrottlingException":
1131
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1132
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1133
- case "ValidationException":
1134
- case "com.amazonaws.accessanalyzer#ValidationException":
1135
- throw await de_ValidationExceptionRes(parsedOutput, context);
1136
- default:
1137
- const parsedBody = parsedOutput.body;
1138
- return throwDefaultError({
1139
- output,
1140
- parsedBody,
1141
- errorCode,
1142
- });
638
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
639
+ return de_CommandError(output, context);
1143
640
  }
641
+ const contents = map({
642
+ $metadata: deserializeMetadata(output),
643
+ });
644
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
645
+ const doc = take(data, {
646
+ analyzedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
647
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
648
+ error: __expectString,
649
+ findingDetails: (_) => de_FindingDetailsList(_, context),
650
+ findingType: __expectString,
651
+ id: __expectString,
652
+ nextToken: __expectString,
653
+ resource: __expectString,
654
+ resourceOwnerAccount: __expectString,
655
+ resourceType: __expectString,
656
+ status: __expectString,
657
+ updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
658
+ });
659
+ Object.assign(contents, doc);
660
+ return contents;
1144
661
  };
1145
662
  export const de_GetGeneratedPolicyCommand = async (output, context) => {
1146
663
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1147
- return de_GetGeneratedPolicyCommandError(output, context);
664
+ return de_CommandError(output, context);
1148
665
  }
1149
666
  const contents = map({
1150
667
  $metadata: deserializeMetadata(output),
@@ -1157,37 +674,9 @@ export const de_GetGeneratedPolicyCommand = async (output, context) => {
1157
674
  Object.assign(contents, doc);
1158
675
  return contents;
1159
676
  };
1160
- const de_GetGeneratedPolicyCommandError = async (output, context) => {
1161
- const parsedOutput = {
1162
- ...output,
1163
- body: await parseErrorBody(output.body, context),
1164
- };
1165
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1166
- switch (errorCode) {
1167
- case "AccessDeniedException":
1168
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1169
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1170
- case "InternalServerException":
1171
- case "com.amazonaws.accessanalyzer#InternalServerException":
1172
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1173
- case "ThrottlingException":
1174
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1175
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1176
- case "ValidationException":
1177
- case "com.amazonaws.accessanalyzer#ValidationException":
1178
- throw await de_ValidationExceptionRes(parsedOutput, context);
1179
- default:
1180
- const parsedBody = parsedOutput.body;
1181
- return throwDefaultError({
1182
- output,
1183
- parsedBody,
1184
- errorCode,
1185
- });
1186
- }
1187
- };
1188
677
  export const de_ListAccessPreviewFindingsCommand = async (output, context) => {
1189
678
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1190
- return de_ListAccessPreviewFindingsCommandError(output, context);
679
+ return de_CommandError(output, context);
1191
680
  }
1192
681
  const contents = map({
1193
682
  $metadata: deserializeMetadata(output),
@@ -1200,43 +689,9 @@ export const de_ListAccessPreviewFindingsCommand = async (output, context) => {
1200
689
  Object.assign(contents, doc);
1201
690
  return contents;
1202
691
  };
1203
- const de_ListAccessPreviewFindingsCommandError = async (output, context) => {
1204
- const parsedOutput = {
1205
- ...output,
1206
- body: await parseErrorBody(output.body, context),
1207
- };
1208
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1209
- switch (errorCode) {
1210
- case "AccessDeniedException":
1211
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1212
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1213
- case "ConflictException":
1214
- case "com.amazonaws.accessanalyzer#ConflictException":
1215
- throw await de_ConflictExceptionRes(parsedOutput, context);
1216
- case "InternalServerException":
1217
- case "com.amazonaws.accessanalyzer#InternalServerException":
1218
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1219
- case "ResourceNotFoundException":
1220
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1221
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1222
- case "ThrottlingException":
1223
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1224
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1225
- case "ValidationException":
1226
- case "com.amazonaws.accessanalyzer#ValidationException":
1227
- throw await de_ValidationExceptionRes(parsedOutput, context);
1228
- default:
1229
- const parsedBody = parsedOutput.body;
1230
- return throwDefaultError({
1231
- output,
1232
- parsedBody,
1233
- errorCode,
1234
- });
1235
- }
1236
- };
1237
692
  export const de_ListAccessPreviewsCommand = async (output, context) => {
1238
693
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1239
- return de_ListAccessPreviewsCommandError(output, context);
694
+ return de_CommandError(output, context);
1240
695
  }
1241
696
  const contents = map({
1242
697
  $metadata: deserializeMetadata(output),
@@ -1249,40 +704,9 @@ export const de_ListAccessPreviewsCommand = async (output, context) => {
1249
704
  Object.assign(contents, doc);
1250
705
  return contents;
1251
706
  };
1252
- const de_ListAccessPreviewsCommandError = async (output, context) => {
1253
- const parsedOutput = {
1254
- ...output,
1255
- body: await parseErrorBody(output.body, context),
1256
- };
1257
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1258
- switch (errorCode) {
1259
- case "AccessDeniedException":
1260
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1261
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1262
- case "InternalServerException":
1263
- case "com.amazonaws.accessanalyzer#InternalServerException":
1264
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1265
- case "ResourceNotFoundException":
1266
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1267
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1268
- case "ThrottlingException":
1269
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1270
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1271
- case "ValidationException":
1272
- case "com.amazonaws.accessanalyzer#ValidationException":
1273
- throw await de_ValidationExceptionRes(parsedOutput, context);
1274
- default:
1275
- const parsedBody = parsedOutput.body;
1276
- return throwDefaultError({
1277
- output,
1278
- parsedBody,
1279
- errorCode,
1280
- });
1281
- }
1282
- };
1283
707
  export const de_ListAnalyzedResourcesCommand = async (output, context) => {
1284
708
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1285
- return de_ListAnalyzedResourcesCommandError(output, context);
709
+ return de_CommandError(output, context);
1286
710
  }
1287
711
  const contents = map({
1288
712
  $metadata: deserializeMetadata(output),
@@ -1295,40 +719,9 @@ export const de_ListAnalyzedResourcesCommand = async (output, context) => {
1295
719
  Object.assign(contents, doc);
1296
720
  return contents;
1297
721
  };
1298
- const de_ListAnalyzedResourcesCommandError = async (output, context) => {
1299
- const parsedOutput = {
1300
- ...output,
1301
- body: await parseErrorBody(output.body, context),
1302
- };
1303
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1304
- switch (errorCode) {
1305
- case "AccessDeniedException":
1306
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1307
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1308
- case "InternalServerException":
1309
- case "com.amazonaws.accessanalyzer#InternalServerException":
1310
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1311
- case "ResourceNotFoundException":
1312
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1313
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1314
- case "ThrottlingException":
1315
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1316
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1317
- case "ValidationException":
1318
- case "com.amazonaws.accessanalyzer#ValidationException":
1319
- throw await de_ValidationExceptionRes(parsedOutput, context);
1320
- default:
1321
- const parsedBody = parsedOutput.body;
1322
- return throwDefaultError({
1323
- output,
1324
- parsedBody,
1325
- errorCode,
1326
- });
1327
- }
1328
- };
1329
722
  export const de_ListAnalyzersCommand = async (output, context) => {
1330
723
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1331
- return de_ListAnalyzersCommandError(output, context);
724
+ return de_CommandError(output, context);
1332
725
  }
1333
726
  const contents = map({
1334
727
  $metadata: deserializeMetadata(output),
@@ -1341,37 +734,9 @@ export const de_ListAnalyzersCommand = async (output, context) => {
1341
734
  Object.assign(contents, doc);
1342
735
  return contents;
1343
736
  };
1344
- const de_ListAnalyzersCommandError = async (output, context) => {
1345
- const parsedOutput = {
1346
- ...output,
1347
- body: await parseErrorBody(output.body, context),
1348
- };
1349
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1350
- switch (errorCode) {
1351
- case "AccessDeniedException":
1352
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1353
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1354
- case "InternalServerException":
1355
- case "com.amazonaws.accessanalyzer#InternalServerException":
1356
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1357
- case "ThrottlingException":
1358
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1359
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1360
- case "ValidationException":
1361
- case "com.amazonaws.accessanalyzer#ValidationException":
1362
- throw await de_ValidationExceptionRes(parsedOutput, context);
1363
- default:
1364
- const parsedBody = parsedOutput.body;
1365
- return throwDefaultError({
1366
- output,
1367
- parsedBody,
1368
- errorCode,
1369
- });
1370
- }
1371
- };
1372
737
  export const de_ListArchiveRulesCommand = async (output, context) => {
1373
738
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1374
- return de_ListArchiveRulesCommandError(output, context);
739
+ return de_CommandError(output, context);
1375
740
  }
1376
741
  const contents = map({
1377
742
  $metadata: deserializeMetadata(output),
@@ -1384,37 +749,9 @@ export const de_ListArchiveRulesCommand = async (output, context) => {
1384
749
  Object.assign(contents, doc);
1385
750
  return contents;
1386
751
  };
1387
- const de_ListArchiveRulesCommandError = async (output, context) => {
1388
- const parsedOutput = {
1389
- ...output,
1390
- body: await parseErrorBody(output.body, context),
1391
- };
1392
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1393
- switch (errorCode) {
1394
- case "AccessDeniedException":
1395
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1396
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1397
- case "InternalServerException":
1398
- case "com.amazonaws.accessanalyzer#InternalServerException":
1399
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1400
- case "ThrottlingException":
1401
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1402
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1403
- case "ValidationException":
1404
- case "com.amazonaws.accessanalyzer#ValidationException":
1405
- throw await de_ValidationExceptionRes(parsedOutput, context);
1406
- default:
1407
- const parsedBody = parsedOutput.body;
1408
- return throwDefaultError({
1409
- output,
1410
- parsedBody,
1411
- errorCode,
1412
- });
1413
- }
1414
- };
1415
752
  export const de_ListFindingsCommand = async (output, context) => {
1416
753
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1417
- return de_ListFindingsCommandError(output, context);
754
+ return de_CommandError(output, context);
1418
755
  }
1419
756
  const contents = map({
1420
757
  $metadata: deserializeMetadata(output),
@@ -1427,40 +764,9 @@ export const de_ListFindingsCommand = async (output, context) => {
1427
764
  Object.assign(contents, doc);
1428
765
  return contents;
1429
766
  };
1430
- const de_ListFindingsCommandError = async (output, context) => {
1431
- const parsedOutput = {
1432
- ...output,
1433
- body: await parseErrorBody(output.body, context),
1434
- };
1435
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1436
- switch (errorCode) {
1437
- case "AccessDeniedException":
1438
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1439
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1440
- case "InternalServerException":
1441
- case "com.amazonaws.accessanalyzer#InternalServerException":
1442
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1443
- case "ResourceNotFoundException":
1444
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1445
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1446
- case "ThrottlingException":
1447
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1448
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1449
- case "ValidationException":
1450
- case "com.amazonaws.accessanalyzer#ValidationException":
1451
- throw await de_ValidationExceptionRes(parsedOutput, context);
1452
- default:
1453
- const parsedBody = parsedOutput.body;
1454
- return throwDefaultError({
1455
- output,
1456
- parsedBody,
1457
- errorCode,
1458
- });
1459
- }
1460
- };
1461
767
  export const de_ListFindingsV2Command = async (output, context) => {
1462
768
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1463
- return de_ListFindingsV2CommandError(output, context);
769
+ return de_CommandError(output, context);
1464
770
  }
1465
771
  const contents = map({
1466
772
  $metadata: deserializeMetadata(output),
@@ -1471,42 +777,11 @@ export const de_ListFindingsV2Command = async (output, context) => {
1471
777
  nextToken: __expectString,
1472
778
  });
1473
779
  Object.assign(contents, doc);
1474
- return contents;
1475
- };
1476
- const de_ListFindingsV2CommandError = async (output, context) => {
1477
- const parsedOutput = {
1478
- ...output,
1479
- body: await parseErrorBody(output.body, context),
1480
- };
1481
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1482
- switch (errorCode) {
1483
- case "AccessDeniedException":
1484
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1485
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1486
- case "InternalServerException":
1487
- case "com.amazonaws.accessanalyzer#InternalServerException":
1488
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1489
- case "ResourceNotFoundException":
1490
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1491
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1492
- case "ThrottlingException":
1493
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1494
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1495
- case "ValidationException":
1496
- case "com.amazonaws.accessanalyzer#ValidationException":
1497
- throw await de_ValidationExceptionRes(parsedOutput, context);
1498
- default:
1499
- const parsedBody = parsedOutput.body;
1500
- return throwDefaultError({
1501
- output,
1502
- parsedBody,
1503
- errorCode,
1504
- });
1505
- }
780
+ return contents;
1506
781
  };
1507
782
  export const de_ListPolicyGenerationsCommand = async (output, context) => {
1508
783
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1509
- return de_ListPolicyGenerationsCommandError(output, context);
784
+ return de_CommandError(output, context);
1510
785
  }
1511
786
  const contents = map({
1512
787
  $metadata: deserializeMetadata(output),
@@ -1519,37 +794,9 @@ export const de_ListPolicyGenerationsCommand = async (output, context) => {
1519
794
  Object.assign(contents, doc);
1520
795
  return contents;
1521
796
  };
1522
- const de_ListPolicyGenerationsCommandError = async (output, context) => {
1523
- const parsedOutput = {
1524
- ...output,
1525
- body: await parseErrorBody(output.body, context),
1526
- };
1527
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1528
- switch (errorCode) {
1529
- case "AccessDeniedException":
1530
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1531
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1532
- case "InternalServerException":
1533
- case "com.amazonaws.accessanalyzer#InternalServerException":
1534
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1535
- case "ThrottlingException":
1536
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1537
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1538
- case "ValidationException":
1539
- case "com.amazonaws.accessanalyzer#ValidationException":
1540
- throw await de_ValidationExceptionRes(parsedOutput, context);
1541
- default:
1542
- const parsedBody = parsedOutput.body;
1543
- return throwDefaultError({
1544
- output,
1545
- parsedBody,
1546
- errorCode,
1547
- });
1548
- }
1549
- };
1550
797
  export const de_ListTagsForResourceCommand = async (output, context) => {
1551
798
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1552
- return de_ListTagsForResourceCommandError(output, context);
799
+ return de_CommandError(output, context);
1553
800
  }
1554
801
  const contents = map({
1555
802
  $metadata: deserializeMetadata(output),
@@ -1561,40 +808,9 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
1561
808
  Object.assign(contents, doc);
1562
809
  return contents;
1563
810
  };
1564
- const de_ListTagsForResourceCommandError = async (output, context) => {
1565
- const parsedOutput = {
1566
- ...output,
1567
- body: await parseErrorBody(output.body, context),
1568
- };
1569
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1570
- switch (errorCode) {
1571
- case "AccessDeniedException":
1572
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1573
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1574
- case "InternalServerException":
1575
- case "com.amazonaws.accessanalyzer#InternalServerException":
1576
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1577
- case "ResourceNotFoundException":
1578
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1579
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1580
- case "ThrottlingException":
1581
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1582
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1583
- case "ValidationException":
1584
- case "com.amazonaws.accessanalyzer#ValidationException":
1585
- throw await de_ValidationExceptionRes(parsedOutput, context);
1586
- default:
1587
- const parsedBody = parsedOutput.body;
1588
- return throwDefaultError({
1589
- output,
1590
- parsedBody,
1591
- errorCode,
1592
- });
1593
- }
1594
- };
1595
811
  export const de_StartPolicyGenerationCommand = async (output, context) => {
1596
812
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1597
- return de_StartPolicyGenerationCommandError(output, context);
813
+ return de_CommandError(output, context);
1598
814
  }
1599
815
  const contents = map({
1600
816
  $metadata: deserializeMetadata(output),
@@ -1606,43 +822,9 @@ export const de_StartPolicyGenerationCommand = async (output, context) => {
1606
822
  Object.assign(contents, doc);
1607
823
  return contents;
1608
824
  };
1609
- const de_StartPolicyGenerationCommandError = async (output, context) => {
1610
- const parsedOutput = {
1611
- ...output,
1612
- body: await parseErrorBody(output.body, context),
1613
- };
1614
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1615
- switch (errorCode) {
1616
- case "AccessDeniedException":
1617
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1618
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1619
- case "ConflictException":
1620
- case "com.amazonaws.accessanalyzer#ConflictException":
1621
- throw await de_ConflictExceptionRes(parsedOutput, context);
1622
- case "InternalServerException":
1623
- case "com.amazonaws.accessanalyzer#InternalServerException":
1624
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1625
- case "ServiceQuotaExceededException":
1626
- case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException":
1627
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1628
- case "ThrottlingException":
1629
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1630
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1631
- case "ValidationException":
1632
- case "com.amazonaws.accessanalyzer#ValidationException":
1633
- throw await de_ValidationExceptionRes(parsedOutput, context);
1634
- default:
1635
- const parsedBody = parsedOutput.body;
1636
- return throwDefaultError({
1637
- output,
1638
- parsedBody,
1639
- errorCode,
1640
- });
1641
- }
1642
- };
1643
825
  export const de_StartResourceScanCommand = async (output, context) => {
1644
826
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1645
- return de_StartResourceScanCommandError(output, context);
827
+ return de_CommandError(output, context);
1646
828
  }
1647
829
  const contents = map({
1648
830
  $metadata: deserializeMetadata(output),
@@ -1650,40 +832,9 @@ export const de_StartResourceScanCommand = async (output, context) => {
1650
832
  await collectBody(output.body, context);
1651
833
  return contents;
1652
834
  };
1653
- const de_StartResourceScanCommandError = async (output, context) => {
1654
- const parsedOutput = {
1655
- ...output,
1656
- body: await parseErrorBody(output.body, context),
1657
- };
1658
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1659
- switch (errorCode) {
1660
- case "AccessDeniedException":
1661
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1662
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1663
- case "InternalServerException":
1664
- case "com.amazonaws.accessanalyzer#InternalServerException":
1665
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1666
- case "ResourceNotFoundException":
1667
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1668
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1669
- case "ThrottlingException":
1670
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1671
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1672
- case "ValidationException":
1673
- case "com.amazonaws.accessanalyzer#ValidationException":
1674
- throw await de_ValidationExceptionRes(parsedOutput, context);
1675
- default:
1676
- const parsedBody = parsedOutput.body;
1677
- return throwDefaultError({
1678
- output,
1679
- parsedBody,
1680
- errorCode,
1681
- });
1682
- }
1683
- };
1684
835
  export const de_TagResourceCommand = async (output, context) => {
1685
836
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1686
- return de_TagResourceCommandError(output, context);
837
+ return de_CommandError(output, context);
1687
838
  }
1688
839
  const contents = map({
1689
840
  $metadata: deserializeMetadata(output),
@@ -1691,40 +842,9 @@ export const de_TagResourceCommand = async (output, context) => {
1691
842
  await collectBody(output.body, context);
1692
843
  return contents;
1693
844
  };
1694
- const de_TagResourceCommandError = async (output, context) => {
1695
- const parsedOutput = {
1696
- ...output,
1697
- body: await parseErrorBody(output.body, context),
1698
- };
1699
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1700
- switch (errorCode) {
1701
- case "AccessDeniedException":
1702
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1703
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1704
- case "InternalServerException":
1705
- case "com.amazonaws.accessanalyzer#InternalServerException":
1706
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1707
- case "ResourceNotFoundException":
1708
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1709
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1710
- case "ThrottlingException":
1711
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1712
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1713
- case "ValidationException":
1714
- case "com.amazonaws.accessanalyzer#ValidationException":
1715
- throw await de_ValidationExceptionRes(parsedOutput, context);
1716
- default:
1717
- const parsedBody = parsedOutput.body;
1718
- return throwDefaultError({
1719
- output,
1720
- parsedBody,
1721
- errorCode,
1722
- });
1723
- }
1724
- };
1725
845
  export const de_UntagResourceCommand = async (output, context) => {
1726
846
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1727
- return de_UntagResourceCommandError(output, context);
847
+ return de_CommandError(output, context);
1728
848
  }
1729
849
  const contents = map({
1730
850
  $metadata: deserializeMetadata(output),
@@ -1732,40 +852,9 @@ export const de_UntagResourceCommand = async (output, context) => {
1732
852
  await collectBody(output.body, context);
1733
853
  return contents;
1734
854
  };
1735
- const de_UntagResourceCommandError = async (output, context) => {
1736
- const parsedOutput = {
1737
- ...output,
1738
- body: await parseErrorBody(output.body, context),
1739
- };
1740
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1741
- switch (errorCode) {
1742
- case "AccessDeniedException":
1743
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1744
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1745
- case "InternalServerException":
1746
- case "com.amazonaws.accessanalyzer#InternalServerException":
1747
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1748
- case "ResourceNotFoundException":
1749
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1750
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1751
- case "ThrottlingException":
1752
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1753
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1754
- case "ValidationException":
1755
- case "com.amazonaws.accessanalyzer#ValidationException":
1756
- throw await de_ValidationExceptionRes(parsedOutput, context);
1757
- default:
1758
- const parsedBody = parsedOutput.body;
1759
- return throwDefaultError({
1760
- output,
1761
- parsedBody,
1762
- errorCode,
1763
- });
1764
- }
1765
- };
1766
855
  export const de_UpdateArchiveRuleCommand = async (output, context) => {
1767
856
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1768
- return de_UpdateArchiveRuleCommandError(output, context);
857
+ return de_CommandError(output, context);
1769
858
  }
1770
859
  const contents = map({
1771
860
  $metadata: deserializeMetadata(output),
@@ -1773,40 +862,9 @@ export const de_UpdateArchiveRuleCommand = async (output, context) => {
1773
862
  await collectBody(output.body, context);
1774
863
  return contents;
1775
864
  };
1776
- const de_UpdateArchiveRuleCommandError = async (output, context) => {
1777
- const parsedOutput = {
1778
- ...output,
1779
- body: await parseErrorBody(output.body, context),
1780
- };
1781
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1782
- switch (errorCode) {
1783
- case "AccessDeniedException":
1784
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1785
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1786
- case "InternalServerException":
1787
- case "com.amazonaws.accessanalyzer#InternalServerException":
1788
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1789
- case "ResourceNotFoundException":
1790
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1791
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1792
- case "ThrottlingException":
1793
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1794
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1795
- case "ValidationException":
1796
- case "com.amazonaws.accessanalyzer#ValidationException":
1797
- throw await de_ValidationExceptionRes(parsedOutput, context);
1798
- default:
1799
- const parsedBody = parsedOutput.body;
1800
- return throwDefaultError({
1801
- output,
1802
- parsedBody,
1803
- errorCode,
1804
- });
1805
- }
1806
- };
1807
865
  export const de_UpdateFindingsCommand = async (output, context) => {
1808
866
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1809
- return de_UpdateFindingsCommandError(output, context);
867
+ return de_CommandError(output, context);
1810
868
  }
1811
869
  const contents = map({
1812
870
  $metadata: deserializeMetadata(output),
@@ -1814,40 +872,9 @@ export const de_UpdateFindingsCommand = async (output, context) => {
1814
872
  await collectBody(output.body, context);
1815
873
  return contents;
1816
874
  };
1817
- const de_UpdateFindingsCommandError = async (output, context) => {
1818
- const parsedOutput = {
1819
- ...output,
1820
- body: await parseErrorBody(output.body, context),
1821
- };
1822
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1823
- switch (errorCode) {
1824
- case "AccessDeniedException":
1825
- case "com.amazonaws.accessanalyzer#AccessDeniedException":
1826
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1827
- case "InternalServerException":
1828
- case "com.amazonaws.accessanalyzer#InternalServerException":
1829
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1830
- case "ResourceNotFoundException":
1831
- case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
1832
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1833
- case "ThrottlingException":
1834
- case "com.amazonaws.accessanalyzer#ThrottlingException":
1835
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1836
- case "ValidationException":
1837
- case "com.amazonaws.accessanalyzer#ValidationException":
1838
- throw await de_ValidationExceptionRes(parsedOutput, context);
1839
- default:
1840
- const parsedBody = parsedOutput.body;
1841
- return throwDefaultError({
1842
- output,
1843
- parsedBody,
1844
- errorCode,
1845
- });
1846
- }
1847
- };
1848
875
  export const de_ValidatePolicyCommand = async (output, context) => {
1849
876
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1850
- return de_ValidatePolicyCommandError(output, context);
877
+ return de_CommandError(output, context);
1851
878
  }
1852
879
  const contents = map({
1853
880
  $metadata: deserializeMetadata(output),
@@ -1860,7 +887,7 @@ export const de_ValidatePolicyCommand = async (output, context) => {
1860
887
  Object.assign(contents, doc);
1861
888
  return contents;
1862
889
  };
1863
- const de_ValidatePolicyCommandError = async (output, context) => {
890
+ const de_CommandError = async (output, context) => {
1864
891
  const parsedOutput = {
1865
892
  ...output,
1866
893
  body: await parseErrorBody(output.body, context),
@@ -1873,12 +900,27 @@ const de_ValidatePolicyCommandError = async (output, context) => {
1873
900
  case "InternalServerException":
1874
901
  case "com.amazonaws.accessanalyzer#InternalServerException":
1875
902
  throw await de_InternalServerExceptionRes(parsedOutput, context);
903
+ case "ResourceNotFoundException":
904
+ case "com.amazonaws.accessanalyzer#ResourceNotFoundException":
905
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1876
906
  case "ThrottlingException":
1877
907
  case "com.amazonaws.accessanalyzer#ThrottlingException":
1878
908
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
1879
909
  case "ValidationException":
1880
910
  case "com.amazonaws.accessanalyzer#ValidationException":
1881
911
  throw await de_ValidationExceptionRes(parsedOutput, context);
912
+ case "InvalidParameterException":
913
+ case "com.amazonaws.accessanalyzer#InvalidParameterException":
914
+ throw await de_InvalidParameterExceptionRes(parsedOutput, context);
915
+ case "UnprocessableEntityException":
916
+ case "com.amazonaws.accessanalyzer#UnprocessableEntityException":
917
+ throw await de_UnprocessableEntityExceptionRes(parsedOutput, context);
918
+ case "ConflictException":
919
+ case "com.amazonaws.accessanalyzer#ConflictException":
920
+ throw await de_ConflictExceptionRes(parsedOutput, context);
921
+ case "ServiceQuotaExceededException":
922
+ case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException":
923
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1882
924
  default:
1883
925
  const parsedBody = parsedOutput.body;
1884
926
  return throwDefaultError({