@aws-sdk/client-athena 3.503.1 → 3.507.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.
@@ -413,7 +413,7 @@ export const se_UpdateWorkGroupCommand = async (input, context) => {
413
413
  };
414
414
  export const de_BatchGetNamedQueryCommand = async (output, context) => {
415
415
  if (output.statusCode >= 300) {
416
- return de_BatchGetNamedQueryCommandError(output, context);
416
+ return de_CommandError(output, context);
417
417
  }
418
418
  const data = await parseBody(output.body, context);
419
419
  let contents = {};
@@ -424,31 +424,9 @@ export const de_BatchGetNamedQueryCommand = async (output, context) => {
424
424
  };
425
425
  return response;
426
426
  };
427
- const de_BatchGetNamedQueryCommandError = async (output, context) => {
428
- const parsedOutput = {
429
- ...output,
430
- body: await parseErrorBody(output.body, context),
431
- };
432
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
433
- switch (errorCode) {
434
- case "InternalServerException":
435
- case "com.amazonaws.athena#InternalServerException":
436
- throw await de_InternalServerExceptionRes(parsedOutput, context);
437
- case "InvalidRequestException":
438
- case "com.amazonaws.athena#InvalidRequestException":
439
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
440
- default:
441
- const parsedBody = parsedOutput.body;
442
- return throwDefaultError({
443
- output,
444
- parsedBody,
445
- errorCode,
446
- });
447
- }
448
- };
449
427
  export const de_BatchGetPreparedStatementCommand = async (output, context) => {
450
428
  if (output.statusCode >= 300) {
451
- return de_BatchGetPreparedStatementCommandError(output, context);
429
+ return de_CommandError(output, context);
452
430
  }
453
431
  const data = await parseBody(output.body, context);
454
432
  let contents = {};
@@ -459,31 +437,9 @@ export const de_BatchGetPreparedStatementCommand = async (output, context) => {
459
437
  };
460
438
  return response;
461
439
  };
462
- const de_BatchGetPreparedStatementCommandError = async (output, context) => {
463
- const parsedOutput = {
464
- ...output,
465
- body: await parseErrorBody(output.body, context),
466
- };
467
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
468
- switch (errorCode) {
469
- case "InternalServerException":
470
- case "com.amazonaws.athena#InternalServerException":
471
- throw await de_InternalServerExceptionRes(parsedOutput, context);
472
- case "InvalidRequestException":
473
- case "com.amazonaws.athena#InvalidRequestException":
474
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
475
- default:
476
- const parsedBody = parsedOutput.body;
477
- return throwDefaultError({
478
- output,
479
- parsedBody,
480
- errorCode,
481
- });
482
- }
483
- };
484
440
  export const de_BatchGetQueryExecutionCommand = async (output, context) => {
485
441
  if (output.statusCode >= 300) {
486
- return de_BatchGetQueryExecutionCommandError(output, context);
442
+ return de_CommandError(output, context);
487
443
  }
488
444
  const data = await parseBody(output.body, context);
489
445
  let contents = {};
@@ -494,31 +450,9 @@ export const de_BatchGetQueryExecutionCommand = async (output, context) => {
494
450
  };
495
451
  return response;
496
452
  };
497
- const de_BatchGetQueryExecutionCommandError = async (output, context) => {
498
- const parsedOutput = {
499
- ...output,
500
- body: await parseErrorBody(output.body, context),
501
- };
502
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
503
- switch (errorCode) {
504
- case "InternalServerException":
505
- case "com.amazonaws.athena#InternalServerException":
506
- throw await de_InternalServerExceptionRes(parsedOutput, context);
507
- case "InvalidRequestException":
508
- case "com.amazonaws.athena#InvalidRequestException":
509
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
510
- default:
511
- const parsedBody = parsedOutput.body;
512
- return throwDefaultError({
513
- output,
514
- parsedBody,
515
- errorCode,
516
- });
517
- }
518
- };
519
453
  export const de_CancelCapacityReservationCommand = async (output, context) => {
520
454
  if (output.statusCode >= 300) {
521
- return de_CancelCapacityReservationCommandError(output, context);
455
+ return de_CommandError(output, context);
522
456
  }
523
457
  const data = await parseBody(output.body, context);
524
458
  let contents = {};
@@ -529,31 +463,9 @@ export const de_CancelCapacityReservationCommand = async (output, context) => {
529
463
  };
530
464
  return response;
531
465
  };
532
- const de_CancelCapacityReservationCommandError = async (output, context) => {
533
- const parsedOutput = {
534
- ...output,
535
- body: await parseErrorBody(output.body, context),
536
- };
537
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
538
- switch (errorCode) {
539
- case "InternalServerException":
540
- case "com.amazonaws.athena#InternalServerException":
541
- throw await de_InternalServerExceptionRes(parsedOutput, context);
542
- case "InvalidRequestException":
543
- case "com.amazonaws.athena#InvalidRequestException":
544
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
545
- default:
546
- const parsedBody = parsedOutput.body;
547
- return throwDefaultError({
548
- output,
549
- parsedBody,
550
- errorCode,
551
- });
552
- }
553
- };
554
466
  export const de_CreateCapacityReservationCommand = async (output, context) => {
555
467
  if (output.statusCode >= 300) {
556
- return de_CreateCapacityReservationCommandError(output, context);
468
+ return de_CommandError(output, context);
557
469
  }
558
470
  const data = await parseBody(output.body, context);
559
471
  let contents = {};
@@ -564,31 +476,9 @@ export const de_CreateCapacityReservationCommand = async (output, context) => {
564
476
  };
565
477
  return response;
566
478
  };
567
- const de_CreateCapacityReservationCommandError = async (output, context) => {
568
- const parsedOutput = {
569
- ...output,
570
- body: await parseErrorBody(output.body, context),
571
- };
572
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
573
- switch (errorCode) {
574
- case "InternalServerException":
575
- case "com.amazonaws.athena#InternalServerException":
576
- throw await de_InternalServerExceptionRes(parsedOutput, context);
577
- case "InvalidRequestException":
578
- case "com.amazonaws.athena#InvalidRequestException":
579
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
580
- default:
581
- const parsedBody = parsedOutput.body;
582
- return throwDefaultError({
583
- output,
584
- parsedBody,
585
- errorCode,
586
- });
587
- }
588
- };
589
479
  export const de_CreateDataCatalogCommand = async (output, context) => {
590
480
  if (output.statusCode >= 300) {
591
- return de_CreateDataCatalogCommandError(output, context);
481
+ return de_CommandError(output, context);
592
482
  }
593
483
  const data = await parseBody(output.body, context);
594
484
  let contents = {};
@@ -599,31 +489,9 @@ export const de_CreateDataCatalogCommand = async (output, context) => {
599
489
  };
600
490
  return response;
601
491
  };
602
- const de_CreateDataCatalogCommandError = async (output, context) => {
603
- const parsedOutput = {
604
- ...output,
605
- body: await parseErrorBody(output.body, context),
606
- };
607
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
608
- switch (errorCode) {
609
- case "InternalServerException":
610
- case "com.amazonaws.athena#InternalServerException":
611
- throw await de_InternalServerExceptionRes(parsedOutput, context);
612
- case "InvalidRequestException":
613
- case "com.amazonaws.athena#InvalidRequestException":
614
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
615
- default:
616
- const parsedBody = parsedOutput.body;
617
- return throwDefaultError({
618
- output,
619
- parsedBody,
620
- errorCode,
621
- });
622
- }
623
- };
624
492
  export const de_CreateNamedQueryCommand = async (output, context) => {
625
493
  if (output.statusCode >= 300) {
626
- return de_CreateNamedQueryCommandError(output, context);
494
+ return de_CommandError(output, context);
627
495
  }
628
496
  const data = await parseBody(output.body, context);
629
497
  let contents = {};
@@ -634,31 +502,9 @@ export const de_CreateNamedQueryCommand = async (output, context) => {
634
502
  };
635
503
  return response;
636
504
  };
637
- const de_CreateNamedQueryCommandError = async (output, context) => {
638
- const parsedOutput = {
639
- ...output,
640
- body: await parseErrorBody(output.body, context),
641
- };
642
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
643
- switch (errorCode) {
644
- case "InternalServerException":
645
- case "com.amazonaws.athena#InternalServerException":
646
- throw await de_InternalServerExceptionRes(parsedOutput, context);
647
- case "InvalidRequestException":
648
- case "com.amazonaws.athena#InvalidRequestException":
649
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
650
- default:
651
- const parsedBody = parsedOutput.body;
652
- return throwDefaultError({
653
- output,
654
- parsedBody,
655
- errorCode,
656
- });
657
- }
658
- };
659
505
  export const de_CreateNotebookCommand = async (output, context) => {
660
506
  if (output.statusCode >= 300) {
661
- return de_CreateNotebookCommandError(output, context);
507
+ return de_CommandError(output, context);
662
508
  }
663
509
  const data = await parseBody(output.body, context);
664
510
  let contents = {};
@@ -669,34 +515,9 @@ export const de_CreateNotebookCommand = async (output, context) => {
669
515
  };
670
516
  return response;
671
517
  };
672
- const de_CreateNotebookCommandError = async (output, context) => {
673
- const parsedOutput = {
674
- ...output,
675
- body: await parseErrorBody(output.body, context),
676
- };
677
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
678
- switch (errorCode) {
679
- case "InternalServerException":
680
- case "com.amazonaws.athena#InternalServerException":
681
- throw await de_InternalServerExceptionRes(parsedOutput, context);
682
- case "InvalidRequestException":
683
- case "com.amazonaws.athena#InvalidRequestException":
684
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
685
- case "TooManyRequestsException":
686
- case "com.amazonaws.athena#TooManyRequestsException":
687
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
688
- default:
689
- const parsedBody = parsedOutput.body;
690
- return throwDefaultError({
691
- output,
692
- parsedBody,
693
- errorCode,
694
- });
695
- }
696
- };
697
518
  export const de_CreatePreparedStatementCommand = async (output, context) => {
698
519
  if (output.statusCode >= 300) {
699
- return de_CreatePreparedStatementCommandError(output, context);
520
+ return de_CommandError(output, context);
700
521
  }
701
522
  const data = await parseBody(output.body, context);
702
523
  let contents = {};
@@ -707,31 +528,9 @@ export const de_CreatePreparedStatementCommand = async (output, context) => {
707
528
  };
708
529
  return response;
709
530
  };
710
- const de_CreatePreparedStatementCommandError = async (output, context) => {
711
- const parsedOutput = {
712
- ...output,
713
- body: await parseErrorBody(output.body, context),
714
- };
715
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
716
- switch (errorCode) {
717
- case "InternalServerException":
718
- case "com.amazonaws.athena#InternalServerException":
719
- throw await de_InternalServerExceptionRes(parsedOutput, context);
720
- case "InvalidRequestException":
721
- case "com.amazonaws.athena#InvalidRequestException":
722
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
723
- default:
724
- const parsedBody = parsedOutput.body;
725
- return throwDefaultError({
726
- output,
727
- parsedBody,
728
- errorCode,
729
- });
730
- }
731
- };
732
531
  export const de_CreatePresignedNotebookUrlCommand = async (output, context) => {
733
532
  if (output.statusCode >= 300) {
734
- return de_CreatePresignedNotebookUrlCommandError(output, context);
533
+ return de_CommandError(output, context);
735
534
  }
736
535
  const data = await parseBody(output.body, context);
737
536
  let contents = {};
@@ -742,34 +541,9 @@ export const de_CreatePresignedNotebookUrlCommand = async (output, context) => {
742
541
  };
743
542
  return response;
744
543
  };
