@aws-sdk/client-appstream 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 (98) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist-cjs/index.js +3 -0
  3. package/dist-cjs/models/AppStreamServiceException.js +11 -0
  4. package/dist-cjs/models/models_0.js +202 -4
  5. package/dist-cjs/protocols/Aws_json1_1.js +592 -2096
  6. package/dist-es/index.js +1 -0
  7. package/dist-es/models/AppStreamServiceException.js +12 -0
  8. package/dist-es/models/models_0.js +184 -1
  9. package/dist-es/protocols/Aws_json1_1.js +1325 -2308
  10. package/dist-types/index.d.ts +1 -0
  11. package/dist-types/models/AppStreamServiceException.d.ts +10 -0
  12. package/dist-types/models/models_0.d.ts +100 -43
  13. package/dist-types/ts3.4/AppStream.d.ts +330 -0
  14. package/dist-types/ts3.4/AppStreamClient.d.ts +138 -0
  15. package/dist-types/ts3.4/commands/AssociateApplicationFleetCommand.d.ts +17 -0
  16. package/dist-types/ts3.4/commands/AssociateApplicationToEntitlementCommand.d.ts +17 -0
  17. package/dist-types/ts3.4/commands/AssociateFleetCommand.d.ts +17 -0
  18. package/dist-types/ts3.4/commands/BatchAssociateUserStackCommand.d.ts +17 -0
  19. package/dist-types/ts3.4/commands/BatchDisassociateUserStackCommand.d.ts +17 -0
  20. package/dist-types/ts3.4/commands/CopyImageCommand.d.ts +17 -0
  21. package/dist-types/ts3.4/commands/CreateAppBlockCommand.d.ts +17 -0
  22. package/dist-types/ts3.4/commands/CreateApplicationCommand.d.ts +17 -0
  23. package/dist-types/ts3.4/commands/CreateDirectoryConfigCommand.d.ts +17 -0
  24. package/dist-types/ts3.4/commands/CreateEntitlementCommand.d.ts +17 -0
  25. package/dist-types/ts3.4/commands/CreateFleetCommand.d.ts +17 -0
  26. package/dist-types/ts3.4/commands/CreateImageBuilderCommand.d.ts +17 -0
  27. package/dist-types/ts3.4/commands/CreateImageBuilderStreamingURLCommand.d.ts +17 -0
  28. package/dist-types/ts3.4/commands/CreateStackCommand.d.ts +17 -0
  29. package/dist-types/ts3.4/commands/CreateStreamingURLCommand.d.ts +17 -0
  30. package/dist-types/ts3.4/commands/CreateUpdatedImageCommand.d.ts +17 -0
  31. package/dist-types/ts3.4/commands/CreateUsageReportSubscriptionCommand.d.ts +17 -0
  32. package/dist-types/ts3.4/commands/CreateUserCommand.d.ts +17 -0
  33. package/dist-types/ts3.4/commands/DeleteAppBlockCommand.d.ts +17 -0
  34. package/dist-types/ts3.4/commands/DeleteApplicationCommand.d.ts +17 -0
  35. package/dist-types/ts3.4/commands/DeleteDirectoryConfigCommand.d.ts +17 -0
  36. package/dist-types/ts3.4/commands/DeleteEntitlementCommand.d.ts +17 -0
  37. package/dist-types/ts3.4/commands/DeleteFleetCommand.d.ts +17 -0
  38. package/dist-types/ts3.4/commands/DeleteImageBuilderCommand.d.ts +17 -0
  39. package/dist-types/ts3.4/commands/DeleteImageCommand.d.ts +17 -0
  40. package/dist-types/ts3.4/commands/DeleteImagePermissionsCommand.d.ts +17 -0
  41. package/dist-types/ts3.4/commands/DeleteStackCommand.d.ts +17 -0
  42. package/dist-types/ts3.4/commands/DeleteUsageReportSubscriptionCommand.d.ts +17 -0
  43. package/dist-types/ts3.4/commands/DeleteUserCommand.d.ts +17 -0
  44. package/dist-types/ts3.4/commands/DescribeAppBlocksCommand.d.ts +17 -0
  45. package/dist-types/ts3.4/commands/DescribeApplicationFleetAssociationsCommand.d.ts +17 -0
  46. package/dist-types/ts3.4/commands/DescribeApplicationsCommand.d.ts +17 -0
  47. package/dist-types/ts3.4/commands/DescribeDirectoryConfigsCommand.d.ts +17 -0
  48. package/dist-types/ts3.4/commands/DescribeEntitlementsCommand.d.ts +17 -0
  49. package/dist-types/ts3.4/commands/DescribeFleetsCommand.d.ts +17 -0
  50. package/dist-types/ts3.4/commands/DescribeImageBuildersCommand.d.ts +17 -0
  51. package/dist-types/ts3.4/commands/DescribeImagePermissionsCommand.d.ts +17 -0
  52. package/dist-types/ts3.4/commands/DescribeImagesCommand.d.ts +17 -0
  53. package/dist-types/ts3.4/commands/DescribeSessionsCommand.d.ts +17 -0
  54. package/dist-types/ts3.4/commands/DescribeStacksCommand.d.ts +17 -0
  55. package/dist-types/ts3.4/commands/DescribeUsageReportSubscriptionsCommand.d.ts +17 -0
  56. package/dist-types/ts3.4/commands/DescribeUserStackAssociationsCommand.d.ts +17 -0
  57. package/dist-types/ts3.4/commands/DescribeUsersCommand.d.ts +17 -0
  58. package/dist-types/ts3.4/commands/DisableUserCommand.d.ts +17 -0
  59. package/dist-types/ts3.4/commands/DisassociateApplicationFleetCommand.d.ts +17 -0
  60. package/dist-types/ts3.4/commands/DisassociateApplicationFromEntitlementCommand.d.ts +17 -0
  61. package/dist-types/ts3.4/commands/DisassociateFleetCommand.d.ts +17 -0
  62. package/dist-types/ts3.4/commands/EnableUserCommand.d.ts +17 -0
  63. package/dist-types/ts3.4/commands/ExpireSessionCommand.d.ts +17 -0
  64. package/dist-types/ts3.4/commands/ListAssociatedFleetsCommand.d.ts +17 -0
  65. package/dist-types/ts3.4/commands/ListAssociatedStacksCommand.d.ts +17 -0
  66. package/dist-types/ts3.4/commands/ListEntitledApplicationsCommand.d.ts +17 -0
  67. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  68. package/dist-types/ts3.4/commands/StartFleetCommand.d.ts +17 -0
  69. package/dist-types/ts3.4/commands/StartImageBuilderCommand.d.ts +17 -0
  70. package/dist-types/ts3.4/commands/StopFleetCommand.d.ts +17 -0
  71. package/dist-types/ts3.4/commands/StopImageBuilderCommand.d.ts +17 -0
  72. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  73. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  74. package/dist-types/ts3.4/commands/UpdateApplicationCommand.d.ts +17 -0
  75. package/dist-types/ts3.4/commands/UpdateDirectoryConfigCommand.d.ts +17 -0
  76. package/dist-types/ts3.4/commands/UpdateEntitlementCommand.d.ts +17 -0
  77. package/dist-types/ts3.4/commands/UpdateFleetCommand.d.ts +17 -0
  78. package/dist-types/ts3.4/commands/UpdateImagePermissionsCommand.d.ts +17 -0
  79. package/dist-types/ts3.4/commands/UpdateStackCommand.d.ts +17 -0
  80. package/dist-types/ts3.4/commands/index.d.ts +65 -0
  81. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  82. package/dist-types/ts3.4/index.d.ts +7 -0
  83. package/dist-types/ts3.4/models/AppStreamServiceException.d.ts +6 -0
  84. package/dist-types/ts3.4/models/index.d.ts +1 -0
  85. package/dist-types/ts3.4/models/models_0.d.ts +2344 -0
  86. package/dist-types/ts3.4/pagination/DescribeImagePermissionsPaginator.d.ts +4 -0
  87. package/dist-types/ts3.4/pagination/DescribeImagesPaginator.d.ts +4 -0
  88. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  89. package/dist-types/ts3.4/pagination/index.d.ts +3 -0
  90. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +197 -0
  91. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  92. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  93. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  94. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  95. package/dist-types/ts3.4/waiters/index.d.ts +2 -0
  96. package/dist-types/ts3.4/waiters/waitForFleetStarted.d.ts +7 -0
  97. package/dist-types/ts3.4/waiters/waitForFleetStopped.d.ts +7 -0
  98. package/package.json +34 -34
@@ -5,6 +5,8 @@ exports.deserializeAws_json1_1DescribeFleetsCommand = exports.deserializeAws_jso
5
5
  exports.deserializeAws_json1_1UpdateStackCommand = exports.deserializeAws_json1_1UpdateImagePermissionsCommand = exports.deserializeAws_json1_1UpdateFleetCommand = exports.deserializeAws_json1_1UpdateEntitlementCommand = exports.deserializeAws_json1_1UpdateDirectoryConfigCommand = exports.deserializeAws_json1_1UpdateApplicationCommand = exports.deserializeAws_json1_1UntagResourceCommand = exports.deserializeAws_json1_1TagResourceCommand = exports.deserializeAws_json1_1StopImageBuilderCommand = exports.deserializeAws_json1_1StopFleetCommand = exports.deserializeAws_json1_1StartImageBuilderCommand = exports.deserializeAws_json1_1StartFleetCommand = exports.deserializeAws_json1_1ListTagsForResourceCommand = exports.deserializeAws_json1_1ListEntitledApplicationsCommand = exports.deserializeAws_json1_1ListAssociatedStacksCommand = exports.deserializeAws_json1_1ListAssociatedFleetsCommand = exports.deserializeAws_json1_1ExpireSessionCommand = exports.deserializeAws_json1_1EnableUserCommand = exports.deserializeAws_json1_1DisassociateFleetCommand = exports.deserializeAws_json1_1DisassociateApplicationFromEntitlementCommand = exports.deserializeAws_json1_1DisassociateApplicationFleetCommand = exports.deserializeAws_json1_1DisableUserCommand = exports.deserializeAws_json1_1DescribeUserStackAssociationsCommand = exports.deserializeAws_json1_1DescribeUsersCommand = exports.deserializeAws_json1_1DescribeUsageReportSubscriptionsCommand = exports.deserializeAws_json1_1DescribeStacksCommand = exports.deserializeAws_json1_1DescribeSessionsCommand = exports.deserializeAws_json1_1DescribeImagesCommand = exports.deserializeAws_json1_1DescribeImagePermissionsCommand = exports.deserializeAws_json1_1DescribeImageBuildersCommand = void 0;
6
6
  const protocol_http_1 = require("@aws-sdk/protocol-http");
7
7
  const smithy_client_1 = require("@aws-sdk/smithy-client");
8
+ const AppStreamServiceException_1 = require("../models/AppStreamServiceException");
9
+ const models_0_1 = require("../models/models_0");
8
10
  const serializeAws_json1_1AssociateApplicationFleetCommand = async (input, context) => {
9
11
  const headers = {
10
12
  "content-type": "application/x-amz-json-1.1",
@@ -680,59 +682,28 @@ const deserializeAws_json1_1AssociateApplicationFleetCommandError = async (outpu
680
682
  switch (errorCode) {
681
683
  case "ConcurrentModificationException":
682
684
  case "com.amazonaws.appstream#ConcurrentModificationException":
683
- response = {
684
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
685
- name: errorCode,
686
- $metadata: deserializeMetadata(output),
687
- };
688
- break;
685
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
689
686
  case "InvalidParameterCombinationException":
690
687
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
691
- response = {
692
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
693
- name: errorCode,
694
- $metadata: deserializeMetadata(output),
695
- };
696
- break;
688
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
697
689
  case "LimitExceededException":
698
690
  case "com.amazonaws.appstream#LimitExceededException":
699
- response = {
700
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
701
- name: errorCode,
702
- $metadata: deserializeMetadata(output),
703
- };
704
- break;
691
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
705
692
  case "OperationNotPermittedException":
706
693
  case "com.amazonaws.appstream#OperationNotPermittedException":
707
- response = {
708
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
709
- name: errorCode,
710
- $metadata: deserializeMetadata(output),
711
- };
712
- break;
694
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
713
695
  case "ResourceNotFoundException":
714
696
  case "com.amazonaws.appstream#ResourceNotFoundException":
715
- response = {
716
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
717
- name: errorCode,
718
- $metadata: deserializeMetadata(output),
719
- };
720
- break;
697
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
721
698
  default:
722
699
  const parsedBody = parsedOutput.body;
723
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
724
- response = {
725
- ...parsedBody,
726
- name: `${errorCode}`,
727
- message: parsedBody.message || parsedBody.Message || errorCode,
700
+ response = new AppStreamServiceException_1.AppStreamServiceException({
701
+ name: parsedBody.code || parsedBody.Code || errorCode,
728
702
  $fault: "client",
729
703
  $metadata: deserializeMetadata(output),
730
- };
704
+ });
705
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
731
706
  }
732
- const message = response.message || response.Message || errorCode;
733
- response.message = message;
734
- delete response.Message;
735
- return Promise.reject(Object.assign(new Error(message), response));
736
707
  };
737
708
  const deserializeAws_json1_1AssociateApplicationToEntitlementCommand = async (output, context) => {
738
709
  if (output.statusCode >= 300) {
@@ -759,51 +730,25 @@ const deserializeAws_json1_1AssociateApplicationToEntitlementCommandError = asyn
759
730
  switch (errorCode) {
760
731
  case "EntitlementNotFoundException":
761
732
  case "com.amazonaws.appstream#EntitlementNotFoundException":
762
- response = {
763
- ...(await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context)),
764
- name: errorCode,
765
- $metadata: deserializeMetadata(output),
766
- };
767
- break;
733
+ throw await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context);
768
734
  case "LimitExceededException":
769
735
  case "com.amazonaws.appstream#LimitExceededException":
770
- response = {
771
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
772
- name: errorCode,
773
- $metadata: deserializeMetadata(output),
774
- };
775
- break;
736
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
776
737
  case "OperationNotPermittedException":
777
738
  case "com.amazonaws.appstream#OperationNotPermittedException":
778
- response = {
779
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
780
- name: errorCode,
781
- $metadata: deserializeMetadata(output),
782
- };
783
- break;
739
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
784
740
  case "ResourceNotFoundException":
785
741
  case "com.amazonaws.appstream#ResourceNotFoundException":
786
- response = {
787
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
788
- name: errorCode,
789
- $metadata: deserializeMetadata(output),
790
- };
791
- break;
742
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
792
743
  default:
793
744
  const parsedBody = parsedOutput.body;
794
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
795
- response = {
796
- ...parsedBody,
797
- name: `${errorCode}`,
798
- message: parsedBody.message || parsedBody.Message || errorCode,
745
+ response = new AppStreamServiceException_1.AppStreamServiceException({
746
+ name: parsedBody.code || parsedBody.Code || errorCode,
799
747
  $fault: "client",
800
748
  $metadata: deserializeMetadata(output),
801
- };
749
+ });
750
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
802
751
  }
803
- const message = response.message || response.Message || errorCode;
804
- response.message = message;
805
- delete response.Message;
806
- return Promise.reject(Object.assign(new Error(message), response));
807
752
  };
808
753
  const deserializeAws_json1_1AssociateFleetCommand = async (output, context) => {
809
754
  if (output.statusCode >= 300) {
@@ -830,67 +775,31 @@ const deserializeAws_json1_1AssociateFleetCommandError = async (output, context)
830
775
  switch (errorCode) {
831
776
  case "ConcurrentModificationException":
832
777
  case "com.amazonaws.appstream#ConcurrentModificationException":
833
- response = {
834
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
835
- name: errorCode,
836
- $metadata: deserializeMetadata(output),
837
- };
838
- break;
778
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
839
779
  case "IncompatibleImageException":
840
780
  case "com.amazonaws.appstream#IncompatibleImageException":
841
- response = {
842
- ...(await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context)),
843
- name: errorCode,
844
- $metadata: deserializeMetadata(output),
845
- };
846
- break;
781
+ throw await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context);
847
782
  case "InvalidAccountStatusException":
848
783
  case "com.amazonaws.appstream#InvalidAccountStatusException":
849
- response = {
850
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
851
- name: errorCode,
852
- $metadata: deserializeMetadata(output),
853
- };
854
- break;
784
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
855
785
  case "LimitExceededException":
856
786
  case "com.amazonaws.appstream#LimitExceededException":
857
- response = {
858
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
859
- name: errorCode,
860
- $metadata: deserializeMetadata(output),
861
- };
862
- break;
787
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
863
788
  case "OperationNotPermittedException":
864
789
  case "com.amazonaws.appstream#OperationNotPermittedException":
865
- response = {
866
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
867
- name: errorCode,
868
- $metadata: deserializeMetadata(output),
869
- };
870
- break;
790
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
871
791
  case "ResourceNotFoundException":
872
792
  case "com.amazonaws.appstream#ResourceNotFoundException":
873
- response = {
874
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
875
- name: errorCode,
876
- $metadata: deserializeMetadata(output),
877
- };
878
- break;
793
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
879
794
  default:
880
795
  const parsedBody = parsedOutput.body;
881
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
882
- response = {
883
- ...parsedBody,
884
- name: `${errorCode}`,
885
- message: parsedBody.message || parsedBody.Message || errorCode,
796
+ response = new AppStreamServiceException_1.AppStreamServiceException({
797
+ name: parsedBody.code || parsedBody.Code || errorCode,
886
798
  $fault: "client",
887
799
  $metadata: deserializeMetadata(output),
888
- };
800
+ });
801
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
889
802
  }
890
- const message = response.message || response.Message || errorCode;
891
- response.message = message;
892
- delete response.Message;
893
- return Promise.reject(Object.assign(new Error(message), response));
894
803
  };
