@aws-sdk/client-finspace-data 3.52.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.
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1UpdateDatasetCommand = exports.deserializeAws_re
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const uuid_1 = require("uuid");
7
+ const FinspaceDataServiceException_1 = require("../models/FinspaceDataServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_restJson1CreateChangesetCommand = async (input, context) => {
8
10
  var _a;
9
11
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -495,75 +497,34 @@ const deserializeAws_restJson1CreateChangesetCommandError = async (output, conte
495
497
  switch (errorCode) {
496
498
  case "AccessDeniedException":
497
499
  case "com.amazonaws.finspacedata#AccessDeniedException":
498
- response = {
499
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
500
- name: errorCode,
501
- $metadata: deserializeMetadata(output),
502
- };
503
- break;
500
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
504
501
  case "ConflictException":
505
502
  case "com.amazonaws.finspacedata#ConflictException":
506
- response = {
507
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
508
- name: errorCode,
509
- $metadata: deserializeMetadata(output),
510
- };
511
- break;
503
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
512
504
  case "InternalServerException":
513
505
  case "com.amazonaws.finspacedata#InternalServerException":
514
- response = {
515
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
516
- name: errorCode,
517
- $metadata: deserializeMetadata(output),
518
- };
519
- break;
506
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
520
507
  case "LimitExceededException":
521
508
  case "com.amazonaws.finspacedata#LimitExceededException":
522
- response = {
523
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
524
- name: errorCode,
525
- $metadata: deserializeMetadata(output),
526
- };
527
- break;
509
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
528
510
  case "ResourceNotFoundException":
529
511
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
530
- response = {
531
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
532
- name: errorCode,
533
- $metadata: deserializeMetadata(output),
534
- };
535
- break;
512
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
536
513
  case "ThrottlingException":
537
514
  case "com.amazonaws.finspacedata#ThrottlingException":
538
- response = {
539
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
540
- name: errorCode,
541
- $metadata: deserializeMetadata(output),
542
- };
543
- break;
515
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
544
516
  case "ValidationException":
545
517
  case "com.amazonaws.finspacedata#ValidationException":
546
- response = {
547
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
548
- name: errorCode,
549
- $metadata: deserializeMetadata(output),
550
- };
551
- break;
518
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
552
519
  default:
553
520
  const parsedBody = parsedOutput.body;
554
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
555
- response = {
556
- ...parsedBody,
557
- name: `${errorCode}`,
558
- message: parsedBody.message || parsedBody.Message || errorCode,
521
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
522
+ name: parsedBody.code || parsedBody.Code || errorCode,
559
523
  $fault: "client",
560
524
  $metadata: deserializeMetadata(output),
561
- };
525
+ });
526
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
562
527
  }
563
- const message = response.message || response.Message || errorCode;
564
- response.message = message;
565
- delete response.Message;
566
- return Promise.reject(Object.assign(new Error(message), response));
567
528
  };
568
529
  const deserializeAws_restJson1CreateDatasetCommand = async (output, context) => {
569
530
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -591,75 +552,34 @@ const deserializeAws_restJson1CreateDatasetCommandError = async (output, context
591
552
  switch (errorCode) {
592
553
  case "AccessDeniedException":
593
554
  case "com.amazonaws.finspacedata#AccessDeniedException":
594
- response = {
595
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
596
- name: errorCode,
597
- $metadata: deserializeMetadata(output),
598
- };
599
- break;
555
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
600
556
  case "ConflictException":
601
557
  case "com.amazonaws.finspacedata#ConflictException":
602
- response = {
603
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
604
- name: errorCode,
605
- $metadata: deserializeMetadata(output),
606
- };
607
- break;
558
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
608
559
  case "InternalServerException":
609
560
  case "com.amazonaws.finspacedata#InternalServerException":
610
- response = {
611
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
612
- name: errorCode,
613
- $metadata: deserializeMetadata(output),
614
- };
615
- break;
561
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
616
562
  case "LimitExceededException":
617
563
  case "com.amazonaws.finspacedata#LimitExceededException":
618
- response = {
619
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
620
- name: errorCode,
621
- $metadata: deserializeMetadata(output),
622
- };
623
- break;
564
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
624
565
  case "ResourceNotFoundException":
625
566
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
626
- response = {
627
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
628
- name: errorCode,
629
- $metadata: deserializeMetadata(output),
630
- };
631
- break;
567
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
632
568
  case "ThrottlingException":
633
569
  case "com.amazonaws.finspacedata#ThrottlingException":
634
- response = {
635
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
636
- name: errorCode,
637
- $metadata: deserializeMetadata(output),
638
- };
639
- break;
570
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
640
571
  case "ValidationException":
641
572
  case "com.amazonaws.finspacedata#ValidationException":
642
- response = {
643
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
644
- name: errorCode,
645
- $metadata: deserializeMetadata(output),
646
- };
647
- break;
573
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
648
574
  default:
649
575
  const parsedBody = parsedOutput.body;
650
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
651
- response = {
652
- ...parsedBody,
653
- name: `${errorCode}`,
654
- message: parsedBody.message || parsedBody.Message || errorCode,
576
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
577
+ name: parsedBody.code || parsedBody.Code || errorCode,
655
578
  $fault: "client",
656
579
  $metadata: deserializeMetadata(output),
657
- };
580
+ });
581
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
658
582
  }
659
- const message = response.message || response.Message || errorCode;
660
- response.message = message;
661
- delete response.Message;
662
- return Promise.reject(Object.assign(new Error(message), response));
663
583
  };