745
- const de_CreatePresignedNotebookUrlCommandError = async (output, context) => {
746
- const parsedOutput = {
747
- ...output,
748
- body: await parseErrorBody(output.body, context),
749
- };
750
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
751
- switch (errorCode) {
752
- case "InternalServerException":
753
- case "com.amazonaws.athena#InternalServerException":
754
- throw await de_InternalServerExceptionRes(parsedOutput, context);
755
- case "InvalidRequestException":
756
- case "com.amazonaws.athena#InvalidRequestException":
757
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
758
- case "ResourceNotFoundException":
759
- case "com.amazonaws.athena#ResourceNotFoundException":
760
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
761
- default:
762
- const parsedBody = parsedOutput.body;
763
- return throwDefaultError({
764
- output,
765
- parsedBody,
766
- errorCode,
767
- });
768
- }
769
- };
770
544
  export const de_CreateWorkGroupCommand = async (output, context) => {
771
545
  if (output.statusCode >= 300) {
772
- return de_CreateWorkGroupCommandError(output, context);
546
+ return de_CommandError(output, context);
773
547
  }
774
548
  const data = await parseBody(output.body, context);
775
549
  let contents = {};
@@ -780,31 +554,9 @@ export const de_CreateWorkGroupCommand = async (output, context) => {
780
554
  };
781
555
  return response;
782
556
  };
783
- const de_CreateWorkGroupCommandError = async (output, context) => {
784
- const parsedOutput = {
785
- ...output,
786
- body: await parseErrorBody(output.body, context),
787
- };
788
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
789
- switch (errorCode) {
790
- case "InternalServerException":
791
- case "com.amazonaws.athena#InternalServerException":
792
- throw await de_InternalServerExceptionRes(parsedOutput, context);
793
- case "InvalidRequestException":
794
- case "com.amazonaws.athena#InvalidRequestException":
795
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
796
- default:
797
- const parsedBody = parsedOutput.body;
798
- return throwDefaultError({
799
- output,
800
- parsedBody,
801
- errorCode,
802
- });
803
- }
804
- };
805
557
  export const de_DeleteCapacityReservationCommand = async (output, context) => {
806
558
  if (output.statusCode >= 300) {
807
- return de_DeleteCapacityReservationCommandError(output, context);
559
+ return de_CommandError(output, context);
808
560
  }
809
561
  const data = await parseBody(output.body, context);
810
562
  let contents = {};
@@ -815,66 +567,22 @@ export const de_DeleteCapacityReservationCommand = async (output, context) => {
815
567
  };
816
568
  return response;
817
569
  };
818
- const de_DeleteCapacityReservationCommandError = async (output, context) => {
819
- const parsedOutput = {
820
- ...output,
821
- body: await parseErrorBody(output.body, context),
822
- };
823
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
824
- switch (errorCode) {
825
- case "InternalServerException":
826
- case "com.amazonaws.athena#InternalServerException":
827
- throw await de_InternalServerExceptionRes(parsedOutput, context);
828
- case "InvalidRequestException":
829
- case "com.amazonaws.athena#InvalidRequestException":
830
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
831
- default:
832
- const parsedBody = parsedOutput.body;
833
- return throwDefaultError({
834
- output,
835
- parsedBody,
836
- errorCode,
837
- });
838
- }
839
- };
840
- export const de_DeleteDataCatalogCommand = async (output, context) => {
841
- if (output.statusCode >= 300) {
842
- return de_DeleteDataCatalogCommandError(output, context);
843
- }
844
- const data = await parseBody(output.body, context);
845
- let contents = {};
846
- contents = _json(data);
847
- const response = {
848
- $metadata: deserializeMetadata(output),
849
- ...contents,
570
+ export const de_DeleteDataCatalogCommand = async (output, context) => {
571
+ if (output.statusCode >= 300) {
572
+ return de_CommandError(output, context);
573
+ }
574
+ const data = await parseBody(output.body, context);
575
+ let contents = {};
576
+ contents = _json(data);
577
+ const response = {
578
+ $metadata: deserializeMetadata(output),
579
+ ...contents,
850
580
  };
851
581
  return response;
852
582
  };
853
- const de_DeleteDataCatalogCommandError = async (output, context) => {
854
- const parsedOutput = {
855
- ...output,
856
- body: await parseErrorBody(output.body, context),
857
- };
858
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
859
- switch (errorCode) {
860
- case "InternalServerException":
861
- case "com.amazonaws.athena#InternalServerException":
862
- throw await de_InternalServerExceptionRes(parsedOutput, context);
863
- case "InvalidRequestException":
864
- case "com.amazonaws.athena#InvalidRequestException":
865
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
866
- default:
867
- const parsedBody = parsedOutput.body;
868
- return throwDefaultError({
869
- output,
870
- parsedBody,
871
- errorCode,
872
- });
873
- }
874
- };
875
583
  export const de_DeleteNamedQueryCommand = async (output, context) => {
876
584
  if (output.statusCode >= 300) {
877
- return de_DeleteNamedQueryCommandError(output, context);
585
+ return de_CommandError(output, context);
878
586
  }
879
587
  const data = await parseBody(output.body, context);
880
588
  let contents = {};
@@ -885,31 +593,9 @@ export const de_DeleteNamedQueryCommand = async (output, context) => {
885
593
  };
886
594
  return response;
887
595
  };
888
- const de_DeleteNamedQueryCommandError = async (output, context) => {
889
- const parsedOutput = {
890
- ...output,
891
- body: await parseErrorBody(output.body, context),
892
- };
893
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
894
- switch (errorCode) {
895
- case "InternalServerException":
896
- case "com.amazonaws.athena#InternalServerException":
897
- throw await de_InternalServerExceptionRes(parsedOutput, context);
898
- case "InvalidRequestException":
899
- case "com.amazonaws.athena#InvalidRequestException":
900
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
901
- default:
902
- const parsedBody = parsedOutput.body;
903
- return throwDefaultError({
904
- output,
905
- parsedBody,
906
- errorCode,
907
- });
908
- }
909
- };
910
596
  export const de_DeleteNotebookCommand = async (output, context) => {
911
597
  if (output.statusCode >= 300) {
912
- return de_DeleteNotebookCommandError(output, context);
598
+ return de_CommandError(output, context);
913
599
  }
914
600
  const data = await parseBody(output.body, context);
915
601
  let contents = {};
@@ -920,34 +606,9 @@ export const de_DeleteNotebookCommand = async (output, context) => {
920
606
  };
921
607
  return response;
922
608
  };
923
- const de_DeleteNotebookCommandError = async (output, context) => {
924
- const parsedOutput = {
925
- ...output,
926
- body: await parseErrorBody(output.body, context),
927
- };
928
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
929
- switch (errorCode) {
930
- case "InternalServerException":
931
- case "com.amazonaws.athena#InternalServerException":
932
- throw await de_InternalServerExceptionRes(parsedOutput, context);
933
- case "InvalidRequestException":
934
- case "com.amazonaws.athena#InvalidRequestException":
935
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
936
- case "TooManyRequestsException":
937
- case "com.amazonaws.athena#TooManyRequestsException":
938
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
939
- default:
940
- const parsedBody = parsedOutput.body;
941
- return throwDefaultError({
942
- output,
943
- parsedBody,
944
- errorCode,
945
- });
946
- }
947
- };
948
609
  export const de_DeletePreparedStatementCommand = async (output, context) => {
949
610
  if (output.statusCode >= 300) {
950
- return de_DeletePreparedStatementCommandError(output, context);
611
+ return de_CommandError(output, context);
951
612
  }
952
613
  const data = await parseBody(output.body, context);
953
614
  let contents = {};
@@ -958,34 +619,9 @@ export const de_DeletePreparedStatementCommand = async (output, context) => {
958
619
  };
959
620
  return response;
960
621
  };
961
- const de_DeletePreparedStatementCommandError = async (output, context) => {
962
- const parsedOutput = {
963
- ...output,
964
- body: await parseErrorBody(output.body, context),
965
- };
966
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
967
- switch (errorCode) {
968
- case "InternalServerException":
969
- case "com.amazonaws.athena#InternalServerException":
970
- throw await de_InternalServerExceptionRes(parsedOutput, context);
971
- case "InvalidRequestException":
972
- case "com.amazonaws.athena#InvalidRequestException":
973
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
974
- case "ResourceNotFoundException":
975
- case "com.amazonaws.athena#ResourceNotFoundException":
976
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
977
- default:
978
- const parsedBody = parsedOutput.body;
979
- return throwDefaultError({
980
- output,
981
- parsedBody,
982
- errorCode,
983
- });
984
- }
985
- };
986
622
  export const de_DeleteWorkGroupCommand = async (output, context) => {
987
623
  if (output.statusCode >= 300) {
988
- return de_DeleteWorkGroupCommandError(output, context);
624
+ return de_CommandError(output, context);
989
625
  }
990
626
  const data = await parseBody(output.body, context);
991
627
  let contents = {};
@@ -996,31 +632,9 @@ export const de_DeleteWorkGroupCommand = async (output, context) => {
996
632
  };
997
633
  return response;
998
634
  };
999
- const de_DeleteWorkGroupCommandError = async (output, context) => {
1000
- const parsedOutput = {
1001
- ...output,
1002
- body: await parseErrorBody(output.body, context),
1003
- };
1004
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1005
- switch (errorCode) {
1006
- case "InternalServerException":
1007
- case "com.amazonaws.athena#InternalServerException":
1008
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1009
- case "InvalidRequestException":
1010
- case "com.amazonaws.athena#InvalidRequestException":
1011
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1012
- default:
1013
- const parsedBody = parsedOutput.body;
1014
- return throwDefaultError({
1015
- output,
1016
- parsedBody,
1017
- errorCode,
1018
- });
1019
- }
1020
- };
1021
635
  export const de_ExportNotebookCommand = async (output, context) => {
1022
636
  if (output.statusCode >= 300) {
1023
- return de_ExportNotebookCommandError(output, context);
637
+ return de_CommandError(output, context);
1024
638
  }
1025
639
  const data = await parseBody(output.body, context);
1026
640
  let contents = {};
@@ -1031,34 +645,9 @@ export const de_ExportNotebookCommand = async (output, context) => {
1031
645
  };
1032
646
  return response;
1033
647
  };
1034
- const de_ExportNotebookCommandError = async (output, context) => {
1035
- const parsedOutput = {
1036
- ...output,
1037
- body: await parseErrorBody(output.body, context),
1038
- };
1039
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1040
- switch (errorCode) {
1041
- case "InternalServerException":
1042
- case "com.amazonaws.athena#InternalServerException":
1043
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1044
- case "InvalidRequestException":
1045
- case "com.amazonaws.athena#InvalidRequestException":
1046
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1047
- case "TooManyRequestsException":
1048
- case "com.amazonaws.athena#TooManyRequestsException":
1049
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1050
- default:
1051
- const parsedBody = parsedOutput.body;
1052
- return throwDefaultError({
1053
- output,
1054
- parsedBody,
1055
- errorCode,
1056
- });
1057
- }
1058
- };
1059
648
  export const de_GetCalculationExecutionCommand = async (output, context) => {
1060
649
  if (output.statusCode >= 300) {
1061
- return de_GetCalculationExecutionCommandError(output, context);
650
+ return de_CommandError(output, context);
1062
651
  }
1063
652
  const data = await parseBody(output.body, context);
1064
653
  let contents = {};
@@ -1069,34 +658,9 @@ export const de_GetCalculationExecutionCommand = async (output, context) => {
1069
658
  };
1070
659
  return response;
1071
660
  };
1072
- const de_GetCalculationExecutionCommandError = async (output, context) => {
1073
- const parsedOutput = {
1074
- ...output,
1075
- body: await parseErrorBody(output.body, context),
1076
- };
1077
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1078
- switch (errorCode) {
1079
- case "InternalServerException":
1080
- case "com.amazonaws.athena#InternalServerException":
1081
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1082
- case "InvalidRequestException":
1083
- case "com.amazonaws.athena#InvalidRequestException":
1084
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1085
- case "ResourceNotFoundException":
1086
- case "com.amazonaws.athena#ResourceNotFoundException":
1087
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1088
- default:
1089
- const parsedBody = parsedOutput.body;
1090
- return throwDefaultError({
1091
- output,
1092
- parsedBody,
1093
- errorCode,
1094
- });
1095
- }
1096
- };
1097
661
  export const de_GetCalculationExecutionCodeCommand = async (output, context) => {
1098
662
  if (output.statusCode >= 300) {
1099
- return de_GetCalculationExecutionCodeCommandError(output, context);
663
+ return de_CommandError(output, context);
1100
664
  }
1101
665
  const data = await parseBody(output.body, context);
1102
666
  let contents = {};
@@ -1107,34 +671,9 @@ export const de_GetCalculationExecutionCodeCommand = async (output, context) =>
1107
671
  };
1108
672
  return response;
1109
673
  };
1110
- const de_GetCalculationExecutionCodeCommandError = async (output, context) => {
1111
- const parsedOutput = {
1112
- ...output,
1113
- body: await parseErrorBody(output.body, context),
1114
- };
1115
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1116
- switch (errorCode) {
1117
- case "InternalServerException":
1118
- case "com.amazonaws.athena#InternalServerException":
1119
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1120
- case "InvalidRequestException":
1121
- case "com.amazonaws.athena#InvalidRequestException":
1122
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1123
- case "ResourceNotFoundException":
1124
- case "com.amazonaws.athena#ResourceNotFoundException":
1125
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1126
- default:
1127
- const parsedBody = parsedOutput.body;
1128
- return throwDefaultError({
1129
- output,
1130
- parsedBody,
1131
- errorCode,
1132
- });
1133
- }
1134
- };
1135
674
  export const de_GetCalculationExecutionStatusCommand = async (output, context) => {
1136
675
  if (output.statusCode >= 300) {
1137
- return de_GetCalculationExecutionStatusCommandError(output, context);
676
+ return de_CommandError(output, context);
1138
677
  }
1139
678
  const data = await parseBody(output.body, context);
1140
679
  let contents = {};
@@ -1145,34 +684,9 @@ export const de_GetCalculationExecutionStatusCommand = async (output, context) =
1145
684
  };
1146
685
  return response;
1147
686
  };
