@aws-sdk/client-schemas 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.
@@ -406,7 +406,7 @@ export const se_UpdateSchemaCommand = async (input, context) => {
406
406
  };
407
407
  export const de_CreateDiscovererCommand = async (output, context) => {
408
408
  if (output.statusCode !== 201 && output.statusCode >= 300) {
409
- return de_CreateDiscovererCommandError(output, context);
409
+ return de_CommandError(output, context);
410
410
  }
411
411
  const contents = map({
412
412
  $metadata: deserializeMetadata(output),
@@ -424,43 +424,9 @@ export const de_CreateDiscovererCommand = async (output, context) => {
424
424
  Object.assign(contents, doc);
425
425
  return contents;
426
426
  };
427
- const de_CreateDiscovererCommandError = 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 "BadRequestException":
435
- case "com.amazonaws.schemas#BadRequestException":
436
- throw await de_BadRequestExceptionRes(parsedOutput, context);
437
- case "ConflictException":
438
- case "com.amazonaws.schemas#ConflictException":
439
- throw await de_ConflictExceptionRes(parsedOutput, context);
440
- case "ForbiddenException":
441
- case "com.amazonaws.schemas#ForbiddenException":
442
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
443
- case "InternalServerErrorException":
444
- case "com.amazonaws.schemas#InternalServerErrorException":
445
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
446
- case "ServiceUnavailableException":
447
- case "com.amazonaws.schemas#ServiceUnavailableException":
448
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
449
- case "UnauthorizedException":
450
- case "com.amazonaws.schemas#UnauthorizedException":
451
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
452
- default:
453
- const parsedBody = parsedOutput.body;
454
- return throwDefaultError({
455
- output,
456
- parsedBody,
457
- errorCode,
458
- });
459
- }
460
- };
461
427
  export const de_CreateRegistryCommand = async (output, context) => {
462
428
  if (output.statusCode !== 201 && output.statusCode >= 300) {
463
- return de_CreateRegistryCommandError(output, context);
429
+ return de_CommandError(output, context);
464
430
  }
465
431
  const contents = map({
466
432
  $metadata: deserializeMetadata(output),
@@ -475,43 +441,9 @@ export const de_CreateRegistryCommand = async (output, context) => {
475
441
  Object.assign(contents, doc);
476
442
  return contents;
477
443
  };
478
- const de_CreateRegistryCommandError = async (output, context) => {
479
- const parsedOutput = {
480
- ...output,
481
- body: await parseErrorBody(output.body, context),
482
- };
483
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
484
- switch (errorCode) {
485
- case "BadRequestException":
486
- case "com.amazonaws.schemas#BadRequestException":
487
- throw await de_BadRequestExceptionRes(parsedOutput, context);
488
- case "ConflictException":
489
- case "com.amazonaws.schemas#ConflictException":
490
- throw await de_ConflictExceptionRes(parsedOutput, context);
491
- case "ForbiddenException":
492
- case "com.amazonaws.schemas#ForbiddenException":
493
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
494
- case "InternalServerErrorException":
495
- case "com.amazonaws.schemas#InternalServerErrorException":
496
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
497
- case "ServiceUnavailableException":
498
- case "com.amazonaws.schemas#ServiceUnavailableException":
499
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
500
- case "UnauthorizedException":
501
- case "com.amazonaws.schemas#UnauthorizedException":
502
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
503
- default:
504
- const parsedBody = parsedOutput.body;
505
- return throwDefaultError({
506
- output,
507
- parsedBody,
508
- errorCode,
509
- });
510
- }
511
- };
512
444
  export const de_CreateSchemaCommand = async (output, context) => {
513
445
  if (output.statusCode !== 201 && output.statusCode >= 300) {
514
- return de_CreateSchemaCommandError(output, context);
446
+ return de_CommandError(output, context);
515
447
  }
516
448
  const contents = map({
517
449
  $metadata: deserializeMetadata(output),
@@ -530,37 +462,9 @@ export const de_CreateSchemaCommand = async (output, context) => {
530
462
  Object.assign(contents, doc);
531
463
  return contents;
532
464
  };
533
- const de_CreateSchemaCommandError = async (output, context) => {
534
- const parsedOutput = {
535
- ...output,
536
- body: await parseErrorBody(output.body, context),
537
- };
538
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
539
- switch (errorCode) {
540
- case "BadRequestException":
541
- case "com.amazonaws.schemas#BadRequestException":
542
- throw await de_BadRequestExceptionRes(parsedOutput, context);
543
- case "ForbiddenException":
544
- case "com.amazonaws.schemas#ForbiddenException":
545
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
546
- case "InternalServerErrorException":
547
- case "com.amazonaws.schemas#InternalServerErrorException":
548
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
549
- case "ServiceUnavailableException":
550
- case "com.amazonaws.schemas#ServiceUnavailableException":
551
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
552
- default:
553
- const parsedBody = parsedOutput.body;
554
- return throwDefaultError({
555
- output,
556
- parsedBody,
557
- errorCode,
558
- });
559
- }
560
- };
561
465
  export const de_DeleteDiscovererCommand = async (output, context) => {
562
466
  if (output.statusCode !== 204 && output.statusCode >= 300) {
563
- return de_DeleteDiscovererCommandError(output, context);
467
+ return de_CommandError(output, context);
564
468
  }
565
469
  const contents = map({
566
470
  $metadata: deserializeMetadata(output),
@@ -568,43 +472,9 @@ export const de_DeleteDiscovererCommand = async (output, context) => {
568
472
  await collectBody(output.body, context);
569
473
  return contents;
570
474
  };
571
- const de_DeleteDiscovererCommandError = async (output, context) => {
572
- const parsedOutput = {
573
- ...output,
574
- body: await parseErrorBody(output.body, context),
575
- };
576
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
577
- switch (errorCode) {
578
- case "BadRequestException":
579
- case "com.amazonaws.schemas#BadRequestException":
580
- throw await de_BadRequestExceptionRes(parsedOutput, context);
581
- case "ForbiddenException":
582
- case "com.amazonaws.schemas#ForbiddenException":
583
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
584
- case "InternalServerErrorException":
585
- case "com.amazonaws.schemas#InternalServerErrorException":
586
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
587
- case "NotFoundException":
588
- case "com.amazonaws.schemas#NotFoundException":
589
- throw await de_NotFoundExceptionRes(parsedOutput, context);
590
- case "ServiceUnavailableException":
591
- case "com.amazonaws.schemas#ServiceUnavailableException":
592
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
593
- case "UnauthorizedException":
594
- case "com.amazonaws.schemas#UnauthorizedException":
595
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
596
- default:
597
- const parsedBody = parsedOutput.body;
598
- return throwDefaultError({
599
- output,
600
- parsedBody,
601
- errorCode,
602
- });
603
- }
604
- };
605
475
  export const de_DeleteRegistryCommand = async (output, context) => {
606
476
  if (output.statusCode !== 204 && output.statusCode >= 300) {
607
- return de_DeleteRegistryCommandError(output, context);
477
+ return de_CommandError(output, context);
608
478
  }
609
479
  const contents = map({
610
480
  $metadata: deserializeMetadata(output),
@@ -612,43 +482,9 @@ export const de_DeleteRegistryCommand = async (output, context) => {
612
482
  await collectBody(output.body, context);
613
483
  return contents;
614
484
  };
615
- const de_DeleteRegistryCommandError = async (output, context) => {
616
- const parsedOutput = {
617
- ...output,
618
- body: await parseErrorBody(output.body, context),
619
- };
620
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
621
- switch (errorCode) {
622
- case "BadRequestException":
623
- case "com.amazonaws.schemas#BadRequestException":
624
- throw await de_BadRequestExceptionRes(parsedOutput, context);
625
- case "ForbiddenException":
626
- case "com.amazonaws.schemas#ForbiddenException":
627
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
628
- case "InternalServerErrorException":
629
- case "com.amazonaws.schemas#InternalServerErrorException":
630
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
631
- case "NotFoundException":
632
- case "com.amazonaws.schemas#NotFoundException":
633
- throw await de_NotFoundExceptionRes(parsedOutput, context);
634
- case "ServiceUnavailableException":
635
- case "com.amazonaws.schemas#ServiceUnavailableException":
636
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
637
- case "UnauthorizedException":
638
- case "com.amazonaws.schemas#UnauthorizedException":
639
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
640
- default:
641
- const parsedBody = parsedOutput.body;
642
- return throwDefaultError({
643
- output,
644
- parsedBody,
645
- errorCode,
646
- });
647
- }
648
- };
649
485
  export const de_DeleteResourcePolicyCommand = async (output, context) => {
650
486
  if (output.statusCode !== 204 && output.statusCode >= 300) {
651
- return de_DeleteResourcePolicyCommandError(output, context);
487
+ return de_CommandError(output, context);
652
488
  }
653
489
  const contents = map({
654
490
  $metadata: deserializeMetadata(output),
@@ -656,43 +492,9 @@ export const de_DeleteResourcePolicyCommand = async (output, context) => {
656
492
  await collectBody(output.body, context);
657
493
  return contents;
658
494
  };
659
- const de_DeleteResourcePolicyCommandError = async (output, context) => {
660
- const parsedOutput = {
661
- ...output,
662
- body: await parseErrorBody(output.body, context),
663
- };
664
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
665
- switch (errorCode) {
666
- case "BadRequestException":
667
- case "com.amazonaws.schemas#BadRequestException":
668
- throw await de_BadRequestExceptionRes(parsedOutput, context);
669
- case "ForbiddenException":
670
- case "com.amazonaws.schemas#ForbiddenException":
671
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
672
- case "InternalServerErrorException":
673
- case "com.amazonaws.schemas#InternalServerErrorException":
674
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
675
- case "NotFoundException":
676
- case "com.amazonaws.schemas#NotFoundException":
677
- throw await de_NotFoundExceptionRes(parsedOutput, context);
678
- case "ServiceUnavailableException":
679
- case "com.amazonaws.schemas#ServiceUnavailableException":
680
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
681
- case "UnauthorizedException":
682
- case "com.amazonaws.schemas#UnauthorizedException":
683
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
684
- default:
685
- const parsedBody = parsedOutput.body;
686
- return throwDefaultError({
687
- output,
688
- parsedBody,
689
- errorCode,
690
- });
691
- }
692
- };
693
495
  export const de_DeleteSchemaCommand = async (output, context) => {
694
496
  if (output.statusCode !== 204 && output.statusCode >= 300) {
695
- return de_DeleteSchemaCommandError(output, context);
497
+ return de_CommandError(output, context);
696
498
  }
697
499
  const contents = map({
698
500
  $metadata: deserializeMetadata(output),
@@ -700,43 +502,9 @@ export const de_DeleteSchemaCommand = async (output, context) => {
700
502
  await collectBody(output.body, context);
701
503
  return contents;
702
504
  };
703
- const de_DeleteSchemaCommandError = async (output, context) => {
704
- const parsedOutput = {
705
- ...output,
706
- body: await parseErrorBody(output.body, context),
707
- };
708
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
709
- switch (errorCode) {
710
- case "BadRequestException":
711
- case "com.amazonaws.schemas#BadRequestException":
712
- throw await de_BadRequestExceptionRes(parsedOutput, context);
713
- case "ForbiddenException":
714
- case "com.amazonaws.schemas#ForbiddenException":
715
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
716
- case "InternalServerErrorException":
717
- case "com.amazonaws.schemas#InternalServerErrorException":
718
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
719
- case "NotFoundException":
720
- case "com.amazonaws.schemas#NotFoundException":
721
- throw await de_NotFoundExceptionRes(parsedOutput, context);
722
- case "ServiceUnavailableException":
723
- case "com.amazonaws.schemas#ServiceUnavailableException":
724
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
725
- case "UnauthorizedException":
726
- case "com.amazonaws.schemas#UnauthorizedException":
727
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
728
- default:
729
- const parsedBody = parsedOutput.body;
730
- return throwDefaultError({
731
- output,
732
- parsedBody,
733
- errorCode,
734
- });
735
- }
736
- };
737
505
  export const de_DeleteSchemaVersionCommand = async (output, context) => {
738
506
  if (output.statusCode !== 204 && output.statusCode >= 300) {
739
- return de_DeleteSchemaVersionCommandError(output, context);
507
+ return de_CommandError(output, context);
740
508
  }
741
509
  const contents = map({
742
510
  $metadata: deserializeMetadata(output),
@@ -744,43 +512,9 @@ export const de_DeleteSchemaVersionCommand = async (output, context) => {
744
512
  await collectBody(output.body, context);
745
513
  return contents;
746
514
  };
747
- const de_DeleteSchemaVersionCommandError = async (output, context) => {
748
- const parsedOutput = {
749
- ...output,
750
- body: await parseErrorBody(output.body, context),
751
- };
752
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
753
- switch (errorCode) {
754
- case "BadRequestException":
755
- case "com.amazonaws.schemas#BadRequestException":
756
- throw await de_BadRequestExceptionRes(parsedOutput, context);
757
- case "ForbiddenException":
758
- case "com.amazonaws.schemas#ForbiddenException":
759
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
760
- case "InternalServerErrorException":
761
- case "com.amazonaws.schemas#InternalServerErrorException":
762
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
763
- case "NotFoundException":
764
- case "com.amazonaws.schemas#NotFoundException":
765
- throw await de_NotFoundExceptionRes(parsedOutput, context);
766
- case "ServiceUnavailableException":
767
- case "com.amazonaws.schemas#ServiceUnavailableException":
768
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
769
- case "UnauthorizedException":
770
- case "com.amazonaws.schemas#UnauthorizedException":
771
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
772
- default:
773
- const parsedBody = parsedOutput.body;
774
- return throwDefaultError({
775
- output,
776
- parsedBody,
777
- errorCode,
778
- });
779
- }
780
- };
781
515
  export const de_DescribeCodeBindingCommand = async (output, context) => {
782
516
  if (output.statusCode !== 200 && output.statusCode >= 300) {
783
- return de_DescribeCodeBindingCommandError(output, context);
517
+ return de_CommandError(output, context);
784
518
  }
785
519
  const contents = map({
786
520
  $metadata: deserializeMetadata(output),
@@ -795,43 +529,9 @@ export const de_DescribeCodeBindingCommand = async (output, context) => {
795
529
  Object.assign(contents, doc);
796
530
  return contents;
797
531
  };
798
- const de_DescribeCodeBindingCommandError = async (output, context) => {
799
- const parsedOutput = {
800
- ...output,
801
- body: await parseErrorBody(output.body, context),
802
- };
803
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
804
- switch (errorCode) {
805
- case "BadRequestException":
806
- case "com.amazonaws.schemas#BadRequestException":
807
- throw await de_BadRequestExceptionRes(parsedOutput, context);
808
- case "ForbiddenException":
809
- case "com.amazonaws.schemas#ForbiddenException":
810
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
811
- case "InternalServerErrorException":
812
- case "com.amazonaws.schemas#InternalServerErrorException":
813
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
814
- case "NotFoundException":
815
- case "com.amazonaws.schemas#NotFoundException":
816
- throw await de_NotFoundExceptionRes(parsedOutput, context);
817
- case "TooManyRequestsException":
818
- case "com.amazonaws.schemas#TooManyRequestsException":
819
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
820
- case "UnauthorizedException":
821
- case "com.amazonaws.schemas#UnauthorizedException":
822
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
823
- default:
824
- const parsedBody = parsedOutput.body;
825
- return throwDefaultError({
826
- output,
827
- parsedBody,
828
- errorCode,
829
- });
830
- }
831
- };
832
532
  export const de_DescribeDiscovererCommand = async (output, context) => {
833
533
  if (output.statusCode !== 200 && output.statusCode >= 300) {
834
- return de_DescribeDiscovererCommandError(output, context);
534
+ return de_CommandError(output, context);
835
535
  }
836
536
  const contents = map({
837
537
  $metadata: deserializeMetadata(output),
@@ -849,43 +549,9 @@ export const de_DescribeDiscovererCommand = async (output, context) => {
849
549
  Object.assign(contents, doc);
850
550
  return contents;
851
551
  };
852
- const de_DescribeDiscovererCommandError = async (output, context) => {
853
- const parsedOutput = {
854
- ...output,
855
- body: await parseErrorBody(output.body, context),
856
- };
857
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
858
- switch (errorCode) {
859
- case "BadRequestException":
860
- case "com.amazonaws.schemas#BadRequestException":
861
- throw await de_BadRequestExceptionRes(parsedOutput, context);
862
- case "ForbiddenException":
863
- case "com.amazonaws.schemas#ForbiddenException":
864
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
865
- case "InternalServerErrorException":
866
- case "com.amazonaws.schemas#InternalServerErrorException":
867
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
868
- case "NotFoundException":
869
- case "com.amazonaws.schemas#NotFoundException":
870
- throw await de_NotFoundExceptionRes(parsedOutput, context);
871
- case "ServiceUnavailableException":
872
- case "com.amazonaws.schemas#ServiceUnavailableException":
873
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
874
- case "UnauthorizedException":
875
- case "com.amazonaws.schemas#UnauthorizedException":
876
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
877
- default:
878
- const parsedBody = parsedOutput.body;
879
- return throwDefaultError({
880
- output,
881
- parsedBody,
882
- errorCode,
883
- });
884
- }
885
- };
886
552
  export const de_DescribeRegistryCommand = async (output, context) => {
887
553
  if (output.statusCode !== 200 && output.statusCode >= 300) {
888
- return de_DescribeRegistryCommandError(output, context);
554
+ return de_CommandError(output, context);
889
555
  }
890
556
  const contents = map({
891
557
  $metadata: deserializeMetadata(output),
@@ -900,43 +566,9 @@ export const de_DescribeRegistryCommand = async (output, context) => {
900
566
  Object.assign(contents, doc);
901
567
  return contents;
902
568
  };
903
- const de_DescribeRegistryCommandError = async (output, context) => {
904
- const parsedOutput = {
905
- ...output,
906
- body: await parseErrorBody(output.body, context),
907
- };
908
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
909
- switch (errorCode) {
910
- case "BadRequestException":
911
- case "com.amazonaws.schemas#BadRequestException":
912
- throw await de_BadRequestExceptionRes(parsedOutput, context);
913
- case "ForbiddenException":
914
- case "com.amazonaws.schemas#ForbiddenException":
915
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
916
- case "InternalServerErrorException":
917
- case "com.amazonaws.schemas#InternalServerErrorException":
918
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
919
- case "NotFoundException":
920
- case "com.amazonaws.schemas#NotFoundException":
921
- throw await de_NotFoundExceptionRes(parsedOutput, context);
922
- case "ServiceUnavailableException":
923
- case "com.amazonaws.schemas#ServiceUnavailableException":
924
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
925
- case "UnauthorizedException":
926
- case "com.amazonaws.schemas#UnauthorizedException":
927
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
928
- default:
929
- const parsedBody = parsedOutput.body;
930
- return throwDefaultError({
931
- output,
932
- parsedBody,
933
- errorCode,
934
- });
935
- }
936
- };
937
569
  export const de_DescribeSchemaCommand = async (output, context) => {
938
570
  if (output.statusCode !== 200 && output.statusCode >= 300) {
939
- return de_DescribeSchemaCommandError(output, context);
571
+ return de_CommandError(output, context);
940
572
  }
941
573
  const contents = map({
942
574
  $metadata: deserializeMetadata(output),
@@ -956,43 +588,9 @@ export const de_DescribeSchemaCommand = async (output, context) => {
956
588
  Object.assign(contents, doc);
957
589
  return contents;
958
590
  };
959
- const de_DescribeSchemaCommandError = async (output, context) => {
960
- const parsedOutput = {
961
- ...output,
962
- body: await parseErrorBody(output.body, context),
963
- };
964
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
965
- switch (errorCode) {
966
- case "BadRequestException":
967
- case "com.amazonaws.schemas#BadRequestException":
968
- throw await de_BadRequestExceptionRes(parsedOutput, context);
969
- case "ForbiddenException":
970
- case "com.amazonaws.schemas#ForbiddenException":
971
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
972
- case "InternalServerErrorException":
973
- case "com.amazonaws.schemas#InternalServerErrorException":
974
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
975
- case "NotFoundException":
976
- case "com.amazonaws.schemas#NotFoundException":
977
- throw await de_NotFoundExceptionRes(parsedOutput, context);
978
- case "ServiceUnavailableException":
979
- case "com.amazonaws.schemas#ServiceUnavailableException":
980
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
981
- case "UnauthorizedException":
982
- case "com.amazonaws.schemas#UnauthorizedException":
983
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
984
- default:
985
- const parsedBody = parsedOutput.body;
986
- return throwDefaultError({
987
- output,
988
- parsedBody,
989
- errorCode,
990
- });
991
- }
992
- };
993
591
  export const de_ExportSchemaCommand = async (output, context) => {
994
592
  if (output.statusCode !== 200 && output.statusCode >= 300) {
995
- return de_ExportSchemaCommandError(output, context);
593
+ return de_CommandError(output, context);
996
594
  }
997
595
  const contents = map({
998
596
  $metadata: deserializeMetadata(output),
@@ -1008,46 +606,9 @@ export const de_ExportSchemaCommand = async (output, context) => {
1008
606
  Object.assign(contents, doc);
1009
607
  return contents;
1010
608
  };
1011
- const de_ExportSchemaCommandError = async (output, context) => {
1012
- const parsedOutput = {
1013
- ...output,
1014
- body: await parseErrorBody(output.body, context),
1015
- };
1016
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1017
- switch (errorCode) {
1018
- case "BadRequestException":
1019
- case "com.amazonaws.schemas#BadRequestException":
1020
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1021
- case "ForbiddenException":
1022
- case "com.amazonaws.schemas#ForbiddenException":
1023
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1024
- case "InternalServerErrorException":
1025
- case "com.amazonaws.schemas#InternalServerErrorException":
1026
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1027
- case "NotFoundException":
1028
- case "com.amazonaws.schemas#NotFoundException":
1029
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1030
- case "ServiceUnavailableException":
1031
- case "com.amazonaws.schemas#ServiceUnavailableException":
1032
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1033
- case "TooManyRequestsException":
1034
- case "com.amazonaws.schemas#TooManyRequestsException":
1035
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1036
- case "UnauthorizedException":
1037
- case "com.amazonaws.schemas#UnauthorizedException":
1038
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1039
- default:
1040
- const parsedBody = parsedOutput.body;
1041
- return throwDefaultError({
1042
- output,
1043
- parsedBody,
1044
- errorCode,
1045
- });
1046
- }
1047
- };
1048
609
  export const de_GetCodeBindingSourceCommand = async (output, context) => {
1049
610
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1050
- return de_GetCodeBindingSourceCommandError(output, context);
611
+ return de_CommandError(output, context);
1051
612
  }
1052
613
  const contents = map({
1053
614
  $metadata: deserializeMetadata(output),
@@ -1056,43 +617,9 @@ export const de_GetCodeBindingSourceCommand = async (output, context) => {
1056
617
  contents.Body = data;
1057
618
  return contents;
1058
619
  };
1059
- const de_GetCodeBindingSourceCommandError = async (output, context) => {
1060
- const parsedOutput = {
1061
- ...output,
1062
- body: await parseErrorBody(output.body, context),
1063
- };
1064
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1065
- switch (errorCode) {
1066
- case "BadRequestException":
1067
- case "com.amazonaws.schemas#BadRequestException":
1068
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1069
- case "ForbiddenException":
1070
- case "com.amazonaws.schemas#ForbiddenException":
1071
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1072
- case "InternalServerErrorException":
1073
- case "com.amazonaws.schemas#InternalServerErrorException":
1074
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1075
- case "NotFoundException":
1076
- case "com.amazonaws.schemas#NotFoundException":
1077
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1078
- case "TooManyRequestsException":
1079
- case "com.amazonaws.schemas#TooManyRequestsException":
1080
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1081
- case "UnauthorizedException":
1082
- case "com.amazonaws.schemas#UnauthorizedException":
1083
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1084
- default:
1085
- const parsedBody = parsedOutput.body;
1086
- return throwDefaultError({
1087
- output,
1088
- parsedBody,
1089
- errorCode,
1090
- });
1091
- }
1092
- };
1093
620
  export const de_GetDiscoveredSchemaCommand = async (output, context) => {
1094
621
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1095
- return de_GetDiscoveredSchemaCommandError(output, context);
622
+ return de_CommandError(output, context);
1096
623
  }
1097
624
  const contents = map({
1098
625
  $metadata: deserializeMetadata(output),
@@ -1104,40 +631,9 @@ export const de_GetDiscoveredSchemaCommand = async (output, context) => {
1104
631
  Object.assign(contents, doc);
1105
632
  return contents;
1106
633
  };
1107
- const de_GetDiscoveredSchemaCommandError = async (output, context) => {
1108
- const parsedOutput = {
1109
- ...output,
1110
- body: await parseErrorBody(output.body, context),
1111
- };
1112
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1113
- switch (errorCode) {
1114
- case "BadRequestException":
1115
- case "com.amazonaws.schemas#BadRequestException":
1116
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1117
- case "ForbiddenException":
1118
- case "com.amazonaws.schemas#ForbiddenException":
1119
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1120
- case "InternalServerErrorException":
1121
- case "com.amazonaws.schemas#InternalServerErrorException":
1122
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1123
- case "ServiceUnavailableException":
1124
- case "com.amazonaws.schemas#ServiceUnavailableException":
1125
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1126
- case "UnauthorizedException":
1127
- case "com.amazonaws.schemas#UnauthorizedException":
1128
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1129
- default:
1130
- const parsedBody = parsedOutput.body;
1131
- return throwDefaultError({
1132
- output,
1133
- parsedBody,
1134
- errorCode,
1135
- });
1136
- }
1137
- };
1138
634
  export const de_GetResourcePolicyCommand = async (output, context) => {
1139
635
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1140
- return de_GetResourcePolicyCommandError(output, context);
636
+ return de_CommandError(output, context);
1141
637
  }
1142
638
  const contents = map({
1143
639
  $metadata: deserializeMetadata(output),
@@ -1150,43 +646,9 @@ export const de_GetResourcePolicyCommand = async (output, context) => {
1150
646
  Object.assign(contents, doc);
1151
647
  return contents;
1152
648
  };
1153
- const de_GetResourcePolicyCommandError = async (output, context) => {
1154
- const parsedOutput = {
1155
- ...output,
1156
- body: await parseErrorBody(output.body, context),
1157
- };
1158
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1159
- switch (errorCode) {
1160
- case "BadRequestException":
1161
- case "com.amazonaws.schemas#BadRequestException":
1162
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1163
- case "ForbiddenException":
1164
- case "com.amazonaws.schemas#ForbiddenException":
1165
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1166
- case "InternalServerErrorException":
1167
- case "com.amazonaws.schemas#InternalServerErrorException":
1168
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1169
- case "NotFoundException":
1170
- case "com.amazonaws.schemas#NotFoundException":
1171
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1172
- case "ServiceUnavailableException":
1173
- case "com.amazonaws.schemas#ServiceUnavailableException":
1174
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1175
- case "UnauthorizedException":
1176
- case "com.amazonaws.schemas#UnauthorizedException":
1177
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1178
- default:
1179
- const parsedBody = parsedOutput.body;
1180
- return throwDefaultError({
1181
- output,
1182
- parsedBody,
1183
- errorCode,
1184
- });
1185
- }
1186
- };
1187
649
  export const de_ListDiscoverersCommand = async (output, context) => {
1188
650
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1189
- return de_ListDiscoverersCommandError(output, context);
651
+ return de_CommandError(output, context);
1190
652
  }
1191
653
  const contents = map({
1192
654
  $metadata: deserializeMetadata(output),
@@ -1199,40 +661,9 @@ export const de_ListDiscoverersCommand = async (output, context) => {
1199
661
  Object.assign(contents, doc);
1200
662
  return contents;
1201
663
  };
1202
- const de_ListDiscoverersCommandError = async (output, context) => {
1203
- const parsedOutput = {
1204
- ...output,
1205
- body: await parseErrorBody(output.body, context),
1206
- };
1207
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1208
- switch (errorCode) {
1209
- case "BadRequestException":
1210
- case "com.amazonaws.schemas#BadRequestException":
1211
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1212
- case "ForbiddenException":
1213
- case "com.amazonaws.schemas#ForbiddenException":
1214
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1215
- case "InternalServerErrorException":
1216
- case "com.amazonaws.schemas#InternalServerErrorException":
1217
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1218
- case "ServiceUnavailableException":
1219
- case "com.amazonaws.schemas#ServiceUnavailableException":
1220
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1221
- case "UnauthorizedException":
1222
- case "com.amazonaws.schemas#UnauthorizedException":
1223
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1224
- default:
1225
- const parsedBody = parsedOutput.body;
1226
- return throwDefaultError({
1227
- output,
1228
- parsedBody,
1229
- errorCode,
1230
- });
1231
- }
1232
- };
1233
664
  export const de_ListRegistriesCommand = async (output, context) => {
1234
665
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1235
- return de_ListRegistriesCommandError(output, context);
666
+ return de_CommandError(output, context);
1236
667
  }
1237
668
  const contents = map({
1238
669
  $metadata: deserializeMetadata(output),
@@ -1245,40 +676,9 @@ export const de_ListRegistriesCommand = async (output, context) => {
1245
676
  Object.assign(contents, doc);
1246
677
  return contents;
1247
678
  };
1248
- const de_ListRegistriesCommandError = async (output, context) => {
1249
- const parsedOutput = {
1250
- ...output,
1251
- body: await parseErrorBody(output.body, context),
1252
- };
1253
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1254
- switch (errorCode) {
1255
- case "BadRequestException":
1256
- case "com.amazonaws.schemas#BadRequestException":
1257
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1258
- case "ForbiddenException":
1259
- case "com.amazonaws.schemas#ForbiddenException":
1260
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1261
- case "InternalServerErrorException":
1262
- case "com.amazonaws.schemas#InternalServerErrorException":
1263
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1264
- case "ServiceUnavailableException":
1265
- case "com.amazonaws.schemas#ServiceUnavailableException":
1266
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1267
- case "UnauthorizedException":
1268
- case "com.amazonaws.schemas#UnauthorizedException":
1269
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1270
- default:
1271
- const parsedBody = parsedOutput.body;
1272
- return throwDefaultError({
1273
- output,
1274
- parsedBody,
1275
- errorCode,
1276
- });
1277
- }
1278
- };
1279
679
  export const de_ListSchemasCommand = async (output, context) => {
1280
680
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1281
- return de_ListSchemasCommandError(output, context);
681
+ return de_CommandError(output, context);
1282
682
  }
1283
683
  const contents = map({
1284
684
  $metadata: deserializeMetadata(output),
@@ -1291,40 +691,9 @@ export const de_ListSchemasCommand = async (output, context) => {
1291
691
  Object.assign(contents, doc);
1292
692
  return contents;
1293
693
  };
1294
- const de_ListSchemasCommandError = 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 "BadRequestException":
1302
- case "com.amazonaws.schemas#BadRequestException":
1303
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1304
- case "ForbiddenException":
1305
- case "com.amazonaws.schemas#ForbiddenException":
1306
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1307
- case "InternalServerErrorException":
1308
- case "com.amazonaws.schemas#InternalServerErrorException":
1309
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1310
- case "ServiceUnavailableException":
1311
- case "com.amazonaws.schemas#ServiceUnavailableException":
1312
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1313
- case "UnauthorizedException":
1314
- case "com.amazonaws.schemas#UnauthorizedException":
1315
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1316
- default:
1317
- const parsedBody = parsedOutput.body;
1318
- return throwDefaultError({
1319
- output,
1320
- parsedBody,
1321
- errorCode,
1322
- });
1323
- }
1324
- };
1325
694
  export const de_ListSchemaVersionsCommand = async (output, context) => {
1326
695
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1327
- return de_ListSchemaVersionsCommandError(output, context);
696
+ return de_CommandError(output, context);
1328
697
  }
1329
698
  const contents = map({
1330
699
  $metadata: deserializeMetadata(output),
@@ -1337,43 +706,9 @@ export const de_ListSchemaVersionsCommand = async (output, context) => {
1337
706
  Object.assign(contents, doc);
1338
707
  return contents;
1339
708
  };
1340
- const de_ListSchemaVersionsCommandError = async (output, context) => {
1341
- const parsedOutput = {
1342
- ...output,
1343
- body: await parseErrorBody(output.body, context),
1344
- };
1345
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1346
- switch (errorCode) {
1347
- case "BadRequestException":
1348
- case "com.amazonaws.schemas#BadRequestException":
1349
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1350
- case "ForbiddenException":
1351
- case "com.amazonaws.schemas#ForbiddenException":
1352
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1353
- case "InternalServerErrorException":
1354
- case "com.amazonaws.schemas#InternalServerErrorException":
1355
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1356
- case "NotFoundException":
1357
- case "com.amazonaws.schemas#NotFoundException":
1358
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1359
- case "ServiceUnavailableException":
1360
- case "com.amazonaws.schemas#ServiceUnavailableException":
1361
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1362
- case "UnauthorizedException":
1363
- case "com.amazonaws.schemas#UnauthorizedException":
1364
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1365
- default:
1366
- const parsedBody = parsedOutput.body;
1367
- return throwDefaultError({
1368
- output,
1369
- parsedBody,
1370
- errorCode,
1371
- });
1372
- }
1373
- };
1374
709
  export const de_ListTagsForResourceCommand = async (output, context) => {
1375
710
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1376
- return de_ListTagsForResourceCommandError(output, context);
711
+ return de_CommandError(output, context);
1377
712
  }
1378
713
  const contents = map({
1379
714
  $metadata: deserializeMetadata(output),
@@ -1385,37 +720,9 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
1385
720
  Object.assign(contents, doc);
1386
721
  return contents;
1387
722
  };
1388
- const de_ListTagsForResourceCommandError = async (output, context) => {
1389
- const parsedOutput = {
1390
- ...output,
1391
- body: await parseErrorBody(output.body, context),
1392
- };
1393
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1394
- switch (errorCode) {
1395
- case "BadRequestException":
1396
- case "com.amazonaws.schemas#BadRequestException":
1397
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1398
- case "ForbiddenException":
1399
- case "com.amazonaws.schemas#ForbiddenException":
1400
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1401
- case "InternalServerErrorException":
1402
- case "com.amazonaws.schemas#InternalServerErrorException":
1403
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1404
- case "NotFoundException":
1405
- case "com.amazonaws.schemas#NotFoundException":
1406
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1407
- default:
1408
- const parsedBody = parsedOutput.body;
1409
- return throwDefaultError({
1410
- output,
1411
- parsedBody,
1412
- errorCode,
1413
- });
1414
- }
1415
- };
1416
723
  export const de_PutCodeBindingCommand = async (output, context) => {
1417
724
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1418
- return de_PutCodeBindingCommandError(output, context);
725
+ return de_CommandError(output, context);
1419
726
  }
1420
727
  const contents = map({
1421
728
  $metadata: deserializeMetadata(output),
@@ -1423,105 +730,31 @@ export const de_PutCodeBindingCommand = async (output, context) => {
1423
730
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1424
731
  const doc = take(data, {
1425
732
  CreationDate: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
1426
- LastModified: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
1427
- SchemaVersion: __expectString,
1428
- Status: __expectString,
1429
- });
1430
- Object.assign(contents, doc);
1431
- return contents;
1432
- };
1433
- const de_PutCodeBindingCommandError = async (output, context) => {
1434
- const parsedOutput = {
1435
- ...output,
1436
- body: await parseErrorBody(output.body, context),
1437
- };
1438
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1439
- switch (errorCode) {
1440
- case "BadRequestException":
1441
- case "com.amazonaws.schemas#BadRequestException":
1442
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1443
- case "ForbiddenException":
1444
- case "com.amazonaws.schemas#ForbiddenException":
1445
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1446
- case "GoneException":
1447
- case "com.amazonaws.schemas#GoneException":
1448
- throw await de_GoneExceptionRes(parsedOutput, context);
1449
- case "InternalServerErrorException":
1450
- case "com.amazonaws.schemas#InternalServerErrorException":
1451
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1452
- case "NotFoundException":
1453
- case "com.amazonaws.schemas#NotFoundException":
1454
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1455
- case "TooManyRequestsException":
1456
- case "com.amazonaws.schemas#TooManyRequestsException":
1457
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1458
- case "UnauthorizedException":
1459
- case "com.amazonaws.schemas#UnauthorizedException":
1460
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1461
- default:
1462
- const parsedBody = parsedOutput.body;
1463
- return throwDefaultError({
1464
- output,
1465
- parsedBody,
1466
- errorCode,
1467
- });
1468
- }
1469
- };
1470
- export const de_PutResourcePolicyCommand = async (output, context) => {
1471
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1472
- return de_PutResourcePolicyCommandError(output, context);
1473
- }
1474
- const contents = map({
1475
- $metadata: deserializeMetadata(output),
1476
- });
1477
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1478
- const doc = take(data, {
1479
- Policy: (_) => new __LazyJsonString(_),
1480
- RevisionId: __expectString,
1481
- });
1482
- Object.assign(contents, doc);
1483
- return contents;
1484
- };
1485
- const de_PutResourcePolicyCommandError = async (output, context) => {
1486
- const parsedOutput = {
1487
- ...output,
1488
- body: await parseErrorBody(output.body, context),
1489
- };
1490
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1491
- switch (errorCode) {
1492
- case "BadRequestException":
1493
- case "com.amazonaws.schemas#BadRequestException":
1494
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1495
- case "ForbiddenException":
1496
- case "com.amazonaws.schemas#ForbiddenException":
1497
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1498
- case "InternalServerErrorException":
1499
- case "com.amazonaws.schemas#InternalServerErrorException":
1500
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1501
- case "NotFoundException":
1502
- case "com.amazonaws.schemas#NotFoundException":
1503
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1504
- case "PreconditionFailedException":
1505
- case "com.amazonaws.schemas#PreconditionFailedException":
1506
- throw await de_PreconditionFailedExceptionRes(parsedOutput, context);
1507
- case "ServiceUnavailableException":
1508
- case "com.amazonaws.schemas#ServiceUnavailableException":
1509
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1510
- case "UnauthorizedException":
1511
- case "com.amazonaws.schemas#UnauthorizedException":
1512
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1513
- default:
1514
- const parsedBody = parsedOutput.body;
1515
- return throwDefaultError({
1516
- output,
1517
- parsedBody,
1518
- errorCode,
1519
- });
733
+ LastModified: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
734
+ SchemaVersion: __expectString,
735
+ Status: __expectString,
736
+ });
737
+ Object.assign(contents, doc);
738
+ return contents;
739
+ };
740
+ export const de_PutResourcePolicyCommand = async (output, context) => {
741
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
742
+ return de_CommandError(output, context);
1520
743
  }
744
+ const contents = map({
745
+ $metadata: deserializeMetadata(output),
746
+ });
747
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
748
+ const doc = take(data, {
749
+ Policy: (_) => new __LazyJsonString(_),
750
+ RevisionId: __expectString,
751
+ });
752
+ Object.assign(contents, doc);
753
+ return contents;
1521
754
  };
1522
755
  export const de_SearchSchemasCommand = async (output, context) => {
1523
756
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1524
- return de_SearchSchemasCommandError(output, context);
757
+ return de_CommandError(output, context);
1525
758
  }
1526
759
  const contents = map({
1527
760
  $metadata: deserializeMetadata(output),
@@ -1534,40 +767,9 @@ export const de_SearchSchemasCommand = async (output, context) => {
1534
767
  Object.assign(contents, doc);
1535
768
  return contents;
1536
769
  };
1537
- const de_SearchSchemasCommandError = async (output, context) => {
1538
- const parsedOutput = {
1539
- ...output,
1540
- body: await parseErrorBody(output.body, context),
1541
- };
1542
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1543
- switch (errorCode) {
1544
- case "BadRequestException":
1545
- case "com.amazonaws.schemas#BadRequestException":
1546
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1547
- case "ForbiddenException":
1548
- case "com.amazonaws.schemas#ForbiddenException":
1549
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1550
- case "InternalServerErrorException":
1551
- case "com.amazonaws.schemas#InternalServerErrorException":
1552
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1553
- case "ServiceUnavailableException":
1554
- case "com.amazonaws.schemas#ServiceUnavailableException":
1555
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1556
- case "UnauthorizedException":
1557
- case "com.amazonaws.schemas#UnauthorizedException":
1558
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1559
- default:
1560
- const parsedBody = parsedOutput.body;
1561
- return throwDefaultError({
1562
- output,
1563
- parsedBody,
1564
- errorCode,
1565
- });
1566
- }
1567
- };
1568
770
  export const de_StartDiscovererCommand = async (output, context) => {
1569
771
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1570
- return de_StartDiscovererCommandError(output, context);
772
+ return de_CommandError(output, context);
1571
773
  }
1572
774
  const contents = map({
1573
775
  $metadata: deserializeMetadata(output),
@@ -1580,43 +782,9 @@ export const de_StartDiscovererCommand = async (output, context) => {
1580
782
  Object.assign(contents, doc);
1581
783
  return contents;
1582
784
  };
1583
- const de_StartDiscovererCommandError = async (output, context) => {
1584
- const parsedOutput = {
1585
- ...output,
1586
- body: await parseErrorBody(output.body, context),
1587
- };
1588
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1589
- switch (errorCode) {
1590
- case "BadRequestException":
1591
- case "com.amazonaws.schemas#BadRequestException":
1592
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1593
- case "ForbiddenException":
1594
- case "com.amazonaws.schemas#ForbiddenException":
1595
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1596
- case "InternalServerErrorException":
1597
- case "com.amazonaws.schemas#InternalServerErrorException":
1598
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1599
- case "NotFoundException":
1600
- case "com.amazonaws.schemas#NotFoundException":
1601
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1602
- case "ServiceUnavailableException":
1603
- case "com.amazonaws.schemas#ServiceUnavailableException":
1604
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1605
- case "UnauthorizedException":
1606
- case "com.amazonaws.schemas#UnauthorizedException":
1607
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1608
- default:
1609
- const parsedBody = parsedOutput.body;
1610
- return throwDefaultError({
1611
- output,
1612
- parsedBody,
1613
- errorCode,
1614
- });
1615
- }
1616
- };
1617
785
  export const de_StopDiscovererCommand = async (output, context) => {
1618
786
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1619
- return de_StopDiscovererCommandError(output, context);
787
+ return de_CommandError(output, context);
1620
788
  }
1621
789
  const contents = map({
1622
790
  $metadata: deserializeMetadata(output),
@@ -1629,43 +797,9 @@ export const de_StopDiscovererCommand = async (output, context) => {
1629
797
  Object.assign(contents, doc);
1630
798
  return contents;
1631
799
  };
1632
- const de_StopDiscovererCommandError = async (output, context) => {
1633
- const parsedOutput = {
1634
- ...output,
1635
- body: await parseErrorBody(output.body, context),
1636
- };
1637
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1638
- switch (errorCode) {
1639
- case "BadRequestException":
1640
- case "com.amazonaws.schemas#BadRequestException":
1641
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1642
- case "ForbiddenException":
1643
- case "com.amazonaws.schemas#ForbiddenException":
1644
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1645
- case "InternalServerErrorException":
1646
- case "com.amazonaws.schemas#InternalServerErrorException":
1647
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1648
- case "NotFoundException":
1649
- case "com.amazonaws.schemas#NotFoundException":
1650
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1651
- case "ServiceUnavailableException":
1652
- case "com.amazonaws.schemas#ServiceUnavailableException":
1653
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1654
- case "UnauthorizedException":
1655
- case "com.amazonaws.schemas#UnauthorizedException":
1656
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1657
- default:
1658
- const parsedBody = parsedOutput.body;
1659
- return throwDefaultError({
1660
- output,
1661
- parsedBody,
1662
- errorCode,
1663
- });
1664
- }
1665
- };
1666
800
  export const de_TagResourceCommand = async (output, context) => {
1667
801
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1668
- return de_TagResourceCommandError(output, context);
802
+ return de_CommandError(output, context);
1669
803
  }
1670
804
  const contents = map({
1671
805
  $metadata: deserializeMetadata(output),
@@ -1673,37 +807,9 @@ export const de_TagResourceCommand = async (output, context) => {
1673
807
  await collectBody(output.body, context);
1674
808
  return contents;
1675
809
  };
1676
- const de_TagResourceCommandError = async (output, context) => {
1677
- const parsedOutput = {
1678
- ...output,
1679
- body: await parseErrorBody(output.body, context),
1680
- };
1681
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1682
- switch (errorCode) {
1683
- case "BadRequestException":
1684
- case "com.amazonaws.schemas#BadRequestException":
1685
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1686
- case "ForbiddenException":
1687
- case "com.amazonaws.schemas#ForbiddenException":
1688
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1689
- case "InternalServerErrorException":
1690
- case "com.amazonaws.schemas#InternalServerErrorException":
1691
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1692
- case "NotFoundException":
1693
- case "com.amazonaws.schemas#NotFoundException":
1694
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1695
- default:
1696
- const parsedBody = parsedOutput.body;
1697
- return throwDefaultError({
1698
- output,
1699
- parsedBody,
1700
- errorCode,
1701
- });
1702
- }
1703
- };
1704
810
  export const de_UntagResourceCommand = async (output, context) => {
1705
811
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1706
- return de_UntagResourceCommandError(output, context);
812
+ return de_CommandError(output, context);
1707
813
  }
1708
814
  const contents = map({
1709
815
  $metadata: deserializeMetadata(output),
@@ -1711,37 +817,9 @@ export const de_UntagResourceCommand = async (output, context) => {
1711
817
  await collectBody(output.body, context);
1712
818
  return contents;
1713
819
  };
1714
- const de_UntagResourceCommandError = async (output, context) => {
1715
- const parsedOutput = {
1716
- ...output,
1717
- body: await parseErrorBody(output.body, context),
1718
- };
1719
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1720
- switch (errorCode) {
1721
- case "BadRequestException":
1722
- case "com.amazonaws.schemas#BadRequestException":
1723
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1724
- case "ForbiddenException":
1725
- case "com.amazonaws.schemas#ForbiddenException":
1726
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1727
- case "InternalServerErrorException":
1728
- case "com.amazonaws.schemas#InternalServerErrorException":
1729
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1730
- case "NotFoundException":
1731
- case "com.amazonaws.schemas#NotFoundException":
1732
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1733
- default:
1734
- const parsedBody = parsedOutput.body;
1735
- return throwDefaultError({
1736
- output,
1737
- parsedBody,
1738
- errorCode,
1739
- });
1740
- }
1741
- };
1742
820
  export const de_UpdateDiscovererCommand = async (output, context) => {
1743
821
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1744
- return de_UpdateDiscovererCommandError(output, context);
822
+ return de_CommandError(output, context);
1745
823
  }
1746
824
  const contents = map({
1747
825
  $metadata: deserializeMetadata(output),
@@ -1759,43 +837,9 @@ export const de_UpdateDiscovererCommand = async (output, context) => {
1759
837
  Object.assign(contents, doc);
1760
838
  return contents;
1761
839
  };
1762
- const de_UpdateDiscovererCommandError = async (output, context) => {
1763
- const parsedOutput = {
1764
- ...output,
1765
- body: await parseErrorBody(output.body, context),
1766
- };
1767
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1768
- switch (errorCode) {
1769
- case "BadRequestException":
1770
- case "com.amazonaws.schemas#BadRequestException":
1771
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1772
- case "ForbiddenException":
1773
- case "com.amazonaws.schemas#ForbiddenException":
1774
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1775
- case "InternalServerErrorException":
1776
- case "com.amazonaws.schemas#InternalServerErrorException":
1777
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1778
- case "NotFoundException":
1779
- case "com.amazonaws.schemas#NotFoundException":
1780
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1781
- case "ServiceUnavailableException":
1782
- case "com.amazonaws.schemas#ServiceUnavailableException":
1783
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1784
- case "UnauthorizedException":
1785
- case "com.amazonaws.schemas#UnauthorizedException":
1786
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1787
- default:
1788
- const parsedBody = parsedOutput.body;
1789
- return throwDefaultError({
1790
- output,
1791
- parsedBody,
1792
- errorCode,
1793
- });
1794
- }
1795
- };
1796
840
  export const de_UpdateRegistryCommand = async (output, context) => {
1797
841
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1798
- return de_UpdateRegistryCommandError(output, context);
842
+ return de_CommandError(output, context);
1799
843
  }
1800
844
  const contents = map({
1801
845
  $metadata: deserializeMetadata(output),
@@ -1810,43 +854,9 @@ export const de_UpdateRegistryCommand = async (output, context) => {
1810
854
  Object.assign(contents, doc);
1811
855
  return contents;
1812
856
  };
1813
- const de_UpdateRegistryCommandError = async (output, context) => {
1814
- const parsedOutput = {
1815
- ...output,
1816
- body: await parseErrorBody(output.body, context),
1817
- };
1818
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1819
- switch (errorCode) {
1820
- case "BadRequestException":
1821
- case "com.amazonaws.schemas#BadRequestException":
1822
- throw await de_BadRequestExceptionRes(parsedOutput, context);
1823
- case "ForbiddenException":
1824
- case "com.amazonaws.schemas#ForbiddenException":
1825
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
1826
- case "InternalServerErrorException":
1827
- case "com.amazonaws.schemas#InternalServerErrorException":
1828
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1829
- case "NotFoundException":
1830
- case "com.amazonaws.schemas#NotFoundException":
1831
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1832
- case "ServiceUnavailableException":
1833
- case "com.amazonaws.schemas#ServiceUnavailableException":
1834
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
1835
- case "UnauthorizedException":
1836
- case "com.amazonaws.schemas#UnauthorizedException":
1837
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
1838
- default:
1839
- const parsedBody = parsedOutput.body;
1840
- return throwDefaultError({
1841
- output,
1842
- parsedBody,
1843
- errorCode,
1844
- });
1845
- }
1846
- };
1847
857
  export const de_UpdateSchemaCommand = async (output, context) => {
1848
858
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1849
- return de_UpdateSchemaCommandError(output, context);
859
+ return de_CommandError(output, context);
1850
860
  }
1851
861
  const contents = map({
1852
862
  $metadata: deserializeMetadata(output),
@@ -1865,7 +875,7 @@ export const de_UpdateSchemaCommand = async (output, context) => {
1865
875
  Object.assign(contents, doc);
1866
876
  return contents;
1867
877
  };
1868
- const de_UpdateSchemaCommandError = async (output, context) => {
878
+ const de_CommandError = async (output, context) => {
1869
879
  const parsedOutput = {
1870
880
  ...output,
1871
881
  body: await parseErrorBody(output.body, context),
@@ -1875,18 +885,33 @@ const de_UpdateSchemaCommandError = async (output, context) => {
1875
885
  case "BadRequestException":
1876
886
  case "com.amazonaws.schemas#BadRequestException":
1877
887
  throw await de_BadRequestExceptionRes(parsedOutput, context);
888
+ case "ConflictException":
889
+ case "com.amazonaws.schemas#ConflictException":
890
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1878
891
  case "ForbiddenException":
1879
892
  case "com.amazonaws.schemas#ForbiddenException":
1880
893
  throw await de_ForbiddenExceptionRes(parsedOutput, context);
1881
894
  case "InternalServerErrorException":
1882
895
  case "com.amazonaws.schemas#InternalServerErrorException":
1883
896
  throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
1884
- case "NotFoundException":
1885
- case "com.amazonaws.schemas#NotFoundException":
1886
- throw await de_NotFoundExceptionRes(parsedOutput, context);
1887
897
  case "ServiceUnavailableException":
1888
898
  case "com.amazonaws.schemas#ServiceUnavailableException":
1889
899
  throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
900
+ case "UnauthorizedException":
901
+ case "com.amazonaws.schemas#UnauthorizedException":
902
+ throw await de_UnauthorizedExceptionRes(parsedOutput, context);
903
+ case "NotFoundException":
904
+ case "com.amazonaws.schemas#NotFoundException":
905
+ throw await de_NotFoundExceptionRes(parsedOutput, context);
906
+ case "TooManyRequestsException":
907
+ case "com.amazonaws.schemas#TooManyRequestsException":
908
+ throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
909
+ case "GoneException":
910
+ case "com.amazonaws.schemas#GoneException":
911
+ throw await de_GoneExceptionRes(parsedOutput, context);
912
+ case "PreconditionFailedException":
913
+ case "com.amazonaws.schemas#PreconditionFailedException":
914
+ throw await de_PreconditionFailedExceptionRes(parsedOutput, context);
1890
915
  default:
1891
916
  const parsedBody = parsedOutput.body;
1892
917
  return throwDefaultError({