895
804
  const deserializeAws_json1_1BatchAssociateUserStackCommand = async (output, context) => {
896
805
  if (output.statusCode >= 300) {
@@ -917,35 +826,19 @@ const deserializeAws_json1_1BatchAssociateUserStackCommandError = async (output,
917
826
  switch (errorCode) {
918
827
  case "InvalidParameterCombinationException":
919
828
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
920
- response = {
921
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
922
- name: errorCode,
923
- $metadata: deserializeMetadata(output),
924
- };
925
- break;
829
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
926
830
  case "OperationNotPermittedException":
927
831
  case "com.amazonaws.appstream#OperationNotPermittedException":
928
- response = {
929
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
930
- name: errorCode,
931
- $metadata: deserializeMetadata(output),
932
- };
933
- break;
832
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
934
833
  default:
935
834
  const parsedBody = parsedOutput.body;
936
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
937
- response = {
938
- ...parsedBody,
939
- name: `${errorCode}`,
940
- message: parsedBody.message || parsedBody.Message || errorCode,
835
+ response = new AppStreamServiceException_1.AppStreamServiceException({
836
+ name: parsedBody.code || parsedBody.Code || errorCode,
941
837
  $fault: "client",
942
838
  $metadata: deserializeMetadata(output),
943
- };
839
+ });
840
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
944
841
  }
945
- const message = response.message || response.Message || errorCode;
946
- response.message = message;
947
- delete response.Message;
948
- return Promise.reject(Object.assign(new Error(message), response));
949
842
  };
950
843
  const deserializeAws_json1_1BatchDisassociateUserStackCommand = async (output, context) => {
951
844
  if (output.statusCode >= 300) {
@@ -972,35 +865,19 @@ const deserializeAws_json1_1BatchDisassociateUserStackCommandError = async (outp
972
865
  switch (errorCode) {
973
866
  case "InvalidParameterCombinationException":
974
867
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
975
- response = {
976
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
977
- name: errorCode,
978
- $metadata: deserializeMetadata(output),
979
- };
980
- break;
868
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
981
869
  case "OperationNotPermittedException":
982
870
  case "com.amazonaws.appstream#OperationNotPermittedException":
983
- response = {
984
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
985
- name: errorCode,
986
- $metadata: deserializeMetadata(output),
987
- };
988
- break;
871
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
989
872
  default:
990
873
  const parsedBody = parsedOutput.body;
991
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
992
- response = {
993
- ...parsedBody,
994
- name: `${errorCode}`,
995
- message: parsedBody.message || parsedBody.Message || errorCode,
874
+ response = new AppStreamServiceException_1.AppStreamServiceException({
875
+ name: parsedBody.code || parsedBody.Code || errorCode,
996
876
  $fault: "client",
997
877
  $metadata: deserializeMetadata(output),
998
- };
878
+ });
879
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
999
880
  }
1000
- const message = response.message || response.Message || errorCode;
1001
- response.message = message;
1002
- delete response.Message;
1003
- return Promise.reject(Object.assign(new Error(message), response));
1004
881
  };
1005
882
  const deserializeAws_json1_1CopyImageCommand = async (output, context) => {
1006
883
  if (output.statusCode >= 300) {
@@ -1027,67 +904,31 @@ const deserializeAws_json1_1CopyImageCommandError = async (output, context) => {
1027
904
  switch (errorCode) {
1028
905
  case "IncompatibleImageException":
1029
906
  case "com.amazonaws.appstream#IncompatibleImageException":
1030
- response = {
1031
- ...(await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context)),
1032
- name: errorCode,
1033
- $metadata: deserializeMetadata(output),
1034
- };
1035
- break;
907
+ throw await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context);
1036
908
  case "InvalidAccountStatusException":
1037
909
  case "com.amazonaws.appstream#InvalidAccountStatusException":
1038
- response = {
1039
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
1040
- name: errorCode,
1041
- $metadata: deserializeMetadata(output),
1042
- };
1043
- break;
910
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
1044
911
  case "LimitExceededException":
1045
912
  case "com.amazonaws.appstream#LimitExceededException":
1046
- response = {
1047
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1048
- name: errorCode,
1049
- $metadata: deserializeMetadata(output),
1050
- };
1051
- break;
913
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1052
914
  case "ResourceAlreadyExistsException":
1053
915
  case "com.amazonaws.appstream#ResourceAlreadyExistsException":
1054
- response = {
1055
- ...(await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1056
- name: errorCode,
1057
- $metadata: deserializeMetadata(output),
1058
- };
1059
- break;
916
+ throw await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1060
917
  case "ResourceNotAvailableException":
1061
918
  case "com.amazonaws.appstream#ResourceNotAvailableException":
1062
- response = {
1063
- ...(await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context)),
1064
- name: errorCode,
1065
- $metadata: deserializeMetadata(output),
1066
- };
1067
- break;
919
+ throw await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context);
1068
920
  case "ResourceNotFoundException":
1069
921
  case "com.amazonaws.appstream#ResourceNotFoundException":
1070
- response = {
1071
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1072
- name: errorCode,
1073
- $metadata: deserializeMetadata(output),
1074
- };
1075
- break;
922
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1076
923
  default:
1077
924
  const parsedBody = parsedOutput.body;
1078
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1079
- response = {
1080
- ...parsedBody,
1081
- name: `${errorCode}`,
1082
- message: parsedBody.message || parsedBody.Message || errorCode,
925
+ response = new AppStreamServiceException_1.AppStreamServiceException({
926
+ name: parsedBody.code || parsedBody.Code || errorCode,
1083
927
  $fault: "client",
1084
928
  $metadata: deserializeMetadata(output),
1085
- };
929
+ });
930
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1086
931
  }
1087
- const message = response.message || response.Message || errorCode;
1088
- response.message = message;
1089
- delete response.Message;
1090
- return Promise.reject(Object.assign(new Error(message), response));
1091
932
  };
1092
933
  const deserializeAws_json1_1CreateAppBlockCommand = async (output, context) => {
1093
934
  if (output.statusCode >= 300) {
@@ -1114,51 +955,25 @@ const deserializeAws_json1_1CreateAppBlockCommandError = async (output, context)
1114
955
  switch (errorCode) {
1115
956
  case "ConcurrentModificationException":
1116
957
  case "com.amazonaws.appstream#ConcurrentModificationException":
1117
- response = {
1118
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1119
- name: errorCode,
1120
- $metadata: deserializeMetadata(output),
1121
- };
1122
- break;
958
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
1123
959
  case "LimitExceededException":
1124
960
  case "com.amazonaws.appstream#LimitExceededException":
1125
- response = {
1126
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1127
- name: errorCode,
1128
- $metadata: deserializeMetadata(output),
1129
- };
1130
- break;
961
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1131
962
  case "OperationNotPermittedException":
1132
963
  case "com.amazonaws.appstream#OperationNotPermittedException":
1133
- response = {
1134
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1135
- name: errorCode,
1136
- $metadata: deserializeMetadata(output),
1137
- };
1138
- break;
964
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1139
965
  case "ResourceAlreadyExistsException":
1140
966
  case "com.amazonaws.appstream#ResourceAlreadyExistsException":
1141
- response = {
1142
- ...(await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1143
- name: errorCode,
1144
- $metadata: deserializeMetadata(output),
1145
- };
1146
- break;
967
+ throw await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1147
968
  default:
1148
969
  const parsedBody = parsedOutput.body;
1149
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1150
- response = {
1151
- ...parsedBody,
1152
- name: `${errorCode}`,
1153
- message: parsedBody.message || parsedBody.Message || errorCode,
970
+ response = new AppStreamServiceException_1.AppStreamServiceException({
971
+ name: parsedBody.code || parsedBody.Code || errorCode,
1154
972
  $fault: "client",
1155
973
  $metadata: deserializeMetadata(output),
1156
- };
974
+ });
975
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1157
976
  }
1158
- const message = response.message || response.Message || errorCode;
1159
- response.message = message;
1160
- delete response.Message;
1161
- return Promise.reject(Object.assign(new Error(message), response));
1162
977
  };
1163
978
  const deserializeAws_json1_1CreateApplicationCommand = async (output, context) => {
1164
979
  if (output.statusCode >= 300) {
@@ -1185,59 +1000,28 @@ const deserializeAws_json1_1CreateApplicationCommandError = async (output, conte
1185
1000
  switch (errorCode) {
1186
1001
  case "ConcurrentModificationException":
1187
1002
  case "com.amazonaws.appstream#ConcurrentModificationException":
1188
- response = {
1189
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1190
- name: errorCode,
1191
- $metadata: deserializeMetadata(output),
1192
- };
1193
- break;
1003
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
1194
1004
  case "LimitExceededException":
1195
1005
  case "com.amazonaws.appstream#LimitExceededException":
1196
- response = {
1197
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1198
- name: errorCode,
1199
- $metadata: deserializeMetadata(output),
1200
- };
1201
- break;
1006
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1202
1007
  case "OperationNotPermittedException":
1203
1008
  case "com.amazonaws.appstream#OperationNotPermittedException":
1204
- response = {
1205
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1206
- name: errorCode,
1207
- $metadata: deserializeMetadata(output),
1208
- };
1209
- break;
1009
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1210
1010
  case "ResourceAlreadyExistsException":
1211
1011
  case "com.amazonaws.appstream#ResourceAlreadyExistsException":
1212
- response = {
1213
- ...(await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1214
- name: errorCode,
1215
- $metadata: deserializeMetadata(output),
1216
- };
1217
- break;
1012
+ throw await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1218
1013
  case "ResourceNotFoundException":
1219
1014
  case "com.amazonaws.appstream#ResourceNotFoundException":
1220
- response = {
1221
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1222
- name: errorCode,
1223
- $metadata: deserializeMetadata(output),
1224
- };
1225
- break;
1015
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1226
1016
  default:
1227
1017
  const parsedBody = parsedOutput.body;
1228
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1229
- response = {
1230
- ...parsedBody,
1231
- name: `${errorCode}`,
1232
- message: parsedBody.message || parsedBody.Message || errorCode,
1018
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1019
+ name: parsedBody.code || parsedBody.Code || errorCode,
1233
1020
  $fault: "client",
1234
1021
  $metadata: deserializeMetadata(output),
1235
- };
1022
+ });
1023
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1236
1024
  }
1237
- const message = response.message || response.Message || errorCode;
1238
- response.message = message;
1239
- delete response.Message;
1240
- return Promise.reject(Object.assign(new Error(message), response));
1241
1025
  };
1242
1026
  const deserializeAws_json1_1CreateDirectoryConfigCommand = async (output, context) => {
1243
1027
  if (output.statusCode >= 300) {
@@ -1264,67 +1048,31 @@ const deserializeAws_json1_1CreateDirectoryConfigCommandError = async (output, c
1264
1048
  switch (errorCode) {
1265
1049
  case "InvalidAccountStatusException":
1266
1050
  case "com.amazonaws.appstream#InvalidAccountStatusException":
1267
- response = {
1268
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
1269
- name: errorCode,
1270
- $metadata: deserializeMetadata(output),
1271
- };
1272
- break;
1051
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
1273
1052
  case "InvalidRoleException":
1274
1053
  case "com.amazonaws.appstream#InvalidRoleException":
1275
- response = {
1276
- ...(await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context)),
1277
- name: errorCode,
1278
- $metadata: deserializeMetadata(output),
1279
- };
1280
- break;
1054
+ throw await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context);
1281
1055
  case "LimitExceededException":
1282
1056
  case "com.amazonaws.appstream#LimitExceededException":
1283
- response = {
1284
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1285
- name: errorCode,
1286
- $metadata: deserializeMetadata(output),
1287
- };
1288
- break;
1057
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1289
1058
  case "OperationNotPermittedException":
1290
1059
  case "com.amazonaws.appstream#OperationNotPermittedException":
1291
- response = {
1292
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1293
- name: errorCode,
1294
- $metadata: deserializeMetadata(output),
1295
- };
1296
- break;
1060
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1297
1061
  case "ResourceAlreadyExistsException":
1298
1062
  case "com.amazonaws.appstream#ResourceAlreadyExistsException":
1299
- response = {
1300
- ...(await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1301
- name: errorCode,
1302
- $metadata: deserializeMetadata(output),
1303
- };
1304
- break;
1063
+ throw await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1305
1064
  case "ResourceNotFoundException":
1306
1065
  case "com.amazonaws.appstream#ResourceNotFoundException":
1307
- response = {
1308
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1309
- name: errorCode,
1310
- $metadata: deserializeMetadata(output),
1311
- };
1312
- break;
1066
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1313
1067
  default:
1314
1068
  const parsedBody = parsedOutput.body;
1315
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1316
- response = {
1317
- ...parsedBody,
1318
- name: `${errorCode}`,
1319
- message: parsedBody.message || parsedBody.Message || errorCode,
1069
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1070
+ name: parsedBody.code || parsedBody.Code || errorCode,
1320
1071
  $fault: "client",
1321
1072
  $metadata: deserializeMetadata(output),
1322
- };
1073
+ });
1074
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1323
1075
  }
1324
- const message = response.message || response.Message || errorCode;
1325
- response.message = message;
1326
- delete response.Message;
1327
- return Promise.reject(Object.assign(new Error(message), response));
1328
1076
  };
1329
1077
  const deserializeAws_json1_1CreateEntitlementCommand = async (output, context) => {
1330
1078
  if (output.statusCode >= 300) {
@@ -1351,51 +1099,25 @@ const deserializeAws_json1_1CreateEntitlementCommandError = async (output, conte
1351
1099
  switch (errorCode) {
1352
1100
  case "EntitlementAlreadyExistsException":
1353
1101
  case "com.amazonaws.appstream#EntitlementAlreadyExistsException":
1354
- response = {
1355
- ...(await deserializeAws_json1_1EntitlementAlreadyExistsExceptionResponse(parsedOutput, context)),
1356
- name: errorCode,
1357
- $metadata: deserializeMetadata(output),
1358
- };
1359
- break;
1102
+ throw await deserializeAws_json1_1EntitlementAlreadyExistsExceptionResponse(parsedOutput, context);
1360
1103
  case "LimitExceededException":
1361
1104
  case "com.amazonaws.appstream#LimitExceededException":
1362
- response = {
1363
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1364
- name: errorCode,
1365
- $metadata: deserializeMetadata(output),
1366
- };
1367
- break;
1105
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1368
1106
  case "OperationNotPermittedException":
1369
1107
  case "com.amazonaws.appstream#OperationNotPermittedException":
1370
- response = {
1371
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1372
- name: errorCode,
1373
- $metadata: deserializeMetadata(output),
1374
- };
1375
- break;
1108
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1376
1109
  case "ResourceNotFoundException":
1377
1110
  case "com.amazonaws.appstream#ResourceNotFoundException":
1378
- response = {
1379
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1380
- name: errorCode,
1381
- $metadata: deserializeMetadata(output),
1382
- };
1383
- break;
1111
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1384
1112
  default:
1385
1113
  const parsedBody = parsedOutput.body;
1386
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1387
- response = {
1388
- ...parsedBody,
1389
- name: `${errorCode}`,
1390
- message: parsedBody.message || parsedBody.Message || errorCode,
1114
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1115
+ name: parsedBody.code || parsedBody.Code || errorCode,
1391
1116
  $fault: "client",
1392
1117
  $metadata: deserializeMetadata(output),
1393
- };
1118
+ });
1119
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1394
1120
  }
1395
- const message = response.message || response.Message || errorCode;
1396
- response.message = message;
1397
- delete response.Message;
1398
- return Promise.reject(Object.assign(new Error(message), response));
1399
1121
  };
1400
1122
  const deserializeAws_json1_1CreateFleetCommand = async (output, context) => {
1401
1123
  if (output.statusCode >= 300) {
@@ -1422,107 +1144,46 @@ const deserializeAws_json1_1CreateFleetCommandError = async (output, context) =>
1422
1144
  switch (errorCode) {
1423
1145
  case "ConcurrentModificationException":
1424
1146
  case "com.amazonaws.appstream#ConcurrentModificationException":
1425
- response = {
1426
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1427
- name: errorCode,
1428
- $metadata: deserializeMetadata(output),
1429
- };
1430
- break;
1147
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
1431
1148
  case "IncompatibleImageException":
1432
1149
  case "com.amazonaws.appstream#IncompatibleImageException":
1433
- response = {
1434
- ...(await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context)),
1435
- name: errorCode,
1436
- $metadata: deserializeMetadata(output),
1437
- };
1438
- break;
1150
+ throw await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context);
1439
1151
  case "InvalidAccountStatusException":
1440
1152
  case "com.amazonaws.appstream#InvalidAccountStatusException":
1441
- response = {
1442
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
1443
- name: errorCode,
1444
- $metadata: deserializeMetadata(output),
1445
- };
1446
- break;
1153
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
1447
1154
  case "InvalidParameterCombinationException":
1448
1155
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
1449
- response = {
1450
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
1451
- name: errorCode,
1452
- $metadata: deserializeMetadata(output),
1453
- };
1454
- break;
1156
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
1455
1157
  case "InvalidRoleException":
1456
1158
  case "com.amazonaws.appstream#InvalidRoleException":
1457
- response = {
1458
- ...(await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context)),
1459
- name: errorCode,
1460
- $metadata: deserializeMetadata(output),
1461
- };
1462
- break;
1159
+ throw await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context);
1463
1160
  case "LimitExceededException":
1464
1161
  case "com.amazonaws.appstream#LimitExceededException":
1465
- response = {
1466
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1467
- name: errorCode,
1468
- $metadata: deserializeMetadata(output),
1469
- };
1470
- break;
1162
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1471
1163
  case "OperationNotPermittedException":
1472
1164
  case "com.amazonaws.appstream#OperationNotPermittedException":
1473
- response = {
1474
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1475
- name: errorCode,
1476
- $metadata: deserializeMetadata(output),
1477
- };
1478
- break;
1165
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1479
1166
  case "RequestLimitExceededException":
1480
1167
  case "com.amazonaws.appstream#RequestLimitExceededException":
1481
- response = {
1482
- ...(await deserializeAws_json1_1RequestLimitExceededExceptionResponse(parsedOutput, context)),
1483
- name: errorCode,
1484
- $metadata: deserializeMetadata(output),
1485
- };
1486
- break;
1168
+ throw await deserializeAws_json1_1RequestLimitExceededExceptionResponse(parsedOutput, context);
1487
1169
  case "ResourceAlreadyExistsException":
1488
1170
  case "com.amazonaws.appstream#ResourceAlreadyExistsException":
1489
- response = {
1490
- ...(await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1491
- name: errorCode,
1492
- $metadata: deserializeMetadata(output),
1493
- };
1494
- break;
1171
+ throw await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1495
1172
  case "ResourceNotAvailableException":
1496
1173
  case "com.amazonaws.appstream#ResourceNotAvailableException":
1497
- response = {
1498
- ...(await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context)),
1499
- name: errorCode,
1500
- $metadata: deserializeMetadata(output),
1501
- };
1502
- break;
1174
+ throw await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context);
1503
1175
  case "ResourceNotFoundException":
1504
1176
  case "com.amazonaws.appstream#ResourceNotFoundException":
1505
- response = {
1506
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1507
- name: errorCode,
1508
- $metadata: deserializeMetadata(output),
1509
- };
1510
- break;
1177
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1511
1178
  default:
1512
1179
  const parsedBody = parsedOutput.body;
1513
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1514
- response = {
1515
- ...parsedBody,
1516
- name: `${errorCode}`,
1517
- message: parsedBody.message || parsedBody.Message || errorCode,
1180
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1181
+ name: parsedBody.code || parsedBody.Code || errorCode,
1518
1182
  $fault: "client",
1519
1183
  $metadata: deserializeMetadata(output),
1520
- };
1184
+ });
1185
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1521
1186
  }
1522
- const message = response.message || response.Message || errorCode;
1523
- response.message = message;
1524
- delete response.Message;
1525
- return Promise.reject(Object.assign(new Error(message), response));
1526
1187
  };
1527
1188
  const deserializeAws_json1_1CreateImageBuilderCommand = async (output, context) => {
1528
1189
  if (output.statusCode >= 300) {
@@ -1549,107 +1210,46 @@ const deserializeAws_json1_1CreateImageBuilderCommandError = async (output, cont
1549
1210
  switch (errorCode) {
1550
1211
  case "ConcurrentModificationException":
1551
1212
  case "com.amazonaws.appstream#ConcurrentModificationException":
1552
- response = {
1553
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1554
- name: errorCode,
1555
- $metadata: deserializeMetadata(output),
1556
- };
1557
- break;
1213
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
1558
1214
  case "IncompatibleImageException":
1559
1215
  case "com.amazonaws.appstream#IncompatibleImageException":
1560
- response = {
1561
- ...(await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context)),
1562
- name: errorCode,
1563
- $metadata: deserializeMetadata(output),
1564
- };
1565
- break;
1216
+ throw await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context);
1566
1217
  case "InvalidAccountStatusException":
1567
1218
  case "com.amazonaws.appstream#InvalidAccountStatusException":
1568
- response = {
1569
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
1570
- name: errorCode,
1571
- $metadata: deserializeMetadata(output),
1572
- };
1573
- break;
1219
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
1574
1220
  case "InvalidParameterCombinationException":
1575
1221
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
1576
- response = {
1577
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
1578
- name: errorCode,
1579
- $metadata: deserializeMetadata(output),
1580
- };
1581
- break;
1222
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
1582
1223
  case "InvalidRoleException":
1583
1224
  case "com.amazonaws.appstream#InvalidRoleException":
1584
- response = {
1585
- ...(await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context)),
1586
- name: errorCode,
1587
- $metadata: deserializeMetadata(output),
1588
- };
1589
- break;
1225
+ throw await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context);
1590
1226
  case "LimitExceededException":
1591
1227
  case "com.amazonaws.appstream#LimitExceededException":
1592
- response = {
1593
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1594
- name: errorCode,
1595
- $metadata: deserializeMetadata(output),
1596
- };
1597
- break;
1228
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1598
1229
  case "OperationNotPermittedException":
1599
1230
  case "com.amazonaws.appstream#OperationNotPermittedException":
1600
- response = {
1601
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1602
- name: errorCode,
1603
- $metadata: deserializeMetadata(output),
1604
- };
1605
- break;
1231
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1606
1232
  case "RequestLimitExceededException":
1607
1233
  case "com.amazonaws.appstream#RequestLimitExceededException":
1608
- response = {
1609
- ...(await deserializeAws_json1_1RequestLimitExceededExceptionResponse(parsedOutput, context)),
1610
- name: errorCode,
1611
- $metadata: deserializeMetadata(output),
1612
- };
1613
- break;
1234
+ throw await deserializeAws_json1_1RequestLimitExceededExceptionResponse(parsedOutput, context);
1614
1235
  case "ResourceAlreadyExistsException":
1615
1236
  case "com.amazonaws.appstream#ResourceAlreadyExistsException":
1616
- response = {
1617
- ...(await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1618
- name: errorCode,
1619
- $metadata: deserializeMetadata(output),
1620
- };
1621
- break;
1237
+ throw await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1622
1238
  case "ResourceNotAvailableException":
1623
1239
  case "com.amazonaws.appstream#ResourceNotAvailableException":
1624
- response = {
1625
- ...(await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context)),
1626
- name: errorCode,
1627
- $metadata: deserializeMetadata(output),
1628
- };
1629
- break;
1240
+ throw await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context);
1630
1241
  case "ResourceNotFoundException":
1631
1242
  case "com.amazonaws.appstream#ResourceNotFoundException":
1632
- response = {
1633
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1634
- name: errorCode,
1635
- $metadata: deserializeMetadata(output),
1636
- };
1637
- break;
1243
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1638
1244
  default:
1639
1245
  const parsedBody = parsedOutput.body;
1640
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1641
- response = {
1642
- ...parsedBody,
1643
- name: `${errorCode}`,
1644
- message: parsedBody.message || parsedBody.Message || errorCode,
1246
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1247
+ name: parsedBody.code || parsedBody.Code || errorCode,
1645
1248
  $fault: "client",
1646
1249
  $metadata: deserializeMetadata(output),
1647
- };
1250
+ });
1251
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1648
1252
  }
1649
- const message = response.message || response.Message || errorCode;
1650
- response.message = message;
1651
- delete response.Message;
1652
- return Promise.reject(Object.assign(new Error(message), response));
1653
1253
  };
1654
1254
  const deserializeAws_json1_1CreateImageBuilderStreamingURLCommand = async (output, context) => {
1655
1255
  if (output.statusCode >= 300) {
@@ -1676,35 +1276,19 @@ const deserializeAws_json1_1CreateImageBuilderStreamingURLCommandError = async (
1676
1276
  switch (errorCode) {
1677
1277
  case "OperationNotPermittedException":
1678
1278
  case "com.amazonaws.appstream#OperationNotPermittedException":
1679
- response = {
1680
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1681
- name: errorCode,
1682
- $metadata: deserializeMetadata(output),
1683
- };
1684
- break;
1279
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1685
1280
  case "ResourceNotFoundException":
1686
1281
  case "com.amazonaws.appstream#ResourceNotFoundException":
1687
- response = {
1688
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1689
- name: errorCode,
1690
- $metadata: deserializeMetadata(output),
1691
- };
1692
- break;
1282
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1693
1283
  default:
1694
1284
  const parsedBody = parsedOutput.body;
1695
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1696
- response = {
1697
- ...parsedBody,
1698
- name: `${errorCode}`,
1699
- message: parsedBody.message || parsedBody.Message || errorCode,
1285
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1286
+ name: parsedBody.code || parsedBody.Code || errorCode,
1700
1287
  $fault: "client",
1701
1288
  $metadata: deserializeMetadata(output),
1702
- };
1289
+ });
1290
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1703
1291
  }
1704
- const message = response.message || response.Message || errorCode;
1705
- response.message = message;
1706
- delete response.Message;
1707
- return Promise.reject(Object.assign(new Error(message), response));
1708
1292
  };
