@aws-sdk/client-migrationhubstrategy 3.50.0 → 3.53.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist-cjs/index.js +3 -0
  3. package/dist-cjs/models/MigrationHubStrategyServiceException.js +11 -0
  4. package/dist-cjs/models/models_0.js +108 -3
  5. package/dist-cjs/protocols/Aws_restJson1.js +255 -781
  6. package/dist-es/index.js +1 -0
  7. package/dist-es/models/MigrationHubStrategyServiceException.js +12 -0
  8. package/dist-es/models/models_0.js +98 -1
  9. package/dist-es/protocols/Aws_restJson1.js +485 -871
  10. package/dist-types/index.d.ts +1 -0
  11. package/dist-types/models/MigrationHubStrategyServiceException.d.ts +10 -0
  12. package/dist-types/models/models_0.d.ts +58 -33
  13. package/dist-types/ts3.4/MigrationHubStrategy.d.ts +105 -0
  14. package/dist-types/ts3.4/MigrationHubStrategyClient.d.ts +93 -0
  15. package/dist-types/ts3.4/commands/GetApplicationComponentDetailsCommand.d.ts +17 -0
  16. package/dist-types/ts3.4/commands/GetApplicationComponentStrategiesCommand.d.ts +17 -0
  17. package/dist-types/ts3.4/commands/GetAssessmentCommand.d.ts +17 -0
  18. package/dist-types/ts3.4/commands/GetImportFileTaskCommand.d.ts +17 -0
  19. package/dist-types/ts3.4/commands/GetPortfolioPreferencesCommand.d.ts +17 -0
  20. package/dist-types/ts3.4/commands/GetPortfolioSummaryCommand.d.ts +17 -0
  21. package/dist-types/ts3.4/commands/GetRecommendationReportDetailsCommand.d.ts +17 -0
  22. package/dist-types/ts3.4/commands/GetServerDetailsCommand.d.ts +17 -0
  23. package/dist-types/ts3.4/commands/GetServerStrategiesCommand.d.ts +17 -0
  24. package/dist-types/ts3.4/commands/ListApplicationComponentsCommand.d.ts +17 -0
  25. package/dist-types/ts3.4/commands/ListCollectorsCommand.d.ts +17 -0
  26. package/dist-types/ts3.4/commands/ListImportFileTaskCommand.d.ts +17 -0
  27. package/dist-types/ts3.4/commands/ListServersCommand.d.ts +17 -0
  28. package/dist-types/ts3.4/commands/PutPortfolioPreferencesCommand.d.ts +17 -0
  29. package/dist-types/ts3.4/commands/StartAssessmentCommand.d.ts +17 -0
  30. package/dist-types/ts3.4/commands/StartImportFileTaskCommand.d.ts +17 -0
  31. package/dist-types/ts3.4/commands/StartRecommendationReportGenerationCommand.d.ts +17 -0
  32. package/dist-types/ts3.4/commands/StopAssessmentCommand.d.ts +17 -0
  33. package/dist-types/ts3.4/commands/UpdateApplicationComponentConfigCommand.d.ts +17 -0
  34. package/dist-types/ts3.4/commands/UpdateServerConfigCommand.d.ts +17 -0
  35. package/dist-types/ts3.4/commands/index.d.ts +20 -0
  36. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  37. package/dist-types/ts3.4/index.d.ts +6 -0
  38. package/dist-types/ts3.4/models/MigrationHubStrategyServiceException.d.ts +6 -0
  39. package/dist-types/ts3.4/models/index.d.ts +1 -0
  40. package/dist-types/ts3.4/models/models_0.d.ts +1271 -0
  41. package/dist-types/ts3.4/pagination/GetServerDetailsPaginator.d.ts +4 -0
  42. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  43. package/dist-types/ts3.4/pagination/ListApplicationComponentsPaginator.d.ts +4 -0
  44. package/dist-types/ts3.4/pagination/ListCollectorsPaginator.d.ts +4 -0
  45. package/dist-types/ts3.4/pagination/ListImportFileTaskPaginator.d.ts +4 -0
  46. package/dist-types/ts3.4/pagination/ListServersPaginator.d.ts +4 -0
  47. package/dist-types/ts3.4/pagination/index.d.ts +6 -0
  48. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +62 -0
  49. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  50. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  51. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  52. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  53. package/package.json +33 -33
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_restJson1UpdateServerConfigCommand = exports.deserializeAws_restJson1UpdateApplicationComponentConfigCommand = exports.deserializeAws_restJson1StopAssessmentCommand = exports.deserializeAws_restJson1StartRecommendationReportGenerationCommand = exports.deserializeAws_restJson1StartImportFileTaskCommand = exports.deserializeAws_restJson1StartAssessmentCommand = exports.deserializeAws_restJson1PutPortfolioPreferencesCommand = exports.deserializeAws_restJson1ListServersCommand = exports.deserializeAws_restJson1ListImportFileTaskCommand = exports.deserializeAws_restJson1ListCollectorsCommand = exports.deserializeAws_restJson1ListApplicationComponentsCommand = exports.deserializeAws_restJson1GetServerStrategiesCommand = exports.deserializeAws_restJson1GetServerDetailsCommand = exports.deserializeAws_restJson1GetRecommendationReportDetailsCommand = exports.deserializeAws_restJson1GetPortfolioSummaryCommand = exports.deserializeAws_restJson1GetPortfolioPreferencesCommand = exports.deserializeAws_restJson1GetImportFileTaskCommand = exports.deserializeAws_restJson1GetAssessmentCommand = exports.deserializeAws_restJson1GetApplicationComponentStrategiesCommand = exports.deserializeAws_restJson1GetApplicationComponentDetailsCommand = exports.serializeAws_restJson1UpdateServerConfigCommand = exports.serializeAws_restJson1UpdateApplicationComponentConfigCommand = exports.serializeAws_restJson1StopAssessmentCommand = exports.serializeAws_restJson1StartRecommendationReportGenerationCommand = exports.serializeAws_restJson1StartImportFileTaskCommand = exports.serializeAws_restJson1StartAssessmentCommand = exports.serializeAws_restJson1PutPortfolioPreferencesCommand = exports.serializeAws_restJson1ListServersCommand = exports.serializeAws_restJson1ListImportFileTaskCommand = exports.serializeAws_restJson1ListCollectorsCommand = exports.serializeAws_restJson1ListApplicationComponentsCommand = exports.serializeAws_restJson1GetServerStrategiesCommand = exports.serializeAws_restJson1GetServerDetailsCommand = exports.serializeAws_restJson1GetRecommendationReportDetailsCommand = exports.serializeAws_restJson1GetPortfolioSummaryCommand = exports.serializeAws_restJson1GetPortfolioPreferencesCommand = exports.serializeAws_restJson1GetImportFileTaskCommand = exports.serializeAws_restJson1GetAssessmentCommand = exports.serializeAws_restJson1GetApplicationComponentStrategiesCommand = exports.serializeAws_restJson1GetApplicationComponentDetailsCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const MigrationHubStrategyServiceException_1 = require("../models/MigrationHubStrategyServiceException");
6
7
  const models_0_1 = require("../models/models_0");
7
8
  const serializeAws_restJson1GetApplicationComponentDetailsCommand = async (input, context) => {
8
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -557,43 +558,22 @@ const deserializeAws_restJson1GetApplicationComponentDetailsCommandError = async
557
558
  switch (errorCode) {
558
559
  case "InternalServerException":
559
560
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
560
- response = {
561
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
562
- name: errorCode,
563
- $metadata: deserializeMetadata(output),
564
- };
565
- break;
561
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
566
562
  case "ResourceNotFoundException":
567
563
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
568
- response = {
569
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
570
- name: errorCode,
571
- $metadata: deserializeMetadata(output),
572
- };
573
- break;
564
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
574
565
  case "ThrottlingException":
575
566
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
576
- response = {
577
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
578
- name: errorCode,
579
- $metadata: deserializeMetadata(output),
580
- };
581
- break;
567
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
582
568
  default:
583
569
  const parsedBody = parsedOutput.body;
584
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
585
- response = {
586
- ...parsedBody,
587
- name: `${errorCode}`,
588
- message: parsedBody.message || parsedBody.Message || errorCode,
570
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
571
+ name: parsedBody.code || parsedBody.Code || errorCode,
589
572
  $fault: "client",
590
573
  $metadata: deserializeMetadata(output),
591
- };
574
+ });
575
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
592
576
  }