664
584
  const deserializeAws_restJson1CreateDataViewCommand = async (output, context) => {
665
585
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -691,67 +611,31 @@ const deserializeAws_restJson1CreateDataViewCommandError = async (output, contex
691
611
  switch (errorCode) {
692
612
  case "ConflictException":
693
613
  case "com.amazonaws.finspacedata#ConflictException":
694
- response = {
695
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
696
- name: errorCode,
697
- $metadata: deserializeMetadata(output),
698
- };
699
- break;
614
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
700
615
  case "InternalServerException":
701
616
  case "com.amazonaws.finspacedata#InternalServerException":
702
- response = {
703
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
704
- name: errorCode,
705
- $metadata: deserializeMetadata(output),
706
- };
707
- break;
617
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
708
618
  case "LimitExceededException":
709
619
  case "com.amazonaws.finspacedata#LimitExceededException":
710
- response = {
711
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
712
- name: errorCode,
713
- $metadata: deserializeMetadata(output),
714
- };
715
- break;
620
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
716
621
  case "ResourceNotFoundException":
717
622
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
718
- response = {
719
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
720
- name: errorCode,
721
- $metadata: deserializeMetadata(output),
722
- };
723
- break;
623
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
724
624
  case "ThrottlingException":
725
625
  case "com.amazonaws.finspacedata#ThrottlingException":
726
- response = {
727
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
728
- name: errorCode,
729
- $metadata: deserializeMetadata(output),
730
- };
731
- break;
626
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
732
627
  case "ValidationException":
733
628
  case "com.amazonaws.finspacedata#ValidationException":
734
- response = {
735
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
736
- name: errorCode,
737
- $metadata: deserializeMetadata(output),
738
- };
739
- break;
629
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
740
630
  default:
741
631
  const parsedBody = parsedOutput.body;
742
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
743
- response = {
744
- ...parsedBody,
745
- name: `${errorCode}`,
746
- message: parsedBody.message || parsedBody.Message || errorCode,
632
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
633
+ name: parsedBody.code || parsedBody.Code || errorCode,
747
634
  $fault: "client",
748
635
  $metadata: deserializeMetadata(output),
749
- };
636
+ });
637
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
750
638
  }
751
- const message = response.message || response.Message || errorCode;
752
- response.message = message;
753
- delete response.Message;
754
- return Promise.reject(Object.assign(new Error(message), response));
755
639
  };
756
640
  const deserializeAws_restJson1DeleteDatasetCommand = async (output, context) => {
757
641
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -779,75 +663,34 @@ const deserializeAws_restJson1DeleteDatasetCommandError = async (output, context
779
663
  switch (errorCode) {
780
664
  case "AccessDeniedException":
781
665
  case "com.amazonaws.finspacedata#AccessDeniedException":
782
- response = {
783
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
784
- name: errorCode,
785
- $metadata: deserializeMetadata(output),
786
- };
787
- break;
666
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
788
667
  case "ConflictException":
789
668
  case "com.amazonaws.finspacedata#ConflictException":
790
- response = {
791
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
792
- name: errorCode,
793
- $metadata: deserializeMetadata(output),
794
- };
795
- break;
669
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
796
670
  case "InternalServerException":
797
671
  case "com.amazonaws.finspacedata#InternalServerException":
798
- response = {
799
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
800
- name: errorCode,
801
- $metadata: deserializeMetadata(output),
802
- };
803
- break;
672
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
804
673
  case "LimitExceededException":
805
674
  case "com.amazonaws.finspacedata#LimitExceededException":
806
- response = {
807
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
808
- name: errorCode,
809
- $metadata: deserializeMetadata(output),
810
- };
811
- break;
675
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
812
676
  case "ResourceNotFoundException":
813
677
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
814
- response = {
815
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
816
- name: errorCode,
817
- $metadata: deserializeMetadata(output),
818
- };
819
- break;
678
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
820
679
  case "ThrottlingException":
821
680
  case "com.amazonaws.finspacedata#ThrottlingException":
822
- response = {
823
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
824
- name: errorCode,
825
- $metadata: deserializeMetadata(output),
826
- };
827
- break;
681
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
828
682
  case "ValidationException":
829
683
  case "com.amazonaws.finspacedata#ValidationException":
830
- response = {
831
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
832
- name: errorCode,
833
- $metadata: deserializeMetadata(output),
834
- };
835
- break;
684
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
836
685
  default:
837
686
  const parsedBody = parsedOutput.body;
838
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
839
- response = {
840
- ...parsedBody,
841
- name: `${errorCode}`,
842
- message: parsedBody.message || parsedBody.Message || errorCode,
687
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
688
+ name: parsedBody.code || parsedBody.Code || errorCode,
843
689
  $fault: "client",
844
690
  $metadata: deserializeMetadata(output),
845
- };
691
+ });
692
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
846
693
  }
847
- const message = response.message || response.Message || errorCode;
848
- response.message = message;
849
- delete response.Message;
850
- return Promise.reject(Object.assign(new Error(message), response));
851
694
  };
