@aws-sdk/client-cloudwatch 3.312.0 → 3.315.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -433,7 +433,7 @@ const de_DeleteAlarmsCommand = async (output, context) => {
433
433
  const response = {
434
434
  $metadata: deserializeMetadata(output),
435
435
  };
436
- return Promise.resolve(response);
436
+ return response;
437
437
  };
438
438
  exports.de_DeleteAlarmsCommand = de_DeleteAlarmsCommand;
439
439
  const de_DeleteAlarmsCommandError = async (output, context) => {
@@ -448,10 +448,9 @@ const de_DeleteAlarmsCommandError = async (output, context) => {
448
448
  throw await de_ResourceNotFoundRes(parsedOutput, context);
449
449
  default:
450
450
  const parsedBody = parsedOutput.body;
451
- (0, smithy_client_1.throwDefaultError)({
451
+ return throwDefaultError({
452
452
  output,
453
453
  parsedBody: parsedBody.Error,
454
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
455
454
  errorCode,
456
455
  });
457
456
  }
@@ -467,7 +466,7 @@ const de_DeleteAnomalyDetectorCommand = async (output, context) => {
467
466
  $metadata: deserializeMetadata(output),
468
467
  ...contents,
469
468
  };
470
- return Promise.resolve(response);
469
+ return response;
471
470
  };
472
471
  exports.de_DeleteAnomalyDetectorCommand = de_DeleteAnomalyDetectorCommand;
473
472
  const de_DeleteAnomalyDetectorCommandError = async (output, context) => {
@@ -494,10 +493,9 @@ const de_DeleteAnomalyDetectorCommandError = async (output, context) => {
494
493
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
495
494
  default:
496
495
  const parsedBody = parsedOutput.body;
497
- (0, smithy_client_1.throwDefaultError)({
496
+ return throwDefaultError({
498
497
  output,
499
498
  parsedBody: parsedBody.Error,
500
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
501
499
  errorCode,
502
500
  });
503
501
  }
@@ -513,7 +511,7 @@ const de_DeleteDashboardsCommand = async (output, context) => {
513
511
  $metadata: deserializeMetadata(output),
514
512
  ...contents,
515
513
  };
516
- return Promise.resolve(response);
514
+ return response;
517
515
  };
518
516
  exports.de_DeleteDashboardsCommand = de_DeleteDashboardsCommand;
519
517
  const de_DeleteDashboardsCommandError = async (output, context) => {
@@ -534,10 +532,9 @@ const de_DeleteDashboardsCommandError = async (output, context) => {
534
532
  throw await de_DashboardNotFoundErrorRes(parsedOutput, context);
535
533
  default:
536
534
  const parsedBody = parsedOutput.body;
537
- (0, smithy_client_1.throwDefaultError)({
535
+ return throwDefaultError({
538
536
  output,
539
537
  parsedBody: parsedBody.Error,
540
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
541
538
  errorCode,
542
539
  });
543
540
  }
@@ -553,7 +550,7 @@ const de_DeleteInsightRulesCommand = async (output, context) => {
553
550
  $metadata: deserializeMetadata(output),
554
551
  ...contents,
555
552
  };
556
- return Promise.resolve(response);
553
+ return response;
557
554
  };
558
555
  exports.de_DeleteInsightRulesCommand = de_DeleteInsightRulesCommand;
559
556
  const de_DeleteInsightRulesCommandError = async (output, context) => {
@@ -571,10 +568,9 @@ const de_DeleteInsightRulesCommandError = async (output, context) => {
571
568
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
572
569
  default:
573
570
  const parsedBody = parsedOutput.body;
574
- (0, smithy_client_1.throwDefaultError)({
571
+ return throwDefaultError({
575
572
  output,
576
573
  parsedBody: parsedBody.Error,
577
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
578
574
  errorCode,
579
575
  });
580
576
  }
@@ -590,7 +586,7 @@ const de_DeleteMetricStreamCommand = async (output, context) => {
590
586
  $metadata: deserializeMetadata(output),
591
587
  ...contents,
592
588
  };
593
- return Promise.resolve(response);
589
+ return response;
594
590
  };
595
591
  exports.de_DeleteMetricStreamCommand = de_DeleteMetricStreamCommand;
596
592
  const de_DeleteMetricStreamCommandError = async (output, context) => {
@@ -611,10 +607,9 @@ const de_DeleteMetricStreamCommandError = async (output, context) => {
611
607
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
612
608
  default:
613
609
  const parsedBody = parsedOutput.body;
614
- (0, smithy_client_1.throwDefaultError)({
610
+ return throwDefaultError({
615
611
  output,
616
612
  parsedBody: parsedBody.Error,
617
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
618
613
  errorCode,
619
614
  });
620
615
  }
@@ -630,7 +625,7 @@ const de_DescribeAlarmHistoryCommand = async (output, context) => {
630
625
  $metadata: deserializeMetadata(output),
631
626
  ...contents,
632
627
  };
633
- return Promise.resolve(response);
628
+ return response;
634
629
  };
635
630
  exports.de_DescribeAlarmHistoryCommand = de_DescribeAlarmHistoryCommand;
636
631
  const de_DescribeAlarmHistoryCommandError = async (output, context) => {
@@ -645,10 +640,9 @@ const de_DescribeAlarmHistoryCommandError = async (output, context) => {
645
640
  throw await de_InvalidNextTokenRes(parsedOutput, context);
646
641
  default:
647
642
  const parsedBody = parsedOutput.body;
648
- (0, smithy_client_1.throwDefaultError)({
643
+ return throwDefaultError({
649
644
  output,
650
645
  parsedBody: parsedBody.Error,
651
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
652
646
  errorCode,
653
647
  });
654
648
  }
@@ -664,7 +658,7 @@ const de_DescribeAlarmsCommand = async (output, context) => {
664
658
  $metadata: deserializeMetadata(output),
665
659
  ...contents,
666
660
  };
667
- return Promise.resolve(response);
661
+ return response;
668
662
  };
669
663
  exports.de_DescribeAlarmsCommand = de_DescribeAlarmsCommand;
670
664
  const de_DescribeAlarmsCommandError = async (output, context) => {
@@ -679,10 +673,9 @@ const de_DescribeAlarmsCommandError = async (output, context) => {
679
673
  throw await de_InvalidNextTokenRes(parsedOutput, context);
680
674
  default:
681
675
  const parsedBody = parsedOutput.body;
682
- (0, smithy_client_1.throwDefaultError)({
676
+ return throwDefaultError({
683
677
  output,
684
678
  parsedBody: parsedBody.Error,
685
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
686
679
  errorCode,
687
680
  });
688
681
  }
@@ -698,7 +691,7 @@ const de_DescribeAlarmsForMetricCommand = async (output, context) => {
698
691
  $metadata: deserializeMetadata(output),
699
692
  ...contents,
700
693
  };
701
- return Promise.resolve(response);
694
+ return response;
702
695
  };
703
696
  exports.de_DescribeAlarmsForMetricCommand = de_DescribeAlarmsForMetricCommand;
704
697
  const de_DescribeAlarmsForMetricCommandError = async (output, context) => {
@@ -708,10 +701,9 @@ const de_DescribeAlarmsForMetricCommandError = async (output, context) => {
708
701
  };
709
702
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
710
703
  const parsedBody = parsedOutput.body;
711
- (0, smithy_client_1.throwDefaultError)({
704
+ return throwDefaultError({
712
705
  output,
713
706
  parsedBody: parsedBody.Error,
714
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
715
707
  errorCode,
716
708
  });
717
709
  };
@@ -726,7 +718,7 @@ const de_DescribeAnomalyDetectorsCommand = async (output, context) => {
726
718
  $metadata: deserializeMetadata(output),
727
719
  ...contents,
728
720
  };
729
- return Promise.resolve(response);
721
+ return response;
730
722
  };
731
723
  exports.de_DescribeAnomalyDetectorsCommand = de_DescribeAnomalyDetectorsCommand;
732
724
  const de_DescribeAnomalyDetectorsCommandError = async (output, context) => {
@@ -750,10 +742,9 @@ const de_DescribeAnomalyDetectorsCommandError = async (output, context) => {
750
742
  throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
751
743
  default:
752
744
  const parsedBody = parsedOutput.body;
753
- (0, smithy_client_1.throwDefaultError)({
745
+ return throwDefaultError({
754
746
  output,
755
747
  parsedBody: parsedBody.Error,
756
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
757
748
  errorCode,
758
749
  });
759
750
  }
@@ -769,7 +760,7 @@ const de_DescribeInsightRulesCommand = async (output, context) => {
769
760
  $metadata: deserializeMetadata(output),
770
761
  ...contents,
771
762
  };
772
- return Promise.resolve(response);
763
+ return response;
773
764
  };
774
765
  exports.de_DescribeInsightRulesCommand = de_DescribeInsightRulesCommand;
775
766
  const de_DescribeInsightRulesCommandError = async (output, context) => {
@@ -784,10 +775,9 @@ const de_DescribeInsightRulesCommandError = async (output, context) => {
784
775
  throw await de_InvalidNextTokenRes(parsedOutput, context);
785
776
  default:
786
777
  const parsedBody = parsedOutput.body;
787
- (0, smithy_client_1.throwDefaultError)({
778
+ return throwDefaultError({
788
779
  output,
789
780
  parsedBody: parsedBody.Error,
790
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
791
781
  errorCode,
792
782
  });
793
783
  }
@@ -800,7 +790,7 @@ const de_DisableAlarmActionsCommand = async (output, context) => {
800
790
  const response = {
801
791
  $metadata: deserializeMetadata(output),
802
792
  };
803
- return Promise.resolve(response);
793
+ return response;
804
794
  };
805
795
  exports.de_DisableAlarmActionsCommand = de_DisableAlarmActionsCommand;
806
796
  const de_DisableAlarmActionsCommandError = async (output, context) => {
@@ -810,10 +800,9 @@ const de_DisableAlarmActionsCommandError = async (output, context) => {
810
800
  };
811
801
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
812
802
  const parsedBody = parsedOutput.body;
813
- (0, smithy_client_1.throwDefaultError)({
803
+ return throwDefaultError({
814
804
  output,
815
805
  parsedBody: parsedBody.Error,
816
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
817
806
  errorCode,
818
807
  });
819
808
  };
@@ -828,7 +817,7 @@ const de_DisableInsightRulesCommand = async (output, context) => {
828
817
  $metadata: deserializeMetadata(output),
829
818
  ...contents,
830
819
  };
831
- return Promise.resolve(response);
820
+ return response;
832
821
  };
833
822
  exports.de_DisableInsightRulesCommand = de_DisableInsightRulesCommand;
834
823
  const de_DisableInsightRulesCommandError = async (output, context) => {
@@ -846,10 +835,9 @@ const de_DisableInsightRulesCommandError = async (output, context) => {
846
835
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
847
836
  default:
848
837
  const parsedBody = parsedOutput.body;
849
- (0, smithy_client_1.throwDefaultError)({
838
+ return throwDefaultError({
850
839
  output,
851
840
  parsedBody: parsedBody.Error,
852
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
853
841
  errorCode,
854
842
  });
855
843
  }
@@ -862,7 +850,7 @@ const de_EnableAlarmActionsCommand = async (output, context) => {
862
850
  const response = {
863
851
  $metadata: deserializeMetadata(output),
864
852
  };
865
- return Promise.resolve(response);
853
+ return response;
866
854
  };
867
855
  exports.de_EnableAlarmActionsCommand = de_EnableAlarmActionsCommand;
868
856
  const de_EnableAlarmActionsCommandError = async (output, context) => {
@@ -872,10 +860,9 @@ const de_EnableAlarmActionsCommandError = async (output, context) => {
872
860
  };
873
861
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
874
862
  const parsedBody = parsedOutput.body;
875
- (0, smithy_client_1.throwDefaultError)({
863
+ return throwDefaultError({
876
864
  output,
877
865
  parsedBody: parsedBody.Error,
878
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
879
866
  errorCode,
880
867
  });
881
868
  };
@@ -890,7 +877,7 @@ const de_EnableInsightRulesCommand = async (output, context) => {
890
877
  $metadata: deserializeMetadata(output),
891
878
  ...contents,
892
879
  };
893
- return Promise.resolve(response);
880
+ return response;
894
881
  };
895
882
  exports.de_EnableInsightRulesCommand = de_EnableInsightRulesCommand;
896
883
  const de_EnableInsightRulesCommandError = async (output, context) => {
@@ -911,10 +898,9 @@ const de_EnableInsightRulesCommandError = async (output, context) => {
911
898
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
912
899
  default:
913
900
  const parsedBody = parsedOutput.body;
914
- (0, smithy_client_1.throwDefaultError)({
901
+ return throwDefaultError({
915
902
  output,
916
903
  parsedBody: parsedBody.Error,
917
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
918
904
  errorCode,
919
905
  });
920
906
  }
@@ -930,7 +916,7 @@ const de_GetDashboardCommand = async (output, context) => {
930
916
  $metadata: deserializeMetadata(output),
931
917
  ...contents,
932
918
  };
933
- return Promise.resolve(response);
919
+ return response;
934
920
  };
935
921
  exports.de_GetDashboardCommand = de_GetDashboardCommand;
936
922
  const de_GetDashboardCommandError = async (output, context) => {
@@ -951,10 +937,9 @@ const de_GetDashboardCommandError = async (output, context) => {
951
937
  throw await de_DashboardNotFoundErrorRes(parsedOutput, context);
952
938
  default:
953
939
  const parsedBody = parsedOutput.body;
954
- (0, smithy_client_1.throwDefaultError)({
940
+ return throwDefaultError({
955
941
  output,
956
942
  parsedBody: parsedBody.Error,
957
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
958
943
  errorCode,
959
944
  });
960
945
  }
@@ -970,7 +955,7 @@ const de_GetInsightRuleReportCommand = async (output, context) => {
970
955
  $metadata: deserializeMetadata(output),
971
956
  ...contents,
972
957
  };
973
- return Promise.resolve(response);
958
+ return response;
974
959
  };
975
960
  exports.de_GetInsightRuleReportCommand = de_GetInsightRuleReportCommand;
976
961
  const de_GetInsightRuleReportCommandError = async (output, context) => {
@@ -991,10 +976,9 @@ const de_GetInsightRuleReportCommandError = async (output, context) => {
991
976
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
992
977
  default:
993
978
  const parsedBody = parsedOutput.body;
994
- (0, smithy_client_1.throwDefaultError)({
979
+ return throwDefaultError({
995
980
  output,
996
981
  parsedBody: parsedBody.Error,
997
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
998
982
  errorCode,
999
983
  });
1000
984
  }
@@ -1010,7 +994,7 @@ const de_GetMetricDataCommand = async (output, context) => {
1010
994
  $metadata: deserializeMetadata(output),
1011
995
  ...contents,
1012
996
  };
1013
- return Promise.resolve(response);
997
+ return response;
1014
998
  };
1015
999
  exports.de_GetMetricDataCommand = de_GetMetricDataCommand;
1016
1000
  const de_GetMetricDataCommandError = async (output, context) => {
@@ -1025,10 +1009,9 @@ const de_GetMetricDataCommandError = async (output, context) => {
1025
1009
  throw await de_InvalidNextTokenRes(parsedOutput, context);
1026
1010
  default:
1027
1011
  const parsedBody = parsedOutput.body;
1028
- (0, smithy_client_1.throwDefaultError)({
1012
+ return throwDefaultError({
1029
1013
  output,
1030
1014
  parsedBody: parsedBody.Error,
1031
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1032
1015
  errorCode,
1033
1016
  });
1034
1017
  }
@@ -1044,7 +1027,7 @@ const de_GetMetricStatisticsCommand = async (output, context) => {
1044
1027
  $metadata: deserializeMetadata(output),
1045
1028
  ...contents,
1046
1029
  };
1047
- return Promise.resolve(response);
1030
+ return response;
1048
1031
  };
1049
1032
  exports.de_GetMetricStatisticsCommand = de_GetMetricStatisticsCommand;
1050
1033
  const de_GetMetricStatisticsCommandError = async (output, context) => {
@@ -1068,10 +1051,9 @@ const de_GetMetricStatisticsCommandError = async (output, context) => {
1068
1051
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1069
1052
  default:
1070
1053
  const parsedBody = parsedOutput.body;
1071
- (0, smithy_client_1.throwDefaultError)({
1054
+ return throwDefaultError({
1072
1055
  output,
1073
1056
  parsedBody: parsedBody.Error,
1074
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1075
1057
  errorCode,
1076
1058
  });
1077
1059
  }
@@ -1087,7 +1069,7 @@ const de_GetMetricStreamCommand = async (output, context) => {
1087
1069
  $metadata: deserializeMetadata(output),
1088
1070
  ...contents,
1089
1071
  };
1090
- return Promise.resolve(response);
1072
+ return response;
1091
1073
  };
1092
1074
  exports.de_GetMetricStreamCommand = de_GetMetricStreamCommand;
1093
1075
  const de_GetMetricStreamCommandError = async (output, context) => {
@@ -1114,10 +1096,9 @@ const de_GetMetricStreamCommandError = async (output, context) => {
1114
1096
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1115
1097
  default:
1116
1098
  const parsedBody = parsedOutput.body;
1117
- (0, smithy_client_1.throwDefaultError)({
1099
+ return throwDefaultError({
1118
1100
  output,
1119
1101
  parsedBody: parsedBody.Error,
1120
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1121
1102
  errorCode,
1122
1103
  });
1123
1104
  }
@@ -1133,7 +1114,7 @@ const de_GetMetricWidgetImageCommand = async (output, context) => {
1133
1114
  $metadata: deserializeMetadata(output),
1134
1115
  ...contents,
1135
1116
  };
1136
- return Promise.resolve(response);
1117
+ return response;
1137
1118
  };
1138
1119
  exports.de_GetMetricWidgetImageCommand = de_GetMetricWidgetImageCommand;
1139
1120
  const de_GetMetricWidgetImageCommandError = async (output, context) => {
@@ -1143,10 +1124,9 @@ const de_GetMetricWidgetImageCommandError = async (output, context) => {
1143
1124
  };
1144
1125
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
1145
1126
  const parsedBody = parsedOutput.body;
1146
- (0, smithy_client_1.throwDefaultError)({
1127
+ return throwDefaultError({
1147
1128
  output,
1148
1129
  parsedBody: parsedBody.Error,
1149
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1150
1130
  errorCode,
1151
1131
  });
1152
1132
  };
@@ -1161,7 +1141,7 @@ const de_ListDashboardsCommand = async (output, context) => {
1161
1141
  $metadata: deserializeMetadata(output),
1162
1142
  ...contents,
1163
1143
  };
1164
- return Promise.resolve(response);
1144
+ return response;
1165
1145
  };
1166
1146
  exports.de_ListDashboardsCommand = de_ListDashboardsCommand;
1167
1147
  const de_ListDashboardsCommandError = async (output, context) => {
@@ -1179,10 +1159,9 @@ const de_ListDashboardsCommandError = async (output, context) => {
1179
1159
  throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1180
1160
  default:
1181
1161
  const parsedBody = parsedOutput.body;
1182
- (0, smithy_client_1.throwDefaultError)({
1162
+ return throwDefaultError({
1183
1163
  output,
1184
1164
  parsedBody: parsedBody.Error,
1185
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1186
1165
  errorCode,
1187
1166
  });
1188
1167
  }
@@ -1198,7 +1177,7 @@ const de_ListManagedInsightRulesCommand = async (output, context) => {
1198
1177
  $metadata: deserializeMetadata(output),
1199
1178
  ...contents,
1200
1179
  };
1201
- return Promise.resolve(response);
1180
+ return response;
1202
1181
  };
1203
1182
  exports.de_ListManagedInsightRulesCommand = de_ListManagedInsightRulesCommand;
1204
1183
  const de_ListManagedInsightRulesCommandError = async (output, context) => {
@@ -1219,10 +1198,9 @@ const de_ListManagedInsightRulesCommandError = async (output, context) => {
1219
1198
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1220
1199
  default:
1221
1200
  const parsedBody = parsedOutput.body;
1222
- (0, smithy_client_1.throwDefaultError)({
1201
+ return throwDefaultError({
1223
1202
  output,
1224
1203
  parsedBody: parsedBody.Error,
1225
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1226
1204
  errorCode,
1227
1205
  });
1228
1206
  }
@@ -1238,7 +1216,7 @@ const de_ListMetricsCommand = async (output, context) => {
1238
1216
  $metadata: deserializeMetadata(output),
1239
1217
  ...contents,
1240
1218
  };
1241
- return Promise.resolve(response);
1219
+ return response;
1242
1220
  };
1243
1221
  exports.de_ListMetricsCommand = de_ListMetricsCommand;
1244
1222
  const de_ListMetricsCommandError = async (output, context) => {
@@ -1256,10 +1234,9 @@ const de_ListMetricsCommandError = async (output, context) => {
1256
1234
  throw await de_InvalidParameterValueExceptionRes(parsedOutput, context);
1257
1235
  default:
1258
1236
  const parsedBody = parsedOutput.body;
1259
- (0, smithy_client_1.throwDefaultError)({
1237
+ return throwDefaultError({
1260
1238
  output,
1261
1239
  parsedBody: parsedBody.Error,
1262
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1263
1240
  errorCode,
1264
1241
  });
1265
1242
  }
@@ -1275,7 +1252,7 @@ const de_ListMetricStreamsCommand = async (output, context) => {
1275
1252
  $metadata: deserializeMetadata(output),
1276
1253
  ...contents,
1277
1254
  };
1278
- return Promise.resolve(response);
1255
+ return response;
1279
1256
  };
1280
1257
  exports.de_ListMetricStreamsCommand = de_ListMetricStreamsCommand;
1281
1258
  const de_ListMetricStreamsCommandError = async (output, context) => {
@@ -1299,10 +1276,9 @@ const de_ListMetricStreamsCommandError = async (output, context) => {
1299
1276
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1300
1277
  default:
1301
1278
  const parsedBody = parsedOutput.body;
1302
- (0, smithy_client_1.throwDefaultError)({
1279
+ return throwDefaultError({
1303
1280
  output,
1304
1281
  parsedBody: parsedBody.Error,
1305
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1306
1282
  errorCode,
1307
1283
  });
1308
1284
  }
@@ -1318,7 +1294,7 @@ const de_ListTagsForResourceCommand = async (output, context) => {
1318
1294
  $metadata: deserializeMetadata(output),
1319
1295
  ...contents,
1320
1296
  };
1321
- return Promise.resolve(response);
1297
+ return response;
1322
1298
  };
1323
1299
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
1324
1300
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -1339,10 +1315,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
1339
1315
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1340
1316
  default:
1341
1317
  const parsedBody = parsedOutput.body;
1342
- (0, smithy_client_1.throwDefaultError)({
1318
+ return throwDefaultError({
1343
1319
  output,
1344
1320
  parsedBody: parsedBody.Error,
1345
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1346
1321
  errorCode,
1347
1322
  });
1348
1323
  }
@@ -1358,7 +1333,7 @@ const de_PutAnomalyDetectorCommand = async (output, context) => {
1358
1333
  $metadata: deserializeMetadata(output),
1359
1334
  ...contents,
1360
1335
  };
1361
- return Promise.resolve(response);
1336
+ return response;
1362
1337
  };
1363
1338
  exports.de_PutAnomalyDetectorCommand = de_PutAnomalyDetectorCommand;
1364
1339
  const de_PutAnomalyDetectorCommandError = async (output, context) => {
@@ -1385,10 +1360,9 @@ const de_PutAnomalyDetectorCommandError = async (output, context) => {
1385
1360
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1386
1361
  default:
1387
1362
  const parsedBody = parsedOutput.body;
1388
- (0, smithy_client_1.throwDefaultError)({
1363
+ return throwDefaultError({
1389
1364
  output,
1390
1365
  parsedBody: parsedBody.Error,
1391
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1392
1366
  errorCode,
1393
1367
  });
1394
1368
  }
@@ -1401,7 +1375,7 @@ const de_PutCompositeAlarmCommand = async (output, context) => {
1401
1375
  const response = {
1402
1376
  $metadata: deserializeMetadata(output),
1403
1377
  };
1404
- return Promise.resolve(response);
1378
+ return response;
1405
1379
  };
1406
1380
  exports.de_PutCompositeAlarmCommand = de_PutCompositeAlarmCommand;
1407
1381
  const de_PutCompositeAlarmCommandError = async (output, context) => {
@@ -1416,10 +1390,9 @@ const de_PutCompositeAlarmCommandError = async (output, context) => {
1416
1390
  throw await de_LimitExceededFaultRes(parsedOutput, context);
1417
1391
  default:
1418
1392
  const parsedBody = parsedOutput.body;
1419
- (0, smithy_client_1.throwDefaultError)({
1393
+ return throwDefaultError({
1420
1394
  output,
1421
1395
  parsedBody: parsedBody.Error,
1422
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1423
1396
  errorCode,
1424
1397
  });
1425
1398
  }
@@ -1435,7 +1408,7 @@ const de_PutDashboardCommand = async (output, context) => {
1435
1408
  $metadata: deserializeMetadata(output),
1436
1409
  ...contents,
1437
1410
  };
1438
- return Promise.resolve(response);
1411
+ return response;
1439
1412
  };
1440
1413
  exports.de_PutDashboardCommand = de_PutDashboardCommand;
1441
1414
  const de_PutDashboardCommandError = async (output, context) => {
@@ -1453,10 +1426,9 @@ const de_PutDashboardCommandError = async (output, context) => {
1453
1426
  throw await de_DashboardInvalidInputErrorRes(parsedOutput, context);
1454
1427
  default:
1455
1428
  const parsedBody = parsedOutput.body;
1456
- (0, smithy_client_1.throwDefaultError)({
1429
+ return throwDefaultError({
1457
1430
  output,
1458
1431
  parsedBody: parsedBody.Error,
1459
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1460
1432
  errorCode,
1461
1433
  });
1462
1434
  }
@@ -1472,7 +1444,7 @@ const de_PutInsightRuleCommand = async (output, context) => {
1472
1444
  $metadata: deserializeMetadata(output),
1473
1445
  ...contents,
1474
1446
  };
1475
- return Promise.resolve(response);
1447
+ return response;
1476
1448
  };
1477
1449
  exports.de_PutInsightRuleCommand = de_PutInsightRuleCommand;
1478
1450
  const de_PutInsightRuleCommandError = async (output, context) => {
@@ -1493,10 +1465,9 @@ const de_PutInsightRuleCommandError = async (output, context) => {
1493
1465
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1494
1466
  default:
1495
1467
  const parsedBody = parsedOutput.body;
1496
- (0, smithy_client_1.throwDefaultError)({
1468
+ return throwDefaultError({
1497
1469
  output,
1498
1470
  parsedBody: parsedBody.Error,
1499
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1500
1471
  errorCode,
1501
1472
  });
1502
1473
  }
@@ -1512,7 +1483,7 @@ const de_PutManagedInsightRulesCommand = async (output, context) => {
1512
1483
  $metadata: deserializeMetadata(output),
1513
1484
  ...contents,
1514
1485
  };
1515
- return Promise.resolve(response);
1486
+ return response;
1516
1487
  };
1517
1488
  exports.de_PutManagedInsightRulesCommand = de_PutManagedInsightRulesCommand;
1518
1489
  const de_PutManagedInsightRulesCommandError = async (output, context) => {
@@ -1530,10 +1501,9 @@ const de_PutManagedInsightRulesCommandError = async (output, context) => {
1530
1501
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1531
1502
  default:
1532
1503
  const parsedBody = parsedOutput.body;
1533
- (0, smithy_client_1.throwDefaultError)({
1504
+ return throwDefaultError({
1534
1505
  output,
1535
1506
  parsedBody: parsedBody.Error,
1536
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1537
1507
  errorCode,
1538
1508
  });
1539
1509
  }
@@ -1546,7 +1516,7 @@ const de_PutMetricAlarmCommand = async (output, context) => {
1546
1516
  const response = {
1547
1517
  $metadata: deserializeMetadata(output),
1548
1518
  };
1549
- return Promise.resolve(response);
1519
+ return response;
1550
1520
  };
1551
1521
  exports.de_PutMetricAlarmCommand = de_PutMetricAlarmCommand;
1552
1522
  const de_PutMetricAlarmCommandError = async (output, context) => {
@@ -1561,10 +1531,9 @@ const de_PutMetricAlarmCommandError = async (output, context) => {
1561
1531
  throw await de_LimitExceededFaultRes(parsedOutput, context);
1562
1532
  default:
1563
1533
  const parsedBody = parsedOutput.body;
1564
- (0, smithy_client_1.throwDefaultError)({
1534
+ return throwDefaultError({
1565
1535
  output,
1566
1536
  parsedBody: parsedBody.Error,
1567
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1568
1537
  errorCode,
1569
1538
  });
1570
1539
  }
@@ -1577,7 +1546,7 @@ const de_PutMetricDataCommand = async (output, context) => {
1577
1546
  const response = {
1578
1547
  $metadata: deserializeMetadata(output),
1579
1548
  };
1580
- return Promise.resolve(response);
1549
+ return response;
1581
1550
  };
1582
1551
  exports.de_PutMetricDataCommand = de_PutMetricDataCommand;
1583
1552
  const de_PutMetricDataCommandError = async (output, context) => {
@@ -1601,10 +1570,9 @@ const de_PutMetricDataCommandError = async (output, context) => {
1601
1570
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1602
1571
  default:
1603
1572
  const parsedBody = parsedOutput.body;
1604
- (0, smithy_client_1.throwDefaultError)({
1573
+ return throwDefaultError({
1605
1574
  output,
1606
1575
  parsedBody: parsedBody.Error,
1607
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1608
1576
  errorCode,
1609
1577
  });
1610
1578
  }
@@ -1620,7 +1588,7 @@ const de_PutMetricStreamCommand = async (output, context) => {
1620
1588
  $metadata: deserializeMetadata(output),
1621
1589
  ...contents,
1622
1590
  };
1623
- return Promise.resolve(response);
1591
+ return response;
1624
1592
  };
1625
1593
  exports.de_PutMetricStreamCommand = de_PutMetricStreamCommand;
1626
1594
  const de_PutMetricStreamCommandError = async (output, context) => {
@@ -1647,10 +1615,9 @@ const de_PutMetricStreamCommandError = async (output, context) => {
1647
1615
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1648
1616
  default:
1649
1617
  const parsedBody = parsedOutput.body;
1650
- (0, smithy_client_1.throwDefaultError)({
1618
+ return throwDefaultError({
1651
1619
  output,
1652
1620
  parsedBody: parsedBody.Error,
1653
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1654
1621
  errorCode,
1655
1622
  });
1656
1623
  }
@@ -1663,7 +1630,7 @@ const de_SetAlarmStateCommand = async (output, context) => {
1663
1630
  const response = {
1664
1631
  $metadata: deserializeMetadata(output),
1665
1632
  };
1666
- return Promise.resolve(response);
1633
+ return response;
1667
1634
  };
1668
1635
  exports.de_SetAlarmStateCommand = de_SetAlarmStateCommand;
1669
1636
  const de_SetAlarmStateCommandError = async (output, context) => {
@@ -1681,10 +1648,9 @@ const de_SetAlarmStateCommandError = async (output, context) => {
1681
1648
  throw await de_ResourceNotFoundRes(parsedOutput, context);
1682
1649
  default:
1683
1650
  const parsedBody = parsedOutput.body;
1684
- (0, smithy_client_1.throwDefaultError)({
1651
+ return throwDefaultError({
1685
1652
  output,
1686
1653
  parsedBody: parsedBody.Error,
1687
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1688
1654
  errorCode,
1689
1655
  });
1690
1656
  }
@@ -1700,7 +1666,7 @@ const de_StartMetricStreamsCommand = async (output, context) => {
1700
1666
  $metadata: deserializeMetadata(output),
1701
1667
  ...contents,
1702
1668
  };
1703
- return Promise.resolve(response);
1669
+ return response;
1704
1670
  };
1705
1671
  exports.de_StartMetricStreamsCommand = de_StartMetricStreamsCommand;
1706
1672
  const de_StartMetricStreamsCommandError = async (output, context) => {
@@ -1721,10 +1687,9 @@ const de_StartMetricStreamsCommandError = async (output, context) => {
1721
1687
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1722
1688
  default:
1723
1689
  const parsedBody = parsedOutput.body;
1724
- (0, smithy_client_1.throwDefaultError)({
1690
+ return throwDefaultError({
1725
1691
  output,
1726
1692
  parsedBody: parsedBody.Error,
1727
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1728
1693
  errorCode,
1729
1694
  });
1730
1695
  }
@@ -1740,7 +1705,7 @@ const de_StopMetricStreamsCommand = async (output, context) => {
1740
1705
  $metadata: deserializeMetadata(output),
1741
1706
  ...contents,
1742
1707
  };
1743
- return Promise.resolve(response);
1708
+ return response;
1744
1709
  };
1745
1710
  exports.de_StopMetricStreamsCommand = de_StopMetricStreamsCommand;
1746
1711
  const de_StopMetricStreamsCommandError = async (output, context) => {
@@ -1761,10 +1726,9 @@ const de_StopMetricStreamsCommandError = async (output, context) => {
1761
1726
  throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context);
1762
1727
  default:
1763
1728
  const parsedBody = parsedOutput.body;
1764
- (0, smithy_client_1.throwDefaultError)({
1729
+ return throwDefaultError({
1765
1730
  output,
1766
1731
  parsedBody: parsedBody.Error,
1767
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1768
1732
  errorCode,
1769
1733
  });
1770
1734
  }
@@ -1780,7 +1744,7 @@ const de_TagResourceCommand = async (output, context) => {
1780
1744
  $metadata: deserializeMetadata(output),
1781
1745
  ...contents,
1782
1746
  };
1783
- return Promise.resolve(response);
1747
+ return response;
1784
1748
  };
1785
1749
  exports.de_TagResourceCommand = de_TagResourceCommand;
1786
1750
  const de_TagResourceCommandError = async (output, context) => {
@@ -1804,10 +1768,9 @@ const de_TagResourceCommandError = async (output, context) => {
1804
1768
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1805
1769
  default:
1806
1770
  const parsedBody = parsedOutput.body;
1807
- (0, smithy_client_1.throwDefaultError)({
1771
+ return throwDefaultError({
1808
1772
  output,
1809
1773
  parsedBody: parsedBody.Error,
1810
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1811
1774
  errorCode,
1812
1775
  });
1813
1776
  }
@@ -1823,7 +1786,7 @@ const de_UntagResourceCommand = async (output, context) => {
1823
1786
  $metadata: deserializeMetadata(output),
1824
1787
  ...contents,
1825
1788
  };
1826
- return Promise.resolve(response);
1789
+ return response;
1827
1790
  };
1828
1791
  exports.de_UntagResourceCommand = de_UntagResourceCommand;
1829
1792
  const de_UntagResourceCommandError = async (output, context) => {
@@ -1847,10 +1810,9 @@ const de_UntagResourceCommandError = async (output, context) => {
1847
1810
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1848
1811
  default:
1849
1812
  const parsedBody = parsedOutput.body;
1850
- (0, smithy_client_1.throwDefaultError)({
1813
+ return throwDefaultError({
1851
1814
  output,
1852
1815
  parsedBody: parsedBody.Error,
1853
- exceptionCtor: CloudWatchServiceException_1.CloudWatchServiceException,
1854
1816
  errorCode,
1855
1817
  });
1856
1818
  }
@@ -4868,6 +4830,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
4868
4830
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
4869
4831
  };
4870
4832
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
4833
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(CloudWatchServiceException_1.CloudWatchServiceException);
4871
4834
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
4872
4835
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
4873
4836
  const contents = {