593
- const message = response.message || response.Message || errorCode;
594
- response.message = message;
595
- delete response.Message;
596
- return Promise.reject(Object.assign(new Error(message), response));
597
577
  };
598
578
  const deserializeAws_restJson1GetApplicationComponentStrategiesCommand = async (output, context) => {
599
579
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -621,43 +601,22 @@ const deserializeAws_restJson1GetApplicationComponentStrategiesCommandError = as
621
601
  switch (errorCode) {
622
602
  case "InternalServerException":
623
603
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
624
- response = {
625
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
626
- name: errorCode,
627
- $metadata: deserializeMetadata(output),
628
- };
629
- break;
604
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
630
605
  case "ResourceNotFoundException":
631
606
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
632
- response = {
633
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
634
- name: errorCode,
635
- $metadata: deserializeMetadata(output),
636
- };
637
- break;
607
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
638
608
  case "ThrottlingException":
639
609
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
640
- response = {
641
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
642
- name: errorCode,
643
- $metadata: deserializeMetadata(output),
644
- };
645
- break;
610
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
646
611
  default:
647
612
  const parsedBody = parsedOutput.body;
648
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
649
- response = {
650
- ...parsedBody,
651
- name: `${errorCode}`,
652
- message: parsedBody.message || parsedBody.Message || errorCode,
613
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
614
+ name: parsedBody.code || parsedBody.Code || errorCode,
653
615
  $fault: "client",
654
616
  $metadata: deserializeMetadata(output),
655
- };
617
+ });
618
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
656
619
  }
657
- const message = response.message || response.Message || errorCode;
658
- response.message = message;
659
- delete response.Message;
660
- return Promise.reject(Object.assign(new Error(message), response));
661
620
  };
662
621
  const deserializeAws_restJson1GetAssessmentCommand = async (output, context) => {
663
622
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -689,51 +648,25 @@ const deserializeAws_restJson1GetAssessmentCommandError = async (output, context
689
648
  switch (errorCode) {
690
649
  case "AccessDeniedException":
691
650
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
692
- response = {
693
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
694
- name: errorCode,
695
- $metadata: deserializeMetadata(output),
696
- };
697
- break;
651
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
698
652
  case "InternalServerException":
699
653
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
700
- response = {
701
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
702
- name: errorCode,
703
- $metadata: deserializeMetadata(output),
704
- };
705
- break;
654
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
706
655
  case "ResourceNotFoundException":
707
656
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
708
- response = {
709
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
710
- name: errorCode,
711
- $metadata: deserializeMetadata(output),
712
- };
713
- break;
657
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
714
658
  case "ThrottlingException":
715
659
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
716
- response = {
717
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
718
- name: errorCode,
719
- $metadata: deserializeMetadata(output),
720
- };
721
- break;
660
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
722
661
  default:
723
662
  const parsedBody = parsedOutput.body;
724
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
725
- response = {
726
- ...parsedBody,
727
- name: `${errorCode}`,
728
- message: parsedBody.message || parsedBody.Message || errorCode,
663
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
664
+ name: parsedBody.code || parsedBody.Code || errorCode,
729
665
  $fault: "client",
730
666
  $metadata: deserializeMetadata(output),
731
- };
667
+ });
668
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
732
669
  }
733
- const message = response.message || response.Message || errorCode;
734
- response.message = message;
735
- delete response.Message;
736
- return Promise.reject(Object.assign(new Error(message), response));
737
670
  };
738
671
  const deserializeAws_restJson1GetImportFileTaskCommand = async (output, context) => {
739
672
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -801,59 +734,28 @@ const deserializeAws_restJson1GetImportFileTaskCommandError = async (output, con
801
734
  switch (errorCode) {
802
735
  case "AccessDeniedException":
803
736
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
804
- response = {
805
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
806
- name: errorCode,
807
- $metadata: deserializeMetadata(output),
808
- };
809
- break;
737
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
810
738
  case "InternalServerException":
811
739
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
812
- response = {
813
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
814
- name: errorCode,
815
- $metadata: deserializeMetadata(output),
816
- };
817
- break;
740
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
818
741
  case "ResourceNotFoundException":
819
742
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
820
- response = {
821
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
822
- name: errorCode,
823
- $metadata: deserializeMetadata(output),
824
- };
825
- break;
743
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
826
744
  case "ThrottlingException":
827
745
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
828
- response = {
829
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
830
- name: errorCode,
831
- $metadata: deserializeMetadata(output),
832
- };
833
- break;
746
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
834
747
  case "ValidationException":
835
748
  case "com.amazonaws.migrationhubstrategy#ValidationException":
836
- response = {
837
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
838
- name: errorCode,
839
- $metadata: deserializeMetadata(output),
840
- };
841
- break;
749
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
842
750
  default:
843
751
  const parsedBody = parsedOutput.body;
844
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
845
- response = {
846
- ...parsedBody,
847
- name: `${errorCode}`,
848
- message: parsedBody.message || parsedBody.Message || errorCode,
752
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
753
+ name: parsedBody.code || parsedBody.Code || errorCode,
849
754
  $fault: "client",
850
755
  $metadata: deserializeMetadata(output),
851
- };
756
+ });
757
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
852
758
  }
853
- const message = response.message || response.Message || errorCode;
854
- response.message = message;
855
- delete response.Message;
856
- return Promise.reject(Object.assign(new Error(message), response));
857
759
  };
858
760
  const deserializeAws_restJson1GetPortfolioPreferencesCommand = async (output, context) => {
859
761
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -889,51 +791,25 @@ const deserializeAws_restJson1GetPortfolioPreferencesCommandError = async (outpu
889
791
  switch (errorCode) {
890
792
  case "AccessDeniedException":
891
793
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
892
- response = {
893
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
894
- name: errorCode,
895
- $metadata: deserializeMetadata(output),
896
- };
897
- break;
794
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
898
795
  case "InternalServerException":
899
796
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
900
- response = {
901
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
902
- name: errorCode,
903
- $metadata: deserializeMetadata(output),
904
- };
905
- break;
797
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
906
798
  case "ResourceNotFoundException":
907
799
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
908
- response = {
909
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
910
- name: errorCode,
911
- $metadata: deserializeMetadata(output),
912
- };
913
- break;
800
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
914
801
  case "ThrottlingException":
915
802
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
916
- response = {
917
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
918
- name: errorCode,
919
- $metadata: deserializeMetadata(output),
920
- };
921
- break;
803
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
922
804
  default:
923
805
  const parsedBody = parsedOutput.body;
924
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
925
- response = {
926
- ...parsedBody,
927
- name: `${errorCode}`,
928
- message: parsedBody.message || parsedBody.Message || errorCode,
806
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
807
+ name: parsedBody.code || parsedBody.Code || errorCode,
929
808
  $fault: "client",
930
809
  $metadata: deserializeMetadata(output),
931
- };
810
+ });
811
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
932
812
  }
933
- const message = response.message || response.Message || errorCode;
934
- response.message = message;
935
- delete response.Message;
936
- return Promise.reject(Object.assign(new Error(message), response));
937
813
  };
938
814
  const deserializeAws_restJson1GetPortfolioSummaryCommand = async (output, context) => {
939
815
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -961,43 +837,22 @@ const deserializeAws_restJson1GetPortfolioSummaryCommandError = async (output, c
961
837
  switch (errorCode) {
962
838
  case "AccessDeniedException":
963
839
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
964
- response = {
965
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
966
- name: errorCode,
967
- $metadata: deserializeMetadata(output),
968
- };
969
- break;
840
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
970
841
  case "InternalServerException":
971
842
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
972
- response = {
973
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
974
- name: errorCode,
975
- $metadata: deserializeMetadata(output),
976
- };
977
- break;
843
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
978
844
  case "ThrottlingException":
979
845
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
980
- response = {
981
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
982
- name: errorCode,
983
- $metadata: deserializeMetadata(output),
984
- };
985
- break;
846
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
986
847
  default:
987
848
  const parsedBody = parsedOutput.body;
988
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
989
- response = {
990
- ...parsedBody,
991
- name: `${errorCode}`,
992
- message: parsedBody.message || parsedBody.Message || errorCode,
849
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
850
+ name: parsedBody.code || parsedBody.Code || errorCode,
993
851
  $fault: "client",
994
852
  $metadata: deserializeMetadata(output),
995
- };
853
+ });
854
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
996
855
  }