852
695
  const deserializeAws_restJson1GetChangesetCommand = async (output, context) => {
853
696
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -923,67 +766,31 @@ const deserializeAws_restJson1GetChangesetCommandError = async (output, context)
923
766
  switch (errorCode) {
924
767
  case "AccessDeniedException":
925
768
  case "com.amazonaws.finspacedata#AccessDeniedException":
926
- response = {
927
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
928
- name: errorCode,
929
- $metadata: deserializeMetadata(output),
930
- };
931
- break;
769
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
932
770
  case "ConflictException":
933
771
  case "com.amazonaws.finspacedata#ConflictException":
934
- response = {
935
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
936
- name: errorCode,
937
- $metadata: deserializeMetadata(output),
938
- };
939
- break;
772
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
940
773
  case "InternalServerException":
941
774
  case "com.amazonaws.finspacedata#InternalServerException":
942
- response = {
943
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
944
- name: errorCode,
945
- $metadata: deserializeMetadata(output),
946
- };
947
- break;
775
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
948
776
  case "ResourceNotFoundException":
949
777
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
950
- response = {
951
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
952
- name: errorCode,
953
- $metadata: deserializeMetadata(output),
954
- };
955
- break;
778
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
956
779
  case "ThrottlingException":
957
780
  case "com.amazonaws.finspacedata#ThrottlingException":
958
- response = {
959
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
960
- name: errorCode,
961
- $metadata: deserializeMetadata(output),
962
- };
963
- break;
781
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
964
782
  case "ValidationException":
965
783
  case "com.amazonaws.finspacedata#ValidationException":
966
- response = {
967
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
968
- name: errorCode,
969
- $metadata: deserializeMetadata(output),
970
- };
971
- break;
784
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
972
785
  default:
973
786
  const parsedBody = parsedOutput.body;
974
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
975
- response = {
976
- ...parsedBody,
977
- name: `${errorCode}`,
978
- message: parsedBody.message || parsedBody.Message || errorCode,
787
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
788
+ name: parsedBody.code || parsedBody.Code || errorCode,
979
789
  $fault: "client",
980
790
  $metadata: deserializeMetadata(output),
981
- };
791
+ });
792
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
982
793
  }
983
- const message = response.message || response.Message || errorCode;
984
- response.message = message;
985
- delete response.Message;
986
- return Promise.reject(Object.assign(new Error(message), response));
987
794
  };
988
795
  const deserializeAws_restJson1GetDatasetCommand = async (output, context) => {
989
796
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1047,67 +854,31 @@ const deserializeAws_restJson1GetDatasetCommandError = async (output, context) =
1047
854
  switch (errorCode) {
1048
855
  case "AccessDeniedException":
1049
856
  case "com.amazonaws.finspacedata#AccessDeniedException":
1050
- response = {
1051
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1052
- name: errorCode,
1053
- $metadata: deserializeMetadata(output),
1054
- };
1055
- break;
857
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1056
858
  case "ConflictException":
1057
859
  case "com.amazonaws.finspacedata#ConflictException":
1058
- response = {
1059
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1060
- name: errorCode,
1061
- $metadata: deserializeMetadata(output),
1062
- };
1063
- break;
860
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1064
861
  case "InternalServerException":
1065
862
  case "com.amazonaws.finspacedata#InternalServerException":
1066
- response = {
1067
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1068
- name: errorCode,
1069
- $metadata: deserializeMetadata(output),
1070
- };
1071
- break;
863
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1072
864
  case "ResourceNotFoundException":
1073
865
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
1074
- response = {
1075
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1076
- name: errorCode,
1077
- $metadata: deserializeMetadata(output),
1078
- };
1079
- break;
866
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1080
867
  case "ThrottlingException":
1081
868
  case "com.amazonaws.finspacedata#ThrottlingException":
1082
- response = {
1083
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1084
- name: errorCode,
1085
- $metadata: deserializeMetadata(output),
1086
- };
1087
- break;
869
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1088
870
  case "ValidationException":
1089
871
  case "com.amazonaws.finspacedata#ValidationException":
1090
- response = {
1091
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1092
- name: errorCode,
1093
- $metadata: deserializeMetadata(output),
1094
- };
1095
- break;
872
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1096
873
  default:
1097
874
  const parsedBody = parsedOutput.body;
1098
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1099
- response = {
1100
- ...parsedBody,
1101
- name: `${errorCode}`,
1102
- message: parsedBody.message || parsedBody.Message || errorCode,
875
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
876
+ name: parsedBody.code || parsedBody.Code || errorCode,
1103
877
  $fault: "client",
1104
878
  $metadata: deserializeMetadata(output),
1105
- };
879
+ });
880
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1106
881
  }
1107
- const message = response.message || response.Message || errorCode;
1108
- response.message = message;
1109
- delete response.Message;
1110
- return Promise.reject(Object.assign(new Error(message), response));
1111
882
  };
1112
883
  const deserializeAws_restJson1GetDataViewCommand = async (output, context) => {
1113
884
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1179,59 +950,28 @@ const deserializeAws_restJson1GetDataViewCommandError = async (output, context)
1179
950
  switch (errorCode) {
1180
951
  case "ConflictException":
1181
952
  case "com.amazonaws.finspacedata#ConflictException":
1182
- response = {
1183
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1184
- name: errorCode,
1185
- $metadata: deserializeMetadata(output),
1186
- };
1187
- break;
953
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1188
954
  case "InternalServerException":
1189
955
  case "com.amazonaws.finspacedata#InternalServerException":
1190
- response = {
1191
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1192
- name: errorCode,
1193
- $metadata: deserializeMetadata(output),
1194
- };
1195
- break;
956
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1196
957
  case "ResourceNotFoundException":
1197
958
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
1198
- response = {
1199
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1200
- name: errorCode,
1201
- $metadata: deserializeMetadata(output),
1202
- };
1203
- break;
959
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1204
960
  case "ThrottlingException":
1205
961
  case "com.amazonaws.finspacedata#ThrottlingException":
1206
- response = {
1207
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1208
- name: errorCode,
1209
- $metadata: deserializeMetadata(output),
1210
- };
1211
- break;
962
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1212
963
  case "ValidationException":
1213
964
  case "com.amazonaws.finspacedata#ValidationException":
1214
- response = {
1215
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1216
- name: errorCode,
1217
- $metadata: deserializeMetadata(output),
1218
- };
1219
- break;
965
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1220
966
  default:
1221
967
  const parsedBody = parsedOutput.body;
1222
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1223
- response = {
1224
- ...parsedBody,
1225
- name: `${errorCode}`,
1226
- message: parsedBody.message || parsedBody.Message || errorCode,
968
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
969
+ name: parsedBody.code || parsedBody.Code || errorCode,
1227
970
  $fault: "client",
1228
971
  $metadata: deserializeMetadata(output),
1229
- };
972
+ });
973
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1230
974
  }
