@aws-sdk/client-mwaa 3.51.0 → 3.54.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.
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_restJson1UpdateEnvironmentCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1PublishMetricsCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListEnvironmentsCommand = exports.deserializeAws_restJson1GetEnvironmentCommand = exports.deserializeAws_restJson1DeleteEnvironmentCommand = exports.deserializeAws_restJson1CreateWebLoginTokenCommand = exports.deserializeAws_restJson1CreateEnvironmentCommand = exports.deserializeAws_restJson1CreateCliTokenCommand = exports.serializeAws_restJson1UpdateEnvironmentCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1PublishMetricsCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListEnvironmentsCommand = exports.serializeAws_restJson1GetEnvironmentCommand = exports.serializeAws_restJson1DeleteEnvironmentCommand = exports.serializeAws_restJson1CreateWebLoginTokenCommand = exports.serializeAws_restJson1CreateEnvironmentCommand = exports.serializeAws_restJson1CreateCliTokenCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const MWAAServiceException_1 = require("../models/MWAAServiceException");
6
8
  const serializeAws_restJson1CreateCliTokenCommand = async (input, context) => {
7
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
10
  const headers = {};
@@ -490,27 +492,16 @@ const deserializeAws_restJson1CreateCliTokenCommandError = async (output, contex
490
492
  switch (errorCode) {
491
493
  case "ResourceNotFoundException":
492
494
  case "com.amazonaws.mwaa#ResourceNotFoundException":
493
- response = {
494
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
495
- name: errorCode,
496
- $metadata: deserializeMetadata(output),
497
- };
498
- break;
495
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
499
496
  default:
500
497
  const parsedBody = parsedOutput.body;
501
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
502
- response = {
503
- ...parsedBody,
504
- name: `${errorCode}`,
505
- message: parsedBody.message || parsedBody.Message || errorCode,
498
+ response = new MWAAServiceException_1.MWAAServiceException({
499
+ name: parsedBody.code || parsedBody.Code || errorCode,
506
500
  $fault: "client",
507
501
  $metadata: deserializeMetadata(output),
508
- };
502
+ });
503
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
509
504
  }
510
- const message = response.message || response.Message || errorCode;
511
- response.message = message;
512
- delete response.Message;
513
- return Promise.reject(Object.assign(new Error(message), response));
514
505
  };
515
506
  const deserializeAws_restJson1CreateEnvironmentCommand = async (output, context) => {
516
507
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -538,35 +529,19 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, con
538
529
  switch (errorCode) {
539
530
  case "InternalServerException":
540
531
  case "com.amazonaws.mwaa#InternalServerException":
541
- response = {
542
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
543
- name: errorCode,
544
- $metadata: deserializeMetadata(output),
545
- };
546
- break;
532
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
547
533
  case "ValidationException":
548
534
  case "com.amazonaws.mwaa#ValidationException":
549
- response = {
550
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
551
- name: errorCode,
552
- $metadata: deserializeMetadata(output),
553
- };
554
- break;
535
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
555
536
  default:
556
537
  const parsedBody = parsedOutput.body;
557
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
558
- response = {
559
- ...parsedBody,
560
- name: `${errorCode}`,
561
- message: parsedBody.message || parsedBody.Message || errorCode,
538
+ response = new MWAAServiceException_1.MWAAServiceException({
539
+ name: parsedBody.code || parsedBody.Code || errorCode,
562
540
  $fault: "client",
563
541
  $metadata: deserializeMetadata(output),
564
- };
542
+ });
543
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
565
544
  }
566
- const message = response.message || response.Message || errorCode;
567
- response.message = message;
568
- delete response.Message;
569
- return Promise.reject(Object.assign(new Error(message), response));
570
545
  };
571
546
  const deserializeAws_restJson1CreateWebLoginTokenCommand = async (output, context) => {
572
547
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -598,51 +573,25 @@ const deserializeAws_restJson1CreateWebLoginTokenCommandError = async (output, c
598
573
  switch (errorCode) {
599
574
  case "AccessDeniedException":
600
575
  case "com.amazonaws.mwaa#AccessDeniedException":
601
- response = {
602
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
603
- name: errorCode,
604
- $metadata: deserializeMetadata(output),
605
- };
606
- break;
576
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
607
577
  case "InternalServerException":
608
578
  case "com.amazonaws.mwaa#InternalServerException":
609
- response = {
610
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
611
- name: errorCode,
612
- $metadata: deserializeMetadata(output),
613
- };
614
- break;
579
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
615
580
  case "ResourceNotFoundException":
616
581
  case "com.amazonaws.mwaa#ResourceNotFoundException":
617
- response = {
618
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
619
- name: errorCode,
620
- $metadata: deserializeMetadata(output),
621
- };
622
- break;
582
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
623
583
  case "ValidationException":
624
584
  case "com.amazonaws.mwaa#ValidationException":
625
- response = {
626
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
627
- name: errorCode,
628
- $metadata: deserializeMetadata(output),
629
- };
630
- break;
585
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
631
586
  default:
632
587
  const parsedBody = parsedOutput.body;
633
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
634
- response = {
635
- ...parsedBody,
636
- name: `${errorCode}`,
637
- message: parsedBody.message || parsedBody.Message || errorCode,
588
+ response = new MWAAServiceException_1.MWAAServiceException({
589
+ name: parsedBody.code || parsedBody.Code || errorCode,
638
590
  $fault: "client",
639
591
  $metadata: deserializeMetadata(output),
640
- };
592
+ });
593
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
641
594
  }
642
- const message = response.message || response.Message || errorCode;
643
- response.message = message;
644
- delete response.Message;
645
- return Promise.reject(Object.assign(new Error(message), response));
646
595
  };
647
596
  const deserializeAws_restJson1DeleteEnvironmentCommand = async (output, context) => {
648
597
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -666,43 +615,22 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, con
666
615
  switch (errorCode) {
667
616
  case "InternalServerException":
668
617
  case "com.amazonaws.mwaa#InternalServerException":
669
- response = {
670
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
671
- name: errorCode,
672
- $metadata: deserializeMetadata(output),
673
- };
674
- break;
618
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
675
619
  case "ResourceNotFoundException":
676
620
  case "com.amazonaws.mwaa#ResourceNotFoundException":
677
- response = {
678
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
679
- name: errorCode,
680
- $metadata: deserializeMetadata(output),
681
- };
682
- break;
621
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
683
622
  case "ValidationException":
684
623
  case "com.amazonaws.mwaa#ValidationException":
685
- response = {
686
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
687
- name: errorCode,
688
- $metadata: deserializeMetadata(output),
689
- };
690
- break;
624
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
691
625
  default:
692
626
  const parsedBody = parsedOutput.body;
693
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
694
- response = {
695
- ...parsedBody,
696
- name: `${errorCode}`,
697
- message: parsedBody.message || parsedBody.Message || errorCode,
627
+ response = new MWAAServiceException_1.MWAAServiceException({
628
+ name: parsedBody.code || parsedBody.Code || errorCode,
698
629
  $fault: "client",
699
630
  $metadata: deserializeMetadata(output),
700
- };
631
+ });
632
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
701
633
  }
702
- const message = response.message || response.Message || errorCode;
703
- response.message = message;
704
- delete response.Message;
705
- return Promise.reject(Object.assign(new Error(message), response));
706
634
  };
707
635
  const deserializeAws_restJson1GetEnvironmentCommand = async (output, context) => {
708
636
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -730,43 +658,22 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async (output, contex
730
658
  switch (errorCode) {
731
659
  case "InternalServerException":
732
660
  case "com.amazonaws.mwaa#InternalServerException":
733
- response = {
734
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
735
- name: errorCode,
736
- $metadata: deserializeMetadata(output),
737
- };
738
- break;
661
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
739
662
  case "ResourceNotFoundException":
740
663
  case "com.amazonaws.mwaa#ResourceNotFoundException":
741
- response = {
742
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
743
- name: errorCode,
744
- $metadata: deserializeMetadata(output),
745
- };
746
- break;
664
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
747
665
  case "ValidationException":
748
666
  case "com.amazonaws.mwaa#ValidationException":
749
- response = {
750
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
751
- name: errorCode,
752
- $metadata: deserializeMetadata(output),
753
- };
754
- break;
667
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
755
668
  default:
756
669
  const parsedBody = parsedOutput.body;
757
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
758
- response = {
759
- ...parsedBody,
760
- name: `${errorCode}`,
761
- message: parsedBody.message || parsedBody.Message || errorCode,
670
+ response = new MWAAServiceException_1.MWAAServiceException({
671
+ name: parsedBody.code || parsedBody.Code || errorCode,
762
672
  $fault: "client",
763
673
  $metadata: deserializeMetadata(output),
764
- };
674
+ });
675
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
765
676
  }
766
- const message = response.message || response.Message || errorCode;
767
- response.message = message;
768
- delete response.Message;
769
- return Promise.reject(Object.assign(new Error(message), response));
770
677
  };
771
678
  const deserializeAws_restJson1ListEnvironmentsCommand = async (output, context) => {
772
679
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -798,35 +705,19 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, cont
798
705
  switch (errorCode) {
799
706
  case "InternalServerException":
800
707
  case "com.amazonaws.mwaa#InternalServerException":
801
- response = {
802
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
803
- name: errorCode,
804
- $metadata: deserializeMetadata(output),
805
- };
806
- break;
708
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
807
709
  case "ValidationException":
808
710
  case "com.amazonaws.mwaa#ValidationException":
809
- response = {
810
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
811
- name: errorCode,
812
- $metadata: deserializeMetadata(output),
813
- };
814
- break;
711
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
815
712
  default:
816
713
  const parsedBody = parsedOutput.body;
817
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
818
- response = {
819
- ...parsedBody,
820
- name: `${errorCode}`,
821
- message: parsedBody.message || parsedBody.Message || errorCode,
714
+ response = new MWAAServiceException_1.MWAAServiceException({
715
+ name: parsedBody.code || parsedBody.Code || errorCode,
822
716
  $fault: "client",
823
717
  $metadata: deserializeMetadata(output),
824
- };
718
+ });
719
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
825
720
  }
826
- const message = response.message || response.Message || errorCode;
827
- response.message = message;
828
- delete response.Message;
829
- return Promise.reject(Object.assign(new Error(message), response));
830
721
  };
831
722
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
832
723
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -854,43 +745,22 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
854
745
  switch (errorCode) {
855
746
  case "InternalServerException":
856
747
  case "com.amazonaws.mwaa#InternalServerException":
857
- response = {
858
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
859
- name: errorCode,
860
- $metadata: deserializeMetadata(output),
861
- };
862
- break;
748
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
863
749
  case "ResourceNotFoundException":
864
750
  case "com.amazonaws.mwaa#ResourceNotFoundException":
865
- response = {
866
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
867
- name: errorCode,
868
- $metadata: deserializeMetadata(output),
869
- };
870
- break;
751
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
871
752
  case "ValidationException":
872
753
  case "com.amazonaws.mwaa#ValidationException":
873
- response = {
874
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
875
- name: errorCode,
876
- $metadata: deserializeMetadata(output),
877
- };
878
- break;
754
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
879
755
  default:
880
756
  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,
757
+ response = new MWAAServiceException_1.MWAAServiceException({
758
+ name: parsedBody.code || parsedBody.Code || errorCode,
886
759
  $fault: "client",
887
760
  $metadata: deserializeMetadata(output),
888
- };
761
+ });
762
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
889
763
  }
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
764
  };
895
765
  const deserializeAws_restJson1PublishMetricsCommand = async (output, context) => {
896
766
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -914,35 +784,19 @@ const deserializeAws_restJson1PublishMetricsCommandError = async (output, contex
914
784
  switch (errorCode) {
915
785
  case "InternalServerException":
916
786
  case "com.amazonaws.mwaa#InternalServerException":
917
- response = {
918
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
919
- name: errorCode,
920
- $metadata: deserializeMetadata(output),
921
- };
922
- break;
787
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
923
788
  case "ValidationException":
924
789
  case "com.amazonaws.mwaa#ValidationException":
925
- response = {
926
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
927
- name: errorCode,
928
- $metadata: deserializeMetadata(output),
929
- };
930
- break;
790
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
931
791
  default:
932
792
  const parsedBody = parsedOutput.body;
933
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
934
- response = {
935
- ...parsedBody,
936
- name: `${errorCode}`,
937
- message: parsedBody.message || parsedBody.Message || errorCode,
793
+ response = new MWAAServiceException_1.MWAAServiceException({
794
+ name: parsedBody.code || parsedBody.Code || errorCode,
938
795
  $fault: "client",
939
796
  $metadata: deserializeMetadata(output),
940
- };
797
+ });
798
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
941
799
  }
942
- const message = response.message || response.Message || errorCode;
943
- response.message = message;
944
- delete response.Message;
945
- return Promise.reject(Object.assign(new Error(message), response));
946
800
  };
947
801
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
948
802
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -966,43 +820,22 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
966
820
  switch (errorCode) {
967
821
  case "InternalServerException":
968
822
  case "com.amazonaws.mwaa#InternalServerException":
969
- response = {
970
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
971
- name: errorCode,
972
- $metadata: deserializeMetadata(output),
973
- };
974
- break;
823
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
975
824
  case "ResourceNotFoundException":
976
825
  case "com.amazonaws.mwaa#ResourceNotFoundException":
977
- response = {
978
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
979
- name: errorCode,
980
- $metadata: deserializeMetadata(output),
981
- };
982
- break;
826
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
983
827
  case "ValidationException":
984
828
  case "com.amazonaws.mwaa#ValidationException":
985
- response = {
986
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
987
- name: errorCode,
988
- $metadata: deserializeMetadata(output),
989
- };
990
- break;
829
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
991
830
  default:
992
831
  const parsedBody = parsedOutput.body;
993
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
994
- response = {
995
- ...parsedBody,
996
- name: `${errorCode}`,
997
- message: parsedBody.message || parsedBody.Message || errorCode,
832
+ response = new MWAAServiceException_1.MWAAServiceException({
833
+ name: parsedBody.code || parsedBody.Code || errorCode,
998
834
  $fault: "client",
999
835
  $metadata: deserializeMetadata(output),
1000
- };
836
+ });
837
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1001
838
  }
1002
- const message = response.message || response.Message || errorCode;
1003
- response.message = message;
1004
- delete response.Message;
1005
- return Promise.reject(Object.assign(new Error(message), response));
1006
839
  };
1007
840
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1008
841
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1026,43 +859,22 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1026
859
  switch (errorCode) {
1027
860
  case "InternalServerException":
1028
861
  case "com.amazonaws.mwaa#InternalServerException":
1029
- response = {
1030
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1031
- name: errorCode,
1032
- $metadata: deserializeMetadata(output),
1033
- };
1034
- break;
862
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1035
863
  case "ResourceNotFoundException":
1036
864
  case "com.amazonaws.mwaa#ResourceNotFoundException":
1037
- response = {
1038
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1039
- name: errorCode,
1040
- $metadata: deserializeMetadata(output),
1041
- };
1042
- break;
865
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1043
866
  case "ValidationException":
1044
867
  case "com.amazonaws.mwaa#ValidationException":
1045
- response = {
1046
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1047
- name: errorCode,
1048
- $metadata: deserializeMetadata(output),
1049
- };
1050
- break;
868
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1051
869
  default:
1052
870
  const parsedBody = parsedOutput.body;
1053
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1054
- response = {
1055
- ...parsedBody,
1056
- name: `${errorCode}`,
1057
- message: parsedBody.message || parsedBody.Message || errorCode,
871
+ response = new MWAAServiceException_1.MWAAServiceException({
872
+ name: parsedBody.code || parsedBody.Code || errorCode,
1058
873
  $fault: "client",
1059
874
  $metadata: deserializeMetadata(output),
1060
- };
875
+ });
876
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1061
877
  }
1062
- const message = response.message || response.Message || errorCode;
1063
- response.message = message;
1064
- delete response.Message;
1065
- return Promise.reject(Object.assign(new Error(message), response));
1066
878
  };