997
- const message = response.message || response.Message || errorCode;
998
- response.message = message;
999
- delete response.Message;
1000
- return Promise.reject(Object.assign(new Error(message), response));
1001
856
  };
1002
857
  const deserializeAws_restJson1GetRecommendationReportDetailsCommand = async (output, context) => {
1003
858
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1029,59 +884,28 @@ const deserializeAws_restJson1GetRecommendationReportDetailsCommandError = async
1029
884
  switch (errorCode) {
1030
885
  case "AccessDeniedException":
1031
886
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1032
- response = {
1033
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1034
- name: errorCode,
1035
- $metadata: deserializeMetadata(output),
1036
- };
1037
- break;
887
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1038
888
  case "InternalServerException":
1039
889
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1040
- response = {
1041
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1042
- name: errorCode,
1043
- $metadata: deserializeMetadata(output),
1044
- };
1045
- break;
890
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1046
891
  case "ResourceNotFoundException":
1047
892
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
1048
- response = {
1049
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1050
- name: errorCode,
1051
- $metadata: deserializeMetadata(output),
1052
- };
1053
- break;
893
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1054
894
  case "ThrottlingException":
1055
895
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1056
- response = {
1057
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1058
- name: errorCode,
1059
- $metadata: deserializeMetadata(output),
1060
- };
1061
- break;
896
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1062
897
  case "ValidationException":
1063
898
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1064
- response = {
1065
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1066
- name: errorCode,
1067
- $metadata: deserializeMetadata(output),
1068
- };
1069
- break;
899
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1070
900
  default:
1071
901
  const parsedBody = parsedOutput.body;
1072
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1073
- response = {
1074
- ...parsedBody,
1075
- name: `${errorCode}`,
1076
- message: parsedBody.message || parsedBody.Message || errorCode,
902
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
903
+ name: parsedBody.code || parsedBody.Code || errorCode,
1077
904
  $fault: "client",
1078
905
  $metadata: deserializeMetadata(output),
1079
- };
906
+ });
907
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1080
908
  }
1081
- const message = response.message || response.Message || errorCode;
1082
- response.message = message;
1083
- delete response.Message;
1084
- return Promise.reject(Object.assign(new Error(message), response));
1085
909
  };
1086
910
  const deserializeAws_restJson1GetServerDetailsCommand = async (output, context) => {
1087
911
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1117,59 +941,28 @@ const deserializeAws_restJson1GetServerDetailsCommandError = async (output, cont
1117
941
  switch (errorCode) {
1118
942
  case "AccessDeniedException":
1119
943
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1120
- response = {
1121
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1122
- name: errorCode,
1123
- $metadata: deserializeMetadata(output),
1124
- };
1125
- break;
944
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1126
945
  case "InternalServerException":
1127
946
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1128
- response = {
1129
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1130
- name: errorCode,
1131
- $metadata: deserializeMetadata(output),
1132
- };
1133
- break;
947
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1134
948
  case "ResourceNotFoundException":
1135
949
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
1136
- response = {
1137
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1138
- name: errorCode,
1139
- $metadata: deserializeMetadata(output),
1140
- };
1141
- break;
950
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1142
951
  case "ThrottlingException":
1143
952
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1144
- response = {
1145
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1146
- name: errorCode,
1147
- $metadata: deserializeMetadata(output),
1148
- };
1149
- break;
953
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1150
954
  case "ValidationException":
1151
955
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1152
- response = {
1153
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1154
- name: errorCode,
1155
- $metadata: deserializeMetadata(output),
1156
- };
1157
- break;
956
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1158
957
  default:
1159
958
  const parsedBody = parsedOutput.body;
1160
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1161
- response = {
1162
- ...parsedBody,
1163
- name: `${errorCode}`,
1164
- message: parsedBody.message || parsedBody.Message || errorCode,
959
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
960
+ name: parsedBody.code || parsedBody.Code || errorCode,
1165
961
  $fault: "client",
1166
962
  $metadata: deserializeMetadata(output),
1167
- };
963
+ });
964
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1168
965
  }
1169
- const message = response.message || response.Message || errorCode;
1170
- response.message = message;
1171
- delete response.Message;
1172
- return Promise.reject(Object.assign(new Error(message), response));
1173
966
  };
1174
967
  const deserializeAws_restJson1GetServerStrategiesCommand = async (output, context) => {
1175
968
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1197,59 +990,28 @@ const deserializeAws_restJson1GetServerStrategiesCommandError = async (output, c
1197
990
  switch (errorCode) {
1198
991
  case "AccessDeniedException":
1199
992
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1200
- response = {
1201
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1202
- name: errorCode,
1203
- $metadata: deserializeMetadata(output),
1204
- };
1205
- break;
993
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1206
994
  case "InternalServerException":
1207
995
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1208
- response = {
1209
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1210
- name: errorCode,
1211
- $metadata: deserializeMetadata(output),
1212
- };
1213
- break;
996
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1214
997
  case "ResourceNotFoundException":
1215
998
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
1216
- response = {
1217
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1218
- name: errorCode,
1219
- $metadata: deserializeMetadata(output),
1220
- };
1221
- break;
999
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1222
1000
  case "ThrottlingException":
1223
1001
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1224
- response = {
1225
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1226
- name: errorCode,
1227
- $metadata: deserializeMetadata(output),
1228
- };
1229
- break;
1002
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1230
1003
  case "ValidationException":
1231
1004
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1232
- response = {
1233
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1234
- name: errorCode,
1235
- $metadata: deserializeMetadata(output),
1236
- };
1237
- break;
1005
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1238
1006
  default:
1239
1007
  const parsedBody = parsedOutput.body;
1240
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1241
- response = {
1242
- ...parsedBody,
1243
- name: `${errorCode}`,
1244
- message: parsedBody.message || parsedBody.Message || errorCode,
1008
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1009
+ name: parsedBody.code || parsedBody.Code || errorCode,
1245
1010
  $fault: "client",
1246
1011
  $metadata: deserializeMetadata(output),
1247
- };
1012
+ });
1013
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1248
1014
  }
1249
- const message = response.message || response.Message || errorCode;
1250
- response.message = message;
1251
- delete response.Message;
1252
- return Promise.reject(Object.assign(new Error(message), response));
1253
1015
  };
1254
1016
  const deserializeAws_restJson1ListApplicationComponentsCommand = async (output, context) => {
1255
1017
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1281,51 +1043,25 @@ const deserializeAws_restJson1ListApplicationComponentsCommandError = async (out
1281
1043
  switch (errorCode) {
1282
1044
  case "AccessDeniedException":
1283
1045
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1284
- response = {
1285
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1286
- name: errorCode,
1287
- $metadata: deserializeMetadata(output),
1288
- };
1289
- break;
1046
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1290
1047
  case "InternalServerException":
1291
1048
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1292
- response = {
1293
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1294
- name: errorCode,
1295
- $metadata: deserializeMetadata(output),
1296
- };
1297
- break;
1049
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1298
1050
  case "ServiceLinkedRoleLockClientException":
1299
1051
  case "com.amazonaws.migrationhubstrategy#ServiceLinkedRoleLockClientException":
1300
- response = {
1301
- ...(await deserializeAws_restJson1ServiceLinkedRoleLockClientExceptionResponse(parsedOutput, context)),
1302
- name: errorCode,
1303
- $metadata: deserializeMetadata(output),
1304
- };
1305
- break;
1052
+ throw await deserializeAws_restJson1ServiceLinkedRoleLockClientExceptionResponse(parsedOutput, context);
1306
1053
  case "ValidationException":
1307
1054
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1308
- response = {
1309
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1310
- name: errorCode,
1311
- $metadata: deserializeMetadata(output),
1312
- };
1313
- break;
1055
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1314
1056
  default:
1315
1057
  const parsedBody = parsedOutput.body;
1316
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1317
- response = {
1318
- ...parsedBody,
1319
- name: `${errorCode}`,
1320
- message: parsedBody.message || parsedBody.Message || errorCode,
1058
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1059
+ name: parsedBody.code || parsedBody.Code || errorCode,
1321
1060
  $fault: "client",
1322
1061
  $metadata: deserializeMetadata(output),
1323
- };
1062
+ });
1063
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1324
1064
  }