1709
1293
  const deserializeAws_json1_1CreateStackCommand = async (output, context) => {
1710
1294
  if (output.statusCode >= 300) {
@@ -1731,75 +1315,34 @@ const deserializeAws_json1_1CreateStackCommandError = async (output, context) =>
1731
1315
  switch (errorCode) {
1732
1316
  case "ConcurrentModificationException":
1733
1317
  case "com.amazonaws.appstream#ConcurrentModificationException":
1734
- response = {
1735
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1736
- name: errorCode,
1737
- $metadata: deserializeMetadata(output),
1738
- };
1739
- break;
1318
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
1740
1319
  case "InvalidAccountStatusException":
1741
1320
  case "com.amazonaws.appstream#InvalidAccountStatusException":
1742
- response = {
1743
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
1744
- name: errorCode,
1745
- $metadata: deserializeMetadata(output),
1746
- };
1747
- break;
1321
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
1748
1322
  case "InvalidParameterCombinationException":
1749
1323
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
1750
- response = {
1751
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
1752
- name: errorCode,
1753
- $metadata: deserializeMetadata(output),
1754
- };
1755
- break;
1324
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
1756
1325
  case "InvalidRoleException":
1757
1326
  case "com.amazonaws.appstream#InvalidRoleException":
1758
- response = {
1759
- ...(await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context)),
1760
- name: errorCode,
1761
- $metadata: deserializeMetadata(output),
1762
- };
1763
- break;
1327
+ throw await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context);
1764
1328
  case "LimitExceededException":
1765
1329
  case "com.amazonaws.appstream#LimitExceededException":
1766
- response = {
1767
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1768
- name: errorCode,
1769
- $metadata: deserializeMetadata(output),
1770
- };
1771
- break;
1330
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1772
1331
  case "ResourceAlreadyExistsException":
1773
1332
  case "com.amazonaws.appstream#ResourceAlreadyExistsException":
1774
- response = {
1775
- ...(await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1776
- name: errorCode,
1777
- $metadata: deserializeMetadata(output),
1778
- };
1779
- break;
1333
+ throw await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1780
1334
  case "ResourceNotFoundException":
1781
1335
  case "com.amazonaws.appstream#ResourceNotFoundException":
1782
- response = {
1783
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1784
- name: errorCode,
1785
- $metadata: deserializeMetadata(output),
1786
- };
1787
- break;
1336
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1788
1337
  default:
1789
1338
  const parsedBody = parsedOutput.body;
1790
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1791
- response = {
1792
- ...parsedBody,
1793
- name: `${errorCode}`,
1794
- message: parsedBody.message || parsedBody.Message || errorCode,
1339
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1340
+ name: parsedBody.code || parsedBody.Code || errorCode,
1795
1341
  $fault: "client",
1796
1342
  $metadata: deserializeMetadata(output),
1797
- };
1343
+ });
1344
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1798
1345
  }
1799
- const message = response.message || response.Message || errorCode;
1800
- response.message = message;
1801
- delete response.Message;
1802
- return Promise.reject(Object.assign(new Error(message), response));
1803
1346
  };
1804
1347
  const deserializeAws_json1_1CreateStreamingURLCommand = async (output, context) => {
1805
1348
  if (output.statusCode >= 300) {
@@ -1826,51 +1369,25 @@ const deserializeAws_json1_1CreateStreamingURLCommandError = async (output, cont
1826
1369
  switch (errorCode) {
1827
1370
  case "InvalidParameterCombinationException":
1828
1371
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
1829
- response = {
1830
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
1831
- name: errorCode,
1832
- $metadata: deserializeMetadata(output),
1833
- };
1834
- break;
1372
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
1835
1373
  case "OperationNotPermittedException":
1836
1374
  case "com.amazonaws.appstream#OperationNotPermittedException":
1837
- response = {
1838
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1839
- name: errorCode,
1840
- $metadata: deserializeMetadata(output),
1841
- };
1842
- break;
1375
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1843
1376
  case "ResourceNotAvailableException":
1844
1377
  case "com.amazonaws.appstream#ResourceNotAvailableException":
1845
- response = {
1846
- ...(await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context)),
1847
- name: errorCode,
1848
- $metadata: deserializeMetadata(output),
1849
- };
1850
- break;
1378
+ throw await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context);
1851
1379
  case "ResourceNotFoundException":
1852
1380
  case "com.amazonaws.appstream#ResourceNotFoundException":
1853
- response = {
1854
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1855
- name: errorCode,
1856
- $metadata: deserializeMetadata(output),
1857
- };
1858
- break;
1381
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1859
1382
  default:
1860
1383
  const parsedBody = parsedOutput.body;
1861
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1862
- response = {
1863
- ...parsedBody,
1864
- name: `${errorCode}`,
1865
- message: parsedBody.message || parsedBody.Message || errorCode,
1384
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1385
+ name: parsedBody.code || parsedBody.Code || errorCode,
1866
1386
  $fault: "client",
1867
1387
  $metadata: deserializeMetadata(output),
1868
- };
1388
+ });
1389
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1869
1390
  }
1870
- const message = response.message || response.Message || errorCode;
1871
- response.message = message;
1872
- delete response.Message;
1873
- return Promise.reject(Object.assign(new Error(message), response));
1874
1391
  };
1875
1392
  const deserializeAws_json1_1CreateUpdatedImageCommand = async (output, context) => {
1876
1393
  if (output.statusCode >= 300) {
@@ -1897,75 +1414,34 @@ const deserializeAws_json1_1CreateUpdatedImageCommandError = async (output, cont
1897
1414
  switch (errorCode) {
1898
1415
  case "ConcurrentModificationException":
1899
1416
  case "com.amazonaws.appstream#ConcurrentModificationException":
1900
- response = {
1901
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1902
- name: errorCode,
1903
- $metadata: deserializeMetadata(output),
1904
- };
1905
- break;
1417
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
1906
1418
  case "IncompatibleImageException":
1907
1419
  case "com.amazonaws.appstream#IncompatibleImageException":
1908
- response = {
1909
- ...(await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context)),
1910
- name: errorCode,
1911
- $metadata: deserializeMetadata(output),
1912
- };
1913
- break;
1420
+ throw await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context);
1914
1421
  case "InvalidAccountStatusException":
1915
1422
  case "com.amazonaws.appstream#InvalidAccountStatusException":
1916
- response = {
1917
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
1918
- name: errorCode,
1919
- $metadata: deserializeMetadata(output),
1920
- };
1921
- break;
1423
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
1922
1424
  case "LimitExceededException":
1923
1425
  case "com.amazonaws.appstream#LimitExceededException":
1924
- response = {
1925
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1926
- name: errorCode,
1927
- $metadata: deserializeMetadata(output),
1928
- };
1929
- break;
1426
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1930
1427
  case "OperationNotPermittedException":
1931
1428
  case "com.amazonaws.appstream#OperationNotPermittedException":
1932
- response = {
1933
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
1934
- name: errorCode,
1935
- $metadata: deserializeMetadata(output),
1936
- };
1937
- break;
1429
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
1938
1430
  case "ResourceAlreadyExistsException":
1939
1431
  case "com.amazonaws.appstream#ResourceAlreadyExistsException":
1940
- response = {
1941
- ...(await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
1942
- name: errorCode,
1943
- $metadata: deserializeMetadata(output),
1944
- };
1945
- break;
1432
+ throw await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
1946
1433
  case "ResourceNotFoundException":
1947
1434
  case "com.amazonaws.appstream#ResourceNotFoundException":
1948
- response = {
1949
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1950
- name: errorCode,
1951
- $metadata: deserializeMetadata(output),
1952
- };
1953
- break;
1435
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1954
1436
  default:
1955
1437
  const parsedBody = parsedOutput.body;
1956
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1957
- response = {
1958
- ...parsedBody,
1959
- name: `${errorCode}`,
1960
- message: parsedBody.message || parsedBody.Message || errorCode,
1438
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1439
+ name: parsedBody.code || parsedBody.Code || errorCode,
1961
1440
  $fault: "client",
1962
1441
  $metadata: deserializeMetadata(output),
1963
- };
1442
+ });
1443
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1964
1444
  }
1965
- const message = response.message || response.Message || errorCode;
1966
- response.message = message;
1967
- delete response.Message;
1968
- return Promise.reject(Object.assign(new Error(message), response));
1969
1445
  };
1970
1446
  const deserializeAws_json1_1CreateUsageReportSubscriptionCommand = async (output, context) => {
1971
1447
  if (output.statusCode >= 300) {
@@ -1992,43 +1468,22 @@ const deserializeAws_json1_1CreateUsageReportSubscriptionCommandError = async (o
1992
1468
  switch (errorCode) {
1993
1469
  case "InvalidAccountStatusException":
1994
1470
  case "com.amazonaws.appstream#InvalidAccountStatusException":
1995
- response = {
1996
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
1997
- name: errorCode,
1998
- $metadata: deserializeMetadata(output),
1999
- };
2000
- break;
1471
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
2001
1472
  case "InvalidRoleException":
2002
1473
  case "com.amazonaws.appstream#InvalidRoleException":
2003
- response = {
2004
- ...(await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context)),
2005
- name: errorCode,
2006
- $metadata: deserializeMetadata(output),
2007
- };
2008
- break;
1474
+ throw await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context);
2009
1475
  case "LimitExceededException":
2010
1476
  case "com.amazonaws.appstream#LimitExceededException":
2011
- response = {
2012
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2013
- name: errorCode,
2014
- $metadata: deserializeMetadata(output),
2015
- };
2016
- break;
1477
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2017
1478
  default:
2018
1479
  const parsedBody = parsedOutput.body;
2019
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2020
- response = {
2021
- ...parsedBody,
2022
- name: `${errorCode}`,
2023
- message: parsedBody.message || parsedBody.Message || errorCode,
1480
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1481
+ name: parsedBody.code || parsedBody.Code || errorCode,
2024
1482
  $fault: "client",
2025
1483
  $metadata: deserializeMetadata(output),
2026
- };
1484
+ });
1485
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2027
1486
  }
2028
- const message = response.message || response.Message || errorCode;
2029
- response.message = message;
2030
- delete response.Message;
2031
- return Promise.reject(Object.assign(new Error(message), response));
2032
1487
  };
2033
1488
  const deserializeAws_json1_1CreateUserCommand = async (output, context) => {
2034
1489
  if (output.statusCode >= 300) {
@@ -2055,59 +1510,28 @@ const deserializeAws_json1_1CreateUserCommandError = async (output, context) =>
2055
1510
  switch (errorCode) {
2056
1511
  case "InvalidAccountStatusException":
2057
1512
  case "com.amazonaws.appstream#InvalidAccountStatusException":
2058
- response = {
2059
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
2060
- name: errorCode,
2061
- $metadata: deserializeMetadata(output),
2062
- };
2063
- break;
1513
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
2064
1514
  case "InvalidParameterCombinationException":
2065
1515
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
2066
- response = {
2067
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
2068
- name: errorCode,
2069
- $metadata: deserializeMetadata(output),
2070
- };
2071
- break;
1516
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
2072
1517
  case "LimitExceededException":
2073
1518
  case "com.amazonaws.appstream#LimitExceededException":
2074
- response = {
2075
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2076
- name: errorCode,
2077
- $metadata: deserializeMetadata(output),
2078
- };
2079
- break;
1519
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2080
1520
  case "OperationNotPermittedException":
2081
1521
  case "com.amazonaws.appstream#OperationNotPermittedException":
2082
- response = {
2083
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2084
- name: errorCode,
2085
- $metadata: deserializeMetadata(output),
2086
- };
2087
- break;
1522
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
2088
1523
  case "ResourceAlreadyExistsException":
2089
1524
  case "com.amazonaws.appstream#ResourceAlreadyExistsException":
2090
- response = {
2091
- ...(await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context)),
2092
- name: errorCode,
2093
- $metadata: deserializeMetadata(output),
2094
- };
2095
- break;
1525
+ throw await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse(parsedOutput, context);
2096
1526
  default:
2097
1527
  const parsedBody = parsedOutput.body;
2098
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2099
- response = {
2100
- ...parsedBody,
2101
- name: `${errorCode}`,
2102
- message: parsedBody.message || parsedBody.Message || errorCode,
1528
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1529
+ name: parsedBody.code || parsedBody.Code || errorCode,
2103
1530
  $fault: "client",
2104
1531
  $metadata: deserializeMetadata(output),
2105
- };
1532
+ });
1533
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2106
1534
  }
2107
- const message = response.message || response.Message || errorCode;
2108
- response.message = message;
2109
- delete response.Message;
2110
- return Promise.reject(Object.assign(new Error(message), response));
2111
1535
  };
2112
1536
  const deserializeAws_json1_1DeleteAppBlockCommand = async (output, context) => {
2113
1537
  if (output.statusCode >= 300) {
@@ -2134,43 +1558,22 @@ const deserializeAws_json1_1DeleteAppBlockCommandError = async (output, context)
2134
1558
  switch (errorCode) {
2135
1559
  case "ConcurrentModificationException":
2136
1560
  case "com.amazonaws.appstream#ConcurrentModificationException":
2137
- response = {
2138
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2139
- name: errorCode,
2140
- $metadata: deserializeMetadata(output),
2141
- };
2142
- break;
1561
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
2143
1562
  case "ResourceInUseException":
2144
1563
  case "com.amazonaws.appstream#ResourceInUseException":
2145
- response = {
2146
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2147
- name: errorCode,
2148
- $metadata: deserializeMetadata(output),
2149
- };
2150
- break;
1564
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2151
1565
  case "ResourceNotFoundException":
2152
1566
  case "com.amazonaws.appstream#ResourceNotFoundException":
2153
- response = {
2154
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2155
- name: errorCode,
2156
- $metadata: deserializeMetadata(output),
2157
- };
2158
- break;
1567
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2159
1568
  default:
2160
1569
  const parsedBody = parsedOutput.body;
2161
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2162
- response = {
2163
- ...parsedBody,
2164
- name: `${errorCode}`,
2165
- message: parsedBody.message || parsedBody.Message || errorCode,
1570
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1571
+ name: parsedBody.code || parsedBody.Code || errorCode,
2166
1572
  $fault: "client",
2167
1573
  $metadata: deserializeMetadata(output),
2168
- };
1574
+ });
1575
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2169
1576
  }
2170
- const message = response.message || response.Message || errorCode;
2171
- response.message = message;
2172
- delete response.Message;
2173
- return Promise.reject(Object.assign(new Error(message), response));
2174
1577
  };
2175
1578
  const deserializeAws_json1_1DeleteApplicationCommand = async (output, context) => {
2176
1579
  if (output.statusCode >= 300) {
@@ -2197,51 +1600,25 @@ const deserializeAws_json1_1DeleteApplicationCommandError = async (output, conte
2197
1600
  switch (errorCode) {
2198
1601
  case "ConcurrentModificationException":
2199
1602
  case "com.amazonaws.appstream#ConcurrentModificationException":
2200
- response = {
2201
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2202
- name: errorCode,
2203
- $metadata: deserializeMetadata(output),
2204
- };
2205
- break;
1603
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
2206
1604
  case "OperationNotPermittedException":
2207
1605
  case "com.amazonaws.appstream#OperationNotPermittedException":
2208
- response = {
2209
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2210
- name: errorCode,
2211
- $metadata: deserializeMetadata(output),
2212
- };
2213
- break;
1606
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
2214
1607
  case "ResourceInUseException":
2215
1608
  case "com.amazonaws.appstream#ResourceInUseException":
2216
- response = {
2217
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2218
- name: errorCode,
2219
- $metadata: deserializeMetadata(output),
2220
- };
2221
- break;
1609
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2222
1610
  case "ResourceNotFoundException":
2223
1611
  case "com.amazonaws.appstream#ResourceNotFoundException":
2224
- response = {
2225
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2226
- name: errorCode,
2227
- $metadata: deserializeMetadata(output),
2228
- };
2229
- break;
1612
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2230
1613
  default:
2231
1614
  const parsedBody = parsedOutput.body;
2232
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2233
- response = {
2234
- ...parsedBody,
2235
- name: `${errorCode}`,
2236
- message: parsedBody.message || parsedBody.Message || errorCode,
1615
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1616
+ name: parsedBody.code || parsedBody.Code || errorCode,
2237
1617
  $fault: "client",
2238
1618
  $metadata: deserializeMetadata(output),
2239
- };
1619
+ });
1620
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2240
1621
  }
2241
- const message = response.message || response.Message || errorCode;
2242
- response.message = message;
2243
- delete response.Message;
2244
- return Promise.reject(Object.assign(new Error(message), response));
2245
1622
  };
2246
1623
  const deserializeAws_json1_1DeleteDirectoryConfigCommand = async (output, context) => {
2247
1624
  if (output.statusCode >= 300) {
@@ -2268,35 +1645,19 @@ const deserializeAws_json1_1DeleteDirectoryConfigCommandError = async (output, c
2268
1645
  switch (errorCode) {
2269
1646
  case "ResourceInUseException":
2270
1647
  case "com.amazonaws.appstream#ResourceInUseException":
2271
- response = {
2272
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2273
- name: errorCode,
2274
- $metadata: deserializeMetadata(output),
2275
- };
2276
- break;
1648
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2277
1649
  case "ResourceNotFoundException":
2278
1650
  case "com.amazonaws.appstream#ResourceNotFoundException":
2279
- response = {
2280
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2281
- name: errorCode,
2282
- $metadata: deserializeMetadata(output),
2283
- };
2284
- break;
1651
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2285
1652
  default:
2286
1653
  const parsedBody = parsedOutput.body;
2287
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2288
- response = {
2289
- ...parsedBody,
2290
- name: `${errorCode}`,
2291
- message: parsedBody.message || parsedBody.Message || errorCode,
1654
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1655
+ name: parsedBody.code || parsedBody.Code || errorCode,
2292
1656
  $fault: "client",
2293
1657
  $metadata: deserializeMetadata(output),
2294
- };
1658
+ });
1659
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2295
1660
  }
2296
- const message = response.message || response.Message || errorCode;
2297
- response.message = message;
2298
- delete response.Message;
2299
- return Promise.reject(Object.assign(new Error(message), response));
2300
1661
  };
2301
1662
  const deserializeAws_json1_1DeleteEntitlementCommand = async (output, context) => {
2302
1663
  if (output.statusCode >= 300) {
@@ -2323,51 +1684,25 @@ const deserializeAws_json1_1DeleteEntitlementCommandError = async (output, conte
2323
1684
  switch (errorCode) {
2324
1685
  case "ConcurrentModificationException":
2325
1686
  case "com.amazonaws.appstream#ConcurrentModificationException":
2326
- response = {
2327
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2328
- name: errorCode,
2329
- $metadata: deserializeMetadata(output),
2330
- };
2331
- break;
1687
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
2332
1688
  case "EntitlementNotFoundException":
2333
1689
  case "com.amazonaws.appstream#EntitlementNotFoundException":
2334
- response = {
2335
- ...(await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context)),
2336
- name: errorCode,
2337
- $metadata: deserializeMetadata(output),
2338
- };
2339
- break;
1690
+ throw await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context);
2340
1691
  case "OperationNotPermittedException":
2341
1692
  case "com.amazonaws.appstream#OperationNotPermittedException":
2342
- response = {
2343
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2344
- name: errorCode,
2345
- $metadata: deserializeMetadata(output),
2346
- };
2347
- break;
1693
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
2348
1694
  case "ResourceNotFoundException":
2349
1695
  case "com.amazonaws.appstream#ResourceNotFoundException":
2350
- response = {
2351
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2352
- name: errorCode,
2353
- $metadata: deserializeMetadata(output),
2354
- };
2355
- break;
1696
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2356
1697
  default:
2357
1698
  const parsedBody = parsedOutput.body;
2358
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2359
- response = {
2360
- ...parsedBody,
2361
- name: `${errorCode}`,
2362
- message: parsedBody.message || parsedBody.Message || errorCode,
1699
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1700
+ name: parsedBody.code || parsedBody.Code || errorCode,
2363
1701
  $fault: "client",
2364
1702
  $metadata: deserializeMetadata(output),
2365
- };
1703
+ });
1704
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2366
1705
  }
2367
- const message = response.message || response.Message || errorCode;
2368
- response.message = message;
2369
- delete response.Message;
2370
- return Promise.reject(Object.assign(new Error(message), response));
2371
1706
  };
2372
1707
  const deserializeAws_json1_1DeleteFleetCommand = async (output, context) => {
2373
1708
  if (output.statusCode >= 300) {
@@ -2394,43 +1729,22 @@ const deserializeAws_json1_1DeleteFleetCommandError = async (output, context) =>
2394
1729
  switch (errorCode) {
2395
1730
  case "ConcurrentModificationException":
2396
1731
  case "com.amazonaws.appstream#ConcurrentModificationException":
2397
- response = {
2398
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2399
- name: errorCode,
2400
- $metadata: deserializeMetadata(output),
2401
- };
2402
- break;
1732
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
2403
1733
  case "ResourceInUseException":
2404
1734
  case "com.amazonaws.appstream#ResourceInUseException":
2405
- response = {
2406
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2407
- name: errorCode,
2408
- $metadata: deserializeMetadata(output),
2409
- };
2410
- break;
1735
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2411
1736
  case "ResourceNotFoundException":
2412
1737
  case "com.amazonaws.appstream#ResourceNotFoundException":
2413
- response = {
2414
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2415
- name: errorCode,
2416
- $metadata: deserializeMetadata(output),
2417
- };
2418
- break;
1738
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2419
1739
  default:
2420
1740
  const parsedBody = parsedOutput.body;
2421
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2422
- response = {
2423
- ...parsedBody,
2424
- name: `${errorCode}`,
2425
- message: parsedBody.message || parsedBody.Message || errorCode,
1741
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1742
+ name: parsedBody.code || parsedBody.Code || errorCode,
2426
1743
  $fault: "client",
2427
1744
  $metadata: deserializeMetadata(output),
2428
- };
1745
+ });
1746
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2429
1747
  }