1148
- const de_GetCalculationExecutionStatusCommandError = async (output, context) => {
1149
- const parsedOutput = {
1150
- ...output,
1151
- body: await parseErrorBody(output.body, context),
1152
- };
1153
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1154
- switch (errorCode) {
1155
- case "InternalServerException":
1156
- case "com.amazonaws.athena#InternalServerException":
1157
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1158
- case "InvalidRequestException":
1159
- case "com.amazonaws.athena#InvalidRequestException":
1160
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1161
- case "ResourceNotFoundException":
1162
- case "com.amazonaws.athena#ResourceNotFoundException":
1163
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1164
- default:
1165
- const parsedBody = parsedOutput.body;
1166
- return throwDefaultError({
1167
- output,
1168
- parsedBody,
1169
- errorCode,
1170
- });
1171
- }
1172
- };
1173
687
  export const de_GetCapacityAssignmentConfigurationCommand = async (output, context) => {
1174
688
  if (output.statusCode >= 300) {
1175
- return de_GetCapacityAssignmentConfigurationCommandError(output, context);
689
+ return de_CommandError(output, context);
1176
690
  }
1177
691
  const data = await parseBody(output.body, context);
1178
692
  let contents = {};
@@ -1183,31 +697,9 @@ export const de_GetCapacityAssignmentConfigurationCommand = async (output, conte
1183
697
  };
1184
698
  return response;
1185
699
  };
1186
- const de_GetCapacityAssignmentConfigurationCommandError = async (output, context) => {
1187
- const parsedOutput = {
1188
- ...output,
1189
- body: await parseErrorBody(output.body, context),
1190
- };
1191
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1192
- switch (errorCode) {
1193
- case "InternalServerException":
1194
- case "com.amazonaws.athena#InternalServerException":
1195
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1196
- case "InvalidRequestException":
1197
- case "com.amazonaws.athena#InvalidRequestException":
1198
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1199
- default:
1200
- const parsedBody = parsedOutput.body;
1201
- return throwDefaultError({
1202
- output,
1203
- parsedBody,
1204
- errorCode,
1205
- });
1206
- }
1207
- };
1208
700
  export const de_GetCapacityReservationCommand = async (output, context) => {
1209
701
  if (output.statusCode >= 300) {
1210
- return de_GetCapacityReservationCommandError(output, context);
702
+ return de_CommandError(output, context);
1211
703
  }
1212
704
  const data = await parseBody(output.body, context);
1213
705
  let contents = {};
@@ -1218,31 +710,9 @@ export const de_GetCapacityReservationCommand = async (output, context) => {
1218
710
  };
1219
711
  return response;
1220
712
  };
1221
- const de_GetCapacityReservationCommandError = async (output, context) => {
1222
- const parsedOutput = {
1223
- ...output,
1224
- body: await parseErrorBody(output.body, context),
1225
- };
1226
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1227
- switch (errorCode) {
1228
- case "InternalServerException":
1229
- case "com.amazonaws.athena#InternalServerException":
1230
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1231
- case "InvalidRequestException":
1232
- case "com.amazonaws.athena#InvalidRequestException":
1233
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1234
- default:
1235
- const parsedBody = parsedOutput.body;
1236
- return throwDefaultError({
1237
- output,
1238
- parsedBody,
1239
- errorCode,
1240
- });
1241
- }
1242
- };
1243
713
  export const de_GetDatabaseCommand = async (output, context) => {
1244
714
  if (output.statusCode >= 300) {
1245
- return de_GetDatabaseCommandError(output, context);
715
+ return de_CommandError(output, context);
1246
716
  }
1247
717
  const data = await parseBody(output.body, context);
1248
718
  let contents = {};
@@ -1253,34 +723,9 @@ export const de_GetDatabaseCommand = async (output, context) => {
1253
723
  };
1254
724
  return response;
1255
725
  };
1256
- const de_GetDatabaseCommandError = async (output, context) => {
1257
- const parsedOutput = {
1258
- ...output,
1259
- body: await parseErrorBody(output.body, context),
1260
- };
1261
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1262
- switch (errorCode) {
1263
- case "InternalServerException":
1264
- case "com.amazonaws.athena#InternalServerException":
1265
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1266
- case "InvalidRequestException":
1267
- case "com.amazonaws.athena#InvalidRequestException":
1268
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1269
- case "MetadataException":
1270
- case "com.amazonaws.athena#MetadataException":
1271
- throw await de_MetadataExceptionRes(parsedOutput, context);
1272
- default:
1273
- const parsedBody = parsedOutput.body;
1274
- return throwDefaultError({
1275
- output,
1276
- parsedBody,
1277
- errorCode,
1278
- });
1279
- }
1280
- };
1281
726
  export const de_GetDataCatalogCommand = async (output, context) => {
1282
727
  if (output.statusCode >= 300) {
1283
- return de_GetDataCatalogCommandError(output, context);
728
+ return de_CommandError(output, context);
1284
729
  }
1285
730
  const data = await parseBody(output.body, context);
1286
731
  let contents = {};
@@ -1291,31 +736,9 @@ export const de_GetDataCatalogCommand = async (output, context) => {
1291
736
  };
1292
737
  return response;
1293
738
  };
1294
- const de_GetDataCatalogCommandError = async (output, context) => {
1295
- const parsedOutput = {
1296
- ...output,
1297
- body: await parseErrorBody(output.body, context),
1298
- };
1299
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1300
- switch (errorCode) {
1301
- case "InternalServerException":
1302
- case "com.amazonaws.athena#InternalServerException":
1303
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1304
- case "InvalidRequestException":
1305
- case "com.amazonaws.athena#InvalidRequestException":
1306
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1307
- default:
1308
- const parsedBody = parsedOutput.body;
1309
- return throwDefaultError({
1310
- output,
1311
- parsedBody,
1312
- errorCode,
1313
- });
1314
- }
1315
- };
1316
739
  export const de_GetNamedQueryCommand = async (output, context) => {
1317
740
  if (output.statusCode >= 300) {
1318
- return de_GetNamedQueryCommandError(output, context);
741
+ return de_CommandError(output, context);
1319
742
  }
1320
743
  const data = await parseBody(output.body, context);
1321
744
  let contents = {};
@@ -1326,31 +749,9 @@ export const de_GetNamedQueryCommand = async (output, context) => {
1326
749
  };
1327
750
  return response;
1328
751
  };
1329
- const de_GetNamedQueryCommandError = async (output, context) => {
1330
- const parsedOutput = {
1331
- ...output,
1332
- body: await parseErrorBody(output.body, context),
1333
- };
1334
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1335
- switch (errorCode) {
1336
- case "InternalServerException":
1337
- case "com.amazonaws.athena#InternalServerException":
1338
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1339
- case "InvalidRequestException":
1340
- case "com.amazonaws.athena#InvalidRequestException":
1341
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1342
- default:
1343
- const parsedBody = parsedOutput.body;
1344
- return throwDefaultError({
1345
- output,
1346
- parsedBody,
1347
- errorCode,
1348
- });
1349
- }
1350
- };
1351
752
  export const de_GetNotebookMetadataCommand = async (output, context) => {
1352
753
  if (output.statusCode >= 300) {
1353
- return de_GetNotebookMetadataCommandError(output, context);
754
+ return de_CommandError(output, context);
1354
755
  }
1355
756
  const data = await parseBody(output.body, context);
1356
757
  let contents = {};
@@ -1361,34 +762,9 @@ export const de_GetNotebookMetadataCommand = async (output, context) => {
1361
762
  };
1362
763
  return response;
1363
764
  };