1067
879
  const deserializeAws_restJson1UpdateEnvironmentCommand = async (output, context) => {
1068
880
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1090,95 +902,70 @@ const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, con
1090
902
  switch (errorCode) {
1091
903
  case "InternalServerException":
1092
904
  case "com.amazonaws.mwaa#InternalServerException":
1093
- response = {
1094
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1095
- name: errorCode,
1096
- $metadata: deserializeMetadata(output),
1097
- };
1098
- break;
905
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1099
906
  case "ResourceNotFoundException":
1100
907
  case "com.amazonaws.mwaa#ResourceNotFoundException":
1101
- response = {
1102
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1103
- name: errorCode,
1104
- $metadata: deserializeMetadata(output),
1105
- };
1106
- break;
908
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1107
909
  case "ValidationException":
1108
910
  case "com.amazonaws.mwaa#ValidationException":
1109
- response = {
1110
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1111
- name: errorCode,
1112
- $metadata: deserializeMetadata(output),
1113
- };
1114
- break;
911
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1115
912
  default:
1116
913
  const parsedBody = parsedOutput.body;
1117
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1118
- response = {
1119
- ...parsedBody,
1120
- name: `${errorCode}`,
1121
- message: parsedBody.message || parsedBody.Message || errorCode,
914
+ response = new MWAAServiceException_1.MWAAServiceException({
915
+ name: parsedBody.code || parsedBody.Code || errorCode,
1122
916
  $fault: "client",
1123
917
  $metadata: deserializeMetadata(output),
1124
- };
918
+ });
919
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1125
920
  }
1126
- const message = response.message || response.Message || errorCode;
1127
- response.message = message;
1128
- delete response.Message;
1129
- return Promise.reject(Object.assign(new Error(message), response));
1130
921
  };