1231
- const message = response.message || response.Message || errorCode;
1232
- response.message = message;
1233
- delete response.Message;
1234
- return Promise.reject(Object.assign(new Error(message), response));
1235
975
  };
1236
976
  const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand = async (output, context) => {
1237
977
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1263,51 +1003,25 @@ const deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError = asy
1263
1003
  switch (errorCode) {
1264
1004
  case "AccessDeniedException":
1265
1005
  case "com.amazonaws.finspacedata#AccessDeniedException":
1266
- response = {
1267
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1268
- name: errorCode,
1269
- $metadata: deserializeMetadata(output),
1270
- };
1271
- break;
1006
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1272
1007
  case "InternalServerException":
1273
1008
  case "com.amazonaws.finspacedata#InternalServerException":
1274
- response = {
1275
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1276
- name: errorCode,
1277
- $metadata: deserializeMetadata(output),
1278
- };
1279
- break;
1009
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1280
1010
  case "ThrottlingException":
1281
1011
  case "com.amazonaws.finspacedata#ThrottlingException":
1282
- response = {
1283
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1284
- name: errorCode,
1285
- $metadata: deserializeMetadata(output),
1286
- };
1287
- break;
1012
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1288
1013
  case "ValidationException":
1289
1014
  case "com.amazonaws.finspacedata#ValidationException":
1290
- response = {
1291
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1292
- name: errorCode,
1293
- $metadata: deserializeMetadata(output),
1294
- };
1295
- break;
1015
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1296
1016
  default:
1297
1017
  const parsedBody = parsedOutput.body;
1298
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1299
- response = {
1300
- ...parsedBody,
1301
- name: `${errorCode}`,
1302
- message: parsedBody.message || parsedBody.Message || errorCode,
1018
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1019
+ name: parsedBody.code || parsedBody.Code || errorCode,
1303
1020
  $fault: "client",
1304
1021
  $metadata: deserializeMetadata(output),
1305
- };
1022
+ });
1023
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1306
1024
  }
1307
- const message = response.message || response.Message || errorCode;
1308
- response.message = message;
1309
- delete response.Message;
1310
- return Promise.reject(Object.assign(new Error(message), response));
1311
1025
  };
1312
1026
  const deserializeAws_restJson1GetWorkingLocationCommand = async (output, context) => {
1313
1027
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1343,51 +1057,25 @@ const deserializeAws_restJson1GetWorkingLocationCommandError = async (output, co
1343
1057
  switch (errorCode) {
1344
1058
  case "AccessDeniedException":
1345
1059
  case "com.amazonaws.finspacedata#AccessDeniedException":
1346
- response = {
1347
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1348
- name: errorCode,
1349
- $metadata: deserializeMetadata(output),
1350
- };
1351
- break;
1060
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1352
1061
  case "InternalServerException":
1353
1062
  case "com.amazonaws.finspacedata#InternalServerException":
1354
- response = {
1355
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1356
- name: errorCode,
1357
- $metadata: deserializeMetadata(output),
1358
- };
1359
- break;
1063
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1360
1064
  case "ThrottlingException":
1361
1065
  case "com.amazonaws.finspacedata#ThrottlingException":
1362
- response = {
1363
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1364
- name: errorCode,
1365
- $metadata: deserializeMetadata(output),
1366
- };
1367
- break;
1066
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1368
1067
  case "ValidationException":
1369
1068
  case "com.amazonaws.finspacedata#ValidationException":
1370
- response = {
1371
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1372
- name: errorCode,
1373
- $metadata: deserializeMetadata(output),
1374
- };
1375
- break;
1069
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1376
1070
  default:
1377
1071
  const parsedBody = parsedOutput.body;
1378
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1379
- response = {
1380
- ...parsedBody,
1381
- name: `${errorCode}`,
1382
- message: parsedBody.message || parsedBody.Message || errorCode,
1072
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1073
+ name: parsedBody.code || parsedBody.Code || errorCode,
1383
1074
  $fault: "client",
1384
1075
  $metadata: deserializeMetadata(output),
1385
- };
1076
+ });
1077
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1386
1078
  }
1387
- const message = response.message || response.Message || errorCode;
1388
- response.message = message;
1389
- delete response.Message;
1390
- return Promise.reject(Object.assign(new Error(message), response));
1391
1079
  };