1325
- const message = response.message || response.Message || errorCode;
1326
- response.message = message;
1327
- delete response.Message;
1328
- return Promise.reject(Object.assign(new Error(message), response));
1329
1065
  };
1330
1066
  const deserializeAws_restJson1ListCollectorsCommand = async (output, context) => {
1331
1067
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1357,51 +1093,25 @@ const deserializeAws_restJson1ListCollectorsCommandError = async (output, contex
1357
1093
  switch (errorCode) {
1358
1094
  case "AccessDeniedException":
1359
1095
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1360
- response = {
1361
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1362
- name: errorCode,
1363
- $metadata: deserializeMetadata(output),
1364
- };
1365
- break;
1096
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1366
1097
  case "InternalServerException":
1367
1098
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1368
- response = {
1369
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1370
- name: errorCode,
1371
- $metadata: deserializeMetadata(output),
1372
- };
1373
- break;
1099
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1374
1100
  case "ThrottlingException":
1375
1101
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1376
- response = {
1377
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1378
- name: errorCode,
1379
- $metadata: deserializeMetadata(output),
1380
- };
1381
- break;
1102
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1382
1103
  case "ValidationException":
1383
1104
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1384
- response = {
1385
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1386
- name: errorCode,
1387
- $metadata: deserializeMetadata(output),
1388
- };
1389
- break;
1105
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1390
1106
  default:
1391
1107
  const parsedBody = parsedOutput.body;
1392
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1393
- response = {
1394
- ...parsedBody,
1395
- name: `${errorCode}`,
1396
- message: parsedBody.message || parsedBody.Message || errorCode,
1108
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1109
+ name: parsedBody.code || parsedBody.Code || errorCode,
1397
1110
  $fault: "client",
1398
1111
  $metadata: deserializeMetadata(output),
1399
- };
1112
+ });
1113
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1400
1114
  }
1401
- const message = response.message || response.Message || errorCode;
1402
- response.message = message;
1403
- delete response.Message;
1404
- return Promise.reject(Object.assign(new Error(message), response));
1405
1115
  };
1406
1116
  const deserializeAws_restJson1ListImportFileTaskCommand = async (output, context) => {
1407
1117
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1433,51 +1143,25 @@ const deserializeAws_restJson1ListImportFileTaskCommandError = async (output, co
1433
1143
  switch (errorCode) {
1434
1144
  case "AccessDeniedException":
1435
1145
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1436
- response = {
1437
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1438
- name: errorCode,
1439
- $metadata: deserializeMetadata(output),
1440
- };
1441
- break;
1146
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1442
1147
  case "InternalServerException":
1443
1148
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1444
- response = {
1445
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1446
- name: errorCode,
1447
- $metadata: deserializeMetadata(output),
1448
- };
1449
- break;
1149
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1450
1150
  case "ThrottlingException":
1451
1151
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1452
- response = {
1453
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1454
- name: errorCode,
1455
- $metadata: deserializeMetadata(output),
1456
- };
1457
- break;
1152
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1458
1153
  case "ValidationException":
1459
1154
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1460
- response = {
1461
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1462
- name: errorCode,
1463
- $metadata: deserializeMetadata(output),
1464
- };
1465
- break;
1155
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1466
1156
  default:
1467
1157
  const parsedBody = parsedOutput.body;
1468
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1469
- response = {
1470
- ...parsedBody,
1471
- name: `${errorCode}`,
1472
- message: parsedBody.message || parsedBody.Message || errorCode,
1158
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1159
+ name: parsedBody.code || parsedBody.Code || errorCode,
1473
1160
  $fault: "client",
1474
1161
  $metadata: deserializeMetadata(output),
1475
- };
1162
+ });
1163
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1476
1164
  }
1477
- const message = response.message || response.Message || errorCode;
1478
- response.message = message;
1479
- delete response.Message;
1480
- return Promise.reject(Object.assign(new Error(message), response));
1481
1165
  };
1482
1166
  const deserializeAws_restJson1ListServersCommand = async (output, context) => {
1483
1167
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1509,51 +1193,25 @@ const deserializeAws_restJson1ListServersCommandError = async (output, context)
1509
1193
  switch (errorCode) {
1510
1194
  case "AccessDeniedException":
1511
1195
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1512
- response = {
1513
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1514
- name: errorCode,
1515
- $metadata: deserializeMetadata(output),
1516
- };
1517
- break;
1196
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1518
1197
  case "InternalServerException":
1519
1198
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1520
- response = {
1521
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1522
- name: errorCode,
1523
- $metadata: deserializeMetadata(output),
1524
- };
1525
- break;
1199
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1526
1200
  case "ThrottlingException":
1527
1201
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1528
- response = {
1529
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1530
- name: errorCode,
1531
- $metadata: deserializeMetadata(output),
1532
- };
1533
- break;
1202
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1534
1203
  case "ValidationException":
1535
1204
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1536
- response = {
1537
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1538
- name: errorCode,
1539
- $metadata: deserializeMetadata(output),
1540
- };
1541
- break;
1205
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1542
1206
  default:
1543
1207
  const parsedBody = parsedOutput.body;
1544
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1545
- response = {
1546
- ...parsedBody,
1547
- name: `${errorCode}`,
1548
- message: parsedBody.message || parsedBody.Message || errorCode,
1208
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1209
+ name: parsedBody.code || parsedBody.Code || errorCode,
1549
1210
  $fault: "client",
1550
1211
  $metadata: deserializeMetadata(output),
1551
- };
1212
+ });
1213
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1552
1214
  }
1553
- const message = response.message || response.Message || errorCode;
1554
- response.message = message;
1555
- delete response.Message;
1556
- return Promise.reject(Object.assign(new Error(message), response));
1557
1215
  };
1558
1216
  const deserializeAws_restJson1PutPortfolioPreferencesCommand = async (output, context) => {
1559
1217
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1577,59 +1235,28 @@ const deserializeAws_restJson1PutPortfolioPreferencesCommandError = async (outpu
1577
1235
  switch (errorCode) {
1578
1236
  case "AccessDeniedException":
1579
1237
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1580
- response = {
1581
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1582
- name: errorCode,
1583
- $metadata: deserializeMetadata(output),
1584
- };
1585
- break;
1238
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1586
1239
  case "ConflictException":
1587
1240
  case "com.amazonaws.migrationhubstrategy#ConflictException":
1588
- response = {
1589
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1590
- name: errorCode,
1591
- $metadata: deserializeMetadata(output),
1592
- };
1593
- break;
1241
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1594
1242
  case "InternalServerException":
1595
1243
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1596
- response = {
1597
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1598
- name: errorCode,
1599
- $metadata: deserializeMetadata(output),
1600
- };
1601
- break;
1244
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1602
1245
  case "ThrottlingException":
1603
1246
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1604
- response = {
1605
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1606
- name: errorCode,
1607
- $metadata: deserializeMetadata(output),
1608
- };
1609
- break;
1247
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1610
1248
  case "ValidationException":
1611
1249
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1612
- response = {
1613
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1614
- name: errorCode,
1615
- $metadata: deserializeMetadata(output),
1616
- };
1617
- break;
1250
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1618
1251
  default:
1619
1252
  const parsedBody = parsedOutput.body;
1620
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1621
- response = {
1622
- ...parsedBody,
1623
- name: `${errorCode}`,
1624
- message: parsedBody.message || parsedBody.Message || errorCode,
1253
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1254
+ name: parsedBody.code || parsedBody.Code || errorCode,
1625
1255
  $fault: "client",
1626
1256
  $metadata: deserializeMetadata(output),
1627
- };
1257
+ });
1258
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1628
1259
  }
1629
- const message = response.message || response.Message || errorCode;
1630
- response.message = message;
1631
- delete response.Message;
1632
- return Promise.reject(Object.assign(new Error(message), response));
1633
1260
  };