1131
922
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1132
- const contents = {
1133
- name: "AccessDeniedException",
1134
- $fault: "client",
1135
- $metadata: deserializeMetadata(parsedOutput),
1136
- Message: undefined,
1137
- };
923
+ const contents = {};
1138
924
  const data = parsedOutput.body;
1139
925
  if (data.Message !== undefined && data.Message !== null) {
1140
926
  contents.Message = smithy_client_1.expectString(data.Message);
1141
927
  }
1142
- return contents;
928
+ const exception = new models_0_1.AccessDeniedException({
929
+ $metadata: deserializeMetadata(parsedOutput),
930
+ ...contents,
931
+ });
932
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1143
933
  };
1144
934
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1145
- const contents = {
1146
- name: "InternalServerException",
1147
- $fault: "server",
1148
- $metadata: deserializeMetadata(parsedOutput),
1149
- message: undefined,
1150
- };
935
+ const contents = {};
1151
936
  const data = parsedOutput.body;
1152
937
  if (data.message !== undefined && data.message !== null) {
1153
938
  contents.message = smithy_client_1.expectString(data.message);
1154
939
  }
1155
- return contents;
940
+ const exception = new models_0_1.InternalServerException({
941
+ $metadata: deserializeMetadata(parsedOutput),
942
+ ...contents,
943
+ });
944
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1156
945
  };