2430
- const message = response.message || response.Message || errorCode;
2431
- response.message = message;
2432
- delete response.Message;
2433
- return Promise.reject(Object.assign(new Error(message), response));
2434
1748
  };
2435
1749
  const deserializeAws_json1_1DeleteImageCommand = async (output, context) => {
2436
1750
  if (output.statusCode >= 300) {
@@ -2457,51 +1771,25 @@ const deserializeAws_json1_1DeleteImageCommandError = async (output, context) =>
2457
1771
  switch (errorCode) {
2458
1772
  case "ConcurrentModificationException":
2459
1773
  case "com.amazonaws.appstream#ConcurrentModificationException":
2460
- response = {
2461
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2462
- name: errorCode,
2463
- $metadata: deserializeMetadata(output),
2464
- };
2465
- break;
1774
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
2466
1775
  case "OperationNotPermittedException":
2467
1776
  case "com.amazonaws.appstream#OperationNotPermittedException":
2468
- response = {
2469
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2470
- name: errorCode,
2471
- $metadata: deserializeMetadata(output),
2472
- };
2473
- break;
1777
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
2474
1778
  case "ResourceInUseException":
2475
1779
  case "com.amazonaws.appstream#ResourceInUseException":
2476
- response = {
2477
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2478
- name: errorCode,
2479
- $metadata: deserializeMetadata(output),
2480
- };
2481
- break;
1780
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2482
1781
  case "ResourceNotFoundException":
2483
1782
  case "com.amazonaws.appstream#ResourceNotFoundException":
2484
- response = {
2485
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2486
- name: errorCode,
2487
- $metadata: deserializeMetadata(output),
2488
- };
2489
- break;
1783
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2490
1784
  default:
2491
1785
  const parsedBody = parsedOutput.body;
2492
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2493
- response = {
2494
- ...parsedBody,
2495
- name: `${errorCode}`,
2496
- message: parsedBody.message || parsedBody.Message || errorCode,
1786
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1787
+ name: parsedBody.code || parsedBody.Code || errorCode,
2497
1788
  $fault: "client",
2498
1789
  $metadata: deserializeMetadata(output),
2499
- };
1790
+ });
1791
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2500
1792
  }
2501
- const message = response.message || response.Message || errorCode;
2502
- response.message = message;
2503
- delete response.Message;
2504
- return Promise.reject(Object.assign(new Error(message), response));
2505
1793
  };
2506
1794
  const deserializeAws_json1_1DeleteImageBuilderCommand = async (output, context) => {
2507
1795
  if (output.statusCode >= 300) {
@@ -2528,43 +1816,22 @@ const deserializeAws_json1_1DeleteImageBuilderCommandError = async (output, cont
2528
1816
  switch (errorCode) {
2529
1817
  case "ConcurrentModificationException":
2530
1818
  case "com.amazonaws.appstream#ConcurrentModificationException":
2531
- response = {
2532
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2533
- name: errorCode,
2534
- $metadata: deserializeMetadata(output),
2535
- };
2536
- break;
1819
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
2537
1820
  case "OperationNotPermittedException":
2538
1821
  case "com.amazonaws.appstream#OperationNotPermittedException":
2539
- response = {
2540
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2541
- name: errorCode,
2542
- $metadata: deserializeMetadata(output),
2543
- };
2544
- break;
1822
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
2545
1823
  case "ResourceNotFoundException":
2546
1824
  case "com.amazonaws.appstream#ResourceNotFoundException":
2547
- response = {
2548
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2549
- name: errorCode,
2550
- $metadata: deserializeMetadata(output),
2551
- };
2552
- break;
1825
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2553
1826
  default:
2554
1827
  const parsedBody = parsedOutput.body;
2555
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2556
- response = {
2557
- ...parsedBody,
2558
- name: `${errorCode}`,
2559
- message: parsedBody.message || parsedBody.Message || errorCode,
1828
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1829
+ name: parsedBody.code || parsedBody.Code || errorCode,
2560
1830
  $fault: "client",
2561
1831
  $metadata: deserializeMetadata(output),
2562
- };
1832
+ });
1833
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2563
1834
  }
2564
- const message = response.message || response.Message || errorCode;
2565
- response.message = message;
2566
- delete response.Message;
2567
- return Promise.reject(Object.assign(new Error(message), response));
2568
1835
  };
2569
1836
  const deserializeAws_json1_1DeleteImagePermissionsCommand = async (output, context) => {
2570
1837
  if (output.statusCode >= 300) {
@@ -2591,35 +1858,19 @@ const deserializeAws_json1_1DeleteImagePermissionsCommandError = async (output,
2591
1858
  switch (errorCode) {
2592
1859
  case "ResourceNotAvailableException":
2593
1860
  case "com.amazonaws.appstream#ResourceNotAvailableException":
2594
- response = {
2595
- ...(await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context)),
2596
- name: errorCode,
2597
- $metadata: deserializeMetadata(output),
2598
- };
2599
- break;
1861
+ throw await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context);
2600
1862
  case "ResourceNotFoundException":
2601
1863
  case "com.amazonaws.appstream#ResourceNotFoundException":
2602
- response = {
2603
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2604
- name: errorCode,
2605
- $metadata: deserializeMetadata(output),
2606
- };
2607
- break;
1864
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2608
1865
  default:
2609
1866
  const parsedBody = parsedOutput.body;
2610
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2611
- response = {
2612
- ...parsedBody,
2613
- name: `${errorCode}`,
2614
- message: parsedBody.message || parsedBody.Message || errorCode,
1867
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1868
+ name: parsedBody.code || parsedBody.Code || errorCode,
2615
1869
  $fault: "client",
2616
1870
  $metadata: deserializeMetadata(output),
2617
- };
1871
+ });
1872
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2618
1873
  }
2619
- const message = response.message || response.Message || errorCode;
2620
- response.message = message;
2621
- delete response.Message;
2622
- return Promise.reject(Object.assign(new Error(message), response));
2623
1874
  };
2624
1875
  const deserializeAws_json1_1DeleteStackCommand = async (output, context) => {
2625
1876
  if (output.statusCode >= 300) {
@@ -2646,51 +1897,25 @@ const deserializeAws_json1_1DeleteStackCommandError = async (output, context) =>
2646
1897
  switch (errorCode) {
2647
1898
  case "ConcurrentModificationException":
2648
1899
  case "com.amazonaws.appstream#ConcurrentModificationException":
2649
- response = {
2650
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2651
- name: errorCode,
2652
- $metadata: deserializeMetadata(output),
2653
- };
2654
- break;
1900
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
2655
1901
  case "OperationNotPermittedException":
2656
1902
  case "com.amazonaws.appstream#OperationNotPermittedException":
2657
- response = {
2658
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2659
- name: errorCode,
2660
- $metadata: deserializeMetadata(output),
2661
- };
2662
- break;
1903
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
2663
1904
  case "ResourceInUseException":
2664
1905
  case "com.amazonaws.appstream#ResourceInUseException":
2665
- response = {
2666
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2667
- name: errorCode,
2668
- $metadata: deserializeMetadata(output),
2669
- };
2670
- break;
1906
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2671
1907
  case "ResourceNotFoundException":
2672
1908
  case "com.amazonaws.appstream#ResourceNotFoundException":
2673
- response = {
2674
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2675
- name: errorCode,
2676
- $metadata: deserializeMetadata(output),
2677
- };
2678
- break;
1909
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2679
1910
  default:
2680
1911
  const parsedBody = parsedOutput.body;
2681
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2682
- response = {
2683
- ...parsedBody,
2684
- name: `${errorCode}`,
2685
- message: parsedBody.message || parsedBody.Message || errorCode,
1912
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1913
+ name: parsedBody.code || parsedBody.Code || errorCode,
2686
1914
  $fault: "client",
2687
1915
  $metadata: deserializeMetadata(output),
2688
- };
1916
+ });
1917
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2689
1918
  }
2690
- const message = response.message || response.Message || errorCode;
2691
- response.message = message;
2692
- delete response.Message;
2693
- return Promise.reject(Object.assign(new Error(message), response));
2694
1919
  };
2695
1920
  const deserializeAws_json1_1DeleteUsageReportSubscriptionCommand = async (output, context) => {
2696
1921
  if (output.statusCode >= 300) {
@@ -2717,35 +1942,19 @@ const deserializeAws_json1_1DeleteUsageReportSubscriptionCommandError = async (o
2717
1942
  switch (errorCode) {
2718
1943
  case "InvalidAccountStatusException":
2719
1944
  case "com.amazonaws.appstream#InvalidAccountStatusException":
2720
- response = {
2721
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
2722
- name: errorCode,
2723
- $metadata: deserializeMetadata(output),
2724
- };
2725
- break;
1945
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
2726
1946
  case "ResourceNotFoundException":
2727
1947
  case "com.amazonaws.appstream#ResourceNotFoundException":
2728
- response = {
2729
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2730
- name: errorCode,
2731
- $metadata: deserializeMetadata(output),
2732
- };
2733
- break;
1948
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2734
1949
  default:
2735
1950
  const parsedBody = parsedOutput.body;
2736
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2737
- response = {
2738
- ...parsedBody,
2739
- name: `${errorCode}`,
2740
- message: parsedBody.message || parsedBody.Message || errorCode,
1951
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1952
+ name: parsedBody.code || parsedBody.Code || errorCode,
2741
1953
  $fault: "client",
2742
1954
  $metadata: deserializeMetadata(output),
2743
- };
1955
+ });
1956
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2744
1957
  }
2745
- const message = response.message || response.Message || errorCode;
2746
- response.message = message;
2747
- delete response.Message;
2748
- return Promise.reject(Object.assign(new Error(message), response));
2749
1958
  };
2750
1959
  const deserializeAws_json1_1DeleteUserCommand = async (output, context) => {
2751
1960
  if (output.statusCode >= 300) {
@@ -2772,27 +1981,16 @@ const deserializeAws_json1_1DeleteUserCommandError = async (output, context) =>
2772
1981
  switch (errorCode) {
2773
1982
  case "ResourceNotFoundException":
2774
1983
  case "com.amazonaws.appstream#ResourceNotFoundException":
2775
- response = {
2776
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2777
- name: errorCode,
2778
- $metadata: deserializeMetadata(output),
2779
- };
2780
- break;
1984
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2781
1985
  default:
2782
1986
  const parsedBody = parsedOutput.body;
2783
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2784
- response = {
2785
- ...parsedBody,
2786
- name: `${errorCode}`,
2787
- message: parsedBody.message || parsedBody.Message || errorCode,
1987
+ response = new AppStreamServiceException_1.AppStreamServiceException({
1988
+ name: parsedBody.code || parsedBody.Code || errorCode,
2788
1989
  $fault: "client",
2789
1990
  $metadata: deserializeMetadata(output),
2790
- };
1991
+ });
1992
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2791
1993
  }
2792
- const message = response.message || response.Message || errorCode;
2793
- response.message = message;
2794
- delete response.Message;
2795
- return Promise.reject(Object.assign(new Error(message), response));
2796
1994
  };
2797
1995
  const deserializeAws_json1_1DescribeAppBlocksCommand = async (output, context) => {
2798
1996
  if (output.statusCode >= 300) {
@@ -2819,35 +2017,19 @@ const deserializeAws_json1_1DescribeAppBlocksCommandError = async (output, conte
2819
2017
  switch (errorCode) {
2820
2018
  case "OperationNotPermittedException":
2821
2019
  case "com.amazonaws.appstream#OperationNotPermittedException":
2822
- response = {
2823
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2824
- name: errorCode,
2825
- $metadata: deserializeMetadata(output),
2826
- };
2827
- break;
2020
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
2828
2021
  case "ResourceNotFoundException":
2829
2022
  case "com.amazonaws.appstream#ResourceNotFoundException":
2830
- response = {
2831
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2832
- name: errorCode,
2833
- $metadata: deserializeMetadata(output),
2834
- };
2835
- break;
2023
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2836
2024
  default:
2837
2025
  const parsedBody = parsedOutput.body;
2838
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2839
- response = {
2840
- ...parsedBody,
2841
- name: `${errorCode}`,
2842
- message: parsedBody.message || parsedBody.Message || errorCode,
2026
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2027
+ name: parsedBody.code || parsedBody.Code || errorCode,
2843
2028
  $fault: "client",
2844
2029
  $metadata: deserializeMetadata(output),
2845
- };
2030
+ });
2031
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2846
2032
  }
2847
- const message = response.message || response.Message || errorCode;
2848
- response.message = message;
2849
- delete response.Message;
2850
- return Promise.reject(Object.assign(new Error(message), response));
2851
2033
  };
2852
2034
  const deserializeAws_json1_1DescribeApplicationFleetAssociationsCommand = async (output, context) => {
2853
2035
  if (output.statusCode >= 300) {
@@ -2874,35 +2056,19 @@ const deserializeAws_json1_1DescribeApplicationFleetAssociationsCommandError = a
2874
2056
  switch (errorCode) {
2875
2057
  case "InvalidParameterCombinationException":
2876
2058
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
2877
- response = {
2878
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
2879
- name: errorCode,
2880
- $metadata: deserializeMetadata(output),
2881
- };
2882
- break;
2059
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
2883
2060
  case "OperationNotPermittedException":
2884
2061
  case "com.amazonaws.appstream#OperationNotPermittedException":
2885
- response = {
2886
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2887
- name: errorCode,
2888
- $metadata: deserializeMetadata(output),
2889
- };
2890
- break;
2062
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
2891
2063
  default:
2892
2064
  const parsedBody = parsedOutput.body;
2893
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2894
- response = {
2895
- ...parsedBody,
2896
- name: `${errorCode}`,
2897
- message: parsedBody.message || parsedBody.Message || errorCode,
2065
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2066
+ name: parsedBody.code || parsedBody.Code || errorCode,
2898
2067
  $fault: "client",
2899
2068
  $metadata: deserializeMetadata(output),
2900
- };
2069
+ });
2070
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2901
2071
  }
2902
- const message = response.message || response.Message || errorCode;
2903
- response.message = message;
2904
- delete response.Message;
2905
- return Promise.reject(Object.assign(new Error(message), response));
2906
2072
  };
2907
2073
  const deserializeAws_json1_1DescribeApplicationsCommand = async (output, context) => {
2908
2074
  if (output.statusCode >= 300) {
@@ -2929,35 +2095,19 @@ const deserializeAws_json1_1DescribeApplicationsCommandError = async (output, co
2929
2095
  switch (errorCode) {
2930
2096
  case "OperationNotPermittedException":
2931
2097
  case "com.amazonaws.appstream#OperationNotPermittedException":
2932
- response = {
2933
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
2934
- name: errorCode,
2935
- $metadata: deserializeMetadata(output),
2936
- };
2937
- break;
2098
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
2938
2099
  case "ResourceNotFoundException":
2939
2100
  case "com.amazonaws.appstream#ResourceNotFoundException":
2940
- response = {
2941
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2942
- name: errorCode,
2943
- $metadata: deserializeMetadata(output),
2944
- };
2945
- break;
2101
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2946
2102
  default:
2947
2103
  const parsedBody = parsedOutput.body;
2948
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2949
- response = {
2950
- ...parsedBody,
2951
- name: `${errorCode}`,
2952
- message: parsedBody.message || parsedBody.Message || errorCode,
2104
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2105
+ name: parsedBody.code || parsedBody.Code || errorCode,
2953
2106
  $fault: "client",
2954
2107
  $metadata: deserializeMetadata(output),
2955
- };
2108
+ });
2109
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2956
2110
  }
2957
- const message = response.message || response.Message || errorCode;
2958
- response.message = message;
2959
- delete response.Message;
2960
- return Promise.reject(Object.assign(new Error(message), response));
2961
2111
  };
2962
2112
  const deserializeAws_json1_1DescribeDirectoryConfigsCommand = async (output, context) => {
2963
2113
  if (output.statusCode >= 300) {
@@ -2984,27 +2134,16 @@ const deserializeAws_json1_1DescribeDirectoryConfigsCommandError = async (output
2984
2134
  switch (errorCode) {
2985
2135
  case "ResourceNotFoundException":
2986
2136
  case "com.amazonaws.appstream#ResourceNotFoundException":
2987
- response = {
2988
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2989
- name: errorCode,
2990
- $metadata: deserializeMetadata(output),
2991
- };
2992
- break;
2137
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2993
2138
  default:
2994
2139
  const parsedBody = parsedOutput.body;
2995
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2996
- response = {
2997
- ...parsedBody,
2998
- name: `${errorCode}`,
2999
- message: parsedBody.message || parsedBody.Message || errorCode,
2140
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2141
+ name: parsedBody.code || parsedBody.Code || errorCode,
3000
2142
  $fault: "client",
3001
2143
  $metadata: deserializeMetadata(output),
3002
- };
2144
+ });
2145
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3003
2146
  }
3004
- const message = response.message || response.Message || errorCode;
3005
- response.message = message;
3006
- delete response.Message;
3007
- return Promise.reject(Object.assign(new Error(message), response));
3008
2147
  };
3009
2148
  const deserializeAws_json1_1DescribeEntitlementsCommand = async (output, context) => {
3010
2149
  if (output.statusCode >= 300) {
@@ -3031,43 +2170,22 @@ const deserializeAws_json1_1DescribeEntitlementsCommandError = async (output, co
3031
2170
  switch (errorCode) {
3032
2171
  case "EntitlementNotFoundException":
3033
2172
  case "com.amazonaws.appstream#EntitlementNotFoundException":
3034
- response = {
3035
- ...(await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context)),
3036
- name: errorCode,
3037
- $metadata: deserializeMetadata(output),
3038
- };
3039
- break;
2173
+ throw await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context);
3040
2174
  case "OperationNotPermittedException":
3041
2175
  case "com.amazonaws.appstream#OperationNotPermittedException":
3042
- response = {
3043
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
3044
- name: errorCode,
3045
- $metadata: deserializeMetadata(output),
3046
- };
3047
- break;
2176
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
3048
2177
  case "ResourceNotFoundException":
3049
2178
  case "com.amazonaws.appstream#ResourceNotFoundException":
3050
- response = {
3051
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3052
- name: errorCode,
3053
- $metadata: deserializeMetadata(output),
3054
- };
3055
- break;
2179
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3056
2180
  default:
3057
2181
  const parsedBody = parsedOutput.body;
3058
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3059
- response = {
3060
- ...parsedBody,
3061
- name: `${errorCode}`,
3062
- message: parsedBody.message || parsedBody.Message || errorCode,
2182
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2183
+ name: parsedBody.code || parsedBody.Code || errorCode,
3063
2184
  $fault: "client",
3064
2185
  $metadata: deserializeMetadata(output),
3065
- };
2186
+ });
2187
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3066
2188
  }
3067
- const message = response.message || response.Message || errorCode;
3068
- response.message = message;
3069
- delete response.Message;
3070
- return Promise.reject(Object.assign(new Error(message), response));
3071
2189
  };
3072
2190
  const deserializeAws_json1_1DescribeFleetsCommand = async (output, context) => {
3073
2191
  if (output.statusCode >= 300) {
@@ -3094,27 +2212,16 @@ const deserializeAws_json1_1DescribeFleetsCommandError = async (output, context)
3094
2212
  switch (errorCode) {
3095
2213
  case "ResourceNotFoundException":
3096
2214
  case "com.amazonaws.appstream#ResourceNotFoundException":
3097
- response = {
3098
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3099
- name: errorCode,
3100
- $metadata: deserializeMetadata(output),
3101
- };
3102
- break;
2215
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3103
2216
  default:
3104
2217
  const parsedBody = parsedOutput.body;
3105
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3106
- response = {
3107
- ...parsedBody,
3108
- name: `${errorCode}`,
3109
- message: parsedBody.message || parsedBody.Message || errorCode,
2218
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2219
+ name: parsedBody.code || parsedBody.Code || errorCode,
3110
2220
  $fault: "client",
3111
2221
  $metadata: deserializeMetadata(output),
3112
- };
2222
+ });
2223
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3113
2224
  }
3114
- const message = response.message || response.Message || errorCode;
3115
- response.message = message;
3116
- delete response.Message;
3117
- return Promise.reject(Object.assign(new Error(message), response));
3118
2225
  };
3119
2226
  const deserializeAws_json1_1DescribeImageBuildersCommand = async (output, context) => {
3120
2227
  if (output.statusCode >= 300) {
@@ -3141,27 +2248,16 @@ const deserializeAws_json1_1DescribeImageBuildersCommandError = async (output, c
3141
2248
  switch (errorCode) {
3142
2249
  case "ResourceNotFoundException":
3143
2250
  case "com.amazonaws.appstream#ResourceNotFoundException":
3144
- response = {
3145
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3146
- name: errorCode,
3147
- $metadata: deserializeMetadata(output),
3148
- };
3149
- break;
2251
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3150
2252
  default:
3151
2253
  const parsedBody = parsedOutput.body;
3152
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3153
- response = {
3154
- ...parsedBody,
3155
- name: `${errorCode}`,
3156
- message: parsedBody.message || parsedBody.Message || errorCode,
2254
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2255
+ name: parsedBody.code || parsedBody.Code || errorCode,
3157
2256
  $fault: "client",
3158
2257
  $metadata: deserializeMetadata(output),
3159
- };
2258
+ });
2259
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3160
2260
  }
3161
- const message = response.message || response.Message || errorCode;
3162
- response.message = message;
3163
- delete response.Message;
3164
- return Promise.reject(Object.assign(new Error(message), response));
3165
2261
  };
