@aws-sdk/client-xray 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.
@@ -444,7 +444,7 @@ export const se_UpdateSamplingRuleCommand = async (input, context) => {
444
444
  };
445
445
  export const de_BatchGetTracesCommand = async (output, context) => {
446
446
  if (output.statusCode !== 200 && output.statusCode >= 300) {
447
- return de_BatchGetTracesCommandError(output, context);
447
+ return de_CommandError(output, context);
448
448
  }
449
449
  const contents = map({
450
450
  $metadata: deserializeMetadata(output),
@@ -458,31 +458,9 @@ export const de_BatchGetTracesCommand = async (output, context) => {
458
458
  Object.assign(contents, doc);
459
459
  return contents;
460
460
  };
461
- const de_BatchGetTracesCommandError = async (output, context) => {
462
- const parsedOutput = {
463
- ...output,
464
- body: await parseErrorBody(output.body, context),
465
- };
466
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
467
- switch (errorCode) {
468
- case "InvalidRequestException":
469
- case "com.amazonaws.xray#InvalidRequestException":
470
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
471
- case "ThrottledException":
472
- case "com.amazonaws.xray#ThrottledException":
473
- throw await de_ThrottledExceptionRes(parsedOutput, context);
474
- default:
475
- const parsedBody = parsedOutput.body;
476
- return throwDefaultError({
477
- output,
478
- parsedBody,
479
- errorCode,
480
- });
481
- }
482
- };
483
461
  export const de_CreateGroupCommand = async (output, context) => {
484
462
  if (output.statusCode !== 200 && output.statusCode >= 300) {
485
- return de_CreateGroupCommandError(output, context);
463
+ return de_CommandError(output, context);
486
464
  }
487
465
  const contents = map({
488
466
  $metadata: deserializeMetadata(output),
@@ -494,31 +472,9 @@ export const de_CreateGroupCommand = async (output, context) => {
494
472
  Object.assign(contents, doc);
495
473
  return contents;
496
474
  };
497
- const de_CreateGroupCommandError = async (output, context) => {
498
- const parsedOutput = {
499
- ...output,
500
- body: await parseErrorBody(output.body, context),
501
- };
502
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
503
- switch (errorCode) {
504
- case "InvalidRequestException":
505
- case "com.amazonaws.xray#InvalidRequestException":
506
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
507
- case "ThrottledException":
508
- case "com.amazonaws.xray#ThrottledException":
509
- throw await de_ThrottledExceptionRes(parsedOutput, context);
510
- default:
511
- const parsedBody = parsedOutput.body;
512
- return throwDefaultError({
513
- output,
514
- parsedBody,
515
- errorCode,
516
- });
517
- }
518
- };
519
475
  export const de_CreateSamplingRuleCommand = async (output, context) => {
520
476
  if (output.statusCode !== 200 && output.statusCode >= 300) {
521
- return de_CreateSamplingRuleCommandError(output, context);
477
+ return de_CommandError(output, context);
522
478
  }
523
479
  const contents = map({
524
480
  $metadata: deserializeMetadata(output),
@@ -530,34 +486,9 @@ export const de_CreateSamplingRuleCommand = async (output, context) => {
530
486
  Object.assign(contents, doc);
531
487
  return contents;
532
488
  };
533
- const de_CreateSamplingRuleCommandError = async (output, context) => {
534
- const parsedOutput = {
535
- ...output,
536
- body: await parseErrorBody(output.body, context),
537
- };
538
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
539
- switch (errorCode) {
540
- case "InvalidRequestException":
541
- case "com.amazonaws.xray#InvalidRequestException":
542
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
543
- case "RuleLimitExceededException":
544
- case "com.amazonaws.xray#RuleLimitExceededException":
545
- throw await de_RuleLimitExceededExceptionRes(parsedOutput, context);
546
- case "ThrottledException":
547
- case "com.amazonaws.xray#ThrottledException":
548
- throw await de_ThrottledExceptionRes(parsedOutput, context);
549
- default:
550
- const parsedBody = parsedOutput.body;
551
- return throwDefaultError({
552
- output,
553
- parsedBody,
554
- errorCode,
555
- });
556
- }
557
- };
558
489
  export const de_DeleteGroupCommand = async (output, context) => {
559
490
  if (output.statusCode !== 200 && output.statusCode >= 300) {
560
- return de_DeleteGroupCommandError(output, context);
491
+ return de_CommandError(output, context);
561
492
  }
562
493
  const contents = map({
563
494
  $metadata: deserializeMetadata(output),
@@ -565,31 +496,9 @@ export const de_DeleteGroupCommand = async (output, context) => {
565
496
  await collectBody(output.body, context);
566
497
  return contents;
567
498
  };
568
- const de_DeleteGroupCommandError = async (output, context) => {
569
- const parsedOutput = {
570
- ...output,
571
- body: await parseErrorBody(output.body, context),
572
- };
573
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
574
- switch (errorCode) {
575
- case "InvalidRequestException":
576
- case "com.amazonaws.xray#InvalidRequestException":
577
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
578
- case "ThrottledException":
579
- case "com.amazonaws.xray#ThrottledException":
580
- throw await de_ThrottledExceptionRes(parsedOutput, context);
581
- default:
582
- const parsedBody = parsedOutput.body;
583
- return throwDefaultError({
584
- output,
585
- parsedBody,
586
- errorCode,
587
- });
588
- }
589
- };
590
499
  export const de_DeleteResourcePolicyCommand = async (output, context) => {
591
500
  if (output.statusCode !== 200 && output.statusCode >= 300) {
592
- return de_DeleteResourcePolicyCommandError(output, context);
501
+ return de_CommandError(output, context);
593
502
  }
594
503
  const contents = map({
595
504
  $metadata: deserializeMetadata(output),
@@ -597,34 +506,9 @@ export const de_DeleteResourcePolicyCommand = async (output, context) => {
597
506
  await collectBody(output.body, context);
598
507
  return contents;
599
508
  };
600
- const de_DeleteResourcePolicyCommandError = async (output, context) => {
601
- const parsedOutput = {
602
- ...output,
603
- body: await parseErrorBody(output.body, context),
604
- };
605
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
606
- switch (errorCode) {
607
- case "InvalidPolicyRevisionIdException":
608
- case "com.amazonaws.xray#InvalidPolicyRevisionIdException":
609
- throw await de_InvalidPolicyRevisionIdExceptionRes(parsedOutput, context);
610
- case "InvalidRequestException":
611
- case "com.amazonaws.xray#InvalidRequestException":
612
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
613
- case "ThrottledException":
614
- case "com.amazonaws.xray#ThrottledException":
615
- throw await de_ThrottledExceptionRes(parsedOutput, context);
616
- default:
617
- const parsedBody = parsedOutput.body;
618
- return throwDefaultError({
619
- output,
620
- parsedBody,
621
- errorCode,
622
- });
623
- }
624
- };
625
509
  export const de_DeleteSamplingRuleCommand = async (output, context) => {
626
510
  if (output.statusCode !== 200 && output.statusCode >= 300) {
627
- return de_DeleteSamplingRuleCommandError(output, context);
511
+ return de_CommandError(output, context);
628
512
  }
629
513
  const contents = map({
630
514
  $metadata: deserializeMetadata(output),
@@ -636,31 +520,9 @@ export const de_DeleteSamplingRuleCommand = async (output, context) => {
636
520
  Object.assign(contents, doc);
637
521
  return contents;
638
522
  };
639
- const de_DeleteSamplingRuleCommandError = async (output, context) => {
640
- const parsedOutput = {
641
- ...output,
642
- body: await parseErrorBody(output.body, context),
643
- };
644
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
645
- switch (errorCode) {
646
- case "InvalidRequestException":
647
- case "com.amazonaws.xray#InvalidRequestException":
648
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
649
- case "ThrottledException":
650
- case "com.amazonaws.xray#ThrottledException":
651
- throw await de_ThrottledExceptionRes(parsedOutput, context);
652
- default:
653
- const parsedBody = parsedOutput.body;
654
- return throwDefaultError({
655
- output,
656
- parsedBody,
657
- errorCode,
658
- });
659
- }
660
- };
661
523
  export const de_GetEncryptionConfigCommand = async (output, context) => {
662
524
  if (output.statusCode !== 200 && output.statusCode >= 300) {
663
- return de_GetEncryptionConfigCommandError(output, context);
525
+ return de_CommandError(output, context);
664
526
  }
665
527
  const contents = map({
666
528
  $metadata: deserializeMetadata(output),
@@ -672,31 +534,9 @@ export const de_GetEncryptionConfigCommand = async (output, context) => {
672
534
  Object.assign(contents, doc);
673
535
  return contents;
674
536
  };
675
- const de_GetEncryptionConfigCommandError = async (output, context) => {
676
- const parsedOutput = {
677
- ...output,
678
- body: await parseErrorBody(output.body, context),
679
- };
680
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
681
- switch (errorCode) {
682
- case "InvalidRequestException":
683
- case "com.amazonaws.xray#InvalidRequestException":
684
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
685
- case "ThrottledException":
686
- case "com.amazonaws.xray#ThrottledException":
687
- throw await de_ThrottledExceptionRes(parsedOutput, context);
688
- default:
689
- const parsedBody = parsedOutput.body;
690
- return throwDefaultError({
691
- output,
692
- parsedBody,
693
- errorCode,
694
- });
695
- }
696
- };
697
537
  export const de_GetGroupCommand = async (output, context) => {
698
538
  if (output.statusCode !== 200 && output.statusCode >= 300) {
699
- return de_GetGroupCommandError(output, context);
539
+ return de_CommandError(output, context);
700
540
  }
701
541
  const contents = map({
702
542
  $metadata: deserializeMetadata(output),
@@ -708,31 +548,9 @@ export const de_GetGroupCommand = async (output, context) => {
708
548
  Object.assign(contents, doc);
709
549
  return contents;
710
550
  };
711
- const de_GetGroupCommandError = async (output, context) => {
712
- const parsedOutput = {
713
- ...output,
714
- body: await parseErrorBody(output.body, context),
715
- };
716
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
717
- switch (errorCode) {
718
- case "InvalidRequestException":
719
- case "com.amazonaws.xray#InvalidRequestException":
720
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
721
- case "ThrottledException":
722
- case "com.amazonaws.xray#ThrottledException":
723
- throw await de_ThrottledExceptionRes(parsedOutput, context);
724
- default:
725
- const parsedBody = parsedOutput.body;
726
- return throwDefaultError({
727
- output,
728
- parsedBody,
729
- errorCode,
730
- });
731
- }
732
- };
733
551
  export const de_GetGroupsCommand = async (output, context) => {
734
552
  if (output.statusCode !== 200 && output.statusCode >= 300) {
735
- return de_GetGroupsCommandError(output, context);
553
+ return de_CommandError(output, context);
736
554
  }
737
555
  const contents = map({
738
556
  $metadata: deserializeMetadata(output),
@@ -745,31 +563,9 @@ export const de_GetGroupsCommand = async (output, context) => {
745
563
  Object.assign(contents, doc);
746
564
  return contents;
747
565
  };
748
- const de_GetGroupsCommandError = async (output, context) => {
749
- const parsedOutput = {
750
- ...output,
751
- body: await parseErrorBody(output.body, context),
752
- };
753
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
754
- switch (errorCode) {
755
- case "InvalidRequestException":
756
- case "com.amazonaws.xray#InvalidRequestException":
757
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
758
- case "ThrottledException":
759
- case "com.amazonaws.xray#ThrottledException":
760
- throw await de_ThrottledExceptionRes(parsedOutput, context);
761
- default:
762
- const parsedBody = parsedOutput.body;
763
- return throwDefaultError({
764
- output,
765
- parsedBody,
766
- errorCode,
767
- });
768
- }
769
- };
770
566
  export const de_GetInsightCommand = async (output, context) => {
771
567
  if (output.statusCode !== 200 && output.statusCode >= 300) {
772
- return de_GetInsightCommandError(output, context);
568
+ return de_CommandError(output, context);
773
569
  }
774
570
  const contents = map({
775
571
  $metadata: deserializeMetadata(output),
@@ -781,31 +577,9 @@ export const de_GetInsightCommand = async (output, context) => {
781
577
  Object.assign(contents, doc);
782
578
  return contents;
783
579
  };
784
- const de_GetInsightCommandError = async (output, context) => {
785
- const parsedOutput = {
786
- ...output,
787
- body: await parseErrorBody(output.body, context),
788
- };
789
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
790
- switch (errorCode) {
791
- case "InvalidRequestException":
792
- case "com.amazonaws.xray#InvalidRequestException":
793
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
794
- case "ThrottledException":
795
- case "com.amazonaws.xray#ThrottledException":
796
- throw await de_ThrottledExceptionRes(parsedOutput, context);
797
- default:
798
- const parsedBody = parsedOutput.body;
799
- return throwDefaultError({
800
- output,
801
- parsedBody,
802
- errorCode,
803
- });
804
- }
805
- };
806
580
  export const de_GetInsightEventsCommand = async (output, context) => {
807
581
  if (output.statusCode !== 200 && output.statusCode >= 300) {
808
- return de_GetInsightEventsCommandError(output, context);
582
+ return de_CommandError(output, context);
809
583
  }
810
584
  const contents = map({
811
585
  $metadata: deserializeMetadata(output),
@@ -818,31 +592,9 @@ export const de_GetInsightEventsCommand = async (output, context) => {
818
592
  Object.assign(contents, doc);
819
593
  return contents;
820
594
  };
821
- const de_GetInsightEventsCommandError = async (output, context) => {
822
- const parsedOutput = {
823
- ...output,
824
- body: await parseErrorBody(output.body, context),
825
- };
826
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
827
- switch (errorCode) {
828
- case "InvalidRequestException":
829
- case "com.amazonaws.xray#InvalidRequestException":
830
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
831
- case "ThrottledException":
832
- case "com.amazonaws.xray#ThrottledException":
833
- throw await de_ThrottledExceptionRes(parsedOutput, context);
834
- default:
835
- const parsedBody = parsedOutput.body;
836
- return throwDefaultError({
837
- output,
838
- parsedBody,
839
- errorCode,
840
- });
841
- }
842
- };
843
595
  export const de_GetInsightImpactGraphCommand = async (output, context) => {
844
596
  if (output.statusCode !== 200 && output.statusCode >= 300) {
845
- return de_GetInsightImpactGraphCommandError(output, context);
597
+ return de_CommandError(output, context);
846
598
  }
847
599
  const contents = map({
848
600
  $metadata: deserializeMetadata(output),
@@ -860,31 +612,9 @@ export const de_GetInsightImpactGraphCommand = async (output, context) => {
860
612
  Object.assign(contents, doc);
861
613
  return contents;
862
614
  };
863
- const de_GetInsightImpactGraphCommandError = async (output, context) => {
864
- const parsedOutput = {
865
- ...output,
866
- body: await parseErrorBody(output.body, context),
867
- };
868
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
869
- switch (errorCode) {
870
- case "InvalidRequestException":
871
- case "com.amazonaws.xray#InvalidRequestException":
872
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
873
- case "ThrottledException":
874
- case "com.amazonaws.xray#ThrottledException":
875
- throw await de_ThrottledExceptionRes(parsedOutput, context);
876
- default:
877
- const parsedBody = parsedOutput.body;
878
- return throwDefaultError({
879
- output,
880
- parsedBody,
881
- errorCode,
882
- });
883
- }
884
- };
885
615
  export const de_GetInsightSummariesCommand = async (output, context) => {
886
616
  if (output.statusCode !== 200 && output.statusCode >= 300) {
887
- return de_GetInsightSummariesCommandError(output, context);
617
+ return de_CommandError(output, context);
888
618
  }
889
619
  const contents = map({
890
620
  $metadata: deserializeMetadata(output),
@@ -897,31 +627,9 @@ export const de_GetInsightSummariesCommand = async (output, context) => {
897
627
  Object.assign(contents, doc);
898
628
  return contents;
899
629
  };
900
- const de_GetInsightSummariesCommandError = async (output, context) => {
901
- const parsedOutput = {
902
- ...output,
903
- body: await parseErrorBody(output.body, context),
904
- };
905
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
906
- switch (errorCode) {
907
- case "InvalidRequestException":
908
- case "com.amazonaws.xray#InvalidRequestException":
909
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
910
- case "ThrottledException":
911
- case "com.amazonaws.xray#ThrottledException":
912
- throw await de_ThrottledExceptionRes(parsedOutput, context);
913
- default:
914
- const parsedBody = parsedOutput.body;
915
- return throwDefaultError({
916
- output,
917
- parsedBody,
918
- errorCode,
919
- });
920
- }
921
- };
922
630
  export const de_GetSamplingRulesCommand = async (output, context) => {
923
631
  if (output.statusCode !== 200 && output.statusCode >= 300) {
924
- return de_GetSamplingRulesCommandError(output, context);
632
+ return de_CommandError(output, context);
925
633
  }
926
634
  const contents = map({
927
635
  $metadata: deserializeMetadata(output),
@@ -934,31 +642,9 @@ export const de_GetSamplingRulesCommand = async (output, context) => {
934
642
  Object.assign(contents, doc);
935
643
  return contents;
936
644
  };
937
- const de_GetSamplingRulesCommandError = async (output, context) => {
938
- const parsedOutput = {
939
- ...output,
940
- body: await parseErrorBody(output.body, context),
941
- };
942
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
943
- switch (errorCode) {
944
- case "InvalidRequestException":
945
- case "com.amazonaws.xray#InvalidRequestException":
946
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
947
- case "ThrottledException":
948
- case "com.amazonaws.xray#ThrottledException":
949
- throw await de_ThrottledExceptionRes(parsedOutput, context);
950
- default:
951
- const parsedBody = parsedOutput.body;
952
- return throwDefaultError({
953
- output,
954
- parsedBody,
955
- errorCode,
956
- });
957
- }
958
- };
959
645
  export const de_GetSamplingStatisticSummariesCommand = async (output, context) => {
960
646
  if (output.statusCode !== 200 && output.statusCode >= 300) {
961
- return de_GetSamplingStatisticSummariesCommandError(output, context);
647
+ return de_CommandError(output, context);
962
648
  }
963
649
  const contents = map({
964
650
  $metadata: deserializeMetadata(output),
@@ -971,31 +657,9 @@ export const de_GetSamplingStatisticSummariesCommand = async (output, context) =
971
657
  Object.assign(contents, doc);
972
658
  return contents;
973
659
  };
974
- const de_GetSamplingStatisticSummariesCommandError = async (output, context) => {
975
- const parsedOutput = {
976
- ...output,
977
- body: await parseErrorBody(output.body, context),
978
- };
979
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
980
- switch (errorCode) {
981
- case "InvalidRequestException":
982
- case "com.amazonaws.xray#InvalidRequestException":
983
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
984
- case "ThrottledException":
985
- case "com.amazonaws.xray#ThrottledException":
986
- throw await de_ThrottledExceptionRes(parsedOutput, context);
987
- default:
988
- const parsedBody = parsedOutput.body;
989
- return throwDefaultError({
990
- output,
991
- parsedBody,
992
- errorCode,
993
- });
994
- }
995
- };
996
660
  export const de_GetSamplingTargetsCommand = async (output, context) => {
997
661
  if (output.statusCode !== 200 && output.statusCode >= 300) {
998
- return de_GetSamplingTargetsCommandError(output, context);
662
+ return de_CommandError(output, context);
999
663
  }
1000
664
  const contents = map({
1001
665
  $metadata: deserializeMetadata(output),
@@ -1009,31 +673,9 @@ export const de_GetSamplingTargetsCommand = async (output, context) => {
1009
673
  Object.assign(contents, doc);
1010
674
  return contents;
1011
675
  };
1012
- const de_GetSamplingTargetsCommandError = async (output, context) => {
1013
- const parsedOutput = {
1014
- ...output,
1015
- body: await parseErrorBody(output.body, context),
1016
- };
1017
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1018
- switch (errorCode) {
1019
- case "InvalidRequestException":
1020
- case "com.amazonaws.xray#InvalidRequestException":
1021
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1022
- case "ThrottledException":
1023
- case "com.amazonaws.xray#ThrottledException":
1024
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1025
- default:
1026
- const parsedBody = parsedOutput.body;
1027
- return throwDefaultError({
1028
- output,
1029
- parsedBody,
1030
- errorCode,
1031
- });
1032
- }
1033
- };
1034
676
  export const de_GetServiceGraphCommand = async (output, context) => {
1035
677
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1036
- return de_GetServiceGraphCommandError(output, context);
678
+ return de_CommandError(output, context);
1037
679
  }
1038
680
  const contents = map({
1039
681
  $metadata: deserializeMetadata(output),
@@ -1049,31 +691,9 @@ export const de_GetServiceGraphCommand = async (output, context) => {
1049
691
  Object.assign(contents, doc);
1050
692
  return contents;
1051
693
  };
1052
- const de_GetServiceGraphCommandError = async (output, context) => {
1053
- const parsedOutput = {
1054
- ...output,
1055
- body: await parseErrorBody(output.body, context),
1056
- };
1057
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1058
- switch (errorCode) {
1059
- case "InvalidRequestException":
1060
- case "com.amazonaws.xray#InvalidRequestException":
1061
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1062
- case "ThrottledException":
1063
- case "com.amazonaws.xray#ThrottledException":
1064
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1065
- default:
1066
- const parsedBody = parsedOutput.body;
1067
- return throwDefaultError({
1068
- output,
1069
- parsedBody,
1070
- errorCode,
1071
- });
1072
- }
1073
- };
1074
694
  export const de_GetTimeSeriesServiceStatisticsCommand = async (output, context) => {
1075
695
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1076
- return de_GetTimeSeriesServiceStatisticsCommandError(output, context);
696
+ return de_CommandError(output, context);
1077
697
  }
1078
698
  const contents = map({
1079
699
  $metadata: deserializeMetadata(output),
@@ -1087,31 +707,9 @@ export const de_GetTimeSeriesServiceStatisticsCommand = async (output, context)
1087
707
  Object.assign(contents, doc);
1088
708
  return contents;
1089
709
  };
1090
- const de_GetTimeSeriesServiceStatisticsCommandError = async (output, context) => {
1091
- const parsedOutput = {
1092
- ...output,
1093
- body: await parseErrorBody(output.body, context),
1094
- };
1095
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1096
- switch (errorCode) {
1097
- case "InvalidRequestException":
1098
- case "com.amazonaws.xray#InvalidRequestException":
1099
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1100
- case "ThrottledException":
1101
- case "com.amazonaws.xray#ThrottledException":
1102
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1103
- default:
1104
- const parsedBody = parsedOutput.body;
1105
- return throwDefaultError({
1106
- output,
1107
- parsedBody,
1108
- errorCode,
1109
- });
1110
- }
1111
- };
1112
710
  export const de_GetTraceGraphCommand = async (output, context) => {
1113
711
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1114
- return de_GetTraceGraphCommandError(output, context);
712
+ return de_CommandError(output, context);
1115
713
  }
1116
714
  const contents = map({
1117
715
  $metadata: deserializeMetadata(output),
@@ -1124,31 +722,9 @@ export const de_GetTraceGraphCommand = async (output, context) => {
1124
722
  Object.assign(contents, doc);
1125
723
  return contents;
1126
724
  };
1127
- const de_GetTraceGraphCommandError = async (output, context) => {
1128
- const parsedOutput = {
1129
- ...output,
1130
- body: await parseErrorBody(output.body, context),
1131
- };
1132
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1133
- switch (errorCode) {
1134
- case "InvalidRequestException":
1135
- case "com.amazonaws.xray#InvalidRequestException":
1136
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1137
- case "ThrottledException":
1138
- case "com.amazonaws.xray#ThrottledException":
1139
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1140
- default:
1141
- const parsedBody = parsedOutput.body;
1142
- return throwDefaultError({
1143
- output,
1144
- parsedBody,
1145
- errorCode,
1146
- });
1147
- }
1148
- };
1149
725
  export const de_GetTraceSummariesCommand = async (output, context) => {
1150
726
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1151
- return de_GetTraceSummariesCommandError(output, context);
727
+ return de_CommandError(output, context);
1152
728
  }
1153
729
  const contents = map({
1154
730
  $metadata: deserializeMetadata(output),
@@ -1163,31 +739,9 @@ export const de_GetTraceSummariesCommand = async (output, context) => {
1163
739
  Object.assign(contents, doc);
1164
740
  return contents;
1165
741
  };
1166
- const de_GetTraceSummariesCommandError = async (output, context) => {
1167
- const parsedOutput = {
1168
- ...output,
1169
- body: await parseErrorBody(output.body, context),
1170
- };
1171
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1172
- switch (errorCode) {
1173
- case "InvalidRequestException":
1174
- case "com.amazonaws.xray#InvalidRequestException":
1175
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1176
- case "ThrottledException":
1177
- case "com.amazonaws.xray#ThrottledException":
1178
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1179
- default:
1180
- const parsedBody = parsedOutput.body;
1181
- return throwDefaultError({
1182
- output,
1183
- parsedBody,
1184
- errorCode,
1185
- });
1186
- }
1187
- };
1188
742
  export const de_ListResourcePoliciesCommand = async (output, context) => {
1189
743
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1190
- return de_ListResourcePoliciesCommandError(output, context);
744
+ return de_CommandError(output, context);
1191
745
  }
1192
746
  const contents = map({
1193
747
  $metadata: deserializeMetadata(output),
@@ -1200,31 +754,9 @@ export const de_ListResourcePoliciesCommand = async (output, context) => {
1200
754
  Object.assign(contents, doc);
1201
755
  return contents;
1202
756
  };
1203
- const de_ListResourcePoliciesCommandError = 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 "InvalidRequestException":
1211
- case "com.amazonaws.xray#InvalidRequestException":
1212
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1213
- case "ThrottledException":
1214
- case "com.amazonaws.xray#ThrottledException":
1215
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1216
- default:
1217
- const parsedBody = parsedOutput.body;
1218
- return throwDefaultError({
1219
- output,
1220
- parsedBody,
1221
- errorCode,
1222
- });
1223
- }
1224
- };
1225
757
  export const de_ListTagsForResourceCommand = async (output, context) => {
1226
758
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1227
- return de_ListTagsForResourceCommandError(output, context);
759
+ return de_CommandError(output, context);
1228
760
  }
1229
761
  const contents = map({
1230
762
  $metadata: deserializeMetadata(output),
@@ -1237,34 +769,9 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
1237
769
  Object.assign(contents, doc);
1238
770
  return contents;
1239
771
  };
1240
- const de_ListTagsForResourceCommandError = async (output, context) => {
1241
- const parsedOutput = {
1242
- ...output,
1243
- body: await parseErrorBody(output.body, context),
1244
- };
1245
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1246
- switch (errorCode) {
1247
- case "InvalidRequestException":
1248
- case "com.amazonaws.xray#InvalidRequestException":
1249
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1250
- case "ResourceNotFoundException":
1251
- case "com.amazonaws.xray#ResourceNotFoundException":
1252
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1253
- case "ThrottledException":
1254
- case "com.amazonaws.xray#ThrottledException":
1255
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1256
- default:
1257
- const parsedBody = parsedOutput.body;
1258
- return throwDefaultError({
1259
- output,
1260
- parsedBody,
1261
- errorCode,
1262
- });
1263
- }
1264
- };
1265
772
  export const de_PutEncryptionConfigCommand = async (output, context) => {
1266
773
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1267
- return de_PutEncryptionConfigCommandError(output, context);
774
+ return de_CommandError(output, context);
1268
775
  }
1269
776
  const contents = map({
1270
777
  $metadata: deserializeMetadata(output),
@@ -1276,31 +783,9 @@ export const de_PutEncryptionConfigCommand = async (output, context) => {
1276
783
  Object.assign(contents, doc);
1277
784
  return contents;
1278
785
  };
1279
- const de_PutEncryptionConfigCommandError = async (output, context) => {
1280
- const parsedOutput = {
1281
- ...output,
1282
- body: await parseErrorBody(output.body, context),
1283
- };
1284
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1285
- switch (errorCode) {
1286
- case "InvalidRequestException":
1287
- case "com.amazonaws.xray#InvalidRequestException":
1288
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1289
- case "ThrottledException":
1290
- case "com.amazonaws.xray#ThrottledException":
1291
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1292
- default:
1293
- const parsedBody = parsedOutput.body;
1294
- return throwDefaultError({
1295
- output,
1296
- parsedBody,
1297
- errorCode,
1298
- });
1299
- }
1300
- };
1301
786
  export const de_PutResourcePolicyCommand = async (output, context) => {
1302
787
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1303
- return de_PutResourcePolicyCommandError(output, context);
788
+ return de_CommandError(output, context);
1304
789
  }
1305
790
  const contents = map({
1306
791
  $metadata: deserializeMetadata(output),
@@ -1312,43 +797,9 @@ export const de_PutResourcePolicyCommand = async (output, context) => {
1312
797
  Object.assign(contents, doc);
1313
798
  return contents;
1314
799
  };
1315
- const de_PutResourcePolicyCommandError = async (output, context) => {
1316
- const parsedOutput = {
1317
- ...output,
1318
- body: await parseErrorBody(output.body, context),
1319
- };
1320
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1321
- switch (errorCode) {
1322
- case "InvalidPolicyRevisionIdException":
1323
- case "com.amazonaws.xray#InvalidPolicyRevisionIdException":
1324
- throw await de_InvalidPolicyRevisionIdExceptionRes(parsedOutput, context);
1325
- case "LockoutPreventionException":
1326
- case "com.amazonaws.xray#LockoutPreventionException":
1327
- throw await de_LockoutPreventionExceptionRes(parsedOutput, context);
1328
- case "MalformedPolicyDocumentException":
1329
- case "com.amazonaws.xray#MalformedPolicyDocumentException":
1330
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
1331
- case "PolicyCountLimitExceededException":
1332
- case "com.amazonaws.xray#PolicyCountLimitExceededException":
1333
- throw await de_PolicyCountLimitExceededExceptionRes(parsedOutput, context);
1334
- case "PolicySizeLimitExceededException":
1335
- case "com.amazonaws.xray#PolicySizeLimitExceededException":
1336
- throw await de_PolicySizeLimitExceededExceptionRes(parsedOutput, context);
1337
- case "ThrottledException":
1338
- case "com.amazonaws.xray#ThrottledException":
1339
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1340
- default:
1341
- const parsedBody = parsedOutput.body;
1342
- return throwDefaultError({
1343
- output,
1344
- parsedBody,
1345
- errorCode,
1346
- });
1347
- }
1348
- };
1349
800
  export const de_PutTelemetryRecordsCommand = async (output, context) => {
1350
801
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1351
- return de_PutTelemetryRecordsCommandError(output, context);
802
+ return de_CommandError(output, context);
1352
803
  }
1353
804
  const contents = map({
1354
805
  $metadata: deserializeMetadata(output),
@@ -1356,31 +807,9 @@ export const de_PutTelemetryRecordsCommand = async (output, context) => {
1356
807
  await collectBody(output.body, context);
1357
808
  return contents;
1358
809
  };
1359
- const de_PutTelemetryRecordsCommandError = async (output, context) => {
1360
- const parsedOutput = {
1361
- ...output,
1362
- body: await parseErrorBody(output.body, context),
1363
- };
1364
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1365
- switch (errorCode) {
1366
- case "InvalidRequestException":
1367
- case "com.amazonaws.xray#InvalidRequestException":
1368
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1369
- case "ThrottledException":
1370
- case "com.amazonaws.xray#ThrottledException":
1371
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1372
- default:
1373
- const parsedBody = parsedOutput.body;
1374
- return throwDefaultError({
1375
- output,
1376
- parsedBody,
1377
- errorCode,
1378
- });
1379
- }
1380
- };
1381
810
  export const de_PutTraceSegmentsCommand = async (output, context) => {
1382
811
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1383
- return de_PutTraceSegmentsCommandError(output, context);
812
+ return de_CommandError(output, context);
1384
813
  }
1385
814
  const contents = map({
1386
815
  $metadata: deserializeMetadata(output),
@@ -1392,31 +821,9 @@ export const de_PutTraceSegmentsCommand = async (output, context) => {
1392
821
  Object.assign(contents, doc);
1393
822
  return contents;
1394
823
  };
1395
- const de_PutTraceSegmentsCommandError = async (output, context) => {
1396
- const parsedOutput = {
1397
- ...output,
1398
- body: await parseErrorBody(output.body, context),
1399
- };
1400
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1401
- switch (errorCode) {
1402
- case "InvalidRequestException":
1403
- case "com.amazonaws.xray#InvalidRequestException":
1404
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1405
- case "ThrottledException":
1406
- case "com.amazonaws.xray#ThrottledException":
1407
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1408
- default:
1409
- const parsedBody = parsedOutput.body;
1410
- return throwDefaultError({
1411
- output,
1412
- parsedBody,
1413
- errorCode,
1414
- });
1415
- }
1416
- };
1417
824
  export const de_TagResourceCommand = async (output, context) => {
1418
825
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1419
- return de_TagResourceCommandError(output, context);
826
+ return de_CommandError(output, context);
1420
827
  }
1421
828
  const contents = map({
1422
829
  $metadata: deserializeMetadata(output),
@@ -1424,37 +831,9 @@ export const de_TagResourceCommand = async (output, context) => {
1424
831
  await collectBody(output.body, context);
1425
832
  return contents;
1426
833
  };
1427
- const de_TagResourceCommandError = async (output, context) => {
1428
- const parsedOutput = {
1429
- ...output,
1430
- body: await parseErrorBody(output.body, context),
1431
- };
1432
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1433
- switch (errorCode) {
1434
- case "InvalidRequestException":
1435
- case "com.amazonaws.xray#InvalidRequestException":
1436
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1437
- case "ResourceNotFoundException":
1438
- case "com.amazonaws.xray#ResourceNotFoundException":
1439
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1440
- case "ThrottledException":
1441
- case "com.amazonaws.xray#ThrottledException":
1442
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1443
- case "TooManyTagsException":
1444
- case "com.amazonaws.xray#TooManyTagsException":
1445
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
1446
- default:
1447
- const parsedBody = parsedOutput.body;
1448
- return throwDefaultError({
1449
- output,
1450
- parsedBody,
1451
- errorCode,
1452
- });
1453
- }
1454
- };
1455
834
  export const de_UntagResourceCommand = async (output, context) => {
1456
835
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1457
- return de_UntagResourceCommandError(output, context);
836
+ return de_CommandError(output, context);
1458
837
  }
1459
838
  const contents = map({
1460
839
  $metadata: deserializeMetadata(output),
@@ -1462,34 +841,9 @@ export const de_UntagResourceCommand = async (output, context) => {
1462
841
  await collectBody(output.body, context);
1463
842
  return contents;
1464
843
  };
1465
- const de_UntagResourceCommandError = async (output, context) => {
1466
- const parsedOutput = {
1467
- ...output,
1468
- body: await parseErrorBody(output.body, context),
1469
- };
1470
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1471
- switch (errorCode) {
1472
- case "InvalidRequestException":
1473
- case "com.amazonaws.xray#InvalidRequestException":
1474
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1475
- case "ResourceNotFoundException":
1476
- case "com.amazonaws.xray#ResourceNotFoundException":
1477
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1478
- case "ThrottledException":
1479
- case "com.amazonaws.xray#ThrottledException":
1480
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1481
- default:
1482
- const parsedBody = parsedOutput.body;
1483
- return throwDefaultError({
1484
- output,
1485
- parsedBody,
1486
- errorCode,
1487
- });
1488
- }
1489
- };
1490
844
  export const de_UpdateGroupCommand = async (output, context) => {
1491
845
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1492
- return de_UpdateGroupCommandError(output, context);
846
+ return de_CommandError(output, context);
1493
847
  }
1494
848
  const contents = map({
1495
849
  $metadata: deserializeMetadata(output),
@@ -1501,31 +855,9 @@ export const de_UpdateGroupCommand = async (output, context) => {
1501
855
  Object.assign(contents, doc);
1502
856
  return contents;
1503
857
  };
1504
- const de_UpdateGroupCommandError = async (output, context) => {
1505
- const parsedOutput = {
1506
- ...output,
1507
- body: await parseErrorBody(output.body, context),
1508
- };
1509
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1510
- switch (errorCode) {
1511
- case "InvalidRequestException":
1512
- case "com.amazonaws.xray#InvalidRequestException":
1513
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1514
- case "ThrottledException":
1515
- case "com.amazonaws.xray#ThrottledException":
1516
- throw await de_ThrottledExceptionRes(parsedOutput, context);
1517
- default:
1518
- const parsedBody = parsedOutput.body;
1519
- return throwDefaultError({
1520
- output,
1521
- parsedBody,
1522
- errorCode,
1523
- });
1524
- }
1525
- };
1526
858
  export const de_UpdateSamplingRuleCommand = async (output, context) => {
1527
859
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1528
- return de_UpdateSamplingRuleCommandError(output, context);
860
+ return de_CommandError(output, context);
1529
861
  }
1530
862
  const contents = map({
1531
863
  $metadata: deserializeMetadata(output),
@@ -1537,7 +869,7 @@ export const de_UpdateSamplingRuleCommand = async (output, context) => {
1537
869
  Object.assign(contents, doc);
1538
870
  return contents;
1539
871
  };
1540
- const de_UpdateSamplingRuleCommandError = async (output, context) => {
872
+ const de_CommandError = async (output, context) => {
1541
873
  const parsedOutput = {
1542
874
  ...output,
1543
875
  body: await parseErrorBody(output.body, context),
@@ -1550,6 +882,30 @@ const de_UpdateSamplingRuleCommandError = async (output, context) => {
1550
882
  case "ThrottledException":
1551
883
  case "com.amazonaws.xray#ThrottledException":
1552
884
  throw await de_ThrottledExceptionRes(parsedOutput, context);
885
+ case "RuleLimitExceededException":
886
+ case "com.amazonaws.xray#RuleLimitExceededException":
887
+ throw await de_RuleLimitExceededExceptionRes(parsedOutput, context);
888
+ case "InvalidPolicyRevisionIdException":
889
+ case "com.amazonaws.xray#InvalidPolicyRevisionIdException":
890
+ throw await de_InvalidPolicyRevisionIdExceptionRes(parsedOutput, context);
891
+ case "ResourceNotFoundException":
892
+ case "com.amazonaws.xray#ResourceNotFoundException":
893
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
894
+ case "LockoutPreventionException":
895
+ case "com.amazonaws.xray#LockoutPreventionException":
896
+ throw await de_LockoutPreventionExceptionRes(parsedOutput, context);
897
+ case "MalformedPolicyDocumentException":
898
+ case "com.amazonaws.xray#MalformedPolicyDocumentException":
899
+ throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
900
+ case "PolicyCountLimitExceededException":
901
+ case "com.amazonaws.xray#PolicyCountLimitExceededException":
902
+ throw await de_PolicyCountLimitExceededExceptionRes(parsedOutput, context);
903
+ case "PolicySizeLimitExceededException":
904
+ case "com.amazonaws.xray#PolicySizeLimitExceededException":
905
+ throw await de_PolicySizeLimitExceededExceptionRes(parsedOutput, context);
906
+ case "TooManyTagsException":
907
+ case "com.amazonaws.xray#TooManyTagsException":
908
+ throw await de_TooManyTagsExceptionRes(parsedOutput, context);
1553
909
  default:
1554
910
  const parsedBody = parsedOutput.body;
1555
911
  return throwDefaultError({