1392
1080
  const deserializeAws_restJson1ListChangesetsCommand = async (output, context) => {
1393
1081
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1419,67 +1107,31 @@ const deserializeAws_restJson1ListChangesetsCommandError = async (output, contex
1419
1107
  switch (errorCode) {
1420
1108
  case "AccessDeniedException":
1421
1109
  case "com.amazonaws.finspacedata#AccessDeniedException":
1422
- response = {
1423
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1424
- name: errorCode,
1425
- $metadata: deserializeMetadata(output),
1426
- };
1427
- break;
1110
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1428
1111
  case "ConflictException":
1429
1112
  case "com.amazonaws.finspacedata#ConflictException":
1430
- response = {
1431
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1432
- name: errorCode,
1433
- $metadata: deserializeMetadata(output),
1434
- };
1435
- break;
1113
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1436
1114
  case "InternalServerException":
1437
1115
  case "com.amazonaws.finspacedata#InternalServerException":
1438
- response = {
1439
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1440
- name: errorCode,
1441
- $metadata: deserializeMetadata(output),
1442
- };
1443
- break;
1116
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1444
1117
  case "ResourceNotFoundException":
1445
1118
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
1446
- response = {
1447
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1448
- name: errorCode,
1449
- $metadata: deserializeMetadata(output),
1450
- };
1451
- break;
1119
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1452
1120
  case "ThrottlingException":
1453
1121
  case "com.amazonaws.finspacedata#ThrottlingException":
1454
- response = {
1455
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1456
- name: errorCode,
1457
- $metadata: deserializeMetadata(output),
1458
- };
1459
- break;
1122
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1460
1123
  case "ValidationException":
1461
1124
  case "com.amazonaws.finspacedata#ValidationException":
1462
- response = {
1463
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1464
- name: errorCode,
1465
- $metadata: deserializeMetadata(output),
1466
- };
1467
- break;
1125
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1468
1126
  default:
1469
1127
  const parsedBody = parsedOutput.body;
1470
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1471
- response = {
1472
- ...parsedBody,
1473
- name: `${errorCode}`,
1474
- message: parsedBody.message || parsedBody.Message || errorCode,
1128
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1129
+ name: parsedBody.code || parsedBody.Code || errorCode,
1475
1130
  $fault: "client",
1476
1131
  $metadata: deserializeMetadata(output),
1477
- };
1132
+ });
1133
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1478
1134
  }
1479
- const message = response.message || response.Message || errorCode;
1480
- response.message = message;
1481
- delete response.Message;
1482
- return Promise.reject(Object.assign(new Error(message), response));
1483
1135
  };
1484
1136
  const deserializeAws_restJson1ListDatasetsCommand = async (output, context) => {
1485
1137
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1511,59 +1163,28 @@ const deserializeAws_restJson1ListDatasetsCommandError = async (output, context)
1511
1163
  switch (errorCode) {
1512
1164
  case "ConflictException":
1513
1165
  case "com.amazonaws.finspacedata#ConflictException":
1514
- response = {
1515
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1516
- name: errorCode,
1517
- $metadata: deserializeMetadata(output),
1518
- };
1519
- break;
1166
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1520
1167
  case "InternalServerException":
1521
1168
  case "com.amazonaws.finspacedata#InternalServerException":
1522
- response = {
1523
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1524
- name: errorCode,
1525
- $metadata: deserializeMetadata(output),
1526
- };
1527
- break;
1169
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1528
1170
  case "ResourceNotFoundException":
1529
1171
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
1530
- response = {
1531
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1532
- name: errorCode,
1533
- $metadata: deserializeMetadata(output),
1534
- };
1535
- break;
1172
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1536
1173
  case "ThrottlingException":
1537
1174
  case "com.amazonaws.finspacedata#ThrottlingException":
1538
- response = {
1539
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1540
- name: errorCode,
1541
- $metadata: deserializeMetadata(output),
1542
- };
1543
- break;
1175
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1544
1176
  case "ValidationException":
1545
1177
  case "com.amazonaws.finspacedata#ValidationException":
1546
- response = {
1547
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1548
- name: errorCode,
1549
- $metadata: deserializeMetadata(output),
1550
- };
1551
- break;
1178
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1552
1179
  default:
1553
1180
  const parsedBody = parsedOutput.body;
1554
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1555
- response = {
1556
- ...parsedBody,
1557
- name: `${errorCode}`,
1558
- message: parsedBody.message || parsedBody.Message || errorCode,
1181
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1182
+ name: parsedBody.code || parsedBody.Code || errorCode,
1559
1183
  $fault: "client",
1560
1184
  $metadata: deserializeMetadata(output),
1561
- };
1185
+ });
1186
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1562
1187
  }
1563
- const message = response.message || response.Message || errorCode;
1564
- response.message = message;
1565
- delete response.Message;
1566
- return Promise.reject(Object.assign(new Error(message), response));
1567
1188
  };
1568
1189
  const deserializeAws_restJson1ListDataViewsCommand = async (output, context) => {
1569
1190
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1595,59 +1216,28 @@ const deserializeAws_restJson1ListDataViewsCommandError = async (output, context
1595
1216
  switch (errorCode) {
1596
1217
  case "ConflictException":
1597
1218
  case "com.amazonaws.finspacedata#ConflictException":
1598
- response = {
1599
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1600
- name: errorCode,
1601
- $metadata: deserializeMetadata(output),
1602
- };
1603
- break;
1219
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1604
1220
  case "InternalServerException":
1605
1221
  case "com.amazonaws.finspacedata#InternalServerException":
1606
- response = {
1607
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1608
- name: errorCode,
1609
- $metadata: deserializeMetadata(output),
1610
- };
1611
- break;
1222
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1612
1223
  case "ResourceNotFoundException":
1613
1224
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
1614
- response = {
1615
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1616
- name: errorCode,
1617
- $metadata: deserializeMetadata(output),
1618
- };
1619
- break;
1225
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1620
1226
  case "ThrottlingException":
1621
1227
  case "com.amazonaws.finspacedata#ThrottlingException":
1622
- response = {
1623
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1624
- name: errorCode,
1625
- $metadata: deserializeMetadata(output),
1626
- };
1627
- break;
1228
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1628
1229
  case "ValidationException":
1629
1230
  case "com.amazonaws.finspacedata#ValidationException":
1630
- response = {
1631
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1632
- name: errorCode,
1633
- $metadata: deserializeMetadata(output),
1634
- };
1635
- break;
1231
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1636
1232
  default:
1637
1233
  const parsedBody = parsedOutput.body;
1638
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1639
- response = {
1640
- ...parsedBody,
1641
- name: `${errorCode}`,
1642
- message: parsedBody.message || parsedBody.Message || errorCode,
1234
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1235
+ name: parsedBody.code || parsedBody.Code || errorCode,
1643
1236
  $fault: "client",
1644
1237
  $metadata: deserializeMetadata(output),
1645
- };
1238
+ });
1239
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1646
1240
  }