3166
2262
  const deserializeAws_json1_1DescribeImagePermissionsCommand = async (output, context) => {
3167
2263
  if (output.statusCode >= 300) {
@@ -3188,27 +2284,16 @@ const deserializeAws_json1_1DescribeImagePermissionsCommandError = async (output
3188
2284
  switch (errorCode) {
3189
2285
  case "ResourceNotFoundException":
3190
2286
  case "com.amazonaws.appstream#ResourceNotFoundException":
3191
- response = {
3192
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3193
- name: errorCode,
3194
- $metadata: deserializeMetadata(output),
3195
- };
3196
- break;
2287
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3197
2288
  default:
3198
2289
  const parsedBody = parsedOutput.body;
3199
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3200
- response = {
3201
- ...parsedBody,
3202
- name: `${errorCode}`,
3203
- message: parsedBody.message || parsedBody.Message || errorCode,
2290
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2291
+ name: parsedBody.code || parsedBody.Code || errorCode,
3204
2292
  $fault: "client",
3205
2293
  $metadata: deserializeMetadata(output),
3206
- };
2294
+ });
2295
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3207
2296
  }
3208
- const message = response.message || response.Message || errorCode;
3209
- response.message = message;
3210
- delete response.Message;
3211
- return Promise.reject(Object.assign(new Error(message), response));
3212
2297
  };
3213
2298
  const deserializeAws_json1_1DescribeImagesCommand = async (output, context) => {
3214
2299
  if (output.statusCode >= 300) {
@@ -3235,35 +2320,19 @@ const deserializeAws_json1_1DescribeImagesCommandError = async (output, context)
3235
2320
  switch (errorCode) {
3236
2321
  case "InvalidParameterCombinationException":
3237
2322
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
3238
- response = {
3239
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
3240
- name: errorCode,
3241
- $metadata: deserializeMetadata(output),
3242
- };
3243
- break;
2323
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
3244
2324
  case "ResourceNotFoundException":
3245
2325
  case "com.amazonaws.appstream#ResourceNotFoundException":
3246
- response = {
3247
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3248
- name: errorCode,
3249
- $metadata: deserializeMetadata(output),
3250
- };
3251
- break;
2326
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3252
2327
  default:
3253
2328
  const parsedBody = parsedOutput.body;
3254
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3255
- response = {
3256
- ...parsedBody,
3257
- name: `${errorCode}`,
3258
- message: parsedBody.message || parsedBody.Message || errorCode,
2329
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2330
+ name: parsedBody.code || parsedBody.Code || errorCode,
3259
2331
  $fault: "client",
3260
2332
  $metadata: deserializeMetadata(output),
3261
- };
2333
+ });
2334
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3262
2335
  }
3263
- const message = response.message || response.Message || errorCode;
3264
- response.message = message;
3265
- delete response.Message;
3266
- return Promise.reject(Object.assign(new Error(message), response));
3267
2336
  };
3268
2337
  const deserializeAws_json1_1DescribeSessionsCommand = async (output, context) => {
3269
2338
  if (output.statusCode >= 300) {
@@ -3290,27 +2359,16 @@ const deserializeAws_json1_1DescribeSessionsCommandError = async (output, contex
3290
2359
  switch (errorCode) {
3291
2360
  case "InvalidParameterCombinationException":
3292
2361
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
3293
- response = {
3294
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
3295
- name: errorCode,
3296
- $metadata: deserializeMetadata(output),
3297
- };
3298
- break;
2362
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
3299
2363
  default:
3300
2364
  const parsedBody = parsedOutput.body;
3301
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3302
- response = {
3303
- ...parsedBody,
3304
- name: `${errorCode}`,
3305
- message: parsedBody.message || parsedBody.Message || errorCode,
2365
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2366
+ name: parsedBody.code || parsedBody.Code || errorCode,
3306
2367
  $fault: "client",
3307
2368
  $metadata: deserializeMetadata(output),
3308
- };
2369
+ });
2370
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3309
2371
  }
3310
- const message = response.message || response.Message || errorCode;
3311
- response.message = message;
3312
- delete response.Message;
3313
- return Promise.reject(Object.assign(new Error(message), response));
3314
2372
  };
3315
2373
  const deserializeAws_json1_1DescribeStacksCommand = async (output, context) => {
3316
2374
  if (output.statusCode >= 300) {
@@ -3337,27 +2395,16 @@ const deserializeAws_json1_1DescribeStacksCommandError = async (output, context)
3337
2395
  switch (errorCode) {
3338
2396
  case "ResourceNotFoundException":
3339
2397
  case "com.amazonaws.appstream#ResourceNotFoundException":
3340
- response = {
3341
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3342
- name: errorCode,
3343
- $metadata: deserializeMetadata(output),
3344
- };
3345
- break;
2398
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3346
2399
  default:
3347
2400
  const parsedBody = parsedOutput.body;
3348
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3349
- response = {
3350
- ...parsedBody,
3351
- name: `${errorCode}`,
3352
- message: parsedBody.message || parsedBody.Message || errorCode,
2401
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2402
+ name: parsedBody.code || parsedBody.Code || errorCode,
3353
2403
  $fault: "client",
3354
2404
  $metadata: deserializeMetadata(output),
3355
- };
2405
+ });
2406
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3356
2407
  }
3357
- const message = response.message || response.Message || errorCode;
3358
- response.message = message;
3359
- delete response.Message;
3360
- return Promise.reject(Object.assign(new Error(message), response));
3361
2408
  };
3362
2409
  const deserializeAws_json1_1DescribeUsageReportSubscriptionsCommand = async (output, context) => {
3363
2410
  if (output.statusCode >= 300) {
@@ -3384,35 +2431,19 @@ const deserializeAws_json1_1DescribeUsageReportSubscriptionsCommandError = async
3384
2431
  switch (errorCode) {
3385
2432
  case "InvalidAccountStatusException":
3386
2433
  case "com.amazonaws.appstream#InvalidAccountStatusException":
3387
- response = {
3388
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
3389
- name: errorCode,
3390
- $metadata: deserializeMetadata(output),
3391
- };
3392
- break;
2434
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
3393
2435
  case "ResourceNotFoundException":
3394
2436
  case "com.amazonaws.appstream#ResourceNotFoundException":
3395
- response = {
3396
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3397
- name: errorCode,
3398
- $metadata: deserializeMetadata(output),
3399
- };
3400
- break;
2437
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3401
2438
  default:
3402
2439
  const parsedBody = parsedOutput.body;
3403
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3404
- response = {
3405
- ...parsedBody,
3406
- name: `${errorCode}`,
3407
- message: parsedBody.message || parsedBody.Message || errorCode,
2440
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2441
+ name: parsedBody.code || parsedBody.Code || errorCode,
3408
2442
  $fault: "client",
3409
2443
  $metadata: deserializeMetadata(output),
3410
- };
2444
+ });
2445
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3411
2446
  }
3412
- const message = response.message || response.Message || errorCode;
3413
- response.message = message;
3414
- delete response.Message;
3415
- return Promise.reject(Object.assign(new Error(message), response));
3416
2447
  };
3417
2448
  const deserializeAws_json1_1DescribeUsersCommand = async (output, context) => {
3418
2449
  if (output.statusCode >= 300) {
@@ -3439,43 +2470,22 @@ const deserializeAws_json1_1DescribeUsersCommandError = async (output, context)
3439
2470
  switch (errorCode) {
3440
2471
  case "InvalidParameterCombinationException":
3441
2472
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
3442
- response = {
3443
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
3444
- name: errorCode,
3445
- $metadata: deserializeMetadata(output),
3446
- };
3447
- break;
2473
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
3448
2474
  case "OperationNotPermittedException":
3449
2475
  case "com.amazonaws.appstream#OperationNotPermittedException":
3450
- response = {
3451
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
3452
- name: errorCode,
3453
- $metadata: deserializeMetadata(output),
3454
- };
3455
- break;
2476
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
3456
2477
  case "ResourceNotFoundException":
3457
2478
  case "com.amazonaws.appstream#ResourceNotFoundException":
3458
- response = {
3459
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3460
- name: errorCode,
3461
- $metadata: deserializeMetadata(output),
3462
- };
3463
- break;
2479
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3464
2480
  default:
3465
2481
  const parsedBody = parsedOutput.body;
3466
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3467
- response = {
3468
- ...parsedBody,
3469
- name: `${errorCode}`,
3470
- message: parsedBody.message || parsedBody.Message || errorCode,
2482
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2483
+ name: parsedBody.code || parsedBody.Code || errorCode,
3471
2484
  $fault: "client",
3472
2485
  $metadata: deserializeMetadata(output),
3473
- };
2486
+ });
2487
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3474
2488
  }
3475
- const message = response.message || response.Message || errorCode;
3476
- response.message = message;
3477
- delete response.Message;
3478
- return Promise.reject(Object.assign(new Error(message), response));
3479
2489
  };
3480
2490
  const deserializeAws_json1_1DescribeUserStackAssociationsCommand = async (output, context) => {
3481
2491
  if (output.statusCode >= 300) {
@@ -3502,35 +2512,19 @@ const deserializeAws_json1_1DescribeUserStackAssociationsCommandError = async (o
3502
2512
  switch (errorCode) {
3503
2513
  case "InvalidParameterCombinationException":
3504
2514
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
3505
- response = {
3506
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
3507
- name: errorCode,
3508
- $metadata: deserializeMetadata(output),
3509
- };
3510
- break;
2515
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
3511
2516
  case "OperationNotPermittedException":
3512
2517
  case "com.amazonaws.appstream#OperationNotPermittedException":
3513
- response = {
3514
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
3515
- name: errorCode,
3516
- $metadata: deserializeMetadata(output),
3517
- };
3518
- break;
2518
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
3519
2519
  default:
3520
2520
  const parsedBody = parsedOutput.body;
3521
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3522
- response = {
3523
- ...parsedBody,
3524
- name: `${errorCode}`,
3525
- message: parsedBody.message || parsedBody.Message || errorCode,
2521
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2522
+ name: parsedBody.code || parsedBody.Code || errorCode,
3526
2523
  $fault: "client",
3527
2524
  $metadata: deserializeMetadata(output),
3528
- };
2525
+ });
2526
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3529
2527
  }
3530
- const message = response.message || response.Message || errorCode;
3531
- response.message = message;
3532
- delete response.Message;
3533
- return Promise.reject(Object.assign(new Error(message), response));
3534
2528
  };
3535
2529
  const deserializeAws_json1_1DisableUserCommand = async (output, context) => {
3536
2530
  if (output.statusCode >= 300) {
@@ -3557,27 +2551,16 @@ const deserializeAws_json1_1DisableUserCommandError = async (output, context) =>
3557
2551
  switch (errorCode) {
3558
2552
  case "ResourceNotFoundException":
3559
2553
  case "com.amazonaws.appstream#ResourceNotFoundException":
3560
- response = {
3561
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3562
- name: errorCode,
3563
- $metadata: deserializeMetadata(output),
3564
- };
3565
- break;
2554
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3566
2555
  default:
3567
2556
  const parsedBody = parsedOutput.body;
3568
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3569
- response = {
3570
- ...parsedBody,
3571
- name: `${errorCode}`,
3572
- message: parsedBody.message || parsedBody.Message || errorCode,
2557
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2558
+ name: parsedBody.code || parsedBody.Code || errorCode,
3573
2559
  $fault: "client",
3574
2560
  $metadata: deserializeMetadata(output),
3575
- };
2561
+ });
2562
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3576
2563
  }
3577
- const message = response.message || response.Message || errorCode;
3578
- response.message = message;
3579
- delete response.Message;
3580
- return Promise.reject(Object.assign(new Error(message), response));
3581
2564
  };
3582
2565
  const deserializeAws_json1_1DisassociateApplicationFleetCommand = async (output, context) => {
3583
2566
  if (output.statusCode >= 300) {
@@ -3604,43 +2587,22 @@ const deserializeAws_json1_1DisassociateApplicationFleetCommandError = async (ou
3604
2587
  switch (errorCode) {
3605
2588
  case "ConcurrentModificationException":
3606
2589
  case "com.amazonaws.appstream#ConcurrentModificationException":
3607
- response = {
3608
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3609
- name: errorCode,
3610
- $metadata: deserializeMetadata(output),
3611
- };
3612
- break;
2590
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
3613
2591
  case "InvalidParameterCombinationException":
3614
2592
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
3615
- response = {
3616
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
3617
- name: errorCode,
3618
- $metadata: deserializeMetadata(output),
3619
- };
3620
- break;
2593
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
3621
2594
  case "OperationNotPermittedException":
3622
2595
  case "com.amazonaws.appstream#OperationNotPermittedException":
3623
- response = {
3624
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
3625
- name: errorCode,
3626
- $metadata: deserializeMetadata(output),
3627
- };
3628
- break;
2596
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
3629
2597
  default:
3630
2598
  const parsedBody = parsedOutput.body;
3631
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3632
- response = {
3633
- ...parsedBody,
3634
- name: `${errorCode}`,
3635
- message: parsedBody.message || parsedBody.Message || errorCode,
2599
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2600
+ name: parsedBody.code || parsedBody.Code || errorCode,
3636
2601
  $fault: "client",
3637
2602
  $metadata: deserializeMetadata(output),
3638
- };
2603
+ });
2604
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3639
2605
  }
3640
- const message = response.message || response.Message || errorCode;
3641
- response.message = message;
3642
- delete response.Message;
3643
- return Promise.reject(Object.assign(new Error(message), response));
3644
2606
  };
3645
2607
  const deserializeAws_json1_1DisassociateApplicationFromEntitlementCommand = async (output, context) => {
3646
2608
  if (output.statusCode >= 300) {
@@ -3667,43 +2629,22 @@ const deserializeAws_json1_1DisassociateApplicationFromEntitlementCommandError =
3667
2629
  switch (errorCode) {
3668
2630
  case "EntitlementNotFoundException":
3669
2631
  case "com.amazonaws.appstream#EntitlementNotFoundException":
3670
- response = {
3671
- ...(await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context)),
3672
- name: errorCode,
3673
- $metadata: deserializeMetadata(output),
3674
- };
3675
- break;
2632
+ throw await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context);
3676
2633
  case "OperationNotPermittedException":
3677
2634
  case "com.amazonaws.appstream#OperationNotPermittedException":
3678
- response = {
3679
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
3680
- name: errorCode,
3681
- $metadata: deserializeMetadata(output),
3682
- };
3683
- break;
2635
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
3684
2636
  case "ResourceNotFoundException":
3685
2637
  case "com.amazonaws.appstream#ResourceNotFoundException":
3686
- response = {
3687
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3688
- name: errorCode,
3689
- $metadata: deserializeMetadata(output),
3690
- };
3691
- break;
2638
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3692
2639
  default:
3693
2640
  const parsedBody = parsedOutput.body;
3694
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3695
- response = {
3696
- ...parsedBody,
3697
- name: `${errorCode}`,
3698
- message: parsedBody.message || parsedBody.Message || errorCode,
2641
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2642
+ name: parsedBody.code || parsedBody.Code || errorCode,
3699
2643
  $fault: "client",
3700
2644
  $metadata: deserializeMetadata(output),
3701
- };
2645
+ });
2646
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3702
2647
  }
3703
- const message = response.message || response.Message || errorCode;
3704
- response.message = message;
3705
- delete response.Message;
3706
- return Promise.reject(Object.assign(new Error(message), response));
3707
2648
  };
3708
2649
  const deserializeAws_json1_1DisassociateFleetCommand = async (output, context) => {
3709
2650
  if (output.statusCode >= 300) {
@@ -3730,51 +2671,25 @@ const deserializeAws_json1_1DisassociateFleetCommandError = async (output, conte
3730
2671
  switch (errorCode) {
3731
2672
  case "ConcurrentModificationException":
3732
2673
  case "com.amazonaws.appstream#ConcurrentModificationException":
3733
- response = {
3734
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3735
- name: errorCode,
3736
- $metadata: deserializeMetadata(output),
3737
- };
3738
- break;
2674
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
3739
2675
  case "OperationNotPermittedException":
3740
2676
  case "com.amazonaws.appstream#OperationNotPermittedException":
3741
- response = {
3742
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
3743
- name: errorCode,
3744
- $metadata: deserializeMetadata(output),
3745
- };
3746
- break;
2677
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
3747
2678
  case "ResourceInUseException":
3748
2679
  case "com.amazonaws.appstream#ResourceInUseException":
3749
- response = {
3750
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
3751
- name: errorCode,
3752
- $metadata: deserializeMetadata(output),
3753
- };
3754
- break;
2680
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
3755
2681
  case "ResourceNotFoundException":
3756
2682
  case "com.amazonaws.appstream#ResourceNotFoundException":
3757
- response = {
3758
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3759
- name: errorCode,
3760
- $metadata: deserializeMetadata(output),
3761
- };
3762
- break;
2683
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3763
2684
  default:
3764
2685
  const parsedBody = parsedOutput.body;
3765
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3766
- response = {
3767
- ...parsedBody,
3768
- name: `${errorCode}`,
3769
- message: parsedBody.message || parsedBody.Message || errorCode,
2686
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2687
+ name: parsedBody.code || parsedBody.Code || errorCode,
3770
2688
  $fault: "client",
3771
2689
  $metadata: deserializeMetadata(output),
3772
- };
2690
+ });
2691
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3773
2692
  }
3774
- const message = response.message || response.Message || errorCode;
3775
- response.message = message;
3776
- delete response.Message;
3777
- return Promise.reject(Object.assign(new Error(message), response));
3778
2693
  };
3779
2694
  const deserializeAws_json1_1EnableUserCommand = async (output, context) => {
3780
2695
  if (output.statusCode >= 300) {
@@ -3801,35 +2716,19 @@ const deserializeAws_json1_1EnableUserCommandError = async (output, context) =>
3801
2716
  switch (errorCode) {
3802
2717
  case "InvalidAccountStatusException":
3803
2718
  case "com.amazonaws.appstream#InvalidAccountStatusException":
3804
- response = {
3805
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
3806
- name: errorCode,
3807
- $metadata: deserializeMetadata(output),
3808
- };
3809
- break;
2719
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
3810
2720
  case "ResourceNotFoundException":
3811
2721
  case "com.amazonaws.appstream#ResourceNotFoundException":
3812
- response = {
3813
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3814
- name: errorCode,
3815
- $metadata: deserializeMetadata(output),
3816
- };
3817
- break;
2722
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3818
2723
  default:
3819
2724
  const parsedBody = parsedOutput.body;
3820
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3821
- response = {
3822
- ...parsedBody,
3823
- name: `${errorCode}`,
3824
- message: parsedBody.message || parsedBody.Message || errorCode,
2725
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2726
+ name: parsedBody.code || parsedBody.Code || errorCode,
3825
2727
  $fault: "client",
3826
2728
  $metadata: deserializeMetadata(output),
3827
- };
2729
+ });
2730
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3828
2731
  }
3829
- const message = response.message || response.Message || errorCode;
3830
- response.message = message;
3831
- delete response.Message;
3832
- return Promise.reject(Object.assign(new Error(message), response));
3833
2732
  };
3834
2733
  const deserializeAws_json1_1ExpireSessionCommand = async (output, context) => {
3835
2734
  if (output.statusCode >= 300) {
@@ -3856,19 +2755,13 @@ const deserializeAws_json1_1ExpireSessionCommandError = async (output, context)
3856
2755
  switch (errorCode) {
3857
2756
  default:
3858
2757
  const parsedBody = parsedOutput.body;
3859
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3860
- response = {
3861
- ...parsedBody,
3862
- name: `${errorCode}`,
3863
- message: parsedBody.message || parsedBody.Message || errorCode,
2758
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2759
+ name: parsedBody.code || parsedBody.Code || errorCode,
3864
2760
  $fault: "client",
3865
2761
  $metadata: deserializeMetadata(output),
3866
- };
2762
+ });
2763
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3867
2764
  }
3868
- const message = response.message || response.Message || errorCode;
3869
- response.message = message;
3870
- delete response.Message;
3871
- return Promise.reject(Object.assign(new Error(message), response));
3872
2765
  };
3873
2766
  const deserializeAws_json1_1ListAssociatedFleetsCommand = async (output, context) => {
3874
2767
  if (output.statusCode >= 300) {
@@ -3895,19 +2788,13 @@ const deserializeAws_json1_1ListAssociatedFleetsCommandError = async (output, co
3895
2788
  switch (errorCode) {
3896
2789
  default:
3897
2790
  const parsedBody = parsedOutput.body;
3898
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3899
- response = {
3900
- ...parsedBody,
3901
- name: `${errorCode}`,
3902
- message: parsedBody.message || parsedBody.Message || errorCode,
2791
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2792
+ name: parsedBody.code || parsedBody.Code || errorCode,
3903
2793
  $fault: "client",
3904
2794
  $metadata: deserializeMetadata(output),
3905
- };
2795
+ });
2796
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3906
2797
  }
3907
- const message = response.message || response.Message || errorCode;
3908
- response.message = message;
3909
- delete response.Message;
3910
- return Promise.reject(Object.assign(new Error(message), response));
3911
2798
  };
3912
2799
  const deserializeAws_json1_1ListAssociatedStacksCommand = async (output, context) => {
3913
2800
  if (output.statusCode >= 300) {
@@ -3934,19 +2821,13 @@ const deserializeAws_json1_1ListAssociatedStacksCommandError = async (output, co
3934
2821
  switch (errorCode) {
3935
2822
  default:
3936
2823
  const parsedBody = parsedOutput.body;
3937
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3938
- response = {
3939
- ...parsedBody,
3940
- name: `${errorCode}`,
3941
- message: parsedBody.message || parsedBody.Message || errorCode,
2824
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2825
+ name: parsedBody.code || parsedBody.Code || errorCode,
3942
2826
  $fault: "client",
3943
2827
  $metadata: deserializeMetadata(output),
3944
- };
2828
+ });
2829
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3945
2830
  }
3946
- const message = response.message || response.Message || errorCode;
3947
- response.message = message;
3948
- delete response.Message;
3949
- return Promise.reject(Object.assign(new Error(message), response));
3950
2831
  };