1364
- const de_GetNotebookMetadataCommandError = async (output, context) => {
1365
- const parsedOutput = {
1366
- ...output,
1367
- body: await parseErrorBody(output.body, context),
1368
- };
1369
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1370
- switch (errorCode) {
1371
- case "InternalServerException":
1372
- case "com.amazonaws.athena#InternalServerException":
1373
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1374
- case "InvalidRequestException":
1375
- case "com.amazonaws.athena#InvalidRequestException":
1376
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1377
- case "TooManyRequestsException":
1378
- case "com.amazonaws.athena#TooManyRequestsException":
1379
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1380
- default:
1381
- const parsedBody = parsedOutput.body;
1382
- return throwDefaultError({
1383
- output,
1384
- parsedBody,
1385
- errorCode,
1386
- });
1387
- }
1388
- };
1389
765
  export const de_GetPreparedStatementCommand = async (output, context) => {
1390
766
  if (output.statusCode >= 300) {
1391
- return de_GetPreparedStatementCommandError(output, context);
767
+ return de_CommandError(output, context);
1392
768
  }
1393
769
  const data = await parseBody(output.body, context);
1394
770
  let contents = {};
@@ -1399,34 +775,9 @@ export const de_GetPreparedStatementCommand = async (output, context) => {
1399
775
  };
1400
776
  return response;
1401
777
  };
1402
- const de_GetPreparedStatementCommandError = async (output, context) => {
1403
- const parsedOutput = {
1404
- ...output,
1405
- body: await parseErrorBody(output.body, context),
1406
- };
1407
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1408
- switch (errorCode) {
1409
- case "InternalServerException":
1410
- case "com.amazonaws.athena#InternalServerException":
1411
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1412
- case "InvalidRequestException":
1413
- case "com.amazonaws.athena#InvalidRequestException":
1414
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1415
- case "ResourceNotFoundException":
1416
- case "com.amazonaws.athena#ResourceNotFoundException":
1417
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1418
- default:
1419
- const parsedBody = parsedOutput.body;
1420
- return throwDefaultError({
1421
- output,
1422
- parsedBody,
1423
- errorCode,
1424
- });
1425
- }
1426
- };
1427
778
  export const de_GetQueryExecutionCommand = async (output, context) => {
1428
779
  if (output.statusCode >= 300) {
1429
- return de_GetQueryExecutionCommandError(output, context);
780
+ return de_CommandError(output, context);
1430
781
  }
1431
782
  const data = await parseBody(output.body, context);
1432
783
  let contents = {};
@@ -1437,31 +788,9 @@ export const de_GetQueryExecutionCommand = async (output, context) => {
1437
788
  };
1438
789
  return response;
1439
790
  };
1440
- const de_GetQueryExecutionCommandError = async (output, context) => {
1441
- const parsedOutput = {
1442
- ...output,
1443
- body: await parseErrorBody(output.body, context),
1444
- };
1445
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1446
- switch (errorCode) {
1447
- case "InternalServerException":
1448
- case "com.amazonaws.athena#InternalServerException":
1449
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1450
- case "InvalidRequestException":
1451
- case "com.amazonaws.athena#InvalidRequestException":
1452
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1453
- default:
1454
- const parsedBody = parsedOutput.body;
1455
- return throwDefaultError({
1456
- output,
1457
- parsedBody,
1458
- errorCode,
1459
- });
1460
- }
1461
- };
1462
791
  export const de_GetQueryResultsCommand = async (output, context) => {
1463
792
  if (output.statusCode >= 300) {
1464
- return de_GetQueryResultsCommandError(output, context);
793
+ return de_CommandError(output, context);
1465
794
  }
1466
795
  const data = await parseBody(output.body, context);
1467
796
  let contents = {};
@@ -1472,34 +801,9 @@ export const de_GetQueryResultsCommand = async (output, context) => {
1472
801
  };
1473
802
  return response;
1474
803
  };
1475
- const de_GetQueryResultsCommandError = async (output, context) => {
1476
- const parsedOutput = {
1477
- ...output,
1478
- body: await parseErrorBody(output.body, context),
1479
- };
1480
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1481
- switch (errorCode) {
1482
- case "InternalServerException":
1483
- case "com.amazonaws.athena#InternalServerException":
1484
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1485
- case "InvalidRequestException":
1486
- case "com.amazonaws.athena#InvalidRequestException":
1487
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1488
- case "TooManyRequestsException":
1489
- case "com.amazonaws.athena#TooManyRequestsException":
1490
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1491
- default:
1492
- const parsedBody = parsedOutput.body;
1493
- return throwDefaultError({
1494
- output,
1495
- parsedBody,
1496
- errorCode,
1497
- });
1498
- }
1499
- };
1500
804
  export const de_GetQueryRuntimeStatisticsCommand = async (output, context) => {
1501
805
  if (output.statusCode >= 300) {
1502
- return de_GetQueryRuntimeStatisticsCommandError(output, context);
806
+ return de_CommandError(output, context);
1503
807
  }
1504
808
  const data = await parseBody(output.body, context);
1505
809
  let contents = {};
@@ -1510,31 +814,9 @@ export const de_GetQueryRuntimeStatisticsCommand = async (output, context) => {
1510
814
  };
1511
815
  return response;
1512
816
  };
1513
- const de_GetQueryRuntimeStatisticsCommandError = async (output, context) => {
1514
- const parsedOutput = {
1515
- ...output,
1516
- body: await parseErrorBody(output.body, context),
1517
- };
1518
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1519
- switch (errorCode) {
1520
- case "InternalServerException":
1521
- case "com.amazonaws.athena#InternalServerException":
1522
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1523
- case "InvalidRequestException":
1524
- case "com.amazonaws.athena#InvalidRequestException":
1525
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1526
- default:
1527
- const parsedBody = parsedOutput.body;
1528
- return throwDefaultError({
1529
- output,
1530
- parsedBody,
1531
- errorCode,
1532
- });
1533
- }
1534
- };
1535
817
  export const de_GetSessionCommand = async (output, context) => {
1536
818
  if (output.statusCode >= 300) {
1537
- return de_GetSessionCommandError(output, context);
819
+ return de_CommandError(output, context);
1538
820
  }
1539
821
  const data = await parseBody(output.body, context);
1540
822
  let contents = {};
@@ -1545,34 +827,9 @@ export const de_GetSessionCommand = async (output, context) => {
1545
827
  };
1546
828
  return response;
1547
829
  };
1548
- const de_GetSessionCommandError = async (output, context) => {
1549
- const parsedOutput = {
1550
- ...output,
1551
- body: await parseErrorBody(output.body, context),
1552
- };
1553
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1554
- switch (errorCode) {
1555
- case "InternalServerException":
1556
- case "com.amazonaws.athena#InternalServerException":
1557
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1558
- case "InvalidRequestException":
1559
- case "com.amazonaws.athena#InvalidRequestException":
1560
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1561
- case "ResourceNotFoundException":
1562
- case "com.amazonaws.athena#ResourceNotFoundException":
1563
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1564
- default:
1565
- const parsedBody = parsedOutput.body;
1566
- return throwDefaultError({
1567
- output,
1568
- parsedBody,
1569
- errorCode,
1570
- });
1571
- }
1572
- };
1573
830
  export const de_GetSessionStatusCommand = async (output, context) => {
1574
831
  if (output.statusCode >= 300) {
1575
- return de_GetSessionStatusCommandError(output, context);
832
+ return de_CommandError(output, context);
1576
833
  }
1577
834
  const data = await parseBody(output.body, context);
1578
835
  let contents = {};
@@ -1583,34 +840,9 @@ export const de_GetSessionStatusCommand = async (output, context) => {
1583
840
  };
1584
841
  return response;
1585
842
  };
1586
- const de_GetSessionStatusCommandError = async (output, context) => {
1587
- const parsedOutput = {
1588
- ...output,
1589
- body: await parseErrorBody(output.body, context),
1590
- };
1591
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1592
- switch (errorCode) {
1593
- case "InternalServerException":
1594
- case "com.amazonaws.athena#InternalServerException":
1595
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1596
- case "InvalidRequestException":
1597
- case "com.amazonaws.athena#InvalidRequestException":
1598
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1599
- case "ResourceNotFoundException":
1600
- case "com.amazonaws.athena#ResourceNotFoundException":
1601
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1602
- default:
1603
- const parsedBody = parsedOutput.body;
1604
- return throwDefaultError({
1605
- output,
1606
- parsedBody,
1607
- errorCode,
1608
- });
1609
- }
1610
- };
1611
843
  export const de_GetTableMetadataCommand = async (output, context) => {
1612
844
  if (output.statusCode >= 300) {
1613
- return de_GetTableMetadataCommandError(output, context);
845
+ return de_CommandError(output, context);
1614
846
  }
1615
847
  const data = await parseBody(output.body, context);
1616
848
  let contents = {};
@@ -1621,69 +853,22 @@ export const de_GetTableMetadataCommand = async (output, context) => {
1621
853
  };
1622
854
  return response;
1623
855
  };