1647
- const message = response.message || response.Message || errorCode;
1648
- response.message = message;
1649
- delete response.Message;
1650
- return Promise.reject(Object.assign(new Error(message), response));
1651
1241
  };
1652
1242
  const deserializeAws_restJson1UpdateChangesetCommand = async (output, context) => {
1653
1243
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1679,67 +1269,31 @@ const deserializeAws_restJson1UpdateChangesetCommandError = async (output, conte
1679
1269
  switch (errorCode) {
1680
1270
  case "AccessDeniedException":
1681
1271
  case "com.amazonaws.finspacedata#AccessDeniedException":
1682
- response = {
1683
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1684
- name: errorCode,
1685
- $metadata: deserializeMetadata(output),
1686
- };
1687
- break;
1272
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1688
1273
  case "ConflictException":
1689
1274
  case "com.amazonaws.finspacedata#ConflictException":
1690
- response = {
1691
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1692
- name: errorCode,
1693
- $metadata: deserializeMetadata(output),
1694
- };
1695
- break;
1275
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1696
1276
  case "InternalServerException":
1697
1277
  case "com.amazonaws.finspacedata#InternalServerException":
1698
- response = {
1699
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1700
- name: errorCode,
1701
- $metadata: deserializeMetadata(output),
1702
- };
1703
- break;
1278
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1704
1279
  case "ResourceNotFoundException":
1705
1280
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
1706
- response = {
1707
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1708
- name: errorCode,
1709
- $metadata: deserializeMetadata(output),
1710
- };
1711
- break;
1281
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1712
1282
  case "ThrottlingException":
1713
1283
  case "com.amazonaws.finspacedata#ThrottlingException":
1714
- response = {
1715
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1716
- name: errorCode,
1717
- $metadata: deserializeMetadata(output),
1718
- };
1719
- break;
1284
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1720
1285
  case "ValidationException":
1721
1286
  case "com.amazonaws.finspacedata#ValidationException":
1722
- response = {
1723
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1724
- name: errorCode,
1725
- $metadata: deserializeMetadata(output),
1726
- };
1727
- break;
1287
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1728
1288
  default:
1729
1289
  const parsedBody = parsedOutput.body;
1730
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1731
- response = {
1732
- ...parsedBody,
1733
- name: `${errorCode}`,
1734
- message: parsedBody.message || parsedBody.Message || errorCode,
1290
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1291
+ name: parsedBody.code || parsedBody.Code || errorCode,
1735
1292
  $fault: "client",
1736
1293
  $metadata: deserializeMetadata(output),
1737
- };
1294
+ });
1295
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1738
1296
  }
1739
- const message = response.message || response.Message || errorCode;
1740
- response.message = message;
1741
- delete response.Message;
1742
- return Promise.reject(Object.assign(new Error(message), response));
1743
1297
  };
1744
1298
  const deserializeAws_restJson1UpdateDatasetCommand = async (output, context) => {
1745
1299
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1767,154 +1321,112 @@ const deserializeAws_restJson1UpdateDatasetCommandError = async (output, context
1767
1321
  switch (errorCode) {
1768
1322
  case "AccessDeniedException":
1769
1323
  case "com.amazonaws.finspacedata#AccessDeniedException":
1770
- response = {
1771
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1772
- name: errorCode,
1773
- $metadata: deserializeMetadata(output),
1774
- };
1775
- break;
1324
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1776
1325
  case "ConflictException":
1777
1326
  case "com.amazonaws.finspacedata#ConflictException":
1778
- response = {
1779
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1780
- name: errorCode,
1781
- $metadata: deserializeMetadata(output),
1782
- };
1783
- break;
1327
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1784
1328
  case "InternalServerException":
1785
1329
  case "com.amazonaws.finspacedata#InternalServerException":
1786
- response = {
1787
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1788
- name: errorCode,
1789
- $metadata: deserializeMetadata(output),
1790
- };
1791
- break;
1330
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1792
1331
  case "ResourceNotFoundException":
1793
1332
  case "com.amazonaws.finspacedata#ResourceNotFoundException":
1794
- response = {
1795
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1796
- name: errorCode,
1797
- $metadata: deserializeMetadata(output),
1798
- };
1799
- break;
1333
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1800
1334
  case "ThrottlingException":
1801
1335
  case "com.amazonaws.finspacedata#ThrottlingException":
1802
- response = {
1803
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1804
- name: errorCode,
1805
- $metadata: deserializeMetadata(output),
1806
- };
1807
- break;
1336
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1808
1337
  case "ValidationException":
1809
1338
  case "com.amazonaws.finspacedata#ValidationException":
1810
- response = {
1811
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1812
- name: errorCode,
1813
- $metadata: deserializeMetadata(output),
1814
- };
1815
- break;
1339
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1816
1340
  default:
1817
1341
  const parsedBody = parsedOutput.body;
1818
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1819
- response = {
1820
- ...parsedBody,
1821
- name: `${errorCode}`,
1822
- message: parsedBody.message || parsedBody.Message || errorCode,
1342
+ response = new FinspaceDataServiceException_1.FinspaceDataServiceException({
1343
+ name: parsedBody.code || parsedBody.Code || errorCode,
1823
1344
  $fault: "client",
1824
1345
  $metadata: deserializeMetadata(output),
1825
- };
1346
+ });
1347
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1826
1348
  }
1827
- const message = response.message || response.Message || errorCode;
1828
- response.message = message;
1829
- delete response.Message;
1830
- return Promise.reject(Object.assign(new Error(message), response));
1831
1349
  };
1832
1350
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1833
- const contents = {
1834
- name: "AccessDeniedException",
1835
- $fault: "client",
1836
- $metadata: deserializeMetadata(parsedOutput),
1837
- message: undefined,
1838
- };
1351
+ const contents = {};
1839
1352
  const data = parsedOutput.body;
1840
1353
  if (data.message !== undefined && data.message !== null) {
1841
1354
  contents.message = smithy_client_1.expectString(data.message);
1842
1355
  }
1843
- return contents;
1356
+ const exception = new models_0_1.AccessDeniedException({
1357
+ $metadata: deserializeMetadata(parsedOutput),
1358
+ ...contents,
1359
+ });
1360
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1844
1361
  };