1634
1261
  const deserializeAws_restJson1StartAssessmentCommand = async (output, context) => {
1635
1262
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1657,51 +1284,25 @@ const deserializeAws_restJson1StartAssessmentCommandError = async (output, conte
1657
1284
  switch (errorCode) {
1658
1285
  case "AccessDeniedException":
1659
1286
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1660
- response = {
1661
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1662
- name: errorCode,
1663
- $metadata: deserializeMetadata(output),
1664
- };
1665
- break;
1287
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1666
1288
  case "InternalServerException":
1667
1289
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1668
- response = {
1669
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1670
- name: errorCode,
1671
- $metadata: deserializeMetadata(output),
1672
- };
1673
- break;
1290
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1674
1291
  case "ServiceQuotaExceededException":
1675
1292
  case "com.amazonaws.migrationhubstrategy#ServiceQuotaExceededException":
1676
- response = {
1677
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1678
- name: errorCode,
1679
- $metadata: deserializeMetadata(output),
1680
- };
1681
- break;
1293
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1682
1294
  case "ThrottlingException":
1683
1295
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1684
- response = {
1685
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1686
- name: errorCode,
1687
- $metadata: deserializeMetadata(output),
1688
- };
1689
- break;
1296
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1690
1297
  default:
1691
1298
  const parsedBody = parsedOutput.body;
1692
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1693
- response = {
1694
- ...parsedBody,
1695
- name: `${errorCode}`,
1696
- message: parsedBody.message || parsedBody.Message || errorCode,
1299
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1300
+ name: parsedBody.code || parsedBody.Code || errorCode,
1697
1301
  $fault: "client",
1698
1302
  $metadata: deserializeMetadata(output),
1699
- };
1303
+ });
1304
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1700
1305
  }
1701
- const message = response.message || response.Message || errorCode;
1702
- response.message = message;
1703
- delete response.Message;
1704
- return Promise.reject(Object.assign(new Error(message), response));
1705
1306
  };
1706
1307
  const deserializeAws_restJson1StartImportFileTaskCommand = async (output, context) => {
1707
1308
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1729,59 +1330,28 @@ const deserializeAws_restJson1StartImportFileTaskCommandError = async (output, c
1729
1330
  switch (errorCode) {
1730
1331
  case "AccessDeniedException":
1731
1332
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1732
- response = {
1733
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1734
- name: errorCode,
1735
- $metadata: deserializeMetadata(output),
1736
- };
1737
- break;
1333
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1738
1334
  case "InternalServerException":
1739
1335
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1740
- response = {
1741
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1742
- name: errorCode,
1743
- $metadata: deserializeMetadata(output),
1744
- };
1745
- break;
1336
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1746
1337
  case "ServiceQuotaExceededException":
1747
1338
  case "com.amazonaws.migrationhubstrategy#ServiceQuotaExceededException":
1748
- response = {
1749
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1750
- name: errorCode,
1751
- $metadata: deserializeMetadata(output),
1752
- };
1753
- break;
1339
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1754
1340
  case "ThrottlingException":
1755
1341
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1756
- response = {
1757
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1758
- name: errorCode,
1759
- $metadata: deserializeMetadata(output),
1760
- };
1761
- break;
1342
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1762
1343
  case "ValidationException":
1763
1344
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1764
- response = {
1765
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1766
- name: errorCode,
1767
- $metadata: deserializeMetadata(output),
1768
- };
1769
- break;
1345
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1770
1346
  default:
1771
1347
  const parsedBody = parsedOutput.body;
1772
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1773
- response = {
1774
- ...parsedBody,
1775
- name: `${errorCode}`,
1776
- message: parsedBody.message || parsedBody.Message || errorCode,
1348
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1349
+ name: parsedBody.code || parsedBody.Code || errorCode,
1777
1350
  $fault: "client",
1778
1351
  $metadata: deserializeMetadata(output),
1779
- };
1352
+ });
1353
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1780
1354
  }
1781
- const message = response.message || response.Message || errorCode;
1782
- response.message = message;
1783
- delete response.Message;
1784
- return Promise.reject(Object.assign(new Error(message), response));
1785
1355
  };
1786
1356
  const deserializeAws_restJson1StartRecommendationReportGenerationCommand = async (output, context) => {
1787
1357
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1809,59 +1379,28 @@ const deserializeAws_restJson1StartRecommendationReportGenerationCommandError =
1809
1379
  switch (errorCode) {
1810
1380
  case "AccessDeniedException":
1811
1381
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1812
- response = {
1813
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1814
- name: errorCode,
1815
- $metadata: deserializeMetadata(output),
1816
- };
1817
- break;
1382
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1818
1383
  case "ConflictException":
1819
1384
  case "com.amazonaws.migrationhubstrategy#ConflictException":
1820
- response = {
1821
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1822
- name: errorCode,
1823
- $metadata: deserializeMetadata(output),
1824
- };
1825
- break;
1385
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1826
1386
  case "InternalServerException":
1827
1387
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1828
- response = {
1829
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1830
- name: errorCode,
1831
- $metadata: deserializeMetadata(output),
1832
- };
1833
- break;
1388
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1834
1389
  case "ThrottlingException":
1835
1390
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1836
- response = {
1837
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1838
- name: errorCode,
1839
- $metadata: deserializeMetadata(output),
1840
- };
1841
- break;
1391
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1842
1392
  case "ValidationException":
1843
1393
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1844
- response = {
1845
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1846
- name: errorCode,
1847
- $metadata: deserializeMetadata(output),
1848
- };
1849
- break;
1394
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1850
1395
  default:
1851
1396
  const parsedBody = parsedOutput.body;
1852
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1853
- response = {
1854
- ...parsedBody,
1855
- name: `${errorCode}`,
1856
- message: parsedBody.message || parsedBody.Message || errorCode,
1397
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1398
+ name: parsedBody.code || parsedBody.Code || errorCode,
1857
1399
  $fault: "client",
1858
1400
  $metadata: deserializeMetadata(output),
1859
- };
1401
+ });
1402
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1860
1403
  }
1861
- const message = response.message || response.Message || errorCode;
1862
- response.message = message;
1863
- delete response.Message;
1864
- return Promise.reject(Object.assign(new Error(message), response));
1865
1404
  };
1866
1405
  const deserializeAws_restJson1StopAssessmentCommand = async (output, context) => {
1867
1406
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1885,51 +1424,25 @@ const deserializeAws_restJson1StopAssessmentCommandError = async (output, contex
1885
1424
  switch (errorCode) {
1886
1425
  case "AccessDeniedException":
1887
1426
  case "com.amazonaws.migrationhubstrategy#AccessDeniedException":
1888
- response = {
1889
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1890
- name: errorCode,
1891
- $metadata: deserializeMetadata(output),
1892
- };
1893
- break;
1427
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1894
1428
  case "InternalServerException":
1895
1429
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1896
- response = {
1897
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1898
- name: errorCode,
1899
- $metadata: deserializeMetadata(output),
1900
- };
1901
- break;
1430
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1902
1431
  case "ThrottlingException":
1903
1432
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1904
- response = {
1905
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1906
- name: errorCode,
1907
- $metadata: deserializeMetadata(output),
1908
- };
1909
- break;
1433
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1910
1434
  case "ValidationException":
1911
1435
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1912
- response = {
1913
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1914
- name: errorCode,
1915
- $metadata: deserializeMetadata(output),
1916
- };
1917
- break;
1436
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1918
1437
  default:
1919
1438
  const parsedBody = parsedOutput.body;
1920
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1921
- response = {
1922
- ...parsedBody,
1923
- name: `${errorCode}`,
1924
- message: parsedBody.message || parsedBody.Message || errorCode,
1439
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1440
+ name: parsedBody.code || parsedBody.Code || errorCode,
1925
1441
  $fault: "client",
1926
1442
  $metadata: deserializeMetadata(output),
1927
- };
1443
+ });
1444
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1928
1445
  }
1929
- const message = response.message || response.Message || errorCode;
1930
- response.message = message;
1931
- delete response.Message;
1932
- return Promise.reject(Object.assign(new Error(message), response));
1933
1446
  };
1934
1447
  const deserializeAws_restJson1UpdateApplicationComponentConfigCommand = async (output, context) => {
1935
1448
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1953,51 +1466,25 @@ const deserializeAws_restJson1UpdateApplicationComponentConfigCommandError = asy
1953
1466
  switch (errorCode) {
1954
1467
  case "InternalServerException":
1955
1468
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
1956
- response = {
1957
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1958
- name: errorCode,
1959
- $metadata: deserializeMetadata(output),
1960
- };
1961
- break;
1469
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1962
1470
  case "ResourceNotFoundException":
1963
1471
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
1964
- response = {
1965
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1966
- name: errorCode,
1967
- $metadata: deserializeMetadata(output),
1968
- };
1969
- break;
1472
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1970
1473
  case "ThrottlingException":
1971
1474
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
1972
- response = {
1973
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1974
- name: errorCode,
1975
- $metadata: deserializeMetadata(output),
1976
- };
1977
- break;
1475
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1978
1476
  case "ValidationException":
1979
1477
  case "com.amazonaws.migrationhubstrategy#ValidationException":
1980
- response = {
1981
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1982
- name: errorCode,
1983
- $metadata: deserializeMetadata(output),
1984
- };
1985
- break;
1478
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1986
1479
  default:
1987
1480
  const parsedBody = parsedOutput.body;
1988
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1989
- response = {
1990
- ...parsedBody,
1991
- name: `${errorCode}`,
1992
- message: parsedBody.message || parsedBody.Message || errorCode,
1481
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1482
+ name: parsedBody.code || parsedBody.Code || errorCode,
1993
1483
  $fault: "client",
1994
1484
  $metadata: deserializeMetadata(output),
1995
- };
1485
+ });
1486
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1996
1487
  }