3951
2832
  const deserializeAws_json1_1ListEntitledApplicationsCommand = async (output, context) => {
3952
2833
  if (output.statusCode >= 300) {
@@ -3973,43 +2854,22 @@ const deserializeAws_json1_1ListEntitledApplicationsCommandError = async (output
3973
2854
  switch (errorCode) {
3974
2855
  case "EntitlementNotFoundException":
3975
2856
  case "com.amazonaws.appstream#EntitlementNotFoundException":
3976
- response = {
3977
- ...(await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context)),
3978
- name: errorCode,
3979
- $metadata: deserializeMetadata(output),
3980
- };
3981
- break;
2857
+ throw await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context);
3982
2858
  case "OperationNotPermittedException":
3983
2859
  case "com.amazonaws.appstream#OperationNotPermittedException":
3984
- response = {
3985
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
3986
- name: errorCode,
3987
- $metadata: deserializeMetadata(output),
3988
- };
3989
- break;
2860
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
3990
2861
  case "ResourceNotFoundException":
3991
2862
  case "com.amazonaws.appstream#ResourceNotFoundException":
3992
- response = {
3993
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3994
- name: errorCode,
3995
- $metadata: deserializeMetadata(output),
3996
- };
3997
- break;
2863
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
3998
2864
  default:
3999
2865
  const parsedBody = parsedOutput.body;
4000
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4001
- response = {
4002
- ...parsedBody,
4003
- name: `${errorCode}`,
4004
- message: parsedBody.message || parsedBody.Message || errorCode,
2866
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2867
+ name: parsedBody.code || parsedBody.Code || errorCode,
4005
2868
  $fault: "client",
4006
2869
  $metadata: deserializeMetadata(output),
4007
- };
2870
+ });
2871
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4008
2872
  }
4009
- const message = response.message || response.Message || errorCode;
4010
- response.message = message;
4011
- delete response.Message;
4012
- return Promise.reject(Object.assign(new Error(message), response));
4013
2873
  };
4014
2874
  const deserializeAws_json1_1ListTagsForResourceCommand = async (output, context) => {
4015
2875
  if (output.statusCode >= 300) {
@@ -4036,27 +2896,16 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async (output, con
4036
2896
  switch (errorCode) {
4037
2897
  case "ResourceNotFoundException":
4038
2898
  case "com.amazonaws.appstream#ResourceNotFoundException":
4039
- response = {
4040
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4041
- name: errorCode,
4042
- $metadata: deserializeMetadata(output),
4043
- };
4044
- break;
2899
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4045
2900
  default:
4046
2901
  const parsedBody = parsedOutput.body;
4047
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4048
- response = {
4049
- ...parsedBody,
4050
- name: `${errorCode}`,
4051
- message: parsedBody.message || parsedBody.Message || errorCode,
2902
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2903
+ name: parsedBody.code || parsedBody.Code || errorCode,
4052
2904
  $fault: "client",
4053
2905
  $metadata: deserializeMetadata(output),
4054
- };
2906
+ });
2907
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4055
2908
  }
4056
- const message = response.message || response.Message || errorCode;
4057
- response.message = message;
4058
- delete response.Message;
4059
- return Promise.reject(Object.assign(new Error(message), response));
4060
2909
  };
4061
2910
  const deserializeAws_json1_1StartFleetCommand = async (output, context) => {
4062
2911
  if (output.statusCode >= 300) {
@@ -4083,83 +2932,37 @@ const deserializeAws_json1_1StartFleetCommandError = async (output, context) =>
4083
2932
  switch (errorCode) {
4084
2933
  case "ConcurrentModificationException":
4085
2934
  case "com.amazonaws.appstream#ConcurrentModificationException":
4086
- response = {
4087
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4088
- name: errorCode,
4089
- $metadata: deserializeMetadata(output),
4090
- };
4091
- break;
2935
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
4092
2936
  case "InvalidAccountStatusException":
4093
2937
  case "com.amazonaws.appstream#InvalidAccountStatusException":
4094
- response = {
4095
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
4096
- name: errorCode,
4097
- $metadata: deserializeMetadata(output),
4098
- };
4099
- break;
2938
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
4100
2939
  case "InvalidRoleException":
4101
2940
  case "com.amazonaws.appstream#InvalidRoleException":
4102
- response = {
4103
- ...(await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context)),
4104
- name: errorCode,
4105
- $metadata: deserializeMetadata(output),
4106
- };
4107
- break;
2941
+ throw await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context);
4108
2942
  case "LimitExceededException":
4109
2943
  case "com.amazonaws.appstream#LimitExceededException":
4110
- response = {
4111
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
4112
- name: errorCode,
4113
- $metadata: deserializeMetadata(output),
4114
- };
4115
- break;
2944
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
4116
2945
  case "OperationNotPermittedException":
4117
2946
  case "com.amazonaws.appstream#OperationNotPermittedException":
4118
- response = {
4119
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
4120
- name: errorCode,
4121
- $metadata: deserializeMetadata(output),
4122
- };
4123
- break;
2947
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
4124
2948
  case "RequestLimitExceededException":
4125
2949
  case "com.amazonaws.appstream#RequestLimitExceededException":
4126
- response = {
4127
- ...(await deserializeAws_json1_1RequestLimitExceededExceptionResponse(parsedOutput, context)),
4128
- name: errorCode,
4129
- $metadata: deserializeMetadata(output),
4130
- };
4131
- break;
2950
+ throw await deserializeAws_json1_1RequestLimitExceededExceptionResponse(parsedOutput, context);
4132
2951
  case "ResourceNotAvailableException":
4133
2952
  case "com.amazonaws.appstream#ResourceNotAvailableException":
4134
- response = {
4135
- ...(await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context)),
4136
- name: errorCode,
4137
- $metadata: deserializeMetadata(output),
4138
- };
4139
- break;
2953
+ throw await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context);
4140
2954
  case "ResourceNotFoundException":
4141
2955
  case "com.amazonaws.appstream#ResourceNotFoundException":
4142
- response = {
4143
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4144
- name: errorCode,
4145
- $metadata: deserializeMetadata(output),
4146
- };
4147
- break;
2956
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4148
2957
  default:
4149
2958
  const parsedBody = parsedOutput.body;
4150
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4151
- response = {
4152
- ...parsedBody,
4153
- name: `${errorCode}`,
4154
- message: parsedBody.message || parsedBody.Message || errorCode,
2959
+ response = new AppStreamServiceException_1.AppStreamServiceException({
2960
+ name: parsedBody.code || parsedBody.Code || errorCode,
4155
2961
  $fault: "client",
4156
2962
  $metadata: deserializeMetadata(output),
4157
- };
2963
+ });
2964
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4158
2965
  }
4159
- const message = response.message || response.Message || errorCode;
4160
- response.message = message;
4161
- delete response.Message;
4162
- return Promise.reject(Object.assign(new Error(message), response));
4163
2966
  };
4164
2967
  const deserializeAws_json1_1StartImageBuilderCommand = async (output, context) => {
4165
2968
  if (output.statusCode >= 300) {
@@ -4186,59 +2989,28 @@ const deserializeAws_json1_1StartImageBuilderCommandError = async (output, conte
4186
2989
  switch (errorCode) {
4187
2990
  case "ConcurrentModificationException":
4188
2991
  case "com.amazonaws.appstream#ConcurrentModificationException":
4189
- response = {
4190
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4191
- name: errorCode,
4192
- $metadata: deserializeMetadata(output),
4193
- };
4194
- break;
2992
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
4195
2993
  case "IncompatibleImageException":
4196
2994
  case "com.amazonaws.appstream#IncompatibleImageException":
4197
- response = {
4198
- ...(await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context)),
4199
- name: errorCode,
4200
- $metadata: deserializeMetadata(output),
4201
- };
4202
- break;
2995
+ throw await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context);
4203
2996
  case "InvalidAccountStatusException":
4204
2997
  case "com.amazonaws.appstream#InvalidAccountStatusException":
4205
- response = {
4206
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
4207
- name: errorCode,
4208
- $metadata: deserializeMetadata(output),
4209
- };
4210
- break;
2998
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
4211
2999
  case "ResourceNotAvailableException":
4212
3000
  case "com.amazonaws.appstream#ResourceNotAvailableException":
4213
- response = {
4214
- ...(await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context)),
4215
- name: errorCode,
4216
- $metadata: deserializeMetadata(output),
4217
- };
4218
- break;
3001
+ throw await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context);
4219
3002
  case "ResourceNotFoundException":
4220
3003
  case "com.amazonaws.appstream#ResourceNotFoundException":
4221
- response = {
4222
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4223
- name: errorCode,
4224
- $metadata: deserializeMetadata(output),
4225
- };
4226
- break;
3004
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4227
3005
  default:
4228
3006
  const parsedBody = parsedOutput.body;
4229
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4230
- response = {
4231
- ...parsedBody,
4232
- name: `${errorCode}`,
4233
- message: parsedBody.message || parsedBody.Message || errorCode,
3007
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3008
+ name: parsedBody.code || parsedBody.Code || errorCode,
4234
3009
  $fault: "client",
4235
3010
  $metadata: deserializeMetadata(output),
4236
- };
3011
+ });
3012
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4237
3013
  }
4238
- const message = response.message || response.Message || errorCode;
4239
- response.message = message;
4240
- delete response.Message;
4241
- return Promise.reject(Object.assign(new Error(message), response));
4242
3014
  };
4243
3015
  const deserializeAws_json1_1StopFleetCommand = async (output, context) => {
4244
3016
  if (output.statusCode >= 300) {
@@ -4265,35 +3037,19 @@ const deserializeAws_json1_1StopFleetCommandError = async (output, context) => {
4265
3037
  switch (errorCode) {
4266
3038
  case "ConcurrentModificationException":
4267
3039
  case "com.amazonaws.appstream#ConcurrentModificationException":
4268
- response = {
4269
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4270
- name: errorCode,
4271
- $metadata: deserializeMetadata(output),
4272
- };
4273
- break;
3040
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
4274
3041
  case "ResourceNotFoundException":
4275
3042
  case "com.amazonaws.appstream#ResourceNotFoundException":
4276
- response = {
4277
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4278
- name: errorCode,
4279
- $metadata: deserializeMetadata(output),
4280
- };
4281
- break;
3043
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4282
3044
  default:
4283
3045
  const parsedBody = parsedOutput.body;
4284
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4285
- response = {
4286
- ...parsedBody,
4287
- name: `${errorCode}`,
4288
- message: parsedBody.message || parsedBody.Message || errorCode,
3046
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3047
+ name: parsedBody.code || parsedBody.Code || errorCode,
4289
3048
  $fault: "client",
4290
3049
  $metadata: deserializeMetadata(output),
4291
- };
3050
+ });
3051
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4292
3052
  }
4293
- const message = response.message || response.Message || errorCode;
4294
- response.message = message;
4295
- delete response.Message;
4296
- return Promise.reject(Object.assign(new Error(message), response));
4297
3053
  };
4298
3054
  const deserializeAws_json1_1StopImageBuilderCommand = async (output, context) => {
4299
3055
  if (output.statusCode >= 300) {
@@ -4320,43 +3076,22 @@ const deserializeAws_json1_1StopImageBuilderCommandError = async (output, contex
4320
3076
  switch (errorCode) {
4321
3077
  case "ConcurrentModificationException":
4322
3078
  case "com.amazonaws.appstream#ConcurrentModificationException":
4323
- response = {
4324
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4325
- name: errorCode,
4326
- $metadata: deserializeMetadata(output),
4327
- };
4328
- break;
3079
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
4329
3080
  case "OperationNotPermittedException":
4330
3081
  case "com.amazonaws.appstream#OperationNotPermittedException":
4331
- response = {
4332
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
4333
- name: errorCode,
4334
- $metadata: deserializeMetadata(output),
4335
- };
4336
- break;
3082
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
4337
3083
  case "ResourceNotFoundException":
4338
3084
  case "com.amazonaws.appstream#ResourceNotFoundException":
4339
- response = {
4340
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4341
- name: errorCode,
4342
- $metadata: deserializeMetadata(output),
4343
- };
4344
- break;
3085
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4345
3086
  default:
4346
3087
  const parsedBody = parsedOutput.body;
4347
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4348
- response = {
4349
- ...parsedBody,
4350
- name: `${errorCode}`,
4351
- message: parsedBody.message || parsedBody.Message || errorCode,
3088
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3089
+ name: parsedBody.code || parsedBody.Code || errorCode,
4352
3090
  $fault: "client",
4353
3091
  $metadata: deserializeMetadata(output),
4354
- };
3092
+ });
3093
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4355
3094
  }
4356
- const message = response.message || response.Message || errorCode;
4357
- response.message = message;
4358
- delete response.Message;
4359
- return Promise.reject(Object.assign(new Error(message), response));
4360
3095
  };
4361
3096
  const deserializeAws_json1_1TagResourceCommand = async (output, context) => {
4362
3097
  if (output.statusCode >= 300) {
@@ -4383,43 +3118,22 @@ const deserializeAws_json1_1TagResourceCommandError = async (output, context) =>
4383
3118
  switch (errorCode) {
4384
3119
  case "InvalidAccountStatusException":
4385
3120
  case "com.amazonaws.appstream#InvalidAccountStatusException":
4386
- response = {
4387
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
4388
- name: errorCode,
4389
- $metadata: deserializeMetadata(output),
4390
- };
4391
- break;
3121
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
4392
3122
  case "LimitExceededException":
4393
3123
  case "com.amazonaws.appstream#LimitExceededException":
4394
- response = {
4395
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
4396
- name: errorCode,
4397
- $metadata: deserializeMetadata(output),
4398
- };
4399
- break;
3124
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
4400
3125
  case "ResourceNotFoundException":
4401
3126
  case "com.amazonaws.appstream#ResourceNotFoundException":
4402
- response = {
4403
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4404
- name: errorCode,
4405
- $metadata: deserializeMetadata(output),
4406
- };
4407
- break;
3127
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4408
3128
  default:
4409
3129
  const parsedBody = parsedOutput.body;
4410
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4411
- response = {
4412
- ...parsedBody,
4413
- name: `${errorCode}`,
4414
- message: parsedBody.message || parsedBody.Message || errorCode,
3130
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3131
+ name: parsedBody.code || parsedBody.Code || errorCode,
4415
3132
  $fault: "client",
4416
3133
  $metadata: deserializeMetadata(output),
4417
- };
3134
+ });
3135
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4418
3136
  }
4419
- const message = response.message || response.Message || errorCode;
4420
- response.message = message;
4421
- delete response.Message;
4422
- return Promise.reject(Object.assign(new Error(message), response));
4423
3137
  };
4424
3138
  const deserializeAws_json1_1UntagResourceCommand = async (output, context) => {
4425
3139
  if (output.statusCode >= 300) {
@@ -4446,27 +3160,16 @@ const deserializeAws_json1_1UntagResourceCommandError = async (output, context)
4446
3160
  switch (errorCode) {
4447
3161
  case "ResourceNotFoundException":
4448
3162
  case "com.amazonaws.appstream#ResourceNotFoundException":
4449
- response = {
4450
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4451
- name: errorCode,
4452
- $metadata: deserializeMetadata(output),
4453
- };
4454
- break;
3163
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4455
3164
  default:
4456
3165
  const parsedBody = parsedOutput.body;
4457
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4458
- response = {
4459
- ...parsedBody,
4460
- name: `${errorCode}`,
4461
- message: parsedBody.message || parsedBody.Message || errorCode,
3166
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3167
+ name: parsedBody.code || parsedBody.Code || errorCode,
4462
3168
  $fault: "client",
4463
3169
  $metadata: deserializeMetadata(output),
4464
- };
3170
+ });
3171
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4465
3172
  }
4466
- const message = response.message || response.Message || errorCode;
4467
- response.message = message;
4468
- delete response.Message;
4469
- return Promise.reject(Object.assign(new Error(message), response));
4470
3173
  };
4471
3174
  const deserializeAws_json1_1UpdateApplicationCommand = async (output, context) => {
4472
3175
  if (output.statusCode >= 300) {
@@ -4493,43 +3196,22 @@ const deserializeAws_json1_1UpdateApplicationCommandError = async (output, conte
4493
3196
  switch (errorCode) {
4494
3197
  case "ConcurrentModificationException":
4495
3198
  case "com.amazonaws.appstream#ConcurrentModificationException":
4496
- response = {
4497
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4498
- name: errorCode,
4499
- $metadata: deserializeMetadata(output),
4500
- };
4501
- break;
3199
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
4502
3200
  case "OperationNotPermittedException":
4503
3201
  case "com.amazonaws.appstream#OperationNotPermittedException":
4504
- response = {
4505
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
4506
- name: errorCode,
4507
- $metadata: deserializeMetadata(output),
4508
- };
4509
- break;
3202
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
4510
3203
  case "ResourceNotFoundException":
4511
3204
  case "com.amazonaws.appstream#ResourceNotFoundException":
4512
- response = {
4513
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4514
- name: errorCode,
4515
- $metadata: deserializeMetadata(output),
4516
- };
4517
- break;
3205
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4518
3206
  default:
4519
3207
  const parsedBody = parsedOutput.body;
4520
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4521
- response = {
4522
- ...parsedBody,
4523
- name: `${errorCode}`,
4524
- message: parsedBody.message || parsedBody.Message || errorCode,
3208
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3209
+ name: parsedBody.code || parsedBody.Code || errorCode,
4525
3210
  $fault: "client",
4526
3211
  $metadata: deserializeMetadata(output),
4527
- };
3212
+ });
3213
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4528
3214
  }
4529
- const message = response.message || response.Message || errorCode;
4530
- response.message = message;
4531
- delete response.Message;
4532
- return Promise.reject(Object.assign(new Error(message), response));
4533
3215
  };
4534
3216
  const deserializeAws_json1_1UpdateDirectoryConfigCommand = async (output, context) => {
4535
3217
  if (output.statusCode >= 300) {
@@ -4556,59 +3238,28 @@ const deserializeAws_json1_1UpdateDirectoryConfigCommandError = async (output, c
4556
3238
  switch (errorCode) {
4557
3239
  case "ConcurrentModificationException":
4558
3240
  case "com.amazonaws.appstream#ConcurrentModificationException":
4559
- response = {
4560
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4561
- name: errorCode,
4562
- $metadata: deserializeMetadata(output),
4563
- };
4564
- break;
3241
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
4565
3242
  case "InvalidRoleException":
4566
3243
  case "com.amazonaws.appstream#InvalidRoleException":
4567
- response = {
4568
- ...(await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context)),
4569
- name: errorCode,
4570
- $metadata: deserializeMetadata(output),
4571
- };
4572
- break;
3244
+ throw await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context);
4573
3245
  case "OperationNotPermittedException":
4574
3246
  case "com.amazonaws.appstream#OperationNotPermittedException":
4575
- response = {
4576
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
4577
- name: errorCode,
4578
- $metadata: deserializeMetadata(output),
4579
- };
4580
- break;
3247
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
4581
3248
  case "ResourceInUseException":
4582
3249
  case "com.amazonaws.appstream#ResourceInUseException":
4583
- response = {
4584
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
4585
- name: errorCode,
4586
- $metadata: deserializeMetadata(output),
4587
- };
4588
- break;
3250
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
4589
3251
  case "ResourceNotFoundException":
4590
3252
  case "com.amazonaws.appstream#ResourceNotFoundException":
4591
- response = {
4592
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4593
- name: errorCode,
4594
- $metadata: deserializeMetadata(output),
4595
- };
4596
- break;
3253
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4597
3254
  default:
4598
3255
  const parsedBody = parsedOutput.body;
4599
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4600
- response = {
4601
- ...parsedBody,
4602
- name: `${errorCode}`,
4603
- message: parsedBody.message || parsedBody.Message || errorCode,
3256
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3257
+ name: parsedBody.code || parsedBody.Code || errorCode,
4604
3258
  $fault: "client",
4605
3259
  $metadata: deserializeMetadata(output),
4606
- };
3260
+ });
3261
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4607
3262
  }
4608
- const message = response.message || response.Message || errorCode;
4609
- response.message = message;
4610
- delete response.Message;
4611
- return Promise.reject(Object.assign(new Error(message), response));
4612
3263
  };
4613
3264
  const deserializeAws_json1_1UpdateEntitlementCommand = async (output, context) => {
4614
3265
  if (output.statusCode >= 300) {
@@ -4635,51 +3286,25 @@ const deserializeAws_json1_1UpdateEntitlementCommandError = async (output, conte
4635
3286
  switch (errorCode) {
4636
3287
  case "ConcurrentModificationException":
4637
3288
  case "com.amazonaws.appstream#ConcurrentModificationException":
4638
- response = {
4639
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4640
- name: errorCode,
4641
- $metadata: deserializeMetadata(output),
4642
- };
4643
- break;
3289
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
4644
3290
  case "EntitlementNotFoundException":
4645
3291
  case "com.amazonaws.appstream#EntitlementNotFoundException":
4646
- response = {
4647
- ...(await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context)),
4648
- name: errorCode,
4649
- $metadata: deserializeMetadata(output),
4650
- };
4651
- break;
3292
+ throw await deserializeAws_json1_1EntitlementNotFoundExceptionResponse(parsedOutput, context);
4652
3293
  case "OperationNotPermittedException":
4653
3294
  case "com.amazonaws.appstream#OperationNotPermittedException":
4654
- response = {
4655
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
4656
- name: errorCode,
4657
- $metadata: deserializeMetadata(output),
4658
- };
4659
- break;
3295
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
4660
3296
  case "ResourceNotFoundException":
4661
3297
  case "com.amazonaws.appstream#ResourceNotFoundException":
4662
- response = {
4663
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4664
- name: errorCode,
4665
- $metadata: deserializeMetadata(output),
4666
- };
4667
- break;
3298
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4668
3299
  default:
4669
3300
  const parsedBody = parsedOutput.body;
4670
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4671
- response = {
4672
- ...parsedBody,
4673
- name: `${errorCode}`,
4674
- message: parsedBody.message || parsedBody.Message || errorCode,
3301
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3302
+ name: parsedBody.code || parsedBody.Code || errorCode,
4675
3303
  $fault: "client",
4676
3304
  $metadata: deserializeMetadata(output),
4677
- };
3305
+ });
3306
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4678
3307
  }