1845
1362
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1846
- const contents = {
1847
- name: "ConflictException",
1848
- $fault: "client",
1849
- $metadata: deserializeMetadata(parsedOutput),
1850
- message: undefined,
1851
- };
1363
+ const contents = {};
1852
1364
  const data = parsedOutput.body;
1853
1365
  if (data.message !== undefined && data.message !== null) {
1854
1366
  contents.message = smithy_client_1.expectString(data.message);
1855
1367
  }
1856
- return contents;
1368
+ const exception = new models_0_1.ConflictException({
1369
+ $metadata: deserializeMetadata(parsedOutput),
1370
+ ...contents,
1371
+ });
1372
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1857
1373
  };
1858
1374
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1859
- const contents = {
1860
- name: "InternalServerException",
1861
- $fault: "server",
1862
- $metadata: deserializeMetadata(parsedOutput),
1863
- message: undefined,
1864
- };
1375
+ const contents = {};
1865
1376
  const data = parsedOutput.body;
1866
1377
  if (data.message !== undefined && data.message !== null) {
1867
1378
  contents.message = smithy_client_1.expectString(data.message);
1868
1379
  }
1869
- return contents;
1380
+ const exception = new models_0_1.InternalServerException({
1381
+ $metadata: deserializeMetadata(parsedOutput),
1382
+ ...contents,
1383
+ });
1384
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1870
1385
  };
1871
1386
  const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
1872
- const contents = {
1873
- name: "LimitExceededException",
1874
- $fault: "client",
1875
- $metadata: deserializeMetadata(parsedOutput),
1876
- message: undefined,
1877
- };
1387
+ const contents = {};
1878
1388
  const data = parsedOutput.body;
1879
1389
  if (data.message !== undefined && data.message !== null) {
1880
1390
  contents.message = smithy_client_1.expectString(data.message);
1881
1391
  }
1882
- return contents;
1392
+ const exception = new models_0_1.LimitExceededException({
1393
+ $metadata: deserializeMetadata(parsedOutput),
1394
+ ...contents,
1395
+ });
1396
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1883
1397
  };
1884
1398
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1885
- const contents = {
1886
- name: "ResourceNotFoundException",
1887
- $fault: "client",
1888
- $metadata: deserializeMetadata(parsedOutput),
1889
- message: undefined,
1890
- };
1399
+ const contents = {};
1891
1400
  const data = parsedOutput.body;
1892
1401
  if (data.message !== undefined && data.message !== null) {
1893
1402
  contents.message = smithy_client_1.expectString(data.message);
1894
1403
  }
1895
- return contents;
1404
+ const exception = new models_0_1.ResourceNotFoundException({
1405
+ $metadata: deserializeMetadata(parsedOutput),
1406
+ ...contents,
1407
+ });
1408
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1896
1409
  };
1897
1410
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1898
- const contents = {
1899
- name: "ThrottlingException",
1900
- $fault: "client",
1901
- $metadata: deserializeMetadata(parsedOutput),
1902
- };
1411
+ const contents = {};
1903
1412
  const data = parsedOutput.body;
1904
- return contents;
1413
+ const exception = new models_0_1.ThrottlingException({
1414
+ $metadata: deserializeMetadata(parsedOutput),
1415
+ ...contents,
1416
+ });
1417
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1905
1418
  };
1906
1419
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1907
- const contents = {
1908
- name: "ValidationException",
1909
- $fault: "client",
1910
- $metadata: deserializeMetadata(parsedOutput),
1911
- message: undefined,
1912
- };
1420
+ const contents = {};
1913
1421
  const data = parsedOutput.body;
1914
1422
  if (data.message !== undefined && data.message !== null) {
1915
1423
  contents.message = smithy_client_1.expectString(data.message);
1916
1424
  }
1917
- return contents;
1425
+ const exception = new models_0_1.ValidationException({
1426
+ $metadata: deserializeMetadata(parsedOutput),
1427
+ ...contents,
1428
+ });
1429
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1918
1430
  };