1997
- const message = response.message || response.Message || errorCode;
1998
- response.message = message;
1999
- delete response.Message;
2000
- return Promise.reject(Object.assign(new Error(message), response));
2001
1488
  };
2002
1489
  const deserializeAws_restJson1UpdateServerConfigCommand = async (output, context) => {
2003
1490
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2021,155 +1508,121 @@ const deserializeAws_restJson1UpdateServerConfigCommandError = async (output, co
2021
1508
  switch (errorCode) {
2022
1509
  case "InternalServerException":
2023
1510
  case "com.amazonaws.migrationhubstrategy#InternalServerException":
2024
- response = {
2025
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2026
- name: errorCode,
2027
- $metadata: deserializeMetadata(output),
2028
- };
2029
- break;
1511
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2030
1512
  case "ResourceNotFoundException":
2031
1513
  case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException":
2032
- response = {
2033
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2034
- name: errorCode,
2035
- $metadata: deserializeMetadata(output),
2036
- };
2037
- break;
1514
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2038
1515
  case "ThrottlingException":
2039
1516
  case "com.amazonaws.migrationhubstrategy#ThrottlingException":
2040
- response = {
2041
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2042
- name: errorCode,
2043
- $metadata: deserializeMetadata(output),
2044
- };
2045
- break;
1517
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2046
1518
  case "ValidationException":
2047
1519
  case "com.amazonaws.migrationhubstrategy#ValidationException":
2048
- response = {
2049
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2050
- name: errorCode,
2051
- $metadata: deserializeMetadata(output),
2052
- };
2053
- break;
1520
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2054
1521
  default:
2055
1522
  const parsedBody = parsedOutput.body;
2056
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2057
- response = {
2058
- ...parsedBody,
2059
- name: `${errorCode}`,
2060
- message: parsedBody.message || parsedBody.Message || errorCode,
1523
+ response = new MigrationHubStrategyServiceException_1.MigrationHubStrategyServiceException({
1524
+ name: parsedBody.code || parsedBody.Code || errorCode,
2061
1525
  $fault: "client",
2062
1526
  $metadata: deserializeMetadata(output),
2063
- };
1527
+ });
1528
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2064
1529
  }
2065
- const message = response.message || response.Message || errorCode;
2066
- response.message = message;
2067
- delete response.Message;
2068
- return Promise.reject(Object.assign(new Error(message), response));
2069
1530
  };
2070
1531
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
2071
- const contents = {
2072
- name: "AccessDeniedException",
2073
- $fault: "client",
2074
- $metadata: deserializeMetadata(parsedOutput),
2075
- message: undefined,
2076
- };
1532
+ const contents = {};
2077
1533
  const data = parsedOutput.body;
2078
1534
  if (data.message !== undefined && data.message !== null) {
2079
1535
  contents.message = smithy_client_1.expectString(data.message);
2080
1536
  }
2081
- return contents;
1537
+ const exception = new models_0_1.AccessDeniedException({
1538
+ $metadata: deserializeMetadata(parsedOutput),
1539
+ ...contents,
1540
+ });
1541
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2082
1542
  };
2083
1543
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
2084
- const contents = {
2085
- name: "ConflictException",
2086
- $fault: "client",
2087
- $metadata: deserializeMetadata(parsedOutput),
2088
- message: undefined,
2089
- };
1544
+ const contents = {};
2090
1545
  const data = parsedOutput.body;
2091
1546
  if (data.message !== undefined && data.message !== null) {
2092
1547
  contents.message = smithy_client_1.expectString(data.message);
2093
1548
  }
2094
- return contents;
1549
+ const exception = new models_0_1.ConflictException({
1550
+ $metadata: deserializeMetadata(parsedOutput),
1551
+ ...contents,
1552
+ });
1553
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2095
1554
  };
2096
1555
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
2097
- const contents = {
2098
- name: "InternalServerException",
2099
- $fault: "server",
2100
- $metadata: deserializeMetadata(parsedOutput),
2101
- message: undefined,
2102
- };
1556
+ const contents = {};
2103
1557
  const data = parsedOutput.body;
2104
1558
  if (data.message !== undefined && data.message !== null) {
2105
1559
  contents.message = smithy_client_1.expectString(data.message);
2106
1560
  }
2107
- return contents;
1561
+ const exception = new models_0_1.InternalServerException({
1562
+ $metadata: deserializeMetadata(parsedOutput),
1563
+ ...contents,
1564
+ });
1565
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2108
1566
  };
2109
1567
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
2110
- const contents = {
2111
- name: "ResourceNotFoundException",
2112
- $fault: "client",
2113
- $metadata: deserializeMetadata(parsedOutput),
2114
- message: undefined,
2115
- };
1568
+ const contents = {};
2116
1569
  const data = parsedOutput.body;
2117
1570
  if (data.message !== undefined && data.message !== null) {
2118
1571
  contents.message = smithy_client_1.expectString(data.message);
2119
1572
  }
2120
- return contents;
1573
+ const exception = new models_0_1.ResourceNotFoundException({
1574
+ $metadata: deserializeMetadata(parsedOutput),
1575
+ ...contents,
1576
+ });
1577
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2121
1578
  };
2122
1579
  const deserializeAws_restJson1ServiceLinkedRoleLockClientExceptionResponse = async (parsedOutput, context) => {
2123
- const contents = {
2124
- name: "ServiceLinkedRoleLockClientException",
2125
- $fault: "client",
2126
- $metadata: deserializeMetadata(parsedOutput),
2127
- message: undefined,
2128
- };
1580
+ const contents = {};
2129
1581
  const data = parsedOutput.body;
2130
1582
  if (data.message !== undefined && data.message !== null) {
2131
1583
  contents.message = smithy_client_1.expectString(data.message);
2132
1584
  }
2133
- return contents;
1585
+ const exception = new models_0_1.ServiceLinkedRoleLockClientException({
1586
+ $metadata: deserializeMetadata(parsedOutput),
1587
+ ...contents,
1588
+ });
1589
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2134
1590
  };
2135
1591
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
2136
- const contents = {
2137
- name: "ServiceQuotaExceededException",
2138
- $fault: "client",
2139
- $metadata: deserializeMetadata(parsedOutput),
2140
- message: undefined,
2141
- };
1592
+ const contents = {};
2142
1593
  const data = parsedOutput.body;
2143
1594
  if (data.message !== undefined && data.message !== null) {
2144
1595
  contents.message = smithy_client_1.expectString(data.message);
2145
1596
  }
2146
- return contents;
1597
+ const exception = new models_0_1.ServiceQuotaExceededException({
1598
+ $metadata: deserializeMetadata(parsedOutput),
1599
+ ...contents,
1600
+ });
1601
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2147
1602
  };
2148
1603
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
2149
- const contents = {
2150
- name: "ThrottlingException",
2151
- $fault: "client",
2152
- $metadata: deserializeMetadata(parsedOutput),
2153
- message: undefined,
2154
- };
1604
+ const contents = {};
2155
1605
  const data = parsedOutput.body;
2156
1606
  if (data.message !== undefined && data.message !== null) {
2157
1607
  contents.message = smithy_client_1.expectString(data.message);
2158
1608
  }
2159
- return contents;
1609
+ const exception = new models_0_1.ThrottlingException({
1610
+ $metadata: deserializeMetadata(parsedOutput),
1611
+ ...contents,
1612
+ });
1613
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2160
1614
  };