1157
946
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1158
- const contents = {
1159
- name: "ResourceNotFoundException",
1160
- $fault: "client",
1161
- $metadata: deserializeMetadata(parsedOutput),
1162
- message: undefined,
1163
- };
947
+ const contents = {};
1164
948
  const data = parsedOutput.body;
1165
949
  if (data.message !== undefined && data.message !== null) {
1166
950
  contents.message = smithy_client_1.expectString(data.message);
1167
951
  }
1168
- return contents;
952
+ const exception = new models_0_1.ResourceNotFoundException({
953
+ $metadata: deserializeMetadata(parsedOutput),
954
+ ...contents,
955
+ });
956
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1169
957
  };
1170
958
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1171
- const contents = {
1172
- name: "ValidationException",
1173
- $fault: "client",
1174
- $metadata: deserializeMetadata(parsedOutput),
1175
- message: undefined,
1176
- };
959
+ const contents = {};
1177
960
  const data = parsedOutput.body;
1178
961
  if (data.message !== undefined && data.message !== null) {
1179
962
  contents.message = smithy_client_1.expectString(data.message);
1180
963
  }
1181
- return contents;
964
+ const exception = new models_0_1.ValidationException({
965
+ $metadata: deserializeMetadata(parsedOutput),
966
+ ...contents,
967
+ });
968
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1182
969
  };