4679
- const message = response.message || response.Message || errorCode;
4680
- response.message = message;
4681
- delete response.Message;
4682
- return Promise.reject(Object.assign(new Error(message), response));
4683
3308
  };
4684
3309
  const deserializeAws_json1_1UpdateFleetCommand = async (output, context) => {
4685
3310
  if (output.statusCode >= 300) {
@@ -4706,107 +3331,46 @@ const deserializeAws_json1_1UpdateFleetCommandError = async (output, context) =>
4706
3331
  switch (errorCode) {
4707
3332
  case "ConcurrentModificationException":
4708
3333
  case "com.amazonaws.appstream#ConcurrentModificationException":
4709
- response = {
4710
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4711
- name: errorCode,
4712
- $metadata: deserializeMetadata(output),
4713
- };
4714
- break;
3334
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
4715
3335
  case "IncompatibleImageException":
4716
3336
  case "com.amazonaws.appstream#IncompatibleImageException":
4717
- response = {
4718
- ...(await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context)),
4719
- name: errorCode,
4720
- $metadata: deserializeMetadata(output),
4721
- };
4722
- break;
3337
+ throw await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context);
4723
3338
  case "InvalidAccountStatusException":
4724
3339
  case "com.amazonaws.appstream#InvalidAccountStatusException":
4725
- response = {
4726
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
4727
- name: errorCode,
4728
- $metadata: deserializeMetadata(output),
4729
- };
4730
- break;
3340
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
4731
3341
  case "InvalidParameterCombinationException":
4732
3342
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
4733
- response = {
4734
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
4735
- name: errorCode,
4736
- $metadata: deserializeMetadata(output),
4737
- };
4738
- break;
3343
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
4739
3344
  case "InvalidRoleException":
4740
3345
  case "com.amazonaws.appstream#InvalidRoleException":
4741
- response = {
4742
- ...(await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context)),
4743
- name: errorCode,
4744
- $metadata: deserializeMetadata(output),
4745
- };
4746
- break;
3346
+ throw await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context);
4747
3347
  case "LimitExceededException":
4748
3348
  case "com.amazonaws.appstream#LimitExceededException":
4749
- response = {
4750
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
4751
- name: errorCode,
4752
- $metadata: deserializeMetadata(output),
4753
- };
4754
- break;
3349
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
4755
3350
  case "OperationNotPermittedException":
4756
3351
  case "com.amazonaws.appstream#OperationNotPermittedException":
4757
- response = {
4758
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
4759
- name: errorCode,
4760
- $metadata: deserializeMetadata(output),
4761
- };
4762
- break;
3352
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
4763
3353
  case "RequestLimitExceededException":
4764
3354
  case "com.amazonaws.appstream#RequestLimitExceededException":
4765
- response = {
4766
- ...(await deserializeAws_json1_1RequestLimitExceededExceptionResponse(parsedOutput, context)),
4767
- name: errorCode,
4768
- $metadata: deserializeMetadata(output),
4769
- };
4770
- break;
3355
+ throw await deserializeAws_json1_1RequestLimitExceededExceptionResponse(parsedOutput, context);
4771
3356
  case "ResourceInUseException":
4772
3357
  case "com.amazonaws.appstream#ResourceInUseException":
4773
- response = {
4774
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
4775
- name: errorCode,
4776
- $metadata: deserializeMetadata(output),
4777
- };
4778
- break;
3358
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
4779
3359
  case "ResourceNotAvailableException":
4780
3360
  case "com.amazonaws.appstream#ResourceNotAvailableException":
4781
- response = {
4782
- ...(await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context)),
4783
- name: errorCode,
4784
- $metadata: deserializeMetadata(output),
4785
- };
4786
- break;
3361
+ throw await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context);
4787
3362
  case "ResourceNotFoundException":
4788
3363
  case "com.amazonaws.appstream#ResourceNotFoundException":
4789
- response = {
4790
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4791
- name: errorCode,
4792
- $metadata: deserializeMetadata(output),
4793
- };
4794
- break;
3364
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4795
3365
  default:
4796
3366
  const parsedBody = parsedOutput.body;
4797
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4798
- response = {
4799
- ...parsedBody,
4800
- name: `${errorCode}`,
4801
- message: parsedBody.message || parsedBody.Message || errorCode,
3367
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3368
+ name: parsedBody.code || parsedBody.Code || errorCode,
4802
3369
  $fault: "client",
4803
3370
  $metadata: deserializeMetadata(output),
4804
- };
3371
+ });
3372
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4805
3373
  }
4806
- const message = response.message || response.Message || errorCode;
4807
- response.message = message;
4808
- delete response.Message;
4809
- return Promise.reject(Object.assign(new Error(message), response));
4810
3374
  };
4811
3375
  const deserializeAws_json1_1UpdateImagePermissionsCommand = async (output, context) => {
4812
3376
  if (output.statusCode >= 300) {
@@ -4833,43 +3397,22 @@ const deserializeAws_json1_1UpdateImagePermissionsCommandError = async (output,
4833
3397
  switch (errorCode) {
4834
3398
  case "LimitExceededException":
4835
3399
  case "com.amazonaws.appstream#LimitExceededException":
4836
- response = {
4837
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
4838
- name: errorCode,
4839
- $metadata: deserializeMetadata(output),
4840
- };
4841
- break;
3400
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
4842
3401
  case "ResourceNotAvailableException":
4843
3402
  case "com.amazonaws.appstream#ResourceNotAvailableException":
4844
- response = {
4845
- ...(await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context)),
4846
- name: errorCode,
4847
- $metadata: deserializeMetadata(output),
4848
- };
4849
- break;
3403
+ throw await deserializeAws_json1_1ResourceNotAvailableExceptionResponse(parsedOutput, context);
4850
3404
  case "ResourceNotFoundException":
4851
3405
  case "com.amazonaws.appstream#ResourceNotFoundException":
4852
- response = {
4853
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4854
- name: errorCode,
4855
- $metadata: deserializeMetadata(output),
4856
- };
4857
- break;
3406
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4858
3407
  default:
4859
3408
  const parsedBody = parsedOutput.body;
4860
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4861
- response = {
4862
- ...parsedBody,
4863
- name: `${errorCode}`,
4864
- message: parsedBody.message || parsedBody.Message || errorCode,
3409
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3410
+ name: parsedBody.code || parsedBody.Code || errorCode,
4865
3411
  $fault: "client",
4866
3412
  $metadata: deserializeMetadata(output),
4867
- };
3413
+ });
3414
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4868
3415
  }
4869
- const message = response.message || response.Message || errorCode;
4870
- response.message = message;
4871
- delete response.Message;
4872
- return Promise.reject(Object.assign(new Error(message), response));
4873
3416
  };
4874
3417
  const deserializeAws_json1_1UpdateStackCommand = async (output, context) => {
4875
3418
  if (output.statusCode >= 300) {
@@ -4896,245 +3439,166 @@ const deserializeAws_json1_1UpdateStackCommandError = async (output, context) =>
4896
3439
  switch (errorCode) {
4897
3440
  case "ConcurrentModificationException":
4898
3441
  case "com.amazonaws.appstream#ConcurrentModificationException":
4899
- response = {
4900
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4901
- name: errorCode,
4902
- $metadata: deserializeMetadata(output),
4903
- };
4904
- break;
3442
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
4905
3443
  case "IncompatibleImageException":
4906
3444
  case "com.amazonaws.appstream#IncompatibleImageException":
4907
- response = {
4908
- ...(await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context)),
4909
- name: errorCode,
4910
- $metadata: deserializeMetadata(output),
4911
- };
4912
- break;
3445
+ throw await deserializeAws_json1_1IncompatibleImageExceptionResponse(parsedOutput, context);
4913
3446
  case "InvalidAccountStatusException":
4914
3447
  case "com.amazonaws.appstream#InvalidAccountStatusException":
4915
- response = {
4916
- ...(await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context)),
4917
- name: errorCode,
4918
- $metadata: deserializeMetadata(output),
4919
- };
4920
- break;
3448
+ throw await deserializeAws_json1_1InvalidAccountStatusExceptionResponse(parsedOutput, context);
4921
3449
  case "InvalidParameterCombinationException":
4922
3450
  case "com.amazonaws.appstream#InvalidParameterCombinationException":
4923
- response = {
4924
- ...(await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context)),
4925
- name: errorCode,
4926
- $metadata: deserializeMetadata(output),
4927
- };
4928
- break;
3451
+ throw await deserializeAws_json1_1InvalidParameterCombinationExceptionResponse(parsedOutput, context);
4929
3452
  case "InvalidRoleException":
4930
3453
  case "com.amazonaws.appstream#InvalidRoleException":
4931
- response = {
4932
- ...(await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context)),
4933
- name: errorCode,
4934
- $metadata: deserializeMetadata(output),
4935
- };
4936
- break;
3454
+ throw await deserializeAws_json1_1InvalidRoleExceptionResponse(parsedOutput, context);
4937
3455
  case "LimitExceededException":
4938
3456
  case "com.amazonaws.appstream#LimitExceededException":
4939
- response = {
4940
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
4941
- name: errorCode,
4942
- $metadata: deserializeMetadata(output),
4943
- };
4944
- break;
3457
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
4945
3458
  case "OperationNotPermittedException":
4946
3459
  case "com.amazonaws.appstream#OperationNotPermittedException":
4947
- response = {
4948
- ...(await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context)),
4949
- name: errorCode,
4950
- $metadata: deserializeMetadata(output),
4951
- };
4952
- break;
3460
+ throw await deserializeAws_json1_1OperationNotPermittedExceptionResponse(parsedOutput, context);
4953
3461
  case "ResourceInUseException":
4954
3462
  case "com.amazonaws.appstream#ResourceInUseException":
4955
- response = {
4956
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
4957
- name: errorCode,
4958
- $metadata: deserializeMetadata(output),
4959
- };
4960
- break;
3463
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
4961
3464
  case "ResourceNotFoundException":
4962
3465
  case "com.amazonaws.appstream#ResourceNotFoundException":
4963
- response = {
4964
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4965
- name: errorCode,
4966
- $metadata: deserializeMetadata(output),
4967
- };
4968
- break;
3466
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
4969
3467
  default:
4970
3468
  const parsedBody = parsedOutput.body;
4971
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4972
- response = {
4973
- ...parsedBody,
4974
- name: `${errorCode}`,
4975
- message: parsedBody.message || parsedBody.Message || errorCode,
3469
+ response = new AppStreamServiceException_1.AppStreamServiceException({
3470
+ name: parsedBody.code || parsedBody.Code || errorCode,
4976
3471
  $fault: "client",
4977
3472
  $metadata: deserializeMetadata(output),
4978
- };
3473
+ });
3474
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4979
3475
  }
4980
- const message = response.message || response.Message || errorCode;
4981
- response.message = message;
4982
- delete response.Message;
4983
- return Promise.reject(Object.assign(new Error(message), response));
4984
3476
  };
4985
3477
  const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (parsedOutput, context) => {
4986
3478
  const body = parsedOutput.body;
4987
3479
  const deserialized = deserializeAws_json1_1ConcurrentModificationException(body, context);
4988
- const contents = {
4989
- name: "ConcurrentModificationException",
4990
- $fault: "client",
3480
+ const exception = new models_0_1.ConcurrentModificationException({
4991
3481
  $metadata: deserializeMetadata(parsedOutput),
4992
3482
  ...deserialized,
4993
- };
4994
- return contents;
3483
+ });
3484
+ return smithy_client_1.decorateServiceException(exception, body);
4995
3485
  };
4996
3486
  const deserializeAws_json1_1EntitlementAlreadyExistsExceptionResponse = async (parsedOutput, context) => {
4997
3487
  const body = parsedOutput.body;
4998
3488
  const deserialized = deserializeAws_json1_1EntitlementAlreadyExistsException(body, context);
4999
- const contents = {
5000
- name: "EntitlementAlreadyExistsException",
5001
- $fault: "client",
3489
+ const exception = new models_0_1.EntitlementAlreadyExistsException({
5002
3490
  $metadata: deserializeMetadata(parsedOutput),
5003
3491
  ...deserialized,
5004
- };
5005
- return contents;
3492
+ });
3493
+ return smithy_client_1.decorateServiceException(exception, body);
5006
3494
  };
5007
3495
  const deserializeAws_json1_1EntitlementNotFoundExceptionResponse = async (parsedOutput, context) => {
5008
3496
  const body = parsedOutput.body;
5009
3497
  const deserialized = deserializeAws_json1_1EntitlementNotFoundException(body, context);
5010
- const contents = {
5011
- name: "EntitlementNotFoundException",
5012
- $fault: "client",
3498
+ const exception = new models_0_1.EntitlementNotFoundException({
5013
3499
  $metadata: deserializeMetadata(parsedOutput),
5014
3500
  ...deserialized,
5015
- };
5016
- return contents;
3501
+ });
3502
+ return smithy_client_1.decorateServiceException(exception, body);
5017
3503
  };
5018
3504
  const deserializeAws_json1_1IncompatibleImageExceptionResponse = async (parsedOutput, context) => {
5019
3505
  const body = parsedOutput.body;
5020
3506
  const deserialized = deserializeAws_json1_1IncompatibleImageException(body, context);
5021
- const contents = {
5022
- name: "IncompatibleImageException",
5023
- $fault: "client",
3507
+ const exception = new models_0_1.IncompatibleImageException({
5024
3508
  $metadata: deserializeMetadata(parsedOutput),
5025
3509
  ...deserialized,
5026
- };
5027
- return contents;
3510
+ });
3511
+ return smithy_client_1.decorateServiceException(exception, body);
5028
3512
  };
5029
3513
  const deserializeAws_json1_1InvalidAccountStatusExceptionResponse = async (parsedOutput, context) => {
5030
3514
  const body = parsedOutput.body;
5031
3515
  const deserialized = deserializeAws_json1_1InvalidAccountStatusException(body, context);
5032
- const contents = {
5033
- name: "InvalidAccountStatusException",
5034
- $fault: "client",
3516
+ const exception = new models_0_1.InvalidAccountStatusException({
5035
3517
  $metadata: deserializeMetadata(parsedOutput),
5036
3518
  ...deserialized,
5037
- };
5038
- return contents;
3519
+ });
3520
+ return smithy_client_1.decorateServiceException(exception, body);
5039
3521
  };
5040
3522
  const deserializeAws_json1_1InvalidParameterCombinationExceptionResponse = async (parsedOutput, context) => {
5041
3523
  const body = parsedOutput.body;
5042
3524
  const deserialized = deserializeAws_json1_1InvalidParameterCombinationException(body, context);
5043
- const contents = {
5044
- name: "InvalidParameterCombinationException",
5045
- $fault: "client",
3525
+ const exception = new models_0_1.InvalidParameterCombinationException({
5046
3526
  $metadata: deserializeMetadata(parsedOutput),
5047
3527
  ...deserialized,
5048
- };
5049
- return contents;
3528
+ });
3529
+ return smithy_client_1.decorateServiceException(exception, body);
5050
3530
  };
5051
3531
  const deserializeAws_json1_1InvalidRoleExceptionResponse = async (parsedOutput, context) => {
5052
3532
  const body = parsedOutput.body;
5053
3533
  const deserialized = deserializeAws_json1_1InvalidRoleException(body, context);
5054
- const contents = {
5055
- name: "InvalidRoleException",
5056
- $fault: "client",
3534
+ const exception = new models_0_1.InvalidRoleException({
5057
3535
  $metadata: deserializeMetadata(parsedOutput),
5058
3536
  ...deserialized,
5059
- };
5060
- return contents;
3537
+ });
3538
+ return smithy_client_1.decorateServiceException(exception, body);
5061
3539
  };
5062
3540
  const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
5063
3541
  const body = parsedOutput.body;
5064
3542
  const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
5065
- const contents = {
5066
- name: "LimitExceededException",
5067
- $fault: "client",
3543
+ const exception = new models_0_1.LimitExceededException({
5068
3544
  $metadata: deserializeMetadata(parsedOutput),
5069
3545
  ...deserialized,
5070
- };
5071
- return contents;
3546
+ });
3547
+ return smithy_client_1.decorateServiceException(exception, body);
5072
3548
  };
5073
3549
  const deserializeAws_json1_1OperationNotPermittedExceptionResponse = async (parsedOutput, context) => {
5074
3550
  const body = parsedOutput.body;
5075
3551
  const deserialized = deserializeAws_json1_1OperationNotPermittedException(body, context);
5076
- const contents = {
5077
- name: "OperationNotPermittedException",
5078
- $fault: "client",
3552
+ const exception = new models_0_1.OperationNotPermittedException({
5079
3553
  $metadata: deserializeMetadata(parsedOutput),
5080
3554
  ...deserialized,
5081
- };
5082
- return contents;
3555
+ });
3556
+ return smithy_client_1.decorateServiceException(exception, body);
5083
3557
  };
5084
3558
  const deserializeAws_json1_1RequestLimitExceededExceptionResponse = async (parsedOutput, context) => {
5085
3559
  const body = parsedOutput.body;
5086
3560
  const deserialized = deserializeAws_json1_1RequestLimitExceededException(body, context);
5087
- const contents = {
5088
- name: "RequestLimitExceededException",
5089
- $fault: "client",
3561
+ const exception = new models_0_1.RequestLimitExceededException({
5090
3562
  $metadata: deserializeMetadata(parsedOutput),
5091
3563
  ...deserialized,
5092
- };
5093
- return contents;
3564
+ });
3565
+ return smithy_client_1.decorateServiceException(exception, body);
5094
3566
  };
5095
3567
  const deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse = async (parsedOutput, context) => {
5096
3568
  const body = parsedOutput.body;
5097
3569
  const deserialized = deserializeAws_json1_1ResourceAlreadyExistsException(body, context);
5098
- const contents = {
5099
- name: "ResourceAlreadyExistsException",
5100
- $fault: "client",
3570
+ const exception = new models_0_1.ResourceAlreadyExistsException({
5101
3571
  $metadata: deserializeMetadata(parsedOutput),
5102
3572
  ...deserialized,
5103
- };
5104
- return contents;
3573
+ });
3574
+ return smithy_client_1.decorateServiceException(exception, body);
5105
3575
  };
5106
3576
  const deserializeAws_json1_1ResourceInUseExceptionResponse = async (parsedOutput, context) => {
5107
3577
  const body = parsedOutput.body;
5108
3578
  const deserialized = deserializeAws_json1_1ResourceInUseException(body, context);
5109
- const contents = {
5110
- name: "ResourceInUseException",
5111
- $fault: "client",
3579
+ const exception = new models_0_1.ResourceInUseException({
5112
3580
  $metadata: deserializeMetadata(parsedOutput),
5113
3581
  ...deserialized,
5114
- };
5115
- return contents;
3582
+ });
3583
+ return smithy_client_1.decorateServiceException(exception, body);
5116
3584
  };
5117
3585
  const deserializeAws_json1_1ResourceNotAvailableExceptionResponse = async (parsedOutput, context) => {
5118
3586
  const body = parsedOutput.body;
5119
3587
  const deserialized = deserializeAws_json1_1ResourceNotAvailableException(body, context);
5120
- const contents = {
5121
- name: "ResourceNotAvailableException",
5122
- $fault: "client",
3588
+ const exception = new models_0_1.ResourceNotAvailableException({
5123
3589
  $metadata: deserializeMetadata(parsedOutput),
5124
3590
  ...deserialized,
5125
- };
5126
- return contents;
3591
+ });
3592
+ return smithy_client_1.decorateServiceException(exception, body);
5127
3593
  };
5128
3594
  const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
5129
3595
  const body = parsedOutput.body;
5130
3596
  const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
5131
- const contents = {
5132
- name: "ResourceNotFoundException",
5133
- $fault: "client",
3597
+ const exception = new models_0_1.ResourceNotFoundException({
5134
3598
  $metadata: deserializeMetadata(parsedOutput),
5135
3599
  ...deserialized,
5136
- };
5137
- return contents;
3600
+ });
3601
+ return smithy_client_1.decorateServiceException(exception, body);
5138
3602
  };