1624
- const de_GetTableMetadataCommandError = async (output, context) => {
1625
- const parsedOutput = {
1626
- ...output,
1627
- body: await parseErrorBody(output.body, context),
1628
- };
1629
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1630
- switch (errorCode) {
1631
- case "InternalServerException":
1632
- case "com.amazonaws.athena#InternalServerException":
1633
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1634
- case "InvalidRequestException":
1635
- case "com.amazonaws.athena#InvalidRequestException":
1636
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1637
- case "MetadataException":
1638
- case "com.amazonaws.athena#MetadataException":
1639
- throw await de_MetadataExceptionRes(parsedOutput, context);
1640
- default:
1641
- const parsedBody = parsedOutput.body;
1642
- return throwDefaultError({
1643
- output,
1644
- parsedBody,
1645
- errorCode,
1646
- });
1647
- }
1648
- };
1649
- export const de_GetWorkGroupCommand = async (output, context) => {
1650
- if (output.statusCode >= 300) {
1651
- return de_GetWorkGroupCommandError(output, context);
1652
- }
1653
- const data = await parseBody(output.body, context);
1654
- let contents = {};
1655
- contents = de_GetWorkGroupOutput(data, context);
1656
- const response = {
1657
- $metadata: deserializeMetadata(output),
1658
- ...contents,
856
+ export const de_GetWorkGroupCommand = async (output, context) => {
857
+ if (output.statusCode >= 300) {
858
+ return de_CommandError(output, context);
859
+ }
860
+ const data = await parseBody(output.body, context);
861
+ let contents = {};
862
+ contents = de_GetWorkGroupOutput(data, context);
863
+ const response = {
864
+ $metadata: deserializeMetadata(output),
865
+ ...contents,
1659
866
  };
1660
867
  return response;
1661
868
  };
1662
- const de_GetWorkGroupCommandError = async (output, context) => {
1663
- const parsedOutput = {
1664
- ...output,
1665
- body: await parseErrorBody(output.body, context),
1666
- };
1667
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1668
- switch (errorCode) {
1669
- case "InternalServerException":
1670
- case "com.amazonaws.athena#InternalServerException":
1671
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1672
- case "InvalidRequestException":
1673
- case "com.amazonaws.athena#InvalidRequestException":
1674
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1675
- default:
1676
- const parsedBody = parsedOutput.body;
1677
- return throwDefaultError({
1678
- output,
1679
- parsedBody,
1680
- errorCode,
1681
- });
1682
- }
1683
- };
1684
869
  export const de_ImportNotebookCommand = async (output, context) => {
1685
870
  if (output.statusCode >= 300) {
1686
- return de_ImportNotebookCommandError(output, context);
871
+ return de_CommandError(output, context);
1687
872
  }
1688
873
  const data = await parseBody(output.body, context);
1689
874
  let contents = {};
@@ -1694,34 +879,9 @@ export const de_ImportNotebookCommand = async (output, context) => {
1694
879
  };
1695
880
  return response;
1696
881
  };
1697
- const de_ImportNotebookCommandError = async (output, context) => {
1698
- const parsedOutput = {
1699
- ...output,
1700
- body: await parseErrorBody(output.body, context),
1701
- };
1702
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1703
- switch (errorCode) {
1704
- case "InternalServerException":
1705
- case "com.amazonaws.athena#InternalServerException":
1706
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1707
- case "InvalidRequestException":
1708
- case "com.amazonaws.athena#InvalidRequestException":
1709
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1710
- case "TooManyRequestsException":
1711
- case "com.amazonaws.athena#TooManyRequestsException":
1712
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1713
- default:
1714
- const parsedBody = parsedOutput.body;
1715
- return throwDefaultError({
1716
- output,
1717
- parsedBody,
1718
- errorCode,
1719
- });
1720
- }
1721
- };
1722
882
  export const de_ListApplicationDPUSizesCommand = async (output, context) => {
1723
883
  if (output.statusCode >= 300) {
1724
- return de_ListApplicationDPUSizesCommandError(output, context);
884
+ return de_CommandError(output, context);
1725
885
  }
1726
886
  const data = await parseBody(output.body, context);
1727
887
  let contents = {};
@@ -1732,34 +892,9 @@ export const de_ListApplicationDPUSizesCommand = async (output, context) => {
1732
892
  };
1733
893
  return response;
1734
894
  };
1735
- const de_ListApplicationDPUSizesCommandError = async (output, context) => {
1736
- const parsedOutput = {
1737
- ...output,
1738
- body: await parseErrorBody(output.body, context),
1739
- };
1740
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1741
- switch (errorCode) {
1742
- case "InternalServerException":
1743
- case "com.amazonaws.athena#InternalServerException":
1744
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1745
- case "InvalidRequestException":
1746
- case "com.amazonaws.athena#InvalidRequestException":
1747
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1748
- case "TooManyRequestsException":
1749
- case "com.amazonaws.athena#TooManyRequestsException":
1750
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1751
- default:
1752
- const parsedBody = parsedOutput.body;
1753
- return throwDefaultError({
1754
- output,
1755
- parsedBody,
1756
- errorCode,
1757
- });
1758
- }
1759
- };
1760
895
  export const de_ListCalculationExecutionsCommand = async (output, context) => {
1761
896
  if (output.statusCode >= 300) {
1762
- return de_ListCalculationExecutionsCommandError(output, context);
897
+ return de_CommandError(output, context);
1763
898
  }
1764
899
  const data = await parseBody(output.body, context);
1765
900
  let contents = {};
@@ -1770,34 +905,9 @@ export const de_ListCalculationExecutionsCommand = async (output, context) => {
1770
905
  };
1771
906
  return response;
1772
907
  };
1773
- const de_ListCalculationExecutionsCommandError = async (output, context) => {
1774
- const parsedOutput = {
1775
- ...output,
1776
- body: await parseErrorBody(output.body, context),
1777
- };
1778
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1779
- switch (errorCode) {
1780
- case "InternalServerException":
1781
- case "com.amazonaws.athena#InternalServerException":
1782
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1783
- case "InvalidRequestException":
1784
- case "com.amazonaws.athena#InvalidRequestException":
1785
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1786
- case "ResourceNotFoundException":
1787
- case "com.amazonaws.athena#ResourceNotFoundException":
1788
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1789
- default:
1790
- const parsedBody = parsedOutput.body;
1791
- return throwDefaultError({
1792
- output,
1793
- parsedBody,
1794
- errorCode,
1795
- });
1796
- }
1797
- };
1798
908
  export const de_ListCapacityReservationsCommand = async (output, context) => {
1799
909
  if (output.statusCode >= 300) {
1800
- return de_ListCapacityReservationsCommandError(output, context);
910
+ return de_CommandError(output, context);
1801
911
  }
1802
912
  const data = await parseBody(output.body, context);
1803
913
  let contents = {};
@@ -1808,31 +918,9 @@ export const de_ListCapacityReservationsCommand = async (output, context) => {
1808
918
  };
1809
919
  return response;
1810
920
  };
1811
- const de_ListCapacityReservationsCommandError = async (output, context) => {
1812
- const parsedOutput = {
1813
- ...output,
1814
- body: await parseErrorBody(output.body, context),
1815
- };
1816
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1817
- switch (errorCode) {
1818
- case "InternalServerException":
1819
- case "com.amazonaws.athena#InternalServerException":
1820
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1821
- case "InvalidRequestException":
1822
- case "com.amazonaws.athena#InvalidRequestException":
1823
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1824
- default:
1825
- const parsedBody = parsedOutput.body;
1826
- return throwDefaultError({
1827
- output,
1828
- parsedBody,
1829
- errorCode,
1830
- });
1831
- }
1832
- };
1833
921
  export const de_ListDatabasesCommand = async (output, context) => {
1834
922
  if (output.statusCode >= 300) {
1835
- return de_ListDatabasesCommandError(output, context);
923
+ return de_CommandError(output, context);
1836
924
  }
1837
925
  const data = await parseBody(output.body, context);
1838
926
  let contents = {};
@@ -1843,34 +931,9 @@ export const de_ListDatabasesCommand = async (output, context) => {
1843
931
  };
1844
932
  return response;
1845
933
  };
1846
- const de_ListDatabasesCommandError = async (output, context) => {
1847
- const parsedOutput = {
1848
- ...output,
1849
- body: await parseErrorBody(output.body, context),
1850
- };
1851
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1852
- switch (errorCode) {
1853
- case "InternalServerException":
1854
- case "com.amazonaws.athena#InternalServerException":
1855
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1856
- case "InvalidRequestException":
1857
- case "com.amazonaws.athena#InvalidRequestException":
1858
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1859
- case "MetadataException":
1860
- case "com.amazonaws.athena#MetadataException":
1861
- throw await de_MetadataExceptionRes(parsedOutput, context);
1862
- default:
1863
- const parsedBody = parsedOutput.body;
1864
- return throwDefaultError({
1865
- output,
1866
- parsedBody,
1867
- errorCode,
1868
- });
1869
- }
1870
- };
1871
934
  export const de_ListDataCatalogsCommand = async (output, context) => {
1872
935
  if (output.statusCode >= 300) {
1873
- return de_ListDataCatalogsCommandError(output, context);
936
+ return de_CommandError(output, context);
1874
937
  }
1875
938
  const data = await parseBody(output.body, context);
1876
939
  let contents = {};
@@ -1881,31 +944,9 @@ export const de_ListDataCatalogsCommand = async (output, context) => {
1881
944
  };
1882
945
  return response;
1883
946
  };
1884
- const de_ListDataCatalogsCommandError = async (output, context) => {
1885
- const parsedOutput = {
1886
- ...output,
1887
- body: await parseErrorBody(output.body, context),
1888
- };
1889
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1890
- switch (errorCode) {
1891
- case "InternalServerException":
1892
- case "com.amazonaws.athena#InternalServerException":
1893
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1894
- case "InvalidRequestException":
1895
- case "com.amazonaws.athena#InvalidRequestException":
1896
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1897
- default:
1898
- const parsedBody = parsedOutput.body;
1899
- return throwDefaultError({
1900
- output,
1901
- parsedBody,
1902
- errorCode,
1903
- });
1904
- }
1905
- };
1906
947
  export const de_ListEngineVersionsCommand = async (output, context) => {
1907
948
  if (output.statusCode >= 300) {
1908
- return de_ListEngineVersionsCommandError(output, context);
949
+ return de_CommandError(output, context);
1909
950
  }
1910
951
  const data = await parseBody(output.body, context);
1911
952
  let contents = {};
@@ -1916,31 +957,9 @@ export const de_ListEngineVersionsCommand = async (output, context) => {
1916
957
  };
1917
958
  return response;
1918
959
  };
1919
- const de_ListEngineVersionsCommandError = async (output, context) => {
1920
- const parsedOutput = {
1921
- ...output,
1922
- body: await parseErrorBody(output.body, context),
1923
- };
1924
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1925
- switch (errorCode) {
1926
- case "InternalServerException":
1927
- case "com.amazonaws.athena#InternalServerException":
1928
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1929
- case "InvalidRequestException":
1930
- case "com.amazonaws.athena#InvalidRequestException":
1931
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1932
- default:
1933
- const parsedBody = parsedOutput.body;
1934
- return throwDefaultError({
1935
- output,
1936
- parsedBody,
1937
- errorCode,
1938
- });
1939
- }
1940
- };
1941
960
  export const de_ListExecutorsCommand = async (output, context) => {
1942
961
  if (output.statusCode >= 300) {
1943
- return de_ListExecutorsCommandError(output, context);
962
+ return de_CommandError(output, context);
1944
963
  }
1945
964
  const data = await parseBody(output.body, context);
1946
965
  let contents = {};
@@ -1951,34 +970,9 @@ export const de_ListExecutorsCommand = async (output, context) => {
1951
970
  };
1952
971
  return response;
1953
972
  };
1954
- const de_ListExecutorsCommandError = async (output, context) => {
1955
- const parsedOutput = {
1956
- ...output,
1957
- body: await parseErrorBody(output.body, context),
1958
- };
1959
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1960
- switch (errorCode) {
1961
- case "InternalServerException":
1962
- case "com.amazonaws.athena#InternalServerException":
1963
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1964
- case "InvalidRequestException":
1965
- case "com.amazonaws.athena#InvalidRequestException":
1966
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1967
- case "ResourceNotFoundException":
1968
- case "com.amazonaws.athena#ResourceNotFoundException":
1969
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1970
- default:
1971
- const parsedBody = parsedOutput.body;
1972
- return throwDefaultError({
1973
- output,
1974
- parsedBody,
1975
- errorCode,
1976
- });
1977
- }
1978
- };
1979
973
  export const de_ListNamedQueriesCommand = async (output, context) => {
1980
974
  if (output.statusCode >= 300) {
1981
- return de_ListNamedQueriesCommandError(output, context);
975
+ return de_CommandError(output, context);
1982
976
  }
1983
977
  const data = await parseBody(output.body, context);
1984
978
  let contents = {};
@@ -1989,31 +983,9 @@ export const de_ListNamedQueriesCommand = async (output, context) => {
1989
983
  };
1990
984
  return response;
1991
985
  };
1992
- const de_ListNamedQueriesCommandError = async (output, context) => {
1993
- const parsedOutput = {
1994
- ...output,
1995
- body: await parseErrorBody(output.body, context),
1996
- };
1997
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1998
- switch (errorCode) {
1999
- case "InternalServerException":
2000
- case "com.amazonaws.athena#InternalServerException":
2001
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2002
- case "InvalidRequestException":
2003
- case "com.amazonaws.athena#InvalidRequestException":
2004
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2005
- default:
2006
- const parsedBody = parsedOutput.body;
2007
- return throwDefaultError({
2008
- output,
2009
- parsedBody,
2010
- errorCode,
2011
- });
2012
- }
2013
- };
2014
986
  export const de_ListNotebookMetadataCommand = async (output, context) => {
2015
987
  if (output.statusCode >= 300) {
2016
- return de_ListNotebookMetadataCommandError(output, context);
988
+ return de_CommandError(output, context);
2017
989
  }
2018
990
  const data = await parseBody(output.body, context);
2019
991
  let contents = {};
@@ -2024,34 +996,9 @@ export const de_ListNotebookMetadataCommand = async (output, context) => {
2024
996
  };
2025
997
  return response;
2026
998
  };
2027
- const de_ListNotebookMetadataCommandError = async (output, context) => {
2028
- const parsedOutput = {
2029
- ...output,
2030
- body: await parseErrorBody(output.body, context),
2031
- };
2032
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2033
- switch (errorCode) {
2034
- case "InternalServerException":
2035
- case "com.amazonaws.athena#InternalServerException":
2036
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2037
- case "InvalidRequestException":
2038
- case "com.amazonaws.athena#InvalidRequestException":
2039
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2040
- case "TooManyRequestsException":
2041
- case "com.amazonaws.athena#TooManyRequestsException":
2042
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
2043
- default:
2044
- const parsedBody = parsedOutput.body;
2045
- return throwDefaultError({
2046
- output,
2047
- parsedBody,
2048
- errorCode,
2049
- });
2050
- }
2051
- };
2052
999
  export const de_ListNotebookSessionsCommand = async (output, context) => {
2053
1000
  if (output.statusCode >= 300) {
2054
- return de_ListNotebookSessionsCommandError(output, context);
1001
+ return de_CommandError(output, context);
2055
1002
  }
2056
1003
  const data = await parseBody(output.body, context);
2057
1004
  let contents = {};
@@ -2062,34 +1009,9 @@ export const de_ListNotebookSessionsCommand = async (output, context) => {
2062
1009
  };
2063
1010
  return response;
2064
1011
  };
2065
- const de_ListNotebookSessionsCommandError = async (output, context) => {
2066
- const parsedOutput = {
2067
- ...output,
2068
- body: await parseErrorBody(output.body, context),
2069
- };
2070
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2071
- switch (errorCode) {
2072
- case "InternalServerException":
2073
- case "com.amazonaws.athena#InternalServerException":
2074
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2075
- case "InvalidRequestException":
2076
- case "com.amazonaws.athena#InvalidRequestException":
2077
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2078
- case "ResourceNotFoundException":
2079
- case "com.amazonaws.athena#ResourceNotFoundException":
2080
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2081
- default:
2082
- const parsedBody = parsedOutput.body;
2083
- return throwDefaultError({
2084
- output,
2085
- parsedBody,
2086
- errorCode,
2087
- });
2088
- }
2089
- };
2090
1012
  export const de_ListPreparedStatementsCommand = async (output, context) => {
2091
1013
  if (output.statusCode >= 300) {
2092
- return de_ListPreparedStatementsCommandError(output, context);
1014
+ return de_CommandError(output, context);
2093
1015
  }
2094
1016
  const data = await parseBody(output.body, context);
2095
1017
  let contents = {};
@@ -2100,31 +1022,9 @@ export const de_ListPreparedStatementsCommand = async (output, context) => {
2100
1022
  };
2101
1023
  return response;
2102
1024
  };
2103
- const de_ListPreparedStatementsCommandError = async (output, context) => {
2104
- const parsedOutput = {
2105
- ...output,
2106
- body: await parseErrorBody(output.body, context),
2107
- };
2108
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2109
- switch (errorCode) {
2110
- case "InternalServerException":
2111
- case "com.amazonaws.athena#InternalServerException":
2112
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2113
- case "InvalidRequestException":
2114
- case "com.amazonaws.athena#InvalidRequestException":
2115
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2116
- default:
2117
- const parsedBody = parsedOutput.body;
2118
- return throwDefaultError({
2119
- output,
2120
- parsedBody,
2121
- errorCode,
2122
- });
2123
- }
2124
- };
2125
1025
  export const de_ListQueryExecutionsCommand = async (output, context) => {
2126
1026
  if (output.statusCode >= 300) {
2127
- return de_ListQueryExecutionsCommandError(output, context);
1027
+ return de_CommandError(output, context);
2128
1028
  }
2129
1029
  const data = await parseBody(output.body, context);
2130
1030
  let contents = {};
@@ -2135,31 +1035,9 @@ export const de_ListQueryExecutionsCommand = async (output, context) => {
2135
1035
  };
2136
1036
  return response;
2137
1037
  };
2138
- const de_ListQueryExecutionsCommandError = async (output, context) => {
2139
- const parsedOutput = {
2140
- ...output,
2141
- body: await parseErrorBody(output.body, context),
2142
- };
2143
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2144
- switch (errorCode) {
2145
- case "InternalServerException":
2146
- case "com.amazonaws.athena#InternalServerException":
2147
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2148
- case "InvalidRequestException":
2149
- case "com.amazonaws.athena#InvalidRequestException":
2150
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2151
- default:
2152
- const parsedBody = parsedOutput.body;
2153
- return throwDefaultError({
2154
- output,
2155
- parsedBody,
2156
- errorCode,
2157
- });
2158
- }
2159
- };
2160
1038
  export const de_ListSessionsCommand = async (output, context) => {
2161
1039
  if (output.statusCode >= 300) {
2162
- return de_ListSessionsCommandError(output, context);
1040
+ return de_CommandError(output, context);
2163
1041
  }
2164
1042
  const data = await parseBody(output.body, context);
2165
1043
  let contents = {};
@@ -2170,34 +1048,9 @@ export const de_ListSessionsCommand = async (output, context) => {
2170
1048
  };
2171
1049
  return response;
2172
1050
  };
2173
- const de_ListSessionsCommandError = async (output, context) => {
2174
- const parsedOutput = {
2175
- ...output,
2176
- body: await parseErrorBody(output.body, context),
2177
- };
2178
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2179
- switch (errorCode) {
2180
- case "InternalServerException":
2181
- case "com.amazonaws.athena#InternalServerException":
2182
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2183
- case "InvalidRequestException":
2184
- case "com.amazonaws.athena#InvalidRequestException":
2185
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2186
- case "ResourceNotFoundException":
2187
- case "com.amazonaws.athena#ResourceNotFoundException":
2188
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2189
- default:
2190
- const parsedBody = parsedOutput.body;
2191
- return throwDefaultError({
2192
- output,
2193
- parsedBody,
2194
- errorCode,
2195
- });
2196
- }
2197
- };
2198
1051
  export const de_ListTableMetadataCommand = async (output, context) => {
2199
1052
  if (output.statusCode >= 300) {
2200
- return de_ListTableMetadataCommandError(output, context);
1053
+ return de_CommandError(output, context);
2201
1054
  }
2202
1055
  const data = await parseBody(output.body, context);
2203
1056
  let contents = {};
@@ -2208,34 +1061,9 @@ export const de_ListTableMetadataCommand = async (output, context) => {
2208
1061
  };
2209
1062
  return response;
2210
1063
  };
2211
- const de_ListTableMetadataCommandError = async (output, context) => {
2212
- const parsedOutput = {
2213
- ...output,
2214
- body: await parseErrorBody(output.body, context),
2215
- };
2216
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2217
- switch (errorCode) {
2218
- case "InternalServerException":
2219
- case "com.amazonaws.athena#InternalServerException":
2220
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2221
- case "InvalidRequestException":
2222
- case "com.amazonaws.athena#InvalidRequestException":
2223
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2224
- case "MetadataException":
2225
- case "com.amazonaws.athena#MetadataException":
2226
- throw await de_MetadataExceptionRes(parsedOutput, context);
2227
- default:
2228
- const parsedBody = parsedOutput.body;
2229
- return throwDefaultError({
2230
- output,
2231
- parsedBody,
2232
- errorCode,
2233
- });
2234
- }
2235
- };
2236
1064
  export const de_ListTagsForResourceCommand = async (output, context) => {
2237
1065
  if (output.statusCode >= 300) {
2238
- return de_ListTagsForResourceCommandError(output, context);
1066
+ return de_CommandError(output, context);
2239
1067
  }
2240
1068
  const data = await parseBody(output.body, context);
2241
1069
  let contents = {};
@@ -2246,34 +1074,9 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
2246
1074
  };
2247
1075
  return response;
2248
1076
  };
2249
- const de_ListTagsForResourceCommandError = async (output, context) => {
2250
- const parsedOutput = {
2251
- ...output,
2252
- body: await parseErrorBody(output.body, context),
2253
- };
2254
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2255
- switch (errorCode) {
2256
- case "InternalServerException":
2257
- case "com.amazonaws.athena#InternalServerException":
2258
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2259
- case "InvalidRequestException":
2260
- case "com.amazonaws.athena#InvalidRequestException":
2261
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2262
- case "ResourceNotFoundException":
2263
- case "com.amazonaws.athena#ResourceNotFoundException":
2264
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2265
- default:
2266
- const parsedBody = parsedOutput.body;
2267
- return throwDefaultError({
2268
- output,
2269
- parsedBody,
2270
- errorCode,
2271
- });
2272
- }
2273
- };
2274
1077
  export const de_ListWorkGroupsCommand = async (output, context) => {
2275
1078
  if (output.statusCode >= 300) {
2276
- return de_ListWorkGroupsCommandError(output, context);
1079
+ return de_CommandError(output, context);
2277
1080
  }
2278
1081
  const data = await parseBody(output.body, context);
2279
1082
  let contents = {};
@@ -2284,31 +1087,9 @@ export const de_ListWorkGroupsCommand = async (output, context) => {
2284
1087
  };
2285
1088
  return response;
2286
1089
  };
2287
- const de_ListWorkGroupsCommandError = async (output, context) => {
2288
- const parsedOutput = {
2289
- ...output,
2290
- body: await parseErrorBody(output.body, context),
2291
- };
2292
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2293
- switch (errorCode) {
2294
- case "InternalServerException":
2295
- case "com.amazonaws.athena#InternalServerException":
2296
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2297
- case "InvalidRequestException":
2298
- case "com.amazonaws.athena#InvalidRequestException":
2299
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2300
- default:
2301
- const parsedBody = parsedOutput.body;
2302
- return throwDefaultError({
2303
- output,
2304
- parsedBody,
2305
- errorCode,
2306
- });
2307
- }
2308
- };
2309
1090
  export const de_PutCapacityAssignmentConfigurationCommand = async (output, context) => {
2310
1091
  if (output.statusCode >= 300) {
2311
- return de_PutCapacityAssignmentConfigurationCommandError(output, context);
1092
+ return de_CommandError(output, context);
2312
1093
  }
2313
1094
  const data = await parseBody(output.body, context);
2314
1095
  let contents = {};
@@ -2319,31 +1100,9 @@ export const de_PutCapacityAssignmentConfigurationCommand = async (output, conte
2319
1100
  };
2320
1101
  return response;
2321
1102
  };
2322
- const de_PutCapacityAssignmentConfigurationCommandError = async (output, context) => {
2323
- const parsedOutput = {
2324
- ...output,
2325
- body: await parseErrorBody(output.body, context),
2326
- };
2327
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2328
- switch (errorCode) {
2329
- case "InternalServerException":
2330
- case "com.amazonaws.athena#InternalServerException":
2331
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2332
- case "InvalidRequestException":
2333
- case "com.amazonaws.athena#InvalidRequestException":
2334
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2335
- default:
2336
- const parsedBody = parsedOutput.body;
2337
- return throwDefaultError({
2338
- output,
2339
- parsedBody,
2340
- errorCode,
2341
- });
2342
- }
2343
- };
2344
1103
  export const de_StartCalculationExecutionCommand = async (output, context) => {
2345
1104
  if (output.statusCode >= 300) {
2346
- return de_StartCalculationExecutionCommandError(output, context);
1105
+ return de_CommandError(output, context);
2347
1106
  }
2348
1107
  const data = await parseBody(output.body, context);
2349
1108
  let contents = {};
@@ -2354,34 +1113,9 @@ export const de_StartCalculationExecutionCommand = async (output, context) => {
2354
1113
  };
2355
1114
  return response;
2356
1115
  };
2357
- const de_StartCalculationExecutionCommandError = async (output, context) => {
2358
- const parsedOutput = {
2359
- ...output,
2360
- body: await parseErrorBody(output.body, context),
2361
- };
2362
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2363
- switch (errorCode) {
2364
- case "InternalServerException":
2365
- case "com.amazonaws.athena#InternalServerException":
2366
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2367
- case "InvalidRequestException":
2368
- case "com.amazonaws.athena#InvalidRequestException":
2369
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2370
- case "ResourceNotFoundException":
2371
- case "com.amazonaws.athena#ResourceNotFoundException":
2372
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2373
- default:
2374
- const parsedBody = parsedOutput.body;
2375
- return throwDefaultError({
2376
- output,
2377
- parsedBody,
2378
- errorCode,
2379
- });
2380
- }
2381
- };
2382
1116
  export const de_StartQueryExecutionCommand = async (output, context) => {
2383
1117
  if (output.statusCode >= 300) {
2384
- return de_StartQueryExecutionCommandError(output, context);
1118
+ return de_CommandError(output, context);
2385
1119
  }
2386
1120
  const data = await parseBody(output.body, context);
2387
1121
  let contents = {};
@@ -2392,116 +1126,22 @@ export const de_StartQueryExecutionCommand = async (output, context) => {
2392
1126
  };
2393
1127
  return response;
2394
1128
  };
2395
- const de_StartQueryExecutionCommandError = async (output, context) => {
2396
- const parsedOutput = {
2397
- ...output,
2398
- body: await parseErrorBody(output.body, context),
2399
- };
2400
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2401
- switch (errorCode) {
2402
- case "InternalServerException":
2403
- case "com.amazonaws.athena#InternalServerException":
2404
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2405
- case "InvalidRequestException":
2406
- case "com.amazonaws.athena#InvalidRequestException":
2407
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2408
- case "TooManyRequestsException":
2409
- case "com.amazonaws.athena#TooManyRequestsException":
2410
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
2411
- default:
2412
- const parsedBody = parsedOutput.body;
2413
- return throwDefaultError({
2414
- output,
2415
- parsedBody,
2416
- errorCode,
2417
- });
2418
- }
2419
- };
2420
1129
  export const de_StartSessionCommand = async (output, context) => {
2421
1130
  if (output.statusCode >= 300) {
2422
- return de_StartSessionCommandError(output, context);
2423
- }
2424
- const data = await parseBody(output.body, context);
2425
- let contents = {};
2426
- contents = _json(data);
2427
- const response = {
2428
- $metadata: deserializeMetadata(output),
2429
- ...contents,
2430
- };
2431
- return response;
2432
- };
2433
- const de_StartSessionCommandError = async (output, context) => {
2434
- const parsedOutput = {
2435
- ...output,
2436
- body: await parseErrorBody(output.body, context),
2437
- };
2438
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2439
- switch (errorCode) {
2440
- case "InternalServerException":
2441
- case "com.amazonaws.athena#InternalServerException":
2442
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2443
- case "InvalidRequestException":
2444
- case "com.amazonaws.athena#InvalidRequestException":
2445
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2446
- case "ResourceNotFoundException":
2447
- case "com.amazonaws.athena#ResourceNotFoundException":
2448
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2449
- case "SessionAlreadyExistsException":
2450
- case "com.amazonaws.athena#SessionAlreadyExistsException":
2451
- throw await de_SessionAlreadyExistsExceptionRes(parsedOutput, context);
2452
- case "TooManyRequestsException":
2453
- case "com.amazonaws.athena#TooManyRequestsException":
2454
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
2455
- default:
2456
- const parsedBody = parsedOutput.body;
2457
- return throwDefaultError({
2458
- output,
2459
- parsedBody,
2460
- errorCode,
2461
- });
2462
- }
2463
- };
2464
- export const de_StopCalculationExecutionCommand = async (output, context) => {
2465
- if (output.statusCode >= 300) {
2466
- return de_StopCalculationExecutionCommandError(output, context);
1131
+ return de_CommandError(output, context);
2467
1132
  }
2468
1133
  const data = await parseBody(output.body, context);
2469
1134
  let contents = {};
2470
- contents = _json(data);
2471
- const response = {
2472
- $metadata: deserializeMetadata(output),
2473
- ...contents,
2474
- };
2475
- return response;
2476
- };
2477
- const de_StopCalculationExecutionCommandError = async (output, context) => {
2478
- const parsedOutput = {
2479
- ...output,
2480
- body: await parseErrorBody(output.body, context),
2481
- };
2482
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2483
- switch (errorCode) {
2484
- case "InternalServerException":
2485
- case "com.amazonaws.athena#InternalServerException":
2486
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2487
- case "InvalidRequestException":
2488
- case "com.amazonaws.athena#InvalidRequestException":
2489
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2490
- case "ResourceNotFoundException":
2491
- case "com.amazonaws.athena#ResourceNotFoundException":
2492
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2493
- default:
2494
- const parsedBody = parsedOutput.body;
2495
- return throwDefaultError({
2496
- output,
2497
- parsedBody,
2498
- errorCode,
2499
- });
2500
- }
1135
+ contents = _json(data);
1136
+ const response = {
1137
+ $metadata: deserializeMetadata(output),
1138
+ ...contents,
1139
+ };
1140
+ return response;
2501
1141
  };
2502
- export const de_StopQueryExecutionCommand = async (output, context) => {
1142
+ export const de_StopCalculationExecutionCommand = async (output, context) => {
2503
1143
  if (output.statusCode >= 300) {
2504
- return de_StopQueryExecutionCommandError(output, context);
1144
+ return de_CommandError(output, context);
2505
1145
  }
2506
1146
  const data = await parseBody(output.body, context);
2507
1147
  let contents = {};
@@ -2512,31 +1152,22 @@ export const de_StopQueryExecutionCommand = async (output, context) => {
2512
1152
  };
2513
1153
  return response;
2514
1154
  };
2515
- const de_StopQueryExecutionCommandError = async (output, context) => {
2516
- const parsedOutput = {
2517
- ...output,
2518
- body: await parseErrorBody(output.body, context),
2519
- };
2520
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2521
- switch (errorCode) {
2522
- case "InternalServerException":
2523
- case "com.amazonaws.athena#InternalServerException":
2524
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2525
- case "InvalidRequestException":
2526
- case "com.amazonaws.athena#InvalidRequestException":
2527
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2528
- default:
2529
- const parsedBody = parsedOutput.body;
2530
- return throwDefaultError({
2531
- output,
2532
- parsedBody,
2533
- errorCode,
2534
- });
1155
+ export const de_StopQueryExecutionCommand = async (output, context) => {
1156
+ if (output.statusCode >= 300) {
1157
+ return de_CommandError(output, context);
2535
1158
  }
1159
+ const data = await parseBody(output.body, context);
1160
+ let contents = {};
1161
+ contents = _json(data);
1162
+ const response = {
1163
+ $metadata: deserializeMetadata(output),
1164
+ ...contents,
1165
+ };
1166
+ return response;
2536
1167
  };
2537
1168
  export const de_TagResourceCommand = async (output, context) => {
2538
1169
  if (output.statusCode >= 300) {
2539
- return de_TagResourceCommandError(output, context);
1170
+ return de_CommandError(output, context);
2540
1171
  }
2541
1172
  const data = await parseBody(output.body, context);
2542
1173
  let contents = {};
@@ -2547,34 +1178,9 @@ export const de_TagResourceCommand = async (output, context) => {
2547
1178
  };
2548
1179
  return response;
2549
1180
  };
2550
- const de_TagResourceCommandError = async (output, context) => {
2551
- const parsedOutput = {
2552
- ...output,
2553
- body: await parseErrorBody(output.body, context),
2554
- };
2555
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2556
- switch (errorCode) {
2557
- case "InternalServerException":
2558
- case "com.amazonaws.athena#InternalServerException":
2559
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2560
- case "InvalidRequestException":
2561
- case "com.amazonaws.athena#InvalidRequestException":
2562
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2563
- case "ResourceNotFoundException":
2564
- case "com.amazonaws.athena#ResourceNotFoundException":
2565
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2566
- default:
2567
- const parsedBody = parsedOutput.body;
2568
- return throwDefaultError({
2569
- output,
2570
- parsedBody,
2571
- errorCode,
2572
- });
2573
- }
2574
- };
2575
1181
  export const de_TerminateSessionCommand = async (output, context) => {
2576
1182
  if (output.statusCode >= 300) {
2577
- return de_TerminateSessionCommandError(output, context);
1183
+ return de_CommandError(output, context);
2578
1184
  }
2579
1185
  const data = await parseBody(output.body, context);
2580
1186
  let contents = {};
@@ -2585,34 +1191,9 @@ export const de_TerminateSessionCommand = async (output, context) => {
2585
1191
  };
2586
1192
  return response;
2587
1193
  };
2588
- const de_TerminateSessionCommandError = async (output, context) => {
2589
- const parsedOutput = {
2590
- ...output,
2591
- body: await parseErrorBody(output.body, context),
2592
- };
2593
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2594
- switch (errorCode) {
2595
- case "InternalServerException":
2596
- case "com.amazonaws.athena#InternalServerException":
2597
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2598
- case "InvalidRequestException":
2599
- case "com.amazonaws.athena#InvalidRequestException":
2600
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2601
- case "ResourceNotFoundException":
2602
- case "com.amazonaws.athena#ResourceNotFoundException":
2603
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2604
- default:
2605
- const parsedBody = parsedOutput.body;
2606
- return throwDefaultError({
2607
- output,
2608
- parsedBody,
2609
- errorCode,
2610
- });
2611
- }
2612
- };
2613
1194
  export const de_UntagResourceCommand = async (output, context) => {
2614
1195
  if (output.statusCode >= 300) {
2615
- return de_UntagResourceCommandError(output, context);
1196
+ return de_CommandError(output, context);
2616
1197
  }
2617
1198
  const data = await parseBody(output.body, context);
2618
1199
  let contents = {};
@@ -2623,34 +1204,9 @@ export const de_UntagResourceCommand = async (output, context) => {
2623
1204
  };
2624
1205
  return response;
2625
1206
  };
2626
- const de_UntagResourceCommandError = async (output, context) => {
2627
- const parsedOutput = {
2628
- ...output,
2629
- body: await parseErrorBody(output.body, context),
2630
- };
2631
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2632
- switch (errorCode) {
2633
- case "InternalServerException":
2634
- case "com.amazonaws.athena#InternalServerException":
2635
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2636
- case "InvalidRequestException":
2637
- case "com.amazonaws.athena#InvalidRequestException":
2638
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2639
- case "ResourceNotFoundException":
2640
- case "com.amazonaws.athena#ResourceNotFoundException":
2641
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2642
- default:
2643
- const parsedBody = parsedOutput.body;
2644
- return throwDefaultError({
2645
- output,
2646
- parsedBody,
2647
- errorCode,
2648
- });
2649
- }
2650
- };
2651
1207
  export const de_UpdateCapacityReservationCommand = async (output, context) => {
2652
1208
  if (output.statusCode >= 300) {
2653
- return de_UpdateCapacityReservationCommandError(output, context);
1209
+ return de_CommandError(output, context);
2654
1210
  }
2655
1211
  const data = await parseBody(output.body, context);
2656
1212
  let contents = {};
@@ -2661,31 +1217,9 @@ export const de_UpdateCapacityReservationCommand = async (output, context) => {
2661
1217
  };
2662
1218
  return response;
2663
1219
  };
2664
- const de_UpdateCapacityReservationCommandError = async (output, context) => {
2665
- const parsedOutput = {
2666
- ...output,
2667
- body: await parseErrorBody(output.body, context),
2668
- };
2669
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2670
- switch (errorCode) {
2671
- case "InternalServerException":
2672
- case "com.amazonaws.athena#InternalServerException":
2673
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2674
- case "InvalidRequestException":
2675
- case "com.amazonaws.athena#InvalidRequestException":
2676
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2677
- default:
2678
- const parsedBody = parsedOutput.body;
2679
- return throwDefaultError({
2680
- output,
2681
- parsedBody,
2682
- errorCode,
2683
- });
2684
- }
2685
- };
2686
1220
  export const de_UpdateDataCatalogCommand = async (output, context) => {
2687
1221
  if (output.statusCode >= 300) {
2688
- return de_UpdateDataCatalogCommandError(output, context);
1222
+ return de_CommandError(output, context);
2689
1223
  }
2690
1224
  const data = await parseBody(output.body, context);
2691
1225
  let contents = {};
@@ -2696,31 +1230,9 @@ export const de_UpdateDataCatalogCommand = async (output, context) => {
2696
1230
  };
2697
1231
  return response;
2698
1232
  };
2699
- const de_UpdateDataCatalogCommandError = async (output, context) => {
2700
- const parsedOutput = {
2701
- ...output,
2702
- body: await parseErrorBody(output.body, context),
2703
- };
2704
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2705
- switch (errorCode) {
2706
- case "InternalServerException":
2707
- case "com.amazonaws.athena#InternalServerException":
2708
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2709
- case "InvalidRequestException":
2710
- case "com.amazonaws.athena#InvalidRequestException":
2711
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2712
- default:
2713
- const parsedBody = parsedOutput.body;
2714
- return throwDefaultError({
2715
- output,
2716
- parsedBody,
2717
- errorCode,
2718
- });
2719
- }
2720
- };
2721
1233
  export const de_UpdateNamedQueryCommand = async (output, context) => {
2722
1234
  if (output.statusCode >= 300) {
2723
- return de_UpdateNamedQueryCommandError(output, context);
1235
+ return de_CommandError(output, context);
2724
1236
  }
2725
1237
  const data = await parseBody(output.body, context);
2726
1238
  let contents = {};
@@ -2731,31 +1243,9 @@ export const de_UpdateNamedQueryCommand = async (output, context) => {
2731
1243
  };
2732
1244
  return response;
2733
1245
  };
2734
- const de_UpdateNamedQueryCommandError = async (output, context) => {
2735
- const parsedOutput = {
2736
- ...output,
2737
- body: await parseErrorBody(output.body, context),
2738
- };
2739
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2740
- switch (errorCode) {
2741
- case "InternalServerException":
2742
- case "com.amazonaws.athena#InternalServerException":
2743
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2744
- case "InvalidRequestException":
2745
- case "com.amazonaws.athena#InvalidRequestException":
2746
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2747
- default:
2748
- const parsedBody = parsedOutput.body;
2749
- return throwDefaultError({
2750
- output,
2751
- parsedBody,
2752
- errorCode,
2753
- });
2754
- }
2755
- };
2756
1246
  export const de_UpdateNotebookCommand = async (output, context) => {
2757
1247
  if (output.statusCode >= 300) {
2758
- return de_UpdateNotebookCommandError(output, context);
1248
+ return de_CommandError(output, context);
2759
1249
  }
2760
1250
  const data = await parseBody(output.body, context);
2761
1251
  let contents = {};
@@ -2766,34 +1256,9 @@ export const de_UpdateNotebookCommand = async (output, context) => {
2766
1256
  };
2767
1257
  return response;
2768
1258
  };
2769
- const de_UpdateNotebookCommandError = async (output, context) => {
2770
- const parsedOutput = {
2771
- ...output,
2772
- body: await parseErrorBody(output.body, context),
2773
- };
2774
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2775
- switch (errorCode) {
2776
- case "InternalServerException":
2777
- case "com.amazonaws.athena#InternalServerException":
2778
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2779
- case "InvalidRequestException":
2780
- case "com.amazonaws.athena#InvalidRequestException":
2781
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2782
- case "TooManyRequestsException":
2783
- case "com.amazonaws.athena#TooManyRequestsException":
2784
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
2785
- default:
2786
- const parsedBody = parsedOutput.body;
2787
- return throwDefaultError({
2788
- output,
2789
- parsedBody,
2790
- errorCode,
2791
- });
2792
- }
2793
- };
2794
1259
  export const de_UpdateNotebookMetadataCommand = async (output, context) => {
2795
1260
  if (output.statusCode >= 300) {
2796
- return de_UpdateNotebookMetadataCommandError(output, context);
1261
+ return de_CommandError(output, context);
2797
1262
  }
2798
1263
  const data = await parseBody(output.body, context);
2799
1264
  let contents = {};
@@ -2804,34 +1269,9 @@ export const de_UpdateNotebookMetadataCommand = async (output, context) => {
2804
1269
  };
2805
1270
  return response;
2806
1271
  };
2807
- const de_UpdateNotebookMetadataCommandError = async (output, context) => {
2808
- const parsedOutput = {
2809
- ...output,
2810
- body: await parseErrorBody(output.body, context),
2811
- };
2812
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2813
- switch (errorCode) {
2814
- case "InternalServerException":
2815
- case "com.amazonaws.athena#InternalServerException":
2816
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2817
- case "InvalidRequestException":
2818
- case "com.amazonaws.athena#InvalidRequestException":
2819
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2820
- case "TooManyRequestsException":
2821
- case "com.amazonaws.athena#TooManyRequestsException":
2822
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
2823
- default:
2824
- const parsedBody = parsedOutput.body;
2825
- return throwDefaultError({
2826
- output,
2827
- parsedBody,
2828
- errorCode,
2829
- });
2830
- }
2831
- };
2832
1272
  export const de_UpdatePreparedStatementCommand = async (output, context) => {
2833
1273
  if (output.statusCode >= 300) {
2834
- return de_UpdatePreparedStatementCommandError(output, context);
1274
+ return de_CommandError(output, context);
2835
1275
  }
2836
1276
  const data = await parseBody(output.body, context);
2837
1277
  let contents = {};
@@ -2842,34 +1282,9 @@ export const de_UpdatePreparedStatementCommand = async (output, context) => {
2842
1282
  };
2843
1283
  return response;
2844
1284
  };
2845
- const de_UpdatePreparedStatementCommandError = async (output, context) => {
2846
- const parsedOutput = {
2847
- ...output,
2848
- body: await parseErrorBody(output.body, context),
2849
- };
2850
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2851
- switch (errorCode) {
2852
- case "InternalServerException":
2853
- case "com.amazonaws.athena#InternalServerException":
2854
- throw await de_InternalServerExceptionRes(parsedOutput, context);
2855
- case "InvalidRequestException":
2856
- case "com.amazonaws.athena#InvalidRequestException":
2857
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2858
- case "ResourceNotFoundException":
2859
- case "com.amazonaws.athena#ResourceNotFoundException":
2860
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2861
- default:
2862
- const parsedBody = parsedOutput.body;
2863
- return throwDefaultError({
2864
- output,
2865
- parsedBody,
2866
- errorCode,
2867
- });
2868
- }
2869
- };
2870
1285
  export const de_UpdateWorkGroupCommand = async (output, context) => {
2871
1286
  if (output.statusCode >= 300) {
2872
- return de_UpdateWorkGroupCommandError(output, context);
1287
+ return de_CommandError(output, context);
2873
1288
  }
2874
1289
  const data = await parseBody(output.body, context);
2875
1290
  let contents = {};
@@ -2880,7 +1295,7 @@ export const de_UpdateWorkGroupCommand = async (output, context) => {
2880
1295
  };
2881
1296
  return response;
2882
1297
  };
2883
- const de_UpdateWorkGroupCommandError = async (output, context) => {
1298
+ const de_CommandError = async (output, context) => {
2884
1299
  const parsedOutput = {
2885
1300
  ...output,
2886
1301
  body: await parseErrorBody(output.body, context),
@@ -2893,6 +1308,18 @@ const de_UpdateWorkGroupCommandError = async (output, context) => {
2893
1308
  case "InvalidRequestException":
2894
1309
  case "com.amazonaws.athena#InvalidRequestException":
2895
1310
  throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1311
+ case "TooManyRequestsException":
1312
+ case "com.amazonaws.athena#TooManyRequestsException":
1313
+ throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1314
+ case "ResourceNotFoundException":
1315
+ case "com.amazonaws.athena#ResourceNotFoundException":
1316
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1317
+ case "MetadataException":
1318
+ case "com.amazonaws.athena#MetadataException":
1319
+ throw await de_MetadataExceptionRes(parsedOutput, context);
1320
+ case "SessionAlreadyExistsException":
1321
+ case "com.amazonaws.athena#SessionAlreadyExistsException":
1322
+ throw await de_SessionAlreadyExistsExceptionRes(parsedOutput, context);
2896
1323
  default:
2897
1324
  const parsedBody = parsedOutput.body;
2898
1325
  return throwDefaultError({