@aws-sdk/client-connectcases 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.
@@ -448,7 +448,7 @@ export const se_UpdateTemplateCommand = async (input, context) => {
448
448
  };
449
449
  export const de_BatchGetFieldCommand = async (output, context) => {
450
450
  if (output.statusCode !== 200 && output.statusCode >= 300) {
451
- return de_BatchGetFieldCommandError(output, context);
451
+ return de_CommandError(output, context);
452
452
  }
453
453
  const contents = map({
454
454
  $metadata: deserializeMetadata(output),
@@ -461,40 +461,9 @@ export const de_BatchGetFieldCommand = async (output, context) => {
461
461
  Object.assign(contents, doc);
462
462
  return contents;
463
463
  };
464
- const de_BatchGetFieldCommandError = async (output, context) => {
465
- const parsedOutput = {
466
- ...output,
467
- body: await parseErrorBody(output.body, context),
468
- };
469
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
470
- switch (errorCode) {
471
- case "AccessDeniedException":
472
- case "com.amazonaws.connectcases#AccessDeniedException":
473
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
474
- case "InternalServerException":
475
- case "com.amazonaws.connectcases#InternalServerException":
476
- throw await de_InternalServerExceptionRes(parsedOutput, context);
477
- case "ResourceNotFoundException":
478
- case "com.amazonaws.connectcases#ResourceNotFoundException":
479
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
480
- case "ThrottlingException":
481
- case "com.amazonaws.connectcases#ThrottlingException":
482
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
483
- case "ValidationException":
484
- case "com.amazonaws.connectcases#ValidationException":
485
- throw await de_ValidationExceptionRes(parsedOutput, context);
486
- default:
487
- const parsedBody = parsedOutput.body;
488
- return throwDefaultError({
489
- output,
490
- parsedBody,
491
- errorCode,
492
- });
493
- }
494
- };
495
464
  export const de_BatchPutFieldOptionsCommand = async (output, context) => {
496
465
  if (output.statusCode !== 200 && output.statusCode >= 300) {
497
- return de_BatchPutFieldOptionsCommandError(output, context);
466
+ return de_CommandError(output, context);
498
467
  }
499
468
  const contents = map({
500
469
  $metadata: deserializeMetadata(output),
@@ -506,43 +475,9 @@ export const de_BatchPutFieldOptionsCommand = async (output, context) => {
506
475
  Object.assign(contents, doc);
507
476
  return contents;
508
477
  };
509
- const de_BatchPutFieldOptionsCommandError = async (output, context) => {
510
- const parsedOutput = {
511
- ...output,
512
- body: await parseErrorBody(output.body, context),
513
- };
514
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
515
- switch (errorCode) {
516
- case "AccessDeniedException":
517
- case "com.amazonaws.connectcases#AccessDeniedException":
518
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
519
- case "InternalServerException":
520
- case "com.amazonaws.connectcases#InternalServerException":
521
- throw await de_InternalServerExceptionRes(parsedOutput, context);
522
- case "ResourceNotFoundException":
523
- case "com.amazonaws.connectcases#ResourceNotFoundException":
524
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
525
- case "ServiceQuotaExceededException":
526
- case "com.amazonaws.connectcases#ServiceQuotaExceededException":
527
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
528
- case "ThrottlingException":
529
- case "com.amazonaws.connectcases#ThrottlingException":
530
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
531
- case "ValidationException":
532
- case "com.amazonaws.connectcases#ValidationException":
533
- throw await de_ValidationExceptionRes(parsedOutput, context);
534
- default:
535
- const parsedBody = parsedOutput.body;
536
- return throwDefaultError({
537
- output,
538
- parsedBody,
539
- errorCode,
540
- });
541
- }
542
- };
543
478
  export const de_CreateCaseCommand = async (output, context) => {
544
479
  if (output.statusCode !== 200 && output.statusCode >= 300) {
545
- return de_CreateCaseCommandError(output, context);
480
+ return de_CommandError(output, context);
546
481
  }
547
482
  const contents = map({
548
483
  $metadata: deserializeMetadata(output),
@@ -555,43 +490,9 @@ export const de_CreateCaseCommand = async (output, context) => {
555
490
  Object.assign(contents, doc);
556
491
  return contents;
557
492
  };
558
- const de_CreateCaseCommandError = async (output, context) => {
559
- const parsedOutput = {
560
- ...output,
561
- body: await parseErrorBody(output.body, context),
562
- };
563
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
564
- switch (errorCode) {
565
- case "AccessDeniedException":
566
- case "com.amazonaws.connectcases#AccessDeniedException":
567
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
568
- case "ConflictException":
569
- case "com.amazonaws.connectcases#ConflictException":
570
- throw await de_ConflictExceptionRes(parsedOutput, context);
571
- case "InternalServerException":
572
- case "com.amazonaws.connectcases#InternalServerException":
573
- throw await de_InternalServerExceptionRes(parsedOutput, context);
574
- case "ResourceNotFoundException":
575
- case "com.amazonaws.connectcases#ResourceNotFoundException":
576
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
577
- case "ThrottlingException":
578
- case "com.amazonaws.connectcases#ThrottlingException":
579
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
580
- case "ValidationException":
581
- case "com.amazonaws.connectcases#ValidationException":
582
- throw await de_ValidationExceptionRes(parsedOutput, context);
583
- default:
584
- const parsedBody = parsedOutput.body;
585
- return throwDefaultError({
586
- output,
587
- parsedBody,
588
- errorCode,
589
- });
590
- }
591
- };
592
493
  export const de_CreateDomainCommand = async (output, context) => {
593
494
  if (output.statusCode !== 200 && output.statusCode >= 300) {
594
- return de_CreateDomainCommandError(output, context);
495
+ return de_CommandError(output, context);
595
496
  }
596
497
  const contents = map({
597
498
  $metadata: deserializeMetadata(output),
@@ -605,43 +506,9 @@ export const de_CreateDomainCommand = async (output, context) => {
605
506
  Object.assign(contents, doc);
606
507
  return contents;
607
508
  };
608
- const de_CreateDomainCommandError = async (output, context) => {
609
- const parsedOutput = {
610
- ...output,
611
- body: await parseErrorBody(output.body, context),
612
- };
613
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
614
- switch (errorCode) {
615
- case "AccessDeniedException":
616
- case "com.amazonaws.connectcases#AccessDeniedException":
617
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
618
- case "ConflictException":
619
- case "com.amazonaws.connectcases#ConflictException":
620
- throw await de_ConflictExceptionRes(parsedOutput, context);
621
- case "InternalServerException":
622
- case "com.amazonaws.connectcases#InternalServerException":
623
- throw await de_InternalServerExceptionRes(parsedOutput, context);
624
- case "ServiceQuotaExceededException":
625
- case "com.amazonaws.connectcases#ServiceQuotaExceededException":
626
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
627
- case "ThrottlingException":
628
- case "com.amazonaws.connectcases#ThrottlingException":
629
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
630
- case "ValidationException":
631
- case "com.amazonaws.connectcases#ValidationException":
632
- throw await de_ValidationExceptionRes(parsedOutput, context);
633
- default:
634
- const parsedBody = parsedOutput.body;
635
- return throwDefaultError({
636
- output,
637
- parsedBody,
638
- errorCode,
639
- });
640
- }
641
- };
642
509
  export const de_CreateFieldCommand = async (output, context) => {
643
510
  if (output.statusCode !== 200 && output.statusCode >= 300) {
644
- return de_CreateFieldCommandError(output, context);
511
+ return de_CommandError(output, context);
645
512
  }
646
513
  const contents = map({
647
514
  $metadata: deserializeMetadata(output),
@@ -654,46 +521,9 @@ export const de_CreateFieldCommand = async (output, context) => {
654
521
  Object.assign(contents, doc);
655
522
  return contents;
656
523
  };
657
- const de_CreateFieldCommandError = async (output, context) => {
658
- const parsedOutput = {
659
- ...output,
660
- body: await parseErrorBody(output.body, context),
661
- };
662
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
663
- switch (errorCode) {
664
- case "AccessDeniedException":
665
- case "com.amazonaws.connectcases#AccessDeniedException":
666
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
667
- case "ConflictException":
668
- case "com.amazonaws.connectcases#ConflictException":
669
- throw await de_ConflictExceptionRes(parsedOutput, context);
670
- case "InternalServerException":
671
- case "com.amazonaws.connectcases#InternalServerException":
672
- throw await de_InternalServerExceptionRes(parsedOutput, context);
673
- case "ResourceNotFoundException":
674
- case "com.amazonaws.connectcases#ResourceNotFoundException":
675
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
676
- case "ServiceQuotaExceededException":
677
- case "com.amazonaws.connectcases#ServiceQuotaExceededException":
678
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
679
- case "ThrottlingException":
680
- case "com.amazonaws.connectcases#ThrottlingException":
681
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
682
- case "ValidationException":
683
- case "com.amazonaws.connectcases#ValidationException":
684
- throw await de_ValidationExceptionRes(parsedOutput, context);
685
- default:
686
- const parsedBody = parsedOutput.body;
687
- return throwDefaultError({
688
- output,
689
- parsedBody,
690
- errorCode,
691
- });
692
- }
693
- };
694
524
  export const de_CreateLayoutCommand = async (output, context) => {
695
525
  if (output.statusCode !== 200 && output.statusCode >= 300) {
696
- return de_CreateLayoutCommandError(output, context);
526
+ return de_CommandError(output, context);
697
527
  }
698
528
  const contents = map({
699
529
  $metadata: deserializeMetadata(output),
@@ -706,46 +536,9 @@ export const de_CreateLayoutCommand = async (output, context) => {
706
536
  Object.assign(contents, doc);
707
537
  return contents;
708
538
  };
709
- const de_CreateLayoutCommandError = async (output, context) => {
710
- const parsedOutput = {
711
- ...output,
712
- body: await parseErrorBody(output.body, context),
713
- };
714
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
715
- switch (errorCode) {
716
- case "AccessDeniedException":
717
- case "com.amazonaws.connectcases#AccessDeniedException":
718
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
719
- case "ConflictException":
720
- case "com.amazonaws.connectcases#ConflictException":
721
- throw await de_ConflictExceptionRes(parsedOutput, context);
722
- case "InternalServerException":
723
- case "com.amazonaws.connectcases#InternalServerException":
724
- throw await de_InternalServerExceptionRes(parsedOutput, context);
725
- case "ResourceNotFoundException":
726
- case "com.amazonaws.connectcases#ResourceNotFoundException":
727
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
728
- case "ServiceQuotaExceededException":
729
- case "com.amazonaws.connectcases#ServiceQuotaExceededException":
730
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
731
- case "ThrottlingException":
732
- case "com.amazonaws.connectcases#ThrottlingException":
733
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
734
- case "ValidationException":
735
- case "com.amazonaws.connectcases#ValidationException":
736
- throw await de_ValidationExceptionRes(parsedOutput, context);
737
- default:
738
- const parsedBody = parsedOutput.body;
739
- return throwDefaultError({
740
- output,
741
- parsedBody,
742
- errorCode,
743
- });
744
- }
745
- };
746
539
  export const de_CreateRelatedItemCommand = async (output, context) => {
747
540
  if (output.statusCode !== 200 && output.statusCode >= 300) {
748
- return de_CreateRelatedItemCommandError(output, context);
541
+ return de_CommandError(output, context);
749
542
  }
750
543
  const contents = map({
751
544
  $metadata: deserializeMetadata(output),
@@ -758,43 +551,9 @@ export const de_CreateRelatedItemCommand = async (output, context) => {
758
551
  Object.assign(contents, doc);
759
552
  return contents;
760
553
  };
761
- const de_CreateRelatedItemCommandError = async (output, context) => {
762
- const parsedOutput = {
763
- ...output,
764
- body: await parseErrorBody(output.body, context),
765
- };
766
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
767
- switch (errorCode) {
768
- case "AccessDeniedException":
769
- case "com.amazonaws.connectcases#AccessDeniedException":
770
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
771
- case "InternalServerException":
772
- case "com.amazonaws.connectcases#InternalServerException":
773
- throw await de_InternalServerExceptionRes(parsedOutput, context);
774
- case "ResourceNotFoundException":
775
- case "com.amazonaws.connectcases#ResourceNotFoundException":
776
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
777
- case "ServiceQuotaExceededException":
778
- case "com.amazonaws.connectcases#ServiceQuotaExceededException":
779
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
780
- case "ThrottlingException":
781
- case "com.amazonaws.connectcases#ThrottlingException":
782
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
783
- case "ValidationException":
784
- case "com.amazonaws.connectcases#ValidationException":
785
- throw await de_ValidationExceptionRes(parsedOutput, context);
786
- default:
787
- const parsedBody = parsedOutput.body;
788
- return throwDefaultError({
789
- output,
790
- parsedBody,
791
- errorCode,
792
- });
793
- }
794
- };
795
554
  export const de_CreateTemplateCommand = async (output, context) => {
796
555
  if (output.statusCode !== 200 && output.statusCode >= 300) {
797
- return de_CreateTemplateCommandError(output, context);
556
+ return de_CommandError(output, context);
798
557
  }
799
558
  const contents = map({
800
559
  $metadata: deserializeMetadata(output),
@@ -807,46 +566,9 @@ export const de_CreateTemplateCommand = async (output, context) => {
807
566
  Object.assign(contents, doc);
808
567
  return contents;
809
568
  };
810
- const de_CreateTemplateCommandError = async (output, context) => {
811
- const parsedOutput = {
812
- ...output,
813
- body: await parseErrorBody(output.body, context),
814
- };
815
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
816
- switch (errorCode) {
817
- case "AccessDeniedException":
818
- case "com.amazonaws.connectcases#AccessDeniedException":
819
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
820
- case "ConflictException":
821
- case "com.amazonaws.connectcases#ConflictException":
822
- throw await de_ConflictExceptionRes(parsedOutput, context);
823
- case "InternalServerException":
824
- case "com.amazonaws.connectcases#InternalServerException":
825
- throw await de_InternalServerExceptionRes(parsedOutput, context);
826
- case "ResourceNotFoundException":
827
- case "com.amazonaws.connectcases#ResourceNotFoundException":
828
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
829
- case "ServiceQuotaExceededException":
830
- case "com.amazonaws.connectcases#ServiceQuotaExceededException":
831
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
832
- case "ThrottlingException":
833
- case "com.amazonaws.connectcases#ThrottlingException":
834
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
835
- case "ValidationException":
836
- case "com.amazonaws.connectcases#ValidationException":
837
- throw await de_ValidationExceptionRes(parsedOutput, context);
838
- default:
839
- const parsedBody = parsedOutput.body;
840
- return throwDefaultError({
841
- output,
842
- parsedBody,
843
- errorCode,
844
- });
845
- }
846
- };
847
569
  export const de_DeleteDomainCommand = async (output, context) => {
848
570
  if (output.statusCode !== 200 && output.statusCode >= 300) {
849
- return de_DeleteDomainCommandError(output, context);
571
+ return de_CommandError(output, context);
850
572
  }
851
573
  const contents = map({
852
574
  $metadata: deserializeMetadata(output),
@@ -854,43 +576,9 @@ export const de_DeleteDomainCommand = async (output, context) => {
854
576
  await collectBody(output.body, context);
855
577
  return contents;
856
578
  };
857
- const de_DeleteDomainCommandError = async (output, context) => {
858
- const parsedOutput = {
859
- ...output,
860
- body: await parseErrorBody(output.body, context),
861
- };
862
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
863
- switch (errorCode) {
864
- case "AccessDeniedException":
865
- case "com.amazonaws.connectcases#AccessDeniedException":
866
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
867
- case "ConflictException":
868
- case "com.amazonaws.connectcases#ConflictException":
869
- throw await de_ConflictExceptionRes(parsedOutput, context);
870
- case "InternalServerException":
871
- case "com.amazonaws.connectcases#InternalServerException":
872
- throw await de_InternalServerExceptionRes(parsedOutput, context);
873
- case "ResourceNotFoundException":
874
- case "com.amazonaws.connectcases#ResourceNotFoundException":
875
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
876
- case "ThrottlingException":
877
- case "com.amazonaws.connectcases#ThrottlingException":
878
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
879
- case "ValidationException":
880
- case "com.amazonaws.connectcases#ValidationException":
881
- throw await de_ValidationExceptionRes(parsedOutput, context);
882
- default:
883
- const parsedBody = parsedOutput.body;
884
- return throwDefaultError({
885
- output,
886
- parsedBody,
887
- errorCode,
888
- });
889
- }
890
- };
891
579
  export const de_GetCaseCommand = async (output, context) => {
892
580
  if (output.statusCode !== 200 && output.statusCode >= 300) {
893
- return de_GetCaseCommandError(output, context);
581
+ return de_CommandError(output, context);
894
582
  }
895
583
  const contents = map({
896
584
  $metadata: deserializeMetadata(output),
@@ -905,40 +593,9 @@ export const de_GetCaseCommand = async (output, context) => {
905
593
  Object.assign(contents, doc);
906
594
  return contents;
907
595
  };
908
- const de_GetCaseCommandError = async (output, context) => {
909
- const parsedOutput = {
910
- ...output,
911
- body: await parseErrorBody(output.body, context),
912
- };
913
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
914
- switch (errorCode) {
915
- case "AccessDeniedException":
916
- case "com.amazonaws.connectcases#AccessDeniedException":
917
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
918
- case "InternalServerException":
919
- case "com.amazonaws.connectcases#InternalServerException":
920
- throw await de_InternalServerExceptionRes(parsedOutput, context);
921
- case "ResourceNotFoundException":
922
- case "com.amazonaws.connectcases#ResourceNotFoundException":
923
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
924
- case "ThrottlingException":
925
- case "com.amazonaws.connectcases#ThrottlingException":
926
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
927
- case "ValidationException":
928
- case "com.amazonaws.connectcases#ValidationException":
929
- throw await de_ValidationExceptionRes(parsedOutput, context);
930
- default:
931
- const parsedBody = parsedOutput.body;
932
- return throwDefaultError({
933
- output,
934
- parsedBody,
935
- errorCode,
936
- });
937
- }
938
- };
939
596
  export const de_GetCaseAuditEventsCommand = async (output, context) => {
940
597
  if (output.statusCode !== 200 && output.statusCode >= 300) {
941
- return de_GetCaseAuditEventsCommandError(output, context);
598
+ return de_CommandError(output, context);
942
599
  }
943
600
  const contents = map({
944
601
  $metadata: deserializeMetadata(output),
@@ -951,40 +608,9 @@ export const de_GetCaseAuditEventsCommand = async (output, context) => {
951
608
  Object.assign(contents, doc);
952
609
  return contents;
953
610
  };
954
- const de_GetCaseAuditEventsCommandError = async (output, context) => {
955
- const parsedOutput = {
956
- ...output,
957
- body: await parseErrorBody(output.body, context),
958
- };
959
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
960
- switch (errorCode) {
961
- case "AccessDeniedException":
962
- case "com.amazonaws.connectcases#AccessDeniedException":
963
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
964
- case "InternalServerException":
965
- case "com.amazonaws.connectcases#InternalServerException":
966
- throw await de_InternalServerExceptionRes(parsedOutput, context);
967
- case "ResourceNotFoundException":
968
- case "com.amazonaws.connectcases#ResourceNotFoundException":
969
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
970
- case "ThrottlingException":
971
- case "com.amazonaws.connectcases#ThrottlingException":
972
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
973
- case "ValidationException":
974
- case "com.amazonaws.connectcases#ValidationException":
975
- throw await de_ValidationExceptionRes(parsedOutput, context);
976
- default:
977
- const parsedBody = parsedOutput.body;
978
- return throwDefaultError({
979
- output,
980
- parsedBody,
981
- errorCode,
982
- });
983
- }
984
- };
985
611
  export const de_GetCaseEventConfigurationCommand = async (output, context) => {
986
612
  if (output.statusCode !== 200 && output.statusCode >= 300) {
987
- return de_GetCaseEventConfigurationCommandError(output, context);
613
+ return de_CommandError(output, context);
988
614
  }
989
615
  const contents = map({
990
616
  $metadata: deserializeMetadata(output),
@@ -996,40 +622,9 @@ export const de_GetCaseEventConfigurationCommand = async (output, context) => {
996
622
  Object.assign(contents, doc);
997
623
  return contents;
998
624
  };
999
- const de_GetCaseEventConfigurationCommandError = 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 "AccessDeniedException":
1007
- case "com.amazonaws.connectcases#AccessDeniedException":
1008
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1009
- case "InternalServerException":
1010
- case "com.amazonaws.connectcases#InternalServerException":
1011
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1012
- case "ResourceNotFoundException":
1013
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1014
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1015
- case "ThrottlingException":
1016
- case "com.amazonaws.connectcases#ThrottlingException":
1017
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1018
- case "ValidationException":
1019
- case "com.amazonaws.connectcases#ValidationException":
1020
- throw await de_ValidationExceptionRes(parsedOutput, context);
1021
- default:
1022
- const parsedBody = parsedOutput.body;
1023
- return throwDefaultError({
1024
- output,
1025
- parsedBody,
1026
- errorCode,
1027
- });
1028
- }
1029
- };
1030
625
  export const de_GetDomainCommand = async (output, context) => {
1031
626
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1032
- return de_GetDomainCommandError(output, context);
627
+ return de_CommandError(output, context);
1033
628
  }
1034
629
  const contents = map({
1035
630
  $metadata: deserializeMetadata(output),
@@ -1046,40 +641,9 @@ export const de_GetDomainCommand = async (output, context) => {
1046
641
  Object.assign(contents, doc);
1047
642
  return contents;
1048
643
  };
1049
- const de_GetDomainCommandError = async (output, context) => {
1050
- const parsedOutput = {
1051
- ...output,
1052
- body: await parseErrorBody(output.body, context),
1053
- };
1054
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1055
- switch (errorCode) {
1056
- case "AccessDeniedException":
1057
- case "com.amazonaws.connectcases#AccessDeniedException":
1058
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1059
- case "InternalServerException":
1060
- case "com.amazonaws.connectcases#InternalServerException":
1061
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1062
- case "ResourceNotFoundException":
1063
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1064
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1065
- case "ThrottlingException":
1066
- case "com.amazonaws.connectcases#ThrottlingException":
1067
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1068
- case "ValidationException":
1069
- case "com.amazonaws.connectcases#ValidationException":
1070
- throw await de_ValidationExceptionRes(parsedOutput, context);
1071
- default:
1072
- const parsedBody = parsedOutput.body;
1073
- return throwDefaultError({
1074
- output,
1075
- parsedBody,
1076
- errorCode,
1077
- });
1078
- }
1079
- };
1080
644
  export const de_GetLayoutCommand = async (output, context) => {
1081
645
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1082
- return de_GetLayoutCommandError(output, context);
646
+ return de_CommandError(output, context);
1083
647
  }
1084
648
  const contents = map({
1085
649
  $metadata: deserializeMetadata(output),
@@ -1095,40 +659,9 @@ export const de_GetLayoutCommand = async (output, context) => {
1095
659
  Object.assign(contents, doc);
1096
660
  return contents;
1097
661
  };
1098
- const de_GetLayoutCommandError = async (output, context) => {
1099
- const parsedOutput = {
1100
- ...output,
1101
- body: await parseErrorBody(output.body, context),
1102
- };
1103
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1104
- switch (errorCode) {
1105
- case "AccessDeniedException":
1106
- case "com.amazonaws.connectcases#AccessDeniedException":
1107
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1108
- case "InternalServerException":
1109
- case "com.amazonaws.connectcases#InternalServerException":
1110
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1111
- case "ResourceNotFoundException":
1112
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1113
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1114
- case "ThrottlingException":
1115
- case "com.amazonaws.connectcases#ThrottlingException":
1116
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1117
- case "ValidationException":
1118
- case "com.amazonaws.connectcases#ValidationException":
1119
- throw await de_ValidationExceptionRes(parsedOutput, context);
1120
- default:
1121
- const parsedBody = parsedOutput.body;
1122
- return throwDefaultError({
1123
- output,
1124
- parsedBody,
1125
- errorCode,
1126
- });
1127
- }
1128
- };
1129
662
  export const de_GetTemplateCommand = async (output, context) => {
1130
663
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1131
- return de_GetTemplateCommandError(output, context);
664
+ return de_CommandError(output, context);
1132
665
  }
1133
666
  const contents = map({
1134
667
  $metadata: deserializeMetadata(output),
@@ -1147,40 +680,9 @@ export const de_GetTemplateCommand = async (output, context) => {
1147
680
  Object.assign(contents, doc);
1148
681
  return contents;
1149
682
  };
1150
- const de_GetTemplateCommandError = async (output, context) => {
1151
- const parsedOutput = {
1152
- ...output,
1153
- body: await parseErrorBody(output.body, context),
1154
- };
1155
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1156
- switch (errorCode) {
1157
- case "AccessDeniedException":
1158
- case "com.amazonaws.connectcases#AccessDeniedException":
1159
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1160
- case "InternalServerException":
1161
- case "com.amazonaws.connectcases#InternalServerException":
1162
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1163
- case "ResourceNotFoundException":
1164
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1165
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1166
- case "ThrottlingException":
1167
- case "com.amazonaws.connectcases#ThrottlingException":
1168
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1169
- case "ValidationException":
1170
- case "com.amazonaws.connectcases#ValidationException":
1171
- throw await de_ValidationExceptionRes(parsedOutput, context);
1172
- default:
1173
- const parsedBody = parsedOutput.body;
1174
- return throwDefaultError({
1175
- output,
1176
- parsedBody,
1177
- errorCode,
1178
- });
1179
- }
1180
- };
1181
683
  export const de_ListCasesForContactCommand = async (output, context) => {
1182
684
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1183
- return de_ListCasesForContactCommandError(output, context);
685
+ return de_CommandError(output, context);
1184
686
  }
1185
687
  const contents = map({
1186
688
  $metadata: deserializeMetadata(output),
@@ -1193,40 +695,9 @@ export const de_ListCasesForContactCommand = async (output, context) => {
1193
695
  Object.assign(contents, doc);
1194
696
  return contents;
1195
697
  };
1196
- const de_ListCasesForContactCommandError = async (output, context) => {
1197
- const parsedOutput = {
1198
- ...output,
1199
- body: await parseErrorBody(output.body, context),
1200
- };
1201
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1202
- switch (errorCode) {
1203
- case "AccessDeniedException":
1204
- case "com.amazonaws.connectcases#AccessDeniedException":
1205
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1206
- case "InternalServerException":
1207
- case "com.amazonaws.connectcases#InternalServerException":
1208
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1209
- case "ResourceNotFoundException":
1210
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1211
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1212
- case "ThrottlingException":
1213
- case "com.amazonaws.connectcases#ThrottlingException":
1214
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1215
- case "ValidationException":
1216
- case "com.amazonaws.connectcases#ValidationException":
1217
- throw await de_ValidationExceptionRes(parsedOutput, context);
1218
- default:
1219
- const parsedBody = parsedOutput.body;
1220
- return throwDefaultError({
1221
- output,
1222
- parsedBody,
1223
- errorCode,
1224
- });
1225
- }
1226
- };
1227
698
  export const de_ListDomainsCommand = async (output, context) => {
1228
699
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1229
- return de_ListDomainsCommandError(output, context);
700
+ return de_CommandError(output, context);
1230
701
  }
1231
702
  const contents = map({
1232
703
  $metadata: deserializeMetadata(output),
@@ -1239,37 +710,9 @@ export const de_ListDomainsCommand = async (output, context) => {
1239
710
  Object.assign(contents, doc);
1240
711
  return contents;
1241
712
  };
1242
- const de_ListDomainsCommandError = async (output, context) => {
1243
- const parsedOutput = {
1244
- ...output,
1245
- body: await parseErrorBody(output.body, context),
1246
- };
1247
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1248
- switch (errorCode) {
1249
- case "AccessDeniedException":
1250
- case "com.amazonaws.connectcases#AccessDeniedException":
1251
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1252
- case "InternalServerException":
1253
- case "com.amazonaws.connectcases#InternalServerException":
1254
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1255
- case "ThrottlingException":
1256
- case "com.amazonaws.connectcases#ThrottlingException":
1257
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1258
- case "ValidationException":
1259
- case "com.amazonaws.connectcases#ValidationException":
1260
- throw await de_ValidationExceptionRes(parsedOutput, context);
1261
- default:
1262
- const parsedBody = parsedOutput.body;
1263
- return throwDefaultError({
1264
- output,
1265
- parsedBody,
1266
- errorCode,
1267
- });
1268
- }
1269
- };
1270
713
  export const de_ListFieldOptionsCommand = async (output, context) => {
1271
714
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1272
- return de_ListFieldOptionsCommandError(output, context);
715
+ return de_CommandError(output, context);
1273
716
  }
1274
717
  const contents = map({
1275
718
  $metadata: deserializeMetadata(output),
@@ -1282,40 +725,9 @@ export const de_ListFieldOptionsCommand = async (output, context) => {
1282
725
  Object.assign(contents, doc);
1283
726
  return contents;
1284
727
  };
1285
- const de_ListFieldOptionsCommandError = async (output, context) => {
1286
- const parsedOutput = {
1287
- ...output,
1288
- body: await parseErrorBody(output.body, context),
1289
- };
1290
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1291
- switch (errorCode) {
1292
- case "AccessDeniedException":
1293
- case "com.amazonaws.connectcases#AccessDeniedException":
1294
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1295
- case "InternalServerException":
1296
- case "com.amazonaws.connectcases#InternalServerException":
1297
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1298
- case "ResourceNotFoundException":
1299
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1300
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1301
- case "ThrottlingException":
1302
- case "com.amazonaws.connectcases#ThrottlingException":
1303
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1304
- case "ValidationException":
1305
- case "com.amazonaws.connectcases#ValidationException":
1306
- throw await de_ValidationExceptionRes(parsedOutput, context);
1307
- default:
1308
- const parsedBody = parsedOutput.body;
1309
- return throwDefaultError({
1310
- output,
1311
- parsedBody,
1312
- errorCode,
1313
- });
1314
- }
1315
- };
1316
728
  export const de_ListFieldsCommand = async (output, context) => {
1317
729
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1318
- return de_ListFieldsCommandError(output, context);
730
+ return de_CommandError(output, context);
1319
731
  }
1320
732
  const contents = map({
1321
733
  $metadata: deserializeMetadata(output),
@@ -1328,40 +740,9 @@ export const de_ListFieldsCommand = async (output, context) => {
1328
740
  Object.assign(contents, doc);
1329
741
  return contents;
1330
742
  };
1331
- const de_ListFieldsCommandError = async (output, context) => {
1332
- const parsedOutput = {
1333
- ...output,
1334
- body: await parseErrorBody(output.body, context),
1335
- };
1336
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1337
- switch (errorCode) {
1338
- case "AccessDeniedException":
1339
- case "com.amazonaws.connectcases#AccessDeniedException":
1340
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1341
- case "InternalServerException":
1342
- case "com.amazonaws.connectcases#InternalServerException":
1343
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1344
- case "ResourceNotFoundException":
1345
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1346
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1347
- case "ThrottlingException":
1348
- case "com.amazonaws.connectcases#ThrottlingException":
1349
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1350
- case "ValidationException":
1351
- case "com.amazonaws.connectcases#ValidationException":
1352
- throw await de_ValidationExceptionRes(parsedOutput, context);
1353
- default:
1354
- const parsedBody = parsedOutput.body;
1355
- return throwDefaultError({
1356
- output,
1357
- parsedBody,
1358
- errorCode,
1359
- });
1360
- }
1361
- };
1362
743
  export const de_ListLayoutsCommand = async (output, context) => {
1363
744
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1364
- return de_ListLayoutsCommandError(output, context);
745
+ return de_CommandError(output, context);
1365
746
  }
1366
747
  const contents = map({
1367
748
  $metadata: deserializeMetadata(output),
@@ -1374,172 +755,48 @@ export const de_ListLayoutsCommand = async (output, context) => {
1374
755
  Object.assign(contents, doc);
1375
756
  return contents;
1376
757
  };
1377
- const de_ListLayoutsCommandError = async (output, context) => {
1378
- const parsedOutput = {
1379
- ...output,
1380
- body: await parseErrorBody(output.body, context),
1381
- };
1382
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1383
- switch (errorCode) {
1384
- case "AccessDeniedException":
1385
- case "com.amazonaws.connectcases#AccessDeniedException":
1386
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1387
- case "InternalServerException":
1388
- case "com.amazonaws.connectcases#InternalServerException":
1389
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1390
- case "ResourceNotFoundException":
1391
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1392
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1393
- case "ThrottlingException":
1394
- case "com.amazonaws.connectcases#ThrottlingException":
1395
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1396
- case "ValidationException":
1397
- case "com.amazonaws.connectcases#ValidationException":
1398
- throw await de_ValidationExceptionRes(parsedOutput, context);
1399
- default:
1400
- const parsedBody = parsedOutput.body;
1401
- return throwDefaultError({
1402
- output,
1403
- parsedBody,
1404
- errorCode,
1405
- });
1406
- }
1407
- };
1408
758
  export const de_ListTagsForResourceCommand = async (output, context) => {
1409
759
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1410
- return de_ListTagsForResourceCommandError(output, context);
1411
- }
1412
- const contents = map({
1413
- $metadata: deserializeMetadata(output),
1414
- });
1415
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1416
- const doc = take(data, {
1417
- tags: (_) => de_Tags(_, context),
1418
- });
1419
- Object.assign(contents, doc);
1420
- return contents;
1421
- };
1422
- const de_ListTagsForResourceCommandError = async (output, context) => {
1423
- const parsedOutput = {
1424
- ...output,
1425
- body: await parseErrorBody(output.body, context),
1426
- };
1427
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1428
- switch (errorCode) {
1429
- case "AccessDeniedException":
1430
- case "com.amazonaws.connectcases#AccessDeniedException":
1431
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1432
- case "InternalServerException":
1433
- case "com.amazonaws.connectcases#InternalServerException":
1434
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1435
- case "ResourceNotFoundException":
1436
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1437
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1438
- case "ThrottlingException":
1439
- case "com.amazonaws.connectcases#ThrottlingException":
1440
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1441
- case "ValidationException":
1442
- case "com.amazonaws.connectcases#ValidationException":
1443
- throw await de_ValidationExceptionRes(parsedOutput, context);
1444
- default:
1445
- const parsedBody = parsedOutput.body;
1446
- return throwDefaultError({
1447
- output,
1448
- parsedBody,
1449
- errorCode,
1450
- });
1451
- }
1452
- };
1453
- export const de_ListTemplatesCommand = async (output, context) => {
1454
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1455
- return de_ListTemplatesCommandError(output, context);
760
+ return de_CommandError(output, context);
1456
761
  }
1457
762
  const contents = map({
1458
763
  $metadata: deserializeMetadata(output),
1459
764
  });
1460
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1461
- const doc = take(data, {
1462
- nextToken: __expectString,
1463
- templates: _json,
1464
- });
1465
- Object.assign(contents, doc);
1466
- return contents;
1467
- };
1468
- const de_ListTemplatesCommandError = async (output, context) => {
1469
- const parsedOutput = {
1470
- ...output,
1471
- body: await parseErrorBody(output.body, context),
1472
- };
1473
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1474
- switch (errorCode) {
1475
- case "AccessDeniedException":
1476
- case "com.amazonaws.connectcases#AccessDeniedException":
1477
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1478
- case "InternalServerException":
1479
- case "com.amazonaws.connectcases#InternalServerException":
1480
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1481
- case "ResourceNotFoundException":
1482
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1483
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1484
- case "ThrottlingException":
1485
- case "com.amazonaws.connectcases#ThrottlingException":
1486
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1487
- case "ValidationException":
1488
- case "com.amazonaws.connectcases#ValidationException":
1489
- throw await de_ValidationExceptionRes(parsedOutput, context);
1490
- default:
1491
- const parsedBody = parsedOutput.body;
1492
- return throwDefaultError({
1493
- output,
1494
- parsedBody,
1495
- errorCode,
1496
- });
1497
- }
1498
- };
1499
- export const de_PutCaseEventConfigurationCommand = async (output, context) => {
1500
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1501
- return de_PutCaseEventConfigurationCommandError(output, context);
1502
- }
1503
- const contents = map({
1504
- $metadata: deserializeMetadata(output),
1505
- });
1506
- await collectBody(output.body, context);
1507
- return contents;
1508
- };
1509
- const de_PutCaseEventConfigurationCommandError = async (output, context) => {
1510
- const parsedOutput = {
1511
- ...output,
1512
- body: await parseErrorBody(output.body, context),
1513
- };
1514
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1515
- switch (errorCode) {
1516
- case "AccessDeniedException":
1517
- case "com.amazonaws.connectcases#AccessDeniedException":
1518
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1519
- case "InternalServerException":
1520
- case "com.amazonaws.connectcases#InternalServerException":
1521
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1522
- case "ResourceNotFoundException":
1523
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1524
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1525
- case "ThrottlingException":
1526
- case "com.amazonaws.connectcases#ThrottlingException":
1527
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1528
- case "ValidationException":
1529
- case "com.amazonaws.connectcases#ValidationException":
1530
- throw await de_ValidationExceptionRes(parsedOutput, context);
1531
- default:
1532
- const parsedBody = parsedOutput.body;
1533
- return throwDefaultError({
1534
- output,
1535
- parsedBody,
1536
- errorCode,
1537
- });
765
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
766
+ const doc = take(data, {
767
+ tags: (_) => de_Tags(_, context),
768
+ });
769
+ Object.assign(contents, doc);
770
+ return contents;
771
+ };
772
+ export const de_ListTemplatesCommand = async (output, context) => {
773
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
774
+ return de_CommandError(output, context);
775
+ }
776
+ const contents = map({
777
+ $metadata: deserializeMetadata(output),
778
+ });
779
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
780
+ const doc = take(data, {
781
+ nextToken: __expectString,
782
+ templates: _json,
783
+ });
784
+ Object.assign(contents, doc);
785
+ return contents;
786
+ };
787
+ export const de_PutCaseEventConfigurationCommand = async (output, context) => {
788
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
789
+ return de_CommandError(output, context);
1538
790
  }
791
+ const contents = map({
792
+ $metadata: deserializeMetadata(output),
793
+ });
794
+ await collectBody(output.body, context);
795
+ return contents;
1539
796
  };
1540
797
  export const de_SearchCasesCommand = async (output, context) => {
1541
798
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1542
- return de_SearchCasesCommandError(output, context);
799
+ return de_CommandError(output, context);
1543
800
  }
1544
801
  const contents = map({
1545
802
  $metadata: deserializeMetadata(output),
@@ -1552,40 +809,9 @@ export const de_SearchCasesCommand = async (output, context) => {
1552
809
  Object.assign(contents, doc);
1553
810
  return contents;
1554
811
  };
1555
- const de_SearchCasesCommandError = async (output, context) => {
1556
- const parsedOutput = {
1557
- ...output,
1558
- body: await parseErrorBody(output.body, context),
1559
- };
1560
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1561
- switch (errorCode) {
1562
- case "AccessDeniedException":
1563
- case "com.amazonaws.connectcases#AccessDeniedException":
1564
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1565
- case "InternalServerException":
1566
- case "com.amazonaws.connectcases#InternalServerException":
1567
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1568
- case "ResourceNotFoundException":
1569
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1570
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1571
- case "ThrottlingException":
1572
- case "com.amazonaws.connectcases#ThrottlingException":
1573
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1574
- case "ValidationException":
1575
- case "com.amazonaws.connectcases#ValidationException":
1576
- throw await de_ValidationExceptionRes(parsedOutput, context);
1577
- default:
1578
- const parsedBody = parsedOutput.body;
1579
- return throwDefaultError({
1580
- output,
1581
- parsedBody,
1582
- errorCode,
1583
- });
1584
- }
1585
- };
1586
812
  export const de_SearchRelatedItemsCommand = async (output, context) => {
1587
813
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1588
- return de_SearchRelatedItemsCommandError(output, context);
814
+ return de_CommandError(output, context);
1589
815
  }
1590
816
  const contents = map({
1591
817
  $metadata: deserializeMetadata(output),
@@ -1598,40 +824,9 @@ export const de_SearchRelatedItemsCommand = async (output, context) => {
1598
824
  Object.assign(contents, doc);
1599
825
  return contents;
1600
826
  };
1601
- const de_SearchRelatedItemsCommandError = async (output, context) => {
1602
- const parsedOutput = {
1603
- ...output,
1604
- body: await parseErrorBody(output.body, context),
1605
- };
1606
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1607
- switch (errorCode) {
1608
- case "AccessDeniedException":
1609
- case "com.amazonaws.connectcases#AccessDeniedException":
1610
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1611
- case "InternalServerException":
1612
- case "com.amazonaws.connectcases#InternalServerException":
1613
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1614
- case "ResourceNotFoundException":
1615
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1616
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1617
- case "ThrottlingException":
1618
- case "com.amazonaws.connectcases#ThrottlingException":
1619
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1620
- case "ValidationException":
1621
- case "com.amazonaws.connectcases#ValidationException":
1622
- throw await de_ValidationExceptionRes(parsedOutput, context);
1623
- default:
1624
- const parsedBody = parsedOutput.body;
1625
- return throwDefaultError({
1626
- output,
1627
- parsedBody,
1628
- errorCode,
1629
- });
1630
- }
1631
- };
1632
827
  export const de_TagResourceCommand = async (output, context) => {
1633
828
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1634
- return de_TagResourceCommandError(output, context);
829
+ return de_CommandError(output, context);
1635
830
  }
1636
831
  const contents = map({
1637
832
  $metadata: deserializeMetadata(output),
@@ -1639,40 +834,9 @@ export const de_TagResourceCommand = async (output, context) => {
1639
834
  await collectBody(output.body, context);
1640
835
  return contents;
1641
836
  };
1642
- const de_TagResourceCommandError = async (output, context) => {
1643
- const parsedOutput = {
1644
- ...output,
1645
- body: await parseErrorBody(output.body, context),
1646
- };
1647
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1648
- switch (errorCode) {
1649
- case "AccessDeniedException":
1650
- case "com.amazonaws.connectcases#AccessDeniedException":
1651
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1652
- case "InternalServerException":
1653
- case "com.amazonaws.connectcases#InternalServerException":
1654
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1655
- case "ResourceNotFoundException":
1656
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1657
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1658
- case "ThrottlingException":
1659
- case "com.amazonaws.connectcases#ThrottlingException":
1660
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1661
- case "ValidationException":
1662
- case "com.amazonaws.connectcases#ValidationException":
1663
- throw await de_ValidationExceptionRes(parsedOutput, context);
1664
- default:
1665
- const parsedBody = parsedOutput.body;
1666
- return throwDefaultError({
1667
- output,
1668
- parsedBody,
1669
- errorCode,
1670
- });
1671
- }
1672
- };
1673
837
  export const de_UntagResourceCommand = async (output, context) => {
1674
838
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1675
- return de_UntagResourceCommandError(output, context);
839
+ return de_CommandError(output, context);
1676
840
  }
1677
841
  const contents = map({
1678
842
  $metadata: deserializeMetadata(output),
@@ -1680,40 +844,9 @@ export const de_UntagResourceCommand = async (output, context) => {
1680
844
  await collectBody(output.body, context);
1681
845
  return contents;
1682
846
  };
1683
- const de_UntagResourceCommandError = async (output, context) => {
1684
- const parsedOutput = {
1685
- ...output,
1686
- body: await parseErrorBody(output.body, context),
1687
- };
1688
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1689
- switch (errorCode) {
1690
- case "AccessDeniedException":
1691
- case "com.amazonaws.connectcases#AccessDeniedException":
1692
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1693
- case "InternalServerException":
1694
- case "com.amazonaws.connectcases#InternalServerException":
1695
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1696
- case "ResourceNotFoundException":
1697
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1698
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1699
- case "ThrottlingException":
1700
- case "com.amazonaws.connectcases#ThrottlingException":
1701
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1702
- case "ValidationException":
1703
- case "com.amazonaws.connectcases#ValidationException":
1704
- throw await de_ValidationExceptionRes(parsedOutput, context);
1705
- default:
1706
- const parsedBody = parsedOutput.body;
1707
- return throwDefaultError({
1708
- output,
1709
- parsedBody,
1710
- errorCode,
1711
- });
1712
- }
1713
- };
1714
847
  export const de_UpdateCaseCommand = async (output, context) => {
1715
848
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1716
- return de_UpdateCaseCommandError(output, context);
849
+ return de_CommandError(output, context);
1717
850
  }
1718
851
  const contents = map({
1719
852
  $metadata: deserializeMetadata(output),
@@ -1721,40 +854,9 @@ export const de_UpdateCaseCommand = async (output, context) => {
1721
854
  await collectBody(output.body, context);
1722
855
  return contents;
1723
856
  };
1724
- const de_UpdateCaseCommandError = async (output, context) => {
1725
- const parsedOutput = {
1726
- ...output,
1727
- body: await parseErrorBody(output.body, context),
1728
- };
1729
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1730
- switch (errorCode) {
1731
- case "AccessDeniedException":
1732
- case "com.amazonaws.connectcases#AccessDeniedException":
1733
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1734
- case "InternalServerException":
1735
- case "com.amazonaws.connectcases#InternalServerException":
1736
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1737
- case "ResourceNotFoundException":
1738
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1739
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1740
- case "ThrottlingException":
1741
- case "com.amazonaws.connectcases#ThrottlingException":
1742
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1743
- case "ValidationException":
1744
- case "com.amazonaws.connectcases#ValidationException":
1745
- throw await de_ValidationExceptionRes(parsedOutput, context);
1746
- default:
1747
- const parsedBody = parsedOutput.body;
1748
- return throwDefaultError({
1749
- output,
1750
- parsedBody,
1751
- errorCode,
1752
- });
1753
- }
1754
- };
1755
857
  export const de_UpdateFieldCommand = async (output, context) => {
1756
858
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1757
- return de_UpdateFieldCommandError(output, context);
859
+ return de_CommandError(output, context);
1758
860
  }
1759
861
  const contents = map({
1760
862
  $metadata: deserializeMetadata(output),
@@ -1762,43 +864,9 @@ export const de_UpdateFieldCommand = async (output, context) => {
1762
864
  await collectBody(output.body, context);
1763
865
  return contents;
1764
866
  };
1765
- const de_UpdateFieldCommandError = async (output, context) => {
1766
- const parsedOutput = {
1767
- ...output,
1768
- body: await parseErrorBody(output.body, context),
1769
- };
1770
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1771
- switch (errorCode) {
1772
- case "AccessDeniedException":
1773
- case "com.amazonaws.connectcases#AccessDeniedException":
1774
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1775
- case "ConflictException":
1776
- case "com.amazonaws.connectcases#ConflictException":
1777
- throw await de_ConflictExceptionRes(parsedOutput, context);
1778
- case "InternalServerException":
1779
- case "com.amazonaws.connectcases#InternalServerException":
1780
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1781
- case "ResourceNotFoundException":
1782
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1783
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1784
- case "ThrottlingException":
1785
- case "com.amazonaws.connectcases#ThrottlingException":
1786
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1787
- case "ValidationException":
1788
- case "com.amazonaws.connectcases#ValidationException":
1789
- throw await de_ValidationExceptionRes(parsedOutput, context);
1790
- default:
1791
- const parsedBody = parsedOutput.body;
1792
- return throwDefaultError({
1793
- output,
1794
- parsedBody,
1795
- errorCode,
1796
- });
1797
- }
1798
- };
1799
867
  export const de_UpdateLayoutCommand = async (output, context) => {
1800
868
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1801
- return de_UpdateLayoutCommandError(output, context);
869
+ return de_CommandError(output, context);
1802
870
  }
1803
871
  const contents = map({
1804
872
  $metadata: deserializeMetadata(output),
@@ -1806,46 +874,9 @@ export const de_UpdateLayoutCommand = async (output, context) => {
1806
874
  await collectBody(output.body, context);
1807
875
  return contents;
1808
876
  };
1809
- const de_UpdateLayoutCommandError = async (output, context) => {
1810
- const parsedOutput = {
1811
- ...output,
1812
- body: await parseErrorBody(output.body, context),
1813
- };
1814
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1815
- switch (errorCode) {
1816
- case "AccessDeniedException":
1817
- case "com.amazonaws.connectcases#AccessDeniedException":
1818
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1819
- case "ConflictException":
1820
- case "com.amazonaws.connectcases#ConflictException":
1821
- throw await de_ConflictExceptionRes(parsedOutput, context);
1822
- case "InternalServerException":
1823
- case "com.amazonaws.connectcases#InternalServerException":
1824
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1825
- case "ResourceNotFoundException":
1826
- case "com.amazonaws.connectcases#ResourceNotFoundException":
1827
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1828
- case "ServiceQuotaExceededException":
1829
- case "com.amazonaws.connectcases#ServiceQuotaExceededException":
1830
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1831
- case "ThrottlingException":
1832
- case "com.amazonaws.connectcases#ThrottlingException":
1833
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1834
- case "ValidationException":
1835
- case "com.amazonaws.connectcases#ValidationException":
1836
- throw await de_ValidationExceptionRes(parsedOutput, context);
1837
- default:
1838
- const parsedBody = parsedOutput.body;
1839
- return throwDefaultError({
1840
- output,
1841
- parsedBody,
1842
- errorCode,
1843
- });
1844
- }
1845
- };
1846
877
  export const de_UpdateTemplateCommand = async (output, context) => {
1847
878
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1848
- return de_UpdateTemplateCommandError(output, context);
879
+ return de_CommandError(output, context);
1849
880
  }
1850
881
  const contents = map({
1851
882
  $metadata: deserializeMetadata(output),
@@ -1853,7 +884,7 @@ export const de_UpdateTemplateCommand = async (output, context) => {
1853
884
  await collectBody(output.body, context);
1854
885
  return contents;
1855
886
  };
1856
- const de_UpdateTemplateCommandError = async (output, context) => {
887
+ const de_CommandError = async (output, context) => {
1857
888
  const parsedOutput = {
1858
889
  ...output,
1859
890
  body: await parseErrorBody(output.body, context),
@@ -1863,9 +894,6 @@ const de_UpdateTemplateCommandError = async (output, context) => {
1863
894
  case "AccessDeniedException":
1864
895
  case "com.amazonaws.connectcases#AccessDeniedException":
1865
896
  throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1866
- case "ConflictException":
1867
- case "com.amazonaws.connectcases#ConflictException":
1868
- throw await de_ConflictExceptionRes(parsedOutput, context);
1869
897
  case "InternalServerException":
1870
898
  case "com.amazonaws.connectcases#InternalServerException":
1871
899
  throw await de_InternalServerExceptionRes(parsedOutput, context);
@@ -1878,6 +906,12 @@ const de_UpdateTemplateCommandError = async (output, context) => {
1878
906
  case "ValidationException":
1879
907
  case "com.amazonaws.connectcases#ValidationException":
1880
908
  throw await de_ValidationExceptionRes(parsedOutput, context);
909
+ case "ServiceQuotaExceededException":
910
+ case "com.amazonaws.connectcases#ServiceQuotaExceededException":
911
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
912
+ case "ConflictException":
913
+ case "com.amazonaws.connectcases#ConflictException":
914
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1881
915
  default:
1882
916
  const parsedBody = parsedOutput.body;
1883
917
  return throwDefaultError({