2161
1615
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
2162
- const contents = {
2163
- name: "ValidationException",
2164
- $fault: "client",
2165
- $metadata: deserializeMetadata(parsedOutput),
2166
- message: undefined,
2167
- };
1616
+ const contents = {};
2168
1617
  const data = parsedOutput.body;
2169
1618
  if (data.message !== undefined && data.message !== null) {
2170
1619
  contents.message = smithy_client_1.expectString(data.message);
2171
1620
  }
2172
- return contents;
1621
+ const exception = new models_0_1.ValidationException({
1622
+ $metadata: deserializeMetadata(parsedOutput),
1623
+ ...contents,
1624
+ });
1625
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
2173
1626
  };
2174
1627
  const serializeAws_restJson1ApplicationPreferences = (input, context) => {
2175
1628
  return {
@@ -2428,7 +1881,7 @@ const deserializeAws_restJson1ApplicationComponentDetail = (output, context) =>
2428
1881
  };
2429
1882
  };
2430
1883
  const deserializeAws_restJson1ApplicationComponentDetails = (output, context) => {
2431
- return (output || [])
1884
+ const retVal = (output || [])
2432
1885
  .filter((e) => e != null)
2433
1886
  .map((entry) => {
2434
1887
  if (entry === null) {
@@ -2436,9 +1889,10 @@ const deserializeAws_restJson1ApplicationComponentDetails = (output, context) =>
2436
1889
  }
2437
1890
  return deserializeAws_restJson1ApplicationComponentDetail(entry, context);
2438
1891
  });
1892
+ return retVal;
2439
1893
  };
2440
1894
  const deserializeAws_restJson1ApplicationComponentStrategies = (output, context) => {
2441
- return (output || [])
1895
+ const retVal = (output || [])
2442
1896
  .filter((e) => e != null)
2443
1897
  .map((entry) => {
2444
1898
  if (entry === null) {
@@ -2446,6 +1900,7 @@ const deserializeAws_restJson1ApplicationComponentStrategies = (output, context)
2446
1900
  }
2447
1901
  return deserializeAws_restJson1ApplicationComponentStrategy(entry, context);
2448
1902
  });
1903
+ return retVal;
2449
1904
  };