5139
3603
  const serializeAws_json1_1AccessEndpoint = (input, context) => {
5140
3604
  return {
@@ -6128,7 +4592,7 @@ const deserializeAws_json1_1AccessEndpoint = (output, context) => {
6128
4592
  };
6129
4593
  };
6130
4594
  const deserializeAws_json1_1AccessEndpointList = (output, context) => {
6131
- return (output || [])
4595
+ const retVal = (output || [])
6132
4596
  .filter((e) => e != null)
6133
4597
  .map((entry) => {
6134
4598
  if (entry === null) {
@@ -6136,6 +4600,7 @@ const deserializeAws_json1_1AccessEndpointList = (output, context) => {
6136
4600
  }
6137
4601
  return deserializeAws_json1_1AccessEndpoint(entry, context);
6138
4602
  });
4603
+ return retVal;
6139
4604
  };
6140
4605
  const deserializeAws_json1_1AppBlock = (output, context) => {
6141
4606
  return {
@@ -6155,7 +4620,7 @@ const deserializeAws_json1_1AppBlock = (output, context) => {
6155
4620
  };
6156
4621
  };
6157
4622
  const deserializeAws_json1_1AppBlocks = (output, context) => {
6158
- return (output || [])
4623
+ const retVal = (output || [])
6159
4624
  .filter((e) => e != null)
6160
4625
  .map((entry) => {
6161
4626
  if (entry === null) {
@@ -6163,6 +4628,7 @@ const deserializeAws_json1_1AppBlocks = (output, context) => {
6163
4628
  }
6164
4629
  return deserializeAws_json1_1AppBlock(entry, context);
6165
4630
  });
4631
+ return retVal;
6166
4632
  };
6167
4633
  const deserializeAws_json1_1Application = (output, context) => {
6168
4634
  return {
@@ -6200,7 +4666,7 @@ const deserializeAws_json1_1ApplicationFleetAssociation = (output, context) => {
6200
4666
  };
6201
4667
  };
6202
4668
  const deserializeAws_json1_1ApplicationFleetAssociationList = (output, context) => {
6203
- return (output || [])
4669
+ const retVal = (output || [])
6204
4670
  .filter((e) => e != null)
6205
4671
  .map((entry) => {
6206
4672
  if (entry === null) {
@@ -6208,9 +4674,10 @@ const deserializeAws_json1_1ApplicationFleetAssociationList = (output, context)
6208
4674
  }
6209
4675
  return deserializeAws_json1_1ApplicationFleetAssociation(entry, context);
6210
4676
  });
4677
+ return retVal;
6211
4678
  };
6212
4679
  const deserializeAws_json1_1Applications = (output, context) => {
6213
- return (output || [])
4680
+ const retVal = (output || [])
6214
4681
  .filter((e) => e != null)
6215
4682
  .map((entry) => {
6216
4683
  if (entry === null) {
@@ -6218,6 +4685,7 @@ const deserializeAws_json1_1Applications = (output, context) => {
6218
4685
  }
6219
4686
  return deserializeAws_json1_1Application(entry, context);
6220
4687
  });
4688
+ return retVal;
6221
4689
  };
6222
4690
  const deserializeAws_json1_1ApplicationSettingsResponse = (output, context) => {
6223
4691
  return {
@@ -6522,7 +4990,7 @@ const deserializeAws_json1_1DirectoryConfig = (output, context) => {
6522
4990
  };
6523
4991
  };
6524
4992
  const deserializeAws_json1_1DirectoryConfigList = (output, context) => {
6525
- return (output || [])
4993
+ const retVal = (output || [])
6526
4994
  .filter((e) => e != null)
6527
4995
  .map((entry) => {
6528
4996
  if (entry === null) {
@@ -6530,6 +4998,7 @@ const deserializeAws_json1_1DirectoryConfigList = (output, context) => {
6530
4998
  }
6531
4999
  return deserializeAws_json1_1DirectoryConfig(entry, context);
6532
5000
  });
5001
+ return retVal;
6533
5002
  };
6534
5003
  const deserializeAws_json1_1DisableUserResult = (output, context) => {
6535
5004
  return {};
@@ -6550,7 +5019,7 @@ const deserializeAws_json1_1DomainJoinInfo = (output, context) => {
6550
5019
  };
6551
5020
  };
6552
5021
  const deserializeAws_json1_1DomainList = (output, context) => {
6553
- return (output || [])
5022
+ const retVal = (output || [])
6554
5023
  .filter((e) => e != null)
6555
5024
  .map((entry) => {
6556
5025
  if (entry === null) {
@@ -6558,9 +5027,10 @@ const deserializeAws_json1_1DomainList = (output, context) => {
6558
5027
  }
6559
5028
  return smithy_client_1.expectString(entry);
6560
5029
  });
5030
+ return retVal;
6561
5031
  };
6562
5032
  const deserializeAws_json1_1EmbedHostDomains = (output, context) => {
6563
- return (output || [])
5033
+ const retVal = (output || [])
6564
5034
  .filter((e) => e != null)
6565
5035
  .map((entry) => {
6566
5036
  if (entry === null) {
@@ -6568,6 +5038,7 @@ const deserializeAws_json1_1EmbedHostDomains = (output, context) => {
6568
5038
  }
6569
5039
  return smithy_client_1.expectString(entry);
6570
5040
  });
5041
+ return retVal;
6571
5042
  };
6572
5043
  const deserializeAws_json1_1EnableUserResult = (output, context) => {
6573
5044
  return {};
@@ -6578,7 +5049,7 @@ const deserializeAws_json1_1EntitledApplication = (output, context) => {
6578
5049
  };
6579
5050
  };
6580
5051
  const deserializeAws_json1_1EntitledApplicationList = (output, context) => {
6581
- return (output || [])
5052
+ const retVal = (output || [])
6582
5053
  .filter((e) => e != null)
6583
5054
  .map((entry) => {
6584
5055
  if (entry === null) {
@@ -6586,6 +5057,7 @@ const deserializeAws_json1_1EntitledApplicationList = (output, context) => {
6586
5057
  }
6587
5058
  return deserializeAws_json1_1EntitledApplication(entry, context);
6588
5059
  });
5060
+ return retVal;
6589
5061
  };
6590
5062
  const deserializeAws_json1_1Entitlement = (output, context) => {
6591
5063
  return {
@@ -6616,7 +5088,7 @@ const deserializeAws_json1_1EntitlementAttribute = (output, context) => {
6616
5088
  };
6617
5089
  };
6618
5090
  const deserializeAws_json1_1EntitlementAttributeList = (output, context) => {
6619
- return (output || [])
5091
+ const retVal = (output || [])
6620
5092
  .filter((e) => e != null)
6621
5093
  .map((entry) => {
6622
5094
  if (entry === null) {
@@ -6624,9 +5096,10 @@ const deserializeAws_json1_1EntitlementAttributeList = (output, context) => {
6624
5096
  }
6625
5097
  return deserializeAws_json1_1EntitlementAttribute(entry, context);
6626
5098
  });
5099
+ return retVal;
6627
5100
  };
6628
5101
  const deserializeAws_json1_1EntitlementList = (output, context) => {
6629
- return (output || [])
5102
+ const retVal = (output || [])
6630
5103
  .filter((e) => e != null)
6631
5104
  .map((entry) => {
6632
5105
  if (entry === null) {
@@ -6634,6 +5107,7 @@ const deserializeAws_json1_1EntitlementList = (output, context) => {
6634
5107
  }
6635
5108
  return deserializeAws_json1_1Entitlement(entry, context);
6636
5109
  });
5110
+ return retVal;
6637
5111
  };
6638
5112
  const deserializeAws_json1_1EntitlementNotFoundException = (output, context) => {
6639
5113
  return {
@@ -6689,7 +5163,7 @@ const deserializeAws_json1_1FleetError = (output, context) => {
6689
5163
  };
6690
5164
  };
6691
5165
  const deserializeAws_json1_1FleetErrors = (output, context) => {
6692
- return (output || [])
5166
+ const retVal = (output || [])
6693
5167
  .filter((e) => e != null)
6694
5168
  .map((entry) => {
6695
5169
  if (entry === null) {
@@ -6697,9 +5171,10 @@ const deserializeAws_json1_1FleetErrors = (output, context) => {
6697
5171
  }
6698
5172
  return deserializeAws_json1_1FleetError(entry, context);
6699
5173
  });
5174
+ return retVal;
6700
5175
  };
6701
5176
  const deserializeAws_json1_1FleetList = (output, context) => {
6702
- return (output || [])
5177
+ const retVal = (output || [])
6703
5178
  .filter((e) => e != null)
6704
5179
  .map((entry) => {
6705
5180
  if (entry === null) {
@@ -6707,6 +5182,7 @@ const deserializeAws_json1_1FleetList = (output, context) => {
6707
5182
  }
6708
5183
  return deserializeAws_json1_1Fleet(entry, context);
6709
5184
  });
5185
+ return retVal;
6710
5186
  };
6711
5187
  const deserializeAws_json1_1Image = (output, context) => {
6712
5188
  return {
@@ -6778,7 +5254,7 @@ const deserializeAws_json1_1ImageBuilder = (output, context) => {
6778
5254
  };
6779
5255
  };
6780
5256
  const deserializeAws_json1_1ImageBuilderList = (output, context) => {
6781
- return (output || [])
5257
+ const retVal = (output || [])
6782
5258
  .filter((e) => e != null)
6783
5259
  .map((entry) => {
6784
5260
  if (entry === null) {
@@ -6786,6 +5262,7 @@ const deserializeAws_json1_1ImageBuilderList = (output, context) => {
6786
5262
  }
6787
5263
  return deserializeAws_json1_1ImageBuilder(entry, context);
6788
5264
  });
5265
+ return retVal;
6789
5266
  };
6790
5267
  const deserializeAws_json1_1ImageBuilderStateChangeReason = (output, context) => {
6791
5268
  return {
@@ -6794,7 +5271,7 @@ const deserializeAws_json1_1ImageBuilderStateChangeReason = (output, context) =>
6794
5271
  };
6795
5272
  };
6796
5273
  const deserializeAws_json1_1ImageList = (output, context) => {
6797
- return (output || [])
5274
+ const retVal = (output || [])
6798
5275
  .filter((e) => e != null)
6799
5276
  .map((entry) => {
6800
5277
  if (entry === null) {
@@ -6802,6 +5279,7 @@ const deserializeAws_json1_1ImageList = (output, context) => {
6802
5279
  }
6803
5280
  return deserializeAws_json1_1Image(entry, context);
6804
5281
  });
5282
+ return retVal;
6805
5283
  };
6806
5284
  const deserializeAws_json1_1ImagePermissions = (output, context) => {
6807
5285
  return {
@@ -6842,7 +5320,7 @@ const deserializeAws_json1_1LastReportGenerationExecutionError = (output, contex
6842
5320
  };
6843
5321
  };
6844
5322
  const deserializeAws_json1_1LastReportGenerationExecutionErrors = (output, context) => {
6845
- return (output || [])
5323
+ const retVal = (output || [])
6846
5324
  .filter((e) => e != null)
6847
5325
  .map((entry) => {
6848
5326
  if (entry === null) {
@@ -6850,6 +5328,7 @@ const deserializeAws_json1_1LastReportGenerationExecutionErrors = (output, conte
6850
5328
  }
6851
5329
  return deserializeAws_json1_1LastReportGenerationExecutionError(entry, context);
6852
5330
  });
5331
+ return retVal;
6853
5332
  };
6854
5333
  const deserializeAws_json1_1LimitExceededException = (output, context) => {
6855
5334
  return {
@@ -6908,7 +5387,7 @@ const deserializeAws_json1_1OperationNotPermittedException = (output, context) =
6908
5387
  };
6909
5388
  };
6910
5389
  const deserializeAws_json1_1OrganizationalUnitDistinguishedNamesList = (output, context) => {
6911
- return (output || [])
5390
+ const retVal = (output || [])
6912
5391
  .filter((e) => e != null)
6913
5392
  .map((entry) => {
6914
5393
  if (entry === null) {
@@ -6916,9 +5395,10 @@ const deserializeAws_json1_1OrganizationalUnitDistinguishedNamesList = (output,
6916
5395
  }
6917
5396
  return smithy_client_1.expectString(entry);
6918
5397
  });
5398
+ return retVal;
6919
5399
  };
6920
5400
  const deserializeAws_json1_1Platforms = (output, context) => {
6921
- return (output || [])
5401
+ const retVal = (output || [])
6922
5402
  .filter((e) => e != null)
6923
5403
  .map((entry) => {
6924
5404
  if (entry === null) {
@@ -6926,6 +5406,7 @@ const deserializeAws_json1_1Platforms = (output, context) => {
6926
5406
  }
6927
5407
  return smithy_client_1.expectString(entry);
6928
5408
  });
5409
+ return retVal;
6929
5410
  };
6930
5411
  const deserializeAws_json1_1RequestLimitExceededException = (output, context) => {
6931
5412
  return {
@@ -6947,7 +5428,7 @@ const deserializeAws_json1_1ResourceError = (output, context) => {
6947
5428
  };
6948
5429
  };
6949
5430
  const deserializeAws_json1_1ResourceErrors = (output, context) => {
6950
- return (output || [])
5431
+ const retVal = (output || [])
6951
5432
  .filter((e) => e != null)
6952
5433
  .map((entry) => {
6953
5434
  if (entry === null) {
@@ -6955,6 +5436,7 @@ const deserializeAws_json1_1ResourceErrors = (output, context) => {
6955
5436
  }
6956
5437
  return deserializeAws_json1_1ResourceError(entry, context);
6957
5438
  });
5439
+ return retVal;
6958
5440
  };
6959
5441
  const deserializeAws_json1_1ResourceInUseException = (output, context) => {
6960
5442
  return {
@@ -6988,7 +5470,7 @@ const deserializeAws_json1_1ScriptDetails = (output, context) => {
6988
5470
  };
6989
5471
  };
6990
5472
  const deserializeAws_json1_1SecurityGroupIdList = (output, context) => {
6991
- return (output || [])
5473
+ const retVal = (output || [])
6992
5474
  .filter((e) => e != null)
6993
5475
  .map((entry) => {
6994
5476
  if (entry === null) {
@@ -6996,6 +5478,7 @@ const deserializeAws_json1_1SecurityGroupIdList = (output, context) => {
6996
5478
  }
6997
5479
  return smithy_client_1.expectString(entry);
6998
5480
  });
5481
+ return retVal;
6999
5482
  };
7000
5483
  const deserializeAws_json1_1ServiceAccountCredentials = (output, context) => {
7001
5484
  return {
@@ -7024,7 +5507,7 @@ const deserializeAws_json1_1Session = (output, context) => {
7024
5507
  };
7025
5508
  };
7026
5509
  const deserializeAws_json1_1SessionList = (output, context) => {
7027
- return (output || [])
5510
+ const retVal = (output || [])
7028
5511
  .filter((e) => e != null)
7029
5512
  .map((entry) => {
7030
5513
  if (entry === null) {
@@ -7032,6 +5515,7 @@ const deserializeAws_json1_1SessionList = (output, context) => {
7032
5515
  }
7033
5516
  return deserializeAws_json1_1Session(entry, context);
7034
5517
  });
5518
+ return retVal;
7035
5519
  };
7036
5520
  const deserializeAws_json1_1SharedImagePermissions = (output, context) => {
7037
5521
  return {
@@ -7042,7 +5526,7 @@ const deserializeAws_json1_1SharedImagePermissions = (output, context) => {
7042
5526
  };
7043
5527
  };
7044
5528
  const deserializeAws_json1_1SharedImagePermissionsList = (output, context) => {
7045
- return (output || [])
5529
+ const retVal = (output || [])
7046
5530
  .filter((e) => e != null)
7047
5531
  .map((entry) => {
7048
5532
  if (entry === null) {
@@ -7050,6 +5534,7 @@ const deserializeAws_json1_1SharedImagePermissionsList = (output, context) => {
7050
5534
  }
7051
5535
  return deserializeAws_json1_1SharedImagePermissions(entry, context);
7052
5536
  });
5537
+ return retVal;
7053
5538
  };
7054
5539
  const deserializeAws_json1_1Stack = (output, context) => {
7055
5540
  return {
@@ -7089,7 +5574,7 @@ const deserializeAws_json1_1StackError = (output, context) => {
7089
5574
  };
7090
5575
  };
7091
5576
  const deserializeAws_json1_1StackErrors = (output, context) => {
7092
- return (output || [])
5577
+ const retVal = (output || [])
7093
5578
  .filter((e) => e != null)
7094
5579
  .map((entry) => {
7095
5580
  if (entry === null) {
@@ -7097,9 +5582,10 @@ const deserializeAws_json1_1StackErrors = (output, context) => {
7097
5582
  }
7098
5583
  return deserializeAws_json1_1StackError(entry, context);
7099
5584
  });
5585
+ return retVal;
7100
5586
  };
7101
5587
  const deserializeAws_json1_1StackList = (output, context) => {
7102
- return (output || [])
5588
+ const retVal = (output || [])
7103
5589
  .filter((e) => e != null)
7104
5590
  .map((entry) => {
7105
5591
  if (entry === null) {
@@ -7107,6 +5593,7 @@ const deserializeAws_json1_1StackList = (output, context) => {
7107
5593
  }
7108
5594
  return deserializeAws_json1_1Stack(entry, context);
7109
5595
  });
5596
+ return retVal;
7110
5597
  };
7111
5598
  const deserializeAws_json1_1StartFleetResult = (output, context) => {
7112
5599
  return {};
@@ -7138,7 +5625,7 @@ const deserializeAws_json1_1StorageConnector = (output, context) => {
7138
5625
  };
7139
5626
  };
7140
5627
  const deserializeAws_json1_1StorageConnectorList = (output, context) => {
7141
- return (output || [])
5628
+ const retVal = (output || [])
7142
5629
  .filter((e) => e != null)
7143
5630
  .map((entry) => {
7144
5631
  if (entry === null) {
@@ -7146,9 +5633,10 @@ const deserializeAws_json1_1StorageConnectorList = (output, context) => {
7146
5633
  }
7147
5634
  return deserializeAws_json1_1StorageConnector(entry, context);
7148
5635
  });
5636
+ return retVal;
7149
5637
  };
7150
5638
  const deserializeAws_json1_1StringList = (output, context) => {
7151
- return (output || [])
5639
+ const retVal = (output || [])
7152
5640
  .filter((e) => e != null)
7153
5641
  .map((entry) => {
7154
5642
  if (entry === null) {
@@ -7156,9 +5644,10 @@ const deserializeAws_json1_1StringList = (output, context) => {
7156
5644
  }
7157
5645
  return smithy_client_1.expectString(entry);
7158
5646
  });
5647
+ return retVal;
7159
5648
  };
7160
5649
  const deserializeAws_json1_1SubnetIdList = (output, context) => {
7161
- return (output || [])
5650
+ const retVal = (output || [])
7162
5651
  .filter((e) => e != null)
7163
5652
  .map((entry) => {
7164
5653
  if (entry === null) {
@@ -7166,6 +5655,7 @@ const deserializeAws_json1_1SubnetIdList = (output, context) => {
7166
5655
  }
7167
5656
  return smithy_client_1.expectString(entry);
7168
5657
  });
5658
+ return retVal;
7169
5659
  };
7170
5660
  const deserializeAws_json1_1TagResourceResponse = (output, context) => {
7171
5661
  return {};
@@ -7235,7 +5725,7 @@ const deserializeAws_json1_1UsageReportSubscription = (output, context) => {
7235
5725
  };
7236
5726
  };
7237
5727
  const deserializeAws_json1_1UsageReportSubscriptionList = (output, context) => {
7238
- return (output || [])
5728
+ const retVal = (output || [])
7239
5729
  .filter((e) => e != null)
7240
5730
  .map((entry) => {
7241
5731
  if (entry === null) {
@@ -7243,9 +5733,10 @@ const deserializeAws_json1_1UsageReportSubscriptionList = (output, context) => {
7243
5733
  }
7244
5734
  return deserializeAws_json1_1UsageReportSubscription(entry, context);
7245
5735
  });
5736
+ return retVal;
7246
5737
  };
7247
5738
  const deserializeAws_json1_1UsbDeviceFilterStrings = (output, context) => {
7248
- return (output || [])
5739
+ const retVal = (output || [])
7249
5740
  .filter((e) => e != null)
7250
5741
  .map((entry) => {
7251
5742
  if (entry === null) {
@@ -7253,6 +5744,7 @@ const deserializeAws_json1_1UsbDeviceFilterStrings = (output, context) => {
7253
5744
  }
7254
5745
  return smithy_client_1.expectString(entry);
7255
5746
  });
5747
+ return retVal;
7256
5748
  };
7257
5749
  const deserializeAws_json1_1User = (output, context) => {
7258
5750
  return {
@@ -7269,7 +5761,7 @@ const deserializeAws_json1_1User = (output, context) => {
7269
5761
  };
7270
5762
  };
7271
5763
  const deserializeAws_json1_1UserList = (output, context) => {
7272
- return (output || [])
5764
+ const retVal = (output || [])
7273
5765
  .filter((e) => e != null)
7274
5766
  .map((entry) => {
7275
5767
  if (entry === null) {
@@ -7277,6 +5769,7 @@ const deserializeAws_json1_1UserList = (output, context) => {
7277
5769
  }
7278
5770
  return deserializeAws_json1_1User(entry, context);
7279
5771
  });
5772
+ return retVal;
7280
5773
  };
7281
5774
  const deserializeAws_json1_1UserSetting = (output, context) => {
7282
5775
  return {
@@ -7285,7 +5778,7 @@ const deserializeAws_json1_1UserSetting = (output, context) => {
7285
5778
  };
7286
5779
  };
7287
5780
  const deserializeAws_json1_1UserSettingList = (output, context) => {
7288
- return (output || [])
5781
+ const retVal = (output || [])
7289
5782
  .filter((e) => e != null)
7290
5783
  .map((entry) => {
7291
5784
  if (entry === null) {
@@ -7293,6 +5786,7 @@ const deserializeAws_json1_1UserSettingList = (output, context) => {
7293
5786
  }
7294
5787
  return deserializeAws_json1_1UserSetting(entry, context);
7295
5788
  });
5789
+ return retVal;
7296
5790
  };
7297
5791
  const deserializeAws_json1_1UserStackAssociation = (output, context) => {
7298
5792
  return {
@@ -7312,7 +5806,7 @@ const deserializeAws_json1_1UserStackAssociationError = (output, context) => {
7312
5806
  };
7313
5807
  };
7314
5808
  const deserializeAws_json1_1UserStackAssociationErrorList = (output, context) => {
7315
- return (output || [])
5809
+ const retVal = (output || [])
7316
5810
  .filter((e) => e != null)
7317
5811
  .map((entry) => {
7318
5812
  if (entry === null) {
@@ -7320,9 +5814,10 @@ const deserializeAws_json1_1UserStackAssociationErrorList = (output, context) =>
7320
5814
  }
7321
5815
  return deserializeAws_json1_1UserStackAssociationError(entry, context);
7322
5816
  });
5817
+ return retVal;
7323
5818
  };
7324
5819
  const deserializeAws_json1_1UserStackAssociationList = (output, context) => {
7325
- return (output || [])
5820
+ const retVal = (output || [])
7326
5821
  .filter((e) => e != null)
7327
5822
  .map((entry) => {
7328
5823
  if (entry === null) {
@@ -7330,6 +5825,7 @@ const deserializeAws_json1_1UserStackAssociationList = (output, context) => {
7330
5825
  }
7331
5826
  return deserializeAws_json1_1UserStackAssociation(entry, context);
7332
5827
  });
5828
+ return retVal;
7333
5829
  };
7334
5830
  const deserializeAws_json1_1VpcConfig = (output, context) => {
7335
5831
  return {