1919
1431
  const serializeAws_restJson1ColumnDefinition = (input, context) => {
1920
1432
  return {
@@ -2068,7 +1580,7 @@ const deserializeAws_restJson1ChangesetErrorInfo = (output, context) => {
2068
1580
  };
2069
1581
  };
2070
1582
  const deserializeAws_restJson1ChangesetList = (output, context) => {
2071
- return (output || [])
1583
+ const retVal = (output || [])
2072
1584
  .filter((e) => e != null)
2073
1585
  .map((entry) => {
2074
1586
  if (entry === null) {
@@ -2076,6 +1588,7 @@ const deserializeAws_restJson1ChangesetList = (output, context) => {
2076
1588
  }
2077
1589
  return deserializeAws_restJson1ChangesetSummary(entry, context);
2078
1590
  });
1591
+ return retVal;
2079
1592
  };
2080
1593
  const deserializeAws_restJson1ChangesetSummary = (output, context) => {
2081
1594
  return {
@@ -2108,7 +1621,7 @@ const deserializeAws_restJson1ColumnDefinition = (output, context) => {
2108
1621
  };
2109
1622
  };
2110
1623
  const deserializeAws_restJson1ColumnList = (output, context) => {
2111
- return (output || [])
1624
+ const retVal = (output || [])
2112
1625
  .filter((e) => e != null)
2113
1626
  .map((entry) => {
2114
1627
  if (entry === null) {
@@ -2116,9 +1629,10 @@ const deserializeAws_restJson1ColumnList = (output, context) => {
2116
1629
  }
2117
1630
  return deserializeAws_restJson1ColumnDefinition(entry, context);
2118
1631
  });
1632
+ return retVal;
2119
1633
  };
2120
1634
  const deserializeAws_restJson1ColumnNameList = (output, context) => {
2121
- return (output || [])
1635
+ const retVal = (output || [])
2122
1636
  .filter((e) => e != null)
2123
1637
  .map((entry) => {
2124
1638
  if (entry === null) {
@@ -2126,6 +1640,7 @@ const deserializeAws_restJson1ColumnNameList = (output, context) => {
2126
1640
  }
2127
1641
  return smithy_client_1.expectString(entry);
2128
1642
  });
1643
+ return retVal;
2129
1644
  };
2130
1645
  const deserializeAws_restJson1Credentials = (output, context) => {
2131
1646
  return {
@@ -2153,7 +1668,7 @@ const deserializeAws_restJson1Dataset = (output, context) => {
2153
1668
  };
2154
1669
  };
2155
1670
  const deserializeAws_restJson1DatasetList = (output, context) => {
2156
- return (output || [])
1671
+ const retVal = (output || [])
2157
1672
  .filter((e) => e != null)
2158
1673
  .map((entry) => {
2159
1674
  if (entry === null) {
@@ -2161,6 +1676,7 @@ const deserializeAws_restJson1DatasetList = (output, context) => {
2161
1676
  }
2162
1677
  return deserializeAws_restJson1Dataset(entry, context);
2163
1678
  });
1679
+ return retVal;
2164
1680
  };
2165
1681
  const deserializeAws_restJson1DatasetOwnerInfo = (output, context) => {
2166
1682
  return {
@@ -2185,7 +1701,7 @@ const deserializeAws_restJson1DataViewErrorInfo = (output, context) => {
2185
1701
  };
2186
1702
  };
2187
1703
  const deserializeAws_restJson1DataViewList = (output, context) => {
2188
- return (output || [])
1704
+ const retVal = (output || [])
2189
1705
  .filter((e) => e != null)
2190
1706
  .map((entry) => {
2191
1707
  if (entry === null) {
@@ -2193,6 +1709,7 @@ const deserializeAws_restJson1DataViewList = (output, context) => {
2193
1709
  }
2194
1710
  return deserializeAws_restJson1DataViewSummary(entry, context);
2195
1711
  });
1712
+ return retVal;
2196
1713
  };
2197
1714
  const deserializeAws_restJson1DataViewSummary = (output, context) => {
2198
1715
  return {
@@ -2230,7 +1747,7 @@ const deserializeAws_restJson1FormatParams = (output, context) => {
2230
1747
  }, {});
2231
1748
  };
2232
1749
  const deserializeAws_restJson1PartitionColumnList = (output, context) => {
2233
- return (output || [])
1750
+ const retVal = (output || [])
2234
1751
  .filter((e) => e != null)
2235
1752
  .map((entry) => {
2236
1753
  if (entry === null) {
@@ -2238,6 +1755,7 @@ const deserializeAws_restJson1PartitionColumnList = (output, context) => {
2238
1755
  }
2239
1756
  return smithy_client_1.expectString(entry);
2240
1757
  });
1758
+ return retVal;
2241
1759
  };
2242
1760
  const deserializeAws_restJson1S3DestinationFormatOptions = (output, context) => {
2243
1761
  return Object.entries(output).reduce((acc, [key, value]) => {
@@ -2268,7 +1786,7 @@ const deserializeAws_restJson1SchemaUnion = (output, context) => {
2268
1786
  };
2269
1787
  };
2270
1788
  const deserializeAws_restJson1SortColumnList = (output, context) => {
2271
- return (output || [])
1789
+ const retVal = (output || [])
2272
1790
  .filter((e) => e != null)
2273
1791
  .map((entry) => {
2274
1792
  if (entry === null) {
@@ -2276,6 +1794,7 @@ const deserializeAws_restJson1SortColumnList = (output, context) => {
2276
1794
  }
2277
1795
  return smithy_client_1.expectString(entry);
2278
1796
  });
1797
+ return retVal;
2279
1798
  };
2280
1799
  const deserializeAws_restJson1SourceParams = (output, context) => {
2281
1800
  return Object.entries(output).reduce((acc, [key, value]) => {