2450
1905
  const deserializeAws_restJson1ApplicationComponentStrategy = (output, context) => {
2451
1906
  return {
@@ -2504,7 +1959,7 @@ const deserializeAws_restJson1AssociatedApplication = (output, context) => {
2504
1959
  };
2505
1960
  };
2506
1961
  const deserializeAws_restJson1AssociatedApplications = (output, context) => {
2507
- return (output || [])
1962
+ const retVal = (output || [])
2508
1963
  .filter((e) => e != null)
2509
1964
  .map((entry) => {
2510
1965
  if (entry === null) {
@@ -2512,9 +1967,10 @@ const deserializeAws_restJson1AssociatedApplications = (output, context) => {
2512
1967
  }
2513
1968
  return deserializeAws_restJson1AssociatedApplication(entry, context);
2514
1969
  });
1970
+ return retVal;
2515
1971
  };
2516
1972
  const deserializeAws_restJson1AssociatedServerIDs = (output, context) => {
2517
- return (output || [])
1973
+ const retVal = (output || [])
2518
1974
  .filter((e) => e != null)
2519
1975
  .map((entry) => {
2520
1976
  if (entry === null) {
@@ -2522,6 +1978,7 @@ const deserializeAws_restJson1AssociatedServerIDs = (output, context) => {
2522
1978
  }
2523
1979
  return smithy_client_1.expectString(entry);
2524
1980
  });
1981
+ return retVal;
2525
1982
  };
2526
1983
  const deserializeAws_restJson1AwsManagedResources = (output, context) => {
2527
1984
  return {
@@ -2531,7 +1988,7 @@ const deserializeAws_restJson1AwsManagedResources = (output, context) => {
2531
1988
  };
2532
1989
  };
2533
1990
  const deserializeAws_restJson1AwsManagedTargetDestinations = (output, context) => {
2534
- return (output || [])
1991
+ const retVal = (output || [])
2535
1992
  .filter((e) => e != null)
2536
1993
  .map((entry) => {
2537
1994
  if (entry === null) {
@@ -2539,6 +1996,7 @@ const deserializeAws_restJson1AwsManagedTargetDestinations = (output, context) =
2539
1996
  }
2540
1997
  return smithy_client_1.expectString(entry);
2541
1998
  });
1999
+ return retVal;
2542
2000
  };
2543
2001
  const deserializeAws_restJson1BusinessGoals = (output, context) => {
2544
2002
  return {
@@ -2560,7 +2018,7 @@ const deserializeAws_restJson1Collector = (output, context) => {
2560
2018
  };
2561
2019
  };
2562
2020
  const deserializeAws_restJson1Collectors = (output, context) => {
2563
- return (output || [])
2021
+ const retVal = (output || [])
2564
2022
  .filter((e) => e != null)
2565
2023
  .map((entry) => {
2566
2024
  if (entry === null) {
@@ -2568,6 +2026,7 @@ const deserializeAws_restJson1Collectors = (output, context) => {
2568
2026
  }
2569
2027
  return deserializeAws_restJson1Collector(entry, context);
2570
2028
  });
2029
+ return retVal;
2571
2030
  };
2572
2031
  const deserializeAws_restJson1DatabaseConfigDetail = (output, context) => {
2573
2032
  return {
@@ -2623,7 +2082,7 @@ const deserializeAws_restJson1Heterogeneous = (output, context) => {
2623
2082
  };
2624
2083
  };
2625
2084
  const deserializeAws_restJson1HeterogeneousTargetDatabaseEngines = (output, context) => {
2626
- return (output || [])
2085
+ const retVal = (output || [])
2627
2086
  .filter((e) => e != null)
2628
2087
  .map((entry) => {
2629
2088
  if (entry === null) {
@@ -2631,6 +2090,7 @@ const deserializeAws_restJson1HeterogeneousTargetDatabaseEngines = (output, cont
2631
2090
  }
2632
2091
  return smithy_client_1.expectString(entry);
2633
2092
  });
2093
+ return retVal;
2634
2094
  };
2635
2095
  const deserializeAws_restJson1Homogeneous = (output, context) => {
2636
2096
  return {
@@ -2640,7 +2100,7 @@ const deserializeAws_restJson1Homogeneous = (output, context) => {
2640
2100
  };
2641
2101
  };
2642
2102
  const deserializeAws_restJson1HomogeneousTargetDatabaseEngines = (output, context) => {
2643
- return (output || [])
2103
+ const retVal = (output || [])
2644
2104
  .filter((e) => e != null)
2645
2105
  .map((entry) => {
2646
2106
  if (entry === null) {
@@ -2648,6 +2108,7 @@ const deserializeAws_restJson1HomogeneousTargetDatabaseEngines = (output, contex
2648
2108
  }
2649
2109
  return smithy_client_1.expectString(entry);
2650
2110
  });
2111
+ return retVal;
2651
2112
  };
2652
2113
  const deserializeAws_restJson1ImportFileTaskInformation = (output, context) => {
2653
2114
  return {
@@ -2669,7 +2130,7 @@ const deserializeAws_restJson1ImportFileTaskInformation = (output, context) => {
2669
2130
  };
2670
2131
  };
2671
2132
  const deserializeAws_restJson1ListAntipatternSeveritySummary = (output, context) => {
2672
- return (output || [])
2133
+ const retVal = (output || [])
2673
2134
  .filter((e) => e != null)
2674
2135
  .map((entry) => {
2675
2136
  if (entry === null) {
@@ -2677,9 +2138,10 @@ const deserializeAws_restJson1ListAntipatternSeveritySummary = (output, context)
2677
2138
  }
2678
2139
  return deserializeAws_restJson1AntipatternSeveritySummary(entry, context);
2679
2140
  });
2141
+ return retVal;
2680
2142
  };
2681
2143
  const deserializeAws_restJson1ListApplicationComponentSummary = (output, context) => {
2682
- return (output || [])
2144
+ const retVal = (output || [])
2683
2145
  .filter((e) => e != null)
2684
2146
  .map((entry) => {
2685
2147
  if (entry === null) {
@@ -2687,9 +2149,10 @@ const deserializeAws_restJson1ListApplicationComponentSummary = (output, context
2687
2149
  }
2688
2150
  return deserializeAws_restJson1ApplicationComponentSummary(entry, context);
2689
2151
  });
2152
+ return retVal;
2690
2153
  };
2691
2154
  const deserializeAws_restJson1ListImportFileTaskInformation = (output, context) => {
2692
- return (output || [])
2155
+ const retVal = (output || [])
2693
2156
  .filter((e) => e != null)
2694
2157
  .map((entry) => {
2695
2158
  if (entry === null) {
@@ -2697,9 +2160,10 @@ const deserializeAws_restJson1ListImportFileTaskInformation = (output, context)
2697
2160
  }
2698
2161
  return deserializeAws_restJson1ImportFileTaskInformation(entry, context);
2699
2162
  });
2163
+ return retVal;
2700
2164
  };
2701
2165
  const deserializeAws_restJson1ListServerSummary = (output, context) => {
2702
- return (output || [])
2166
+ const retVal = (output || [])
2703
2167
  .filter((e) => e != null)
2704
2168
  .map((entry) => {
2705
2169
  if (entry === null) {
@@ -2707,9 +2171,10 @@ const deserializeAws_restJson1ListServerSummary = (output, context) => {
2707
2171
  }
2708
2172
  return deserializeAws_restJson1ServerSummary(entry, context);
2709
2173
  });
2174
+ return retVal;
2710
2175
  };
2711
2176
  const deserializeAws_restJson1ListStrategySummary = (output, context) => {
2712
- return (output || [])
2177
+ const retVal = (output || [])
2713
2178
  .filter((e) => e != null)
2714
2179
  .map((entry) => {
2715
2180
  if (entry === null) {
@@ -2717,6 +2182,7 @@ const deserializeAws_restJson1ListStrategySummary = (output, context) => {
2717
2182
  }
2718
2183
  return deserializeAws_restJson1StrategySummary(entry, context);
2719
2184
  });
2185
+ return retVal;
2720
2186
  };
2721
2187
  const deserializeAws_restJson1ManagementPreference = (output, context) => {
2722
2188
  if (output.awsManagedResources !== undefined && output.awsManagedResources !== null) {
@@ -2745,7 +2211,7 @@ const deserializeAws_restJson1NetworkInfo = (output, context) => {
2745
2211
  };
2746
2212
  };
2747
2213
  const deserializeAws_restJson1NetworkInfoList = (output, context) => {
2748
- return (output || [])
2214
+ const retVal = (output || [])
2749
2215
  .filter((e) => e != null)
2750
2216
  .map((entry) => {
2751
2217
  if (entry === null) {
@@ -2753,6 +2219,7 @@ const deserializeAws_restJson1NetworkInfoList = (output, context) => {
2753
2219
  }
2754
2220
  return deserializeAws_restJson1NetworkInfo(entry, context);
2755
2221
  });
2222
+ return retVal;
2756
2223
  };
2757
2224
  const deserializeAws_restJson1NoDatabaseMigrationPreference = (output, context) => {
2758
2225
  return {
@@ -2769,7 +2236,7 @@ const deserializeAws_restJson1NoManagementPreference = (output, context) => {
2769
2236
  };
2770
2237
  };
2771
2238
  const deserializeAws_restJson1NoPreferenceTargetDestinations = (output, context) => {
2772
- return (output || [])
2239
+ const retVal = (output || [])
2773
2240
  .filter((e) => e != null)
2774
2241
  .map((entry) => {
2775
2242
  if (entry === null) {
@@ -2777,6 +2244,7 @@ const deserializeAws_restJson1NoPreferenceTargetDestinations = (output, context)
2777
2244
  }
2778
2245
  return smithy_client_1.expectString(entry);
2779
2246
  });
2247
+ return retVal;
2780
2248
  };
2781
2249
  const deserializeAws_restJson1OSInfo = (output, context) => {
2782
2250
  return {
@@ -2817,7 +2285,7 @@ const deserializeAws_restJson1RecommendationSet = (output, context) => {
2817
2285
  };
2818
2286
  };
2819
2287
  const deserializeAws_restJson1S3Keys = (output, context) => {
2820
- return (output || [])
2288
+ const retVal = (output || [])
2821
2289
  .filter((e) => e != null)
2822
2290
  .map((entry) => {
2823
2291
  if (entry === null) {
@@ -2825,6 +2293,7 @@ const deserializeAws_restJson1S3Keys = (output, context) => {
2825
2293
  }
2826
2294
  return smithy_client_1.expectString(entry);
2827
2295
  });
2296
+ return retVal;
2828
2297
  };
2829
2298
  const deserializeAws_restJson1S3Object = (output, context) => {
2830
2299
  return {
@@ -2840,7 +2309,7 @@ const deserializeAws_restJson1SelfManageResources = (output, context) => {
2840
2309
  };
2841
2310
  };
2842
2311
  const deserializeAws_restJson1SelfManageTargetDestinations = (output, context) => {
2843
- return (output || [])
2312
+ const retVal = (output || [])
2844
2313
  .filter((e) => e != null)
2845
2314
  .map((entry) => {
2846
2315
  if (entry === null) {
@@ -2848,6 +2317,7 @@ const deserializeAws_restJson1SelfManageTargetDestinations = (output, context) =
2848
2317
  }
2849
2318
  return smithy_client_1.expectString(entry);
2850
2319
  });
2320
+ return retVal;
2851
2321
  };
2852
2322
  const deserializeAws_restJson1ServerDetail = (output, context) => {
2853
2323
  return {
@@ -2879,7 +2349,7 @@ const deserializeAws_restJson1ServerDetail = (output, context) => {
2879
2349
  };
2880
2350
  };
2881
2351
  const deserializeAws_restJson1ServerDetails = (output, context) => {
2882
- return (output || [])
2352
+ const retVal = (output || [])
2883
2353
  .filter((e) => e != null)
2884
2354
  .map((entry) => {
2885
2355
  if (entry === null) {
@@ -2887,9 +2357,10 @@ const deserializeAws_restJson1ServerDetails = (output, context) => {
2887
2357
  }
2888
2358
  return deserializeAws_restJson1ServerDetail(entry, context);
2889
2359
  });
2360
+ return retVal;
2890
2361
  };
2891
2362
  const deserializeAws_restJson1ServerStrategies = (output, context) => {
2892
- return (output || [])
2363
+ const retVal = (output || [])
2893
2364
  .filter((e) => e != null)
2894
2365
  .map((entry) => {
2895
2366
  if (entry === null) {
@@ -2897,6 +2368,7 @@ const deserializeAws_restJson1ServerStrategies = (output, context) => {
2897
2368
  }
2898
2369
  return deserializeAws_restJson1ServerStrategy(entry, context);
2899
2370
  });
2371
+ return retVal;
2900
2372
  };
2901
2373
  const deserializeAws_restJson1ServerStrategy = (output, context) => {
2902
2374
  return {
@@ -2915,7 +2387,7 @@ const deserializeAws_restJson1ServerSummary = (output, context) => {
2915
2387
  };
2916
2388
  };
2917
2389
  const deserializeAws_restJson1SourceCodeRepositories = (output, context) => {
2918
- return (output || [])
2390
+ const retVal = (output || [])
2919
2391
  .filter((e) => e != null)
2920
2392
  .map((entry) => {
2921
2393
  if (entry === null) {
@@ -2923,6 +2395,7 @@ const deserializeAws_restJson1SourceCodeRepositories = (output, context) => {
2923
2395
  }
2924
2396
  return deserializeAws_restJson1SourceCodeRepository(entry, context);
2925
2397
  });
2398
+ return retVal;
2926
2399
  };
2927
2400
  const deserializeAws_restJson1SourceCodeRepository = (output, context) => {
2928
2401
  return {
@@ -2950,7 +2423,7 @@ const deserializeAws_restJson1SystemInfo = (output, context) => {
2950
2423
  };
2951
2424
  };
2952
2425
  const deserializeAws_restJson1TargetDatabaseEngines = (output, context) => {
2953
- return (output || [])
2426
+ const retVal = (output || [])
2954
2427
  .filter((e) => e != null)
2955
2428
  .map((entry) => {
2956
2429
  if (entry === null) {
@@ -2958,6 +2431,7 @@ const deserializeAws_restJson1TargetDatabaseEngines = (output, context) => {
2958
2431
  }
2959
2432
  return smithy_client_1.expectString(entry);
2960
2433
  });
2434
+ return retVal;
2961
2435
  };
2962
2436
  const deserializeAws_restJson1TransformationTool = (output, context) => {
2963
2437
  return {