1183
970
  const serializeAws_restJson1AirflowConfigurationOptions = (input, context) => {
1184
971
  return Object.entries(input).reduce((acc, [key, value]) => {
@@ -1373,7 +1160,7 @@ const deserializeAws_restJson1Environment = (output, context) => {
1373
1160
  };
1374
1161
  };
1375
1162
  const deserializeAws_restJson1EnvironmentList = (output, context) => {
1376
- return (output || [])
1163
+ const retVal = (output || [])
1377
1164
  .filter((e) => e != null)
1378
1165
  .map((entry) => {
1379
1166
  if (entry === null) {
@@ -1381,6 +1168,7 @@ const deserializeAws_restJson1EnvironmentList = (output, context) => {
1381
1168
  }
1382
1169
  return smithy_client_1.expectString(entry);
1383
1170
  });
1171
+ return retVal;
1384
1172
  };
1385
1173
  const deserializeAws_restJson1LastUpdate = (output, context) => {
1386
1174
  return {
@@ -1431,7 +1219,7 @@ const deserializeAws_restJson1NetworkConfiguration = (output, context) => {
1431
1219
  };
1432
1220
  };
1433
1221
  const deserializeAws_restJson1SecurityGroupList = (output, context) => {
1434
- return (output || [])
1222
+ const retVal = (output || [])
1435
1223
  .filter((e) => e != null)
1436
1224
  .map((entry) => {
1437
1225
  if (entry === null) {
@@ -1439,9 +1227,10 @@ const deserializeAws_restJson1SecurityGroupList = (output, context) => {
1439
1227
  }
1440
1228
  return smithy_client_1.expectString(entry);
1441
1229
  });
1230
+ return retVal;
1442
1231
  };
1443
1232
  const deserializeAws_restJson1SubnetList = (output, context) => {
1444
- return (output || [])
1233
+ const retVal = (output || [])
1445
1234
  .filter((e) => e != null)
1446
1235
  .map((entry) => {
1447
1236
  if (entry === null) {
@@ -1449,6 +1238,7 @@ const deserializeAws_restJson1SubnetList = (output, context) => {
1449
1238
  }
1450
1239
  return smithy_client_1.expectString(entry);
1451
1240
  });
1241
+ return retVal;
1452
1242
  };
1453
1243
  const deserializeAws_restJson1TagMap = (output, context) => {
1454
1244
  return Object.entries(output).reduce((acc, [key, value]) => {
package/dist-es/index.js CHANGED
@@ -3,3 +3,4 @@ export * from "./MWAAClient";
3
3
  export * from "./commands";
4
4
  export * from "./models";
5
5
  export * from "./pagination";
6
+ export { MWAAServiceException } from "./models/MWAAServiceException";