@aws-sdk/client-transcribe 3.52.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ exports.deserializeAws_json1_1UpdateVocabularyFilterCommand = exports.deserializ
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const models_0_1 = require("../models/models_0");
8
+ const TranscribeServiceException_1 = require("../models/TranscribeServiceException");
8
9
  const serializeAws_json1_1CreateCallAnalyticsCategoryCommand = async (input, context) => {
9
10
  const headers = {
10
11
  "content-type": "application/x-amz-json-1.1",
@@ -420,51 +421,25 @@ const deserializeAws_json1_1CreateCallAnalyticsCategoryCommandError = async (out
420
421
  switch (errorCode) {
421
422
  case "BadRequestException":
422
423
  case "com.amazonaws.transcribe#BadRequestException":
423
- response = {
424
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
425
- name: errorCode,
426
- $metadata: deserializeMetadata(output),
427
- };
428
- break;
424
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
429
425
  case "ConflictException":
430
426
  case "com.amazonaws.transcribe#ConflictException":
431
- response = {
432
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
433
- name: errorCode,
434
- $metadata: deserializeMetadata(output),
435
- };
436
- break;
427
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
437
428
  case "InternalFailureException":
438
429
  case "com.amazonaws.transcribe#InternalFailureException":
439
- response = {
440
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
441
- name: errorCode,
442
- $metadata: deserializeMetadata(output),
443
- };
444
- break;
430
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
445
431
  case "LimitExceededException":
446
432
  case "com.amazonaws.transcribe#LimitExceededException":
447
- response = {
448
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
449
- name: errorCode,
450
- $metadata: deserializeMetadata(output),
451
- };
452
- break;
433
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
453
434
  default:
454
435
  const parsedBody = parsedOutput.body;
455
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
456
- response = {
457
- ...parsedBody,
458
- name: `${errorCode}`,
459
- message: parsedBody.message || parsedBody.Message || errorCode,
436
+ response = new TranscribeServiceException_1.TranscribeServiceException({
437
+ name: parsedBody.code || parsedBody.Code || errorCode,
460
438
  $fault: "client",
461
439
  $metadata: deserializeMetadata(output),
462
- };
440
+ });
441
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
463
442
  }
464
- const message = response.message || response.Message || errorCode;
465
- response.message = message;
466
- delete response.Message;
467
- return Promise.reject(Object.assign(new Error(message), response));
468
443
  };
469
444
  const deserializeAws_json1_1CreateLanguageModelCommand = async (output, context) => {
470
445
  if (output.statusCode >= 300) {
@@ -491,51 +466,25 @@ const deserializeAws_json1_1CreateLanguageModelCommandError = async (output, con
491
466
  switch (errorCode) {
492
467
  case "BadRequestException":
493
468
  case "com.amazonaws.transcribe#BadRequestException":
494
- response = {
495
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
496
- name: errorCode,
497
- $metadata: deserializeMetadata(output),
498
- };
499
- break;
469
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
500
470
  case "ConflictException":
501
471
  case "com.amazonaws.transcribe#ConflictException":
502
- response = {
503
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
504
- name: errorCode,
505
- $metadata: deserializeMetadata(output),
506
- };
507
- break;
472
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
508
473
  case "InternalFailureException":
509
474
  case "com.amazonaws.transcribe#InternalFailureException":
510
- response = {
511
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
512
- name: errorCode,
513
- $metadata: deserializeMetadata(output),
514
- };
515
- break;
475
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
516
476
  case "LimitExceededException":
517
477
  case "com.amazonaws.transcribe#LimitExceededException":
518
- response = {
519
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
520
- name: errorCode,
521
- $metadata: deserializeMetadata(output),
522
- };
523
- break;
478
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
524
479
  default:
525
480
  const parsedBody = parsedOutput.body;
526
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
527
- response = {
528
- ...parsedBody,
529
- name: `${errorCode}`,
530
- message: parsedBody.message || parsedBody.Message || errorCode,
481
+ response = new TranscribeServiceException_1.TranscribeServiceException({
482
+ name: parsedBody.code || parsedBody.Code || errorCode,
531
483
  $fault: "client",
532
484
  $metadata: deserializeMetadata(output),
533
- };
485
+ });
486
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
534
487
  }
535
- const message = response.message || response.Message || errorCode;
536
- response.message = message;
537
- delete response.Message;
538
- return Promise.reject(Object.assign(new Error(message), response));
539
488
  };
540
489
  const deserializeAws_json1_1CreateMedicalVocabularyCommand = async (output, context) => {
541
490
  if (output.statusCode >= 300) {
@@ -562,51 +511,25 @@ const deserializeAws_json1_1CreateMedicalVocabularyCommandError = async (output,
562
511
  switch (errorCode) {
563
512
  case "BadRequestException":
564
513
  case "com.amazonaws.transcribe#BadRequestException":
565
- response = {
566
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
567
- name: errorCode,
568
- $metadata: deserializeMetadata(output),
569
- };
570
- break;
514
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
571
515
  case "ConflictException":
572
516
  case "com.amazonaws.transcribe#ConflictException":
573
- response = {
574
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
575
- name: errorCode,
576
- $metadata: deserializeMetadata(output),
577
- };
578
- break;
517
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
579
518
  case "InternalFailureException":
580
519
  case "com.amazonaws.transcribe#InternalFailureException":
581
- response = {
582
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
583
- name: errorCode,
584
- $metadata: deserializeMetadata(output),
585
- };
586
- break;
520
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
587
521
  case "LimitExceededException":
588
522
  case "com.amazonaws.transcribe#LimitExceededException":
589
- response = {
590
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
591
- name: errorCode,
592
- $metadata: deserializeMetadata(output),
593
- };
594
- break;
523
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
595
524
  default:
596
525
  const parsedBody = parsedOutput.body;
597
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
598
- response = {
599
- ...parsedBody,
600
- name: `${errorCode}`,
601
- message: parsedBody.message || parsedBody.Message || errorCode,
526
+ response = new TranscribeServiceException_1.TranscribeServiceException({
527
+ name: parsedBody.code || parsedBody.Code || errorCode,
602
528
  $fault: "client",
603
529
  $metadata: deserializeMetadata(output),
604
- };
530
+ });
531
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
605
532
  }
606
- const message = response.message || response.Message || errorCode;
607
- response.message = message;
608
- delete response.Message;
609
- return Promise.reject(Object.assign(new Error(message), response));
610
533
  };
611
534
  const deserializeAws_json1_1CreateVocabularyCommand = async (output, context) => {
612
535
  if (output.statusCode >= 300) {
@@ -633,51 +556,25 @@ const deserializeAws_json1_1CreateVocabularyCommandError = async (output, contex
633
556
  switch (errorCode) {
634
557
  case "BadRequestException":
635
558
  case "com.amazonaws.transcribe#BadRequestException":
636
- response = {
637
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
638
- name: errorCode,
639
- $metadata: deserializeMetadata(output),
640
- };
641
- break;
559
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
642
560
  case "ConflictException":
643
561
  case "com.amazonaws.transcribe#ConflictException":
644
- response = {
645
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
646
- name: errorCode,
647
- $metadata: deserializeMetadata(output),
648
- };
649
- break;
562
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
650
563
  case "InternalFailureException":
651
564
  case "com.amazonaws.transcribe#InternalFailureException":
652
- response = {
653
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
654
- name: errorCode,
655
- $metadata: deserializeMetadata(output),
656
- };
657
- break;
565
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
658
566
  case "LimitExceededException":
659
567
  case "com.amazonaws.transcribe#LimitExceededException":
660
- response = {
661
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
662
- name: errorCode,
663
- $metadata: deserializeMetadata(output),
664
- };
665
- break;
568
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
666
569
  default:
667
570
  const parsedBody = parsedOutput.body;
668
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
669
- response = {
670
- ...parsedBody,
671
- name: `${errorCode}`,
672
- message: parsedBody.message || parsedBody.Message || errorCode,
571
+ response = new TranscribeServiceException_1.TranscribeServiceException({
572
+ name: parsedBody.code || parsedBody.Code || errorCode,
673
573
  $fault: "client",
674
574
  $metadata: deserializeMetadata(output),
675
- };
575
+ });
576
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
676
577
  }
677
- const message = response.message || response.Message || errorCode;
678
- response.message = message;
679
- delete response.Message;
680
- return Promise.reject(Object.assign(new Error(message), response));
681
578
  };
682
579
  const deserializeAws_json1_1CreateVocabularyFilterCommand = async (output, context) => {
683
580
  if (output.statusCode >= 300) {
@@ -704,51 +601,25 @@ const deserializeAws_json1_1CreateVocabularyFilterCommandError = async (output,
704
601
  switch (errorCode) {
705
602
  case "BadRequestException":
706
603
  case "com.amazonaws.transcribe#BadRequestException":
707
- response = {
708
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
709
- name: errorCode,
710
- $metadata: deserializeMetadata(output),
711
- };
712
- break;
604
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
713
605
  case "ConflictException":
714
606
  case "com.amazonaws.transcribe#ConflictException":
715
- response = {
716
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
717
- name: errorCode,
718
- $metadata: deserializeMetadata(output),
719
- };
720
- break;
607
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
721
608
  case "InternalFailureException":
722
609
  case "com.amazonaws.transcribe#InternalFailureException":
723
- response = {
724
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
725
- name: errorCode,
726
- $metadata: deserializeMetadata(output),
727
- };
728
- break;
610
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
729
611
  case "LimitExceededException":
730
612
  case "com.amazonaws.transcribe#LimitExceededException":
731
- response = {
732
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
733
- name: errorCode,
734
- $metadata: deserializeMetadata(output),
735
- };
736
- break;
613
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
737
614
  default:
738
615
  const parsedBody = parsedOutput.body;
739
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
740
- response = {
741
- ...parsedBody,
742
- name: `${errorCode}`,
743
- message: parsedBody.message || parsedBody.Message || errorCode,
616
+ response = new TranscribeServiceException_1.TranscribeServiceException({
617
+ name: parsedBody.code || parsedBody.Code || errorCode,
744
618
  $fault: "client",
745
619
  $metadata: deserializeMetadata(output),
746
- };
620
+ });
621
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
747
622
  }
748
- const message = response.message || response.Message || errorCode;
749
- response.message = message;
750
- delete response.Message;
751
- return Promise.reject(Object.assign(new Error(message), response));
752
623
  };
753
624
  const deserializeAws_json1_1DeleteCallAnalyticsCategoryCommand = async (output, context) => {
754
625
  if (output.statusCode >= 300) {
@@ -775,51 +646,25 @@ const deserializeAws_json1_1DeleteCallAnalyticsCategoryCommandError = async (out
775
646
  switch (errorCode) {
776
647
  case "BadRequestException":
777
648
  case "com.amazonaws.transcribe#BadRequestException":
778
- response = {
779
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
780
- name: errorCode,
781
- $metadata: deserializeMetadata(output),
782
- };
783
- break;
649
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
784
650
  case "InternalFailureException":
785
651
  case "com.amazonaws.transcribe#InternalFailureException":
786
- response = {
787
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
788
- name: errorCode,
789
- $metadata: deserializeMetadata(output),
790
- };
791
- break;
652
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
792
653
  case "LimitExceededException":
793
654
  case "com.amazonaws.transcribe#LimitExceededException":
794
- response = {
795
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
796
- name: errorCode,
797
- $metadata: deserializeMetadata(output),
798
- };
799
- break;
655
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
800
656
  case "NotFoundException":
801
657
  case "com.amazonaws.transcribe#NotFoundException":
802
- response = {
803
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
804
- name: errorCode,
805
- $metadata: deserializeMetadata(output),
806
- };
807
- break;
658
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
808
659
  default:
809
660
  const parsedBody = parsedOutput.body;
810
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
811
- response = {
812
- ...parsedBody,
813
- name: `${errorCode}`,
814
- message: parsedBody.message || parsedBody.Message || errorCode,
661
+ response = new TranscribeServiceException_1.TranscribeServiceException({
662
+ name: parsedBody.code || parsedBody.Code || errorCode,
815
663
  $fault: "client",
816
664
  $metadata: deserializeMetadata(output),
817
- };
665
+ });
666
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
818
667
  }
819
- const message = response.message || response.Message || errorCode;
820
- response.message = message;
821
- delete response.Message;
822
- return Promise.reject(Object.assign(new Error(message), response));
823
668
  };
824
669
  const deserializeAws_json1_1DeleteCallAnalyticsJobCommand = async (output, context) => {
825
670
  if (output.statusCode >= 300) {
@@ -846,43 +691,22 @@ const deserializeAws_json1_1DeleteCallAnalyticsJobCommandError = async (output,
846
691
  switch (errorCode) {
847
692
  case "BadRequestException":
848
693
  case "com.amazonaws.transcribe#BadRequestException":
849
- response = {
850
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
851
- name: errorCode,
852
- $metadata: deserializeMetadata(output),
853
- };
854
- break;
694
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
855
695
  case "InternalFailureException":
856
696
  case "com.amazonaws.transcribe#InternalFailureException":
857
- response = {
858
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
859
- name: errorCode,
860
- $metadata: deserializeMetadata(output),
861
- };
862
- break;
697
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
863
698
  case "LimitExceededException":
864
699
  case "com.amazonaws.transcribe#LimitExceededException":
865
- response = {
866
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
867
- name: errorCode,
868
- $metadata: deserializeMetadata(output),
869
- };
870
- break;
700
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
871
701
  default:
872
702
  const parsedBody = parsedOutput.body;
873
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
874
- response = {
875
- ...parsedBody,
876
- name: `${errorCode}`,
877
- message: parsedBody.message || parsedBody.Message || errorCode,
703
+ response = new TranscribeServiceException_1.TranscribeServiceException({
704
+ name: parsedBody.code || parsedBody.Code || errorCode,
878
705
  $fault: "client",
879
706
  $metadata: deserializeMetadata(output),
880
- };
707
+ });
708
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
881
709
  }
882
- const message = response.message || response.Message || errorCode;
883
- response.message = message;
884
- delete response.Message;
885
- return Promise.reject(Object.assign(new Error(message), response));
886
710
  };
887
711
  const deserializeAws_json1_1DeleteLanguageModelCommand = async (output, context) => {
888
712
  if (output.statusCode >= 300) {
@@ -906,43 +730,22 @@ const deserializeAws_json1_1DeleteLanguageModelCommandError = async (output, con
906
730
  switch (errorCode) {
907
731
  case "BadRequestException":
908
732
  case "com.amazonaws.transcribe#BadRequestException":
909
- response = {
910
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
911
- name: errorCode,
912
- $metadata: deserializeMetadata(output),
913
- };
914
- break;
733
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
915
734
  case "InternalFailureException":
916
735
  case "com.amazonaws.transcribe#InternalFailureException":
917
- response = {
918
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
919
- name: errorCode,
920
- $metadata: deserializeMetadata(output),
921
- };
922
- break;
736
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
923
737
  case "LimitExceededException":
924
738
  case "com.amazonaws.transcribe#LimitExceededException":
925
- response = {
926
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
927
- name: errorCode,
928
- $metadata: deserializeMetadata(output),
929
- };
930
- break;
739
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
931
740
  default:
932
741
  const parsedBody = parsedOutput.body;
933
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
934
- response = {
935
- ...parsedBody,
936
- name: `${errorCode}`,
937
- message: parsedBody.message || parsedBody.Message || errorCode,
742
+ response = new TranscribeServiceException_1.TranscribeServiceException({
743
+ name: parsedBody.code || parsedBody.Code || errorCode,
938
744
  $fault: "client",
939
745
  $metadata: deserializeMetadata(output),
940
- };
746
+ });
747
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
941
748
  }
942
- const message = response.message || response.Message || errorCode;
943
- response.message = message;
944
- delete response.Message;
945
- return Promise.reject(Object.assign(new Error(message), response));
946
749
  };
947
750
  const deserializeAws_json1_1DeleteMedicalTranscriptionJobCommand = async (output, context) => {
948
751
  if (output.statusCode >= 300) {
@@ -966,43 +769,22 @@ const deserializeAws_json1_1DeleteMedicalTranscriptionJobCommandError = async (o
966
769
  switch (errorCode) {
967
770
  case "BadRequestException":
968
771
  case "com.amazonaws.transcribe#BadRequestException":
969
- response = {
970
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
971
- name: errorCode,
972
- $metadata: deserializeMetadata(output),
973
- };
974
- break;
772
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
975
773
  case "InternalFailureException":
976
774
  case "com.amazonaws.transcribe#InternalFailureException":
977
- response = {
978
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
979
- name: errorCode,
980
- $metadata: deserializeMetadata(output),
981
- };
982
- break;
775
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
983
776
  case "LimitExceededException":
984
777
  case "com.amazonaws.transcribe#LimitExceededException":
985
- response = {
986
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
987
- name: errorCode,
988
- $metadata: deserializeMetadata(output),
989
- };
990
- break;
778
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
991
779
  default:
992
780
  const parsedBody = parsedOutput.body;
993
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
994
- response = {
995
- ...parsedBody,
996
- name: `${errorCode}`,
997
- message: parsedBody.message || parsedBody.Message || errorCode,
781
+ response = new TranscribeServiceException_1.TranscribeServiceException({
782
+ name: parsedBody.code || parsedBody.Code || errorCode,
998
783
  $fault: "client",
999
784
  $metadata: deserializeMetadata(output),
1000
- };
785
+ });
786
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1001
787
  }
1002
- const message = response.message || response.Message || errorCode;
1003
- response.message = message;
1004
- delete response.Message;
1005
- return Promise.reject(Object.assign(new Error(message), response));
1006
788
  };
1007
789
  const deserializeAws_json1_1DeleteMedicalVocabularyCommand = async (output, context) => {
1008
790
  if (output.statusCode >= 300) {
@@ -1026,51 +808,25 @@ const deserializeAws_json1_1DeleteMedicalVocabularyCommandError = async (output,
1026
808
  switch (errorCode) {
1027
809
  case "BadRequestException":
1028
810
  case "com.amazonaws.transcribe#BadRequestException":
1029
- response = {
1030
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1031
- name: errorCode,
1032
- $metadata: deserializeMetadata(output),
1033
- };
1034
- break;
811
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1035
812
  case "InternalFailureException":
1036
813
  case "com.amazonaws.transcribe#InternalFailureException":
1037
- response = {
1038
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1039
- name: errorCode,
1040
- $metadata: deserializeMetadata(output),
1041
- };
1042
- break;
814
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1043
815
  case "LimitExceededException":
1044
816
  case "com.amazonaws.transcribe#LimitExceededException":
1045
- response = {
1046
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1047
- name: errorCode,
1048
- $metadata: deserializeMetadata(output),
1049
- };
1050
- break;
817
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1051
818
  case "NotFoundException":
1052
819
  case "com.amazonaws.transcribe#NotFoundException":
1053
- response = {
1054
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1055
- name: errorCode,
1056
- $metadata: deserializeMetadata(output),
1057
- };
1058
- break;
820
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1059
821
  default:
1060
822
  const parsedBody = parsedOutput.body;
1061
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1062
- response = {
1063
- ...parsedBody,
1064
- name: `${errorCode}`,
1065
- message: parsedBody.message || parsedBody.Message || errorCode,
823
+ response = new TranscribeServiceException_1.TranscribeServiceException({
824
+ name: parsedBody.code || parsedBody.Code || errorCode,
1066
825
  $fault: "client",
1067
826
  $metadata: deserializeMetadata(output),
1068
- };
827
+ });
828
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1069
829
  }
1070
- const message = response.message || response.Message || errorCode;
1071
- response.message = message;
1072
- delete response.Message;
1073
- return Promise.reject(Object.assign(new Error(message), response));
1074
830
  };
1075
831
  const deserializeAws_json1_1DeleteTranscriptionJobCommand = async (output, context) => {
1076
832
  if (output.statusCode >= 300) {
@@ -1094,43 +850,22 @@ const deserializeAws_json1_1DeleteTranscriptionJobCommandError = async (output,
1094
850
  switch (errorCode) {
1095
851
  case "BadRequestException":
1096
852
  case "com.amazonaws.transcribe#BadRequestException":
1097
- response = {
1098
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1099
- name: errorCode,
1100
- $metadata: deserializeMetadata(output),
1101
- };
1102
- break;
853
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1103
854
  case "InternalFailureException":
1104
855
  case "com.amazonaws.transcribe#InternalFailureException":
1105
- response = {
1106
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1107
- name: errorCode,
1108
- $metadata: deserializeMetadata(output),
1109
- };
1110
- break;
856
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1111
857
  case "LimitExceededException":
1112
858
  case "com.amazonaws.transcribe#LimitExceededException":
1113
- response = {
1114
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1115
- name: errorCode,
1116
- $metadata: deserializeMetadata(output),
1117
- };
1118
- break;
859
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1119
860
  default:
1120
861
  const parsedBody = parsedOutput.body;
1121
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1122
- response = {
1123
- ...parsedBody,
1124
- name: `${errorCode}`,
1125
- message: parsedBody.message || parsedBody.Message || errorCode,
862
+ response = new TranscribeServiceException_1.TranscribeServiceException({
863
+ name: parsedBody.code || parsedBody.Code || errorCode,
1126
864
  $fault: "client",
1127
865
  $metadata: deserializeMetadata(output),
1128
- };
866
+ });
867
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1129
868
  }
1130
- const message = response.message || response.Message || errorCode;
1131
- response.message = message;
1132
- delete response.Message;
1133
- return Promise.reject(Object.assign(new Error(message), response));
1134
869
  };
1135
870
  const deserializeAws_json1_1DeleteVocabularyCommand = async (output, context) => {
1136
871
  if (output.statusCode >= 300) {
@@ -1154,51 +889,25 @@ const deserializeAws_json1_1DeleteVocabularyCommandError = async (output, contex
1154
889
  switch (errorCode) {
1155
890
  case "BadRequestException":
1156
891
  case "com.amazonaws.transcribe#BadRequestException":
1157
- response = {
1158
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1159
- name: errorCode,
1160
- $metadata: deserializeMetadata(output),
1161
- };
1162
- break;
892
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1163
893
  case "InternalFailureException":
1164
894
  case "com.amazonaws.transcribe#InternalFailureException":
1165
- response = {
1166
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1167
- name: errorCode,
1168
- $metadata: deserializeMetadata(output),
1169
- };
1170
- break;
895
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1171
896
  case "LimitExceededException":
1172
897
  case "com.amazonaws.transcribe#LimitExceededException":
1173
- response = {
1174
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1175
- name: errorCode,
1176
- $metadata: deserializeMetadata(output),
1177
- };
1178
- break;
898
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1179
899
  case "NotFoundException":
1180
900
  case "com.amazonaws.transcribe#NotFoundException":
1181
- response = {
1182
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1183
- name: errorCode,
1184
- $metadata: deserializeMetadata(output),
1185
- };
1186
- break;
901
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1187
902
  default:
1188
903
  const parsedBody = parsedOutput.body;
1189
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1190
- response = {
1191
- ...parsedBody,
1192
- name: `${errorCode}`,
1193
- message: parsedBody.message || parsedBody.Message || errorCode,
904
+ response = new TranscribeServiceException_1.TranscribeServiceException({
905
+ name: parsedBody.code || parsedBody.Code || errorCode,
1194
906
  $fault: "client",
1195
907
  $metadata: deserializeMetadata(output),
1196
- };
908
+ });
909
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1197
910
  }
1198
- const message = response.message || response.Message || errorCode;
1199
- response.message = message;
1200
- delete response.Message;
1201
- return Promise.reject(Object.assign(new Error(message), response));
1202
911
  };
1203
912
  const deserializeAws_json1_1DeleteVocabularyFilterCommand = async (output, context) => {
1204
913
  if (output.statusCode >= 300) {
@@ -1222,51 +931,25 @@ const deserializeAws_json1_1DeleteVocabularyFilterCommandError = async (output,
1222
931
  switch (errorCode) {
1223
932
  case "BadRequestException":
1224
933
  case "com.amazonaws.transcribe#BadRequestException":
1225
- response = {
1226
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1227
- name: errorCode,
1228
- $metadata: deserializeMetadata(output),
1229
- };
1230
- break;
934
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1231
935
  case "InternalFailureException":
1232
936
  case "com.amazonaws.transcribe#InternalFailureException":
1233
- response = {
1234
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1235
- name: errorCode,
1236
- $metadata: deserializeMetadata(output),
1237
- };
1238
- break;
937
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1239
938
  case "LimitExceededException":
1240
939
  case "com.amazonaws.transcribe#LimitExceededException":
1241
- response = {
1242
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1243
- name: errorCode,
1244
- $metadata: deserializeMetadata(output),
1245
- };
1246
- break;
940
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1247
941
  case "NotFoundException":
1248
942
  case "com.amazonaws.transcribe#NotFoundException":
1249
- response = {
1250
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1251
- name: errorCode,
1252
- $metadata: deserializeMetadata(output),
1253
- };
1254
- break;
943
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1255
944
  default:
1256
945
  const parsedBody = parsedOutput.body;
1257
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1258
- response = {
1259
- ...parsedBody,
1260
- name: `${errorCode}`,
1261
- message: parsedBody.message || parsedBody.Message || errorCode,
946
+ response = new TranscribeServiceException_1.TranscribeServiceException({
947
+ name: parsedBody.code || parsedBody.Code || errorCode,
1262
948
  $fault: "client",
1263
949
  $metadata: deserializeMetadata(output),
1264
- };
950
+ });
951
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1265
952
  }
1266
- const message = response.message || response.Message || errorCode;
1267
- response.message = message;
1268
- delete response.Message;
1269
- return Promise.reject(Object.assign(new Error(message), response));
1270
953
  };
1271
954
  const deserializeAws_json1_1DescribeLanguageModelCommand = async (output, context) => {
1272
955
  if (output.statusCode >= 300) {
@@ -1293,51 +976,25 @@ const deserializeAws_json1_1DescribeLanguageModelCommandError = async (output, c
1293
976
  switch (errorCode) {
1294
977
  case "BadRequestException":
1295
978
  case "com.amazonaws.transcribe#BadRequestException":
1296
- response = {
1297
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1298
- name: errorCode,
1299
- $metadata: deserializeMetadata(output),
1300
- };
1301
- break;
979
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1302
980
  case "InternalFailureException":
1303
981
  case "com.amazonaws.transcribe#InternalFailureException":
1304
- response = {
1305
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1306
- name: errorCode,
1307
- $metadata: deserializeMetadata(output),
1308
- };
1309
- break;
982
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1310
983
  case "LimitExceededException":
1311
984
  case "com.amazonaws.transcribe#LimitExceededException":
1312
- response = {
1313
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1314
- name: errorCode,
1315
- $metadata: deserializeMetadata(output),
1316
- };
1317
- break;
985
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1318
986
  case "NotFoundException":
1319
987
  case "com.amazonaws.transcribe#NotFoundException":
1320
- response = {
1321
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1322
- name: errorCode,
1323
- $metadata: deserializeMetadata(output),
1324
- };
1325
- break;
988
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1326
989
  default:
1327
990
  const parsedBody = parsedOutput.body;
1328
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1329
- response = {
1330
- ...parsedBody,
1331
- name: `${errorCode}`,
1332
- message: parsedBody.message || parsedBody.Message || errorCode,
991
+ response = new TranscribeServiceException_1.TranscribeServiceException({
992
+ name: parsedBody.code || parsedBody.Code || errorCode,
1333
993
  $fault: "client",
1334
994
  $metadata: deserializeMetadata(output),
1335
- };
995
+ });
996
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1336
997
  }
1337
- const message = response.message || response.Message || errorCode;
1338
- response.message = message;
1339
- delete response.Message;
1340
- return Promise.reject(Object.assign(new Error(message), response));
1341
998
  };
1342
999
  const deserializeAws_json1_1GetCallAnalyticsCategoryCommand = async (output, context) => {
1343
1000
  if (output.statusCode >= 300) {
@@ -1364,51 +1021,25 @@ const deserializeAws_json1_1GetCallAnalyticsCategoryCommandError = async (output
1364
1021
  switch (errorCode) {
1365
1022
  case "BadRequestException":
1366
1023
  case "com.amazonaws.transcribe#BadRequestException":
1367
- response = {
1368
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1369
- name: errorCode,
1370
- $metadata: deserializeMetadata(output),
1371
- };
1372
- break;
1024
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1373
1025
  case "InternalFailureException":
1374
1026
  case "com.amazonaws.transcribe#InternalFailureException":
1375
- response = {
1376
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1377
- name: errorCode,
1378
- $metadata: deserializeMetadata(output),
1379
- };
1380
- break;
1027
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1381
1028
  case "LimitExceededException":
1382
1029
  case "com.amazonaws.transcribe#LimitExceededException":
1383
- response = {
1384
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1385
- name: errorCode,
1386
- $metadata: deserializeMetadata(output),
1387
- };
1388
- break;
1030
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1389
1031
  case "NotFoundException":
1390
1032
  case "com.amazonaws.transcribe#NotFoundException":
1391
- response = {
1392
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1393
- name: errorCode,
1394
- $metadata: deserializeMetadata(output),
1395
- };
1396
- break;
1033
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1397
1034
  default:
1398
1035
  const parsedBody = parsedOutput.body;
1399
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1400
- response = {
1401
- ...parsedBody,
1402
- name: `${errorCode}`,
1403
- message: parsedBody.message || parsedBody.Message || errorCode,
1036
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1037
+ name: parsedBody.code || parsedBody.Code || errorCode,
1404
1038
  $fault: "client",
1405
1039
  $metadata: deserializeMetadata(output),
1406
- };
1040
+ });
1041
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1407
1042
  }
1408
- const message = response.message || response.Message || errorCode;
1409
- response.message = message;
1410
- delete response.Message;
1411
- return Promise.reject(Object.assign(new Error(message), response));
1412
1043
  };
1413
1044
  const deserializeAws_json1_1GetCallAnalyticsJobCommand = async (output, context) => {
1414
1045
  if (output.statusCode >= 300) {
@@ -1435,51 +1066,25 @@ const deserializeAws_json1_1GetCallAnalyticsJobCommandError = async (output, con
1435
1066
  switch (errorCode) {
1436
1067
  case "BadRequestException":
1437
1068
  case "com.amazonaws.transcribe#BadRequestException":
1438
- response = {
1439
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1440
- name: errorCode,
1441
- $metadata: deserializeMetadata(output),
1442
- };
1443
- break;
1069
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1444
1070
  case "InternalFailureException":
1445
1071
  case "com.amazonaws.transcribe#InternalFailureException":
1446
- response = {
1447
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1448
- name: errorCode,
1449
- $metadata: deserializeMetadata(output),
1450
- };
1451
- break;
1072
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1452
1073
  case "LimitExceededException":
1453
1074
  case "com.amazonaws.transcribe#LimitExceededException":
1454
- response = {
1455
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1456
- name: errorCode,
1457
- $metadata: deserializeMetadata(output),
1458
- };
1459
- break;
1075
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1460
1076
  case "NotFoundException":
1461
1077
  case "com.amazonaws.transcribe#NotFoundException":
1462
- response = {
1463
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1464
- name: errorCode,
1465
- $metadata: deserializeMetadata(output),
1466
- };
1467
- break;
1078
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1468
1079
  default:
1469
1080
  const parsedBody = parsedOutput.body;
1470
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1471
- response = {
1472
- ...parsedBody,
1473
- name: `${errorCode}`,
1474
- message: parsedBody.message || parsedBody.Message || errorCode,
1081
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1082
+ name: parsedBody.code || parsedBody.Code || errorCode,
1475
1083
  $fault: "client",
1476
1084
  $metadata: deserializeMetadata(output),
1477
- };
1085
+ });
1086
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1478
1087
  }
1479
- const message = response.message || response.Message || errorCode;
1480
- response.message = message;
1481
- delete response.Message;
1482
- return Promise.reject(Object.assign(new Error(message), response));
1483
1088
  };
1484
1089
  const deserializeAws_json1_1GetMedicalTranscriptionJobCommand = async (output, context) => {
1485
1090
  if (output.statusCode >= 300) {
@@ -1506,51 +1111,25 @@ const deserializeAws_json1_1GetMedicalTranscriptionJobCommandError = async (outp
1506
1111
  switch (errorCode) {
1507
1112
  case "BadRequestException":
1508
1113
  case "com.amazonaws.transcribe#BadRequestException":
1509
- response = {
1510
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1511
- name: errorCode,
1512
- $metadata: deserializeMetadata(output),
1513
- };
1514
- break;
1114
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1515
1115
  case "InternalFailureException":
1516
1116
  case "com.amazonaws.transcribe#InternalFailureException":
1517
- response = {
1518
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1519
- name: errorCode,
1520
- $metadata: deserializeMetadata(output),
1521
- };
1522
- break;
1117
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1523
1118
  case "LimitExceededException":
1524
1119
  case "com.amazonaws.transcribe#LimitExceededException":
1525
- response = {
1526
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1527
- name: errorCode,
1528
- $metadata: deserializeMetadata(output),
1529
- };
1530
- break;
1120
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1531
1121
  case "NotFoundException":
1532
1122
  case "com.amazonaws.transcribe#NotFoundException":
1533
- response = {
1534
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1535
- name: errorCode,
1536
- $metadata: deserializeMetadata(output),
1537
- };
1538
- break;
1123
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1539
1124
  default:
1540
1125
  const parsedBody = parsedOutput.body;
1541
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1542
- response = {
1543
- ...parsedBody,
1544
- name: `${errorCode}`,
1545
- message: parsedBody.message || parsedBody.Message || errorCode,
1126
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1127
+ name: parsedBody.code || parsedBody.Code || errorCode,
1546
1128
  $fault: "client",
1547
1129
  $metadata: deserializeMetadata(output),
1548
- };
1130
+ });
1131
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1549
1132
  }
1550
- const message = response.message || response.Message || errorCode;
1551
- response.message = message;
1552
- delete response.Message;
1553
- return Promise.reject(Object.assign(new Error(message), response));
1554
1133
  };
1555
1134
  const deserializeAws_json1_1GetMedicalVocabularyCommand = async (output, context) => {
1556
1135
  if (output.statusCode >= 300) {
@@ -1577,51 +1156,25 @@ const deserializeAws_json1_1GetMedicalVocabularyCommandError = async (output, co
1577
1156
  switch (errorCode) {
1578
1157
  case "BadRequestException":
1579
1158
  case "com.amazonaws.transcribe#BadRequestException":
1580
- response = {
1581
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1582
- name: errorCode,
1583
- $metadata: deserializeMetadata(output),
1584
- };
1585
- break;
1159
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1586
1160
  case "InternalFailureException":
1587
1161
  case "com.amazonaws.transcribe#InternalFailureException":
1588
- response = {
1589
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1590
- name: errorCode,
1591
- $metadata: deserializeMetadata(output),
1592
- };
1593
- break;
1162
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1594
1163
  case "LimitExceededException":
1595
1164
  case "com.amazonaws.transcribe#LimitExceededException":
1596
- response = {
1597
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1598
- name: errorCode,
1599
- $metadata: deserializeMetadata(output),
1600
- };
1601
- break;
1165
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1602
1166
  case "NotFoundException":
1603
1167
  case "com.amazonaws.transcribe#NotFoundException":
1604
- response = {
1605
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1606
- name: errorCode,
1607
- $metadata: deserializeMetadata(output),
1608
- };
1609
- break;
1168
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1610
1169
  default:
1611
1170
  const parsedBody = parsedOutput.body;
1612
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1613
- response = {
1614
- ...parsedBody,
1615
- name: `${errorCode}`,
1616
- message: parsedBody.message || parsedBody.Message || errorCode,
1171
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1172
+ name: parsedBody.code || parsedBody.Code || errorCode,
1617
1173
  $fault: "client",
1618
1174
  $metadata: deserializeMetadata(output),
1619
- };
1175
+ });
1176
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1620
1177
  }
1621
- const message = response.message || response.Message || errorCode;
1622
- response.message = message;
1623
- delete response.Message;
1624
- return Promise.reject(Object.assign(new Error(message), response));
1625
1178
  };
1626
1179
  const deserializeAws_json1_1GetTranscriptionJobCommand = async (output, context) => {
1627
1180
  if (output.statusCode >= 300) {
@@ -1648,51 +1201,25 @@ const deserializeAws_json1_1GetTranscriptionJobCommandError = async (output, con
1648
1201
  switch (errorCode) {
1649
1202
  case "BadRequestException":
1650
1203
  case "com.amazonaws.transcribe#BadRequestException":
1651
- response = {
1652
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1653
- name: errorCode,
1654
- $metadata: deserializeMetadata(output),
1655
- };
1656
- break;
1204
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1657
1205
  case "InternalFailureException":
1658
1206
  case "com.amazonaws.transcribe#InternalFailureException":
1659
- response = {
1660
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1661
- name: errorCode,
1662
- $metadata: deserializeMetadata(output),
1663
- };
1664
- break;
1207
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1665
1208
  case "LimitExceededException":
1666
1209
  case "com.amazonaws.transcribe#LimitExceededException":
1667
- response = {
1668
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1669
- name: errorCode,
1670
- $metadata: deserializeMetadata(output),
1671
- };
1672
- break;
1210
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1673
1211
  case "NotFoundException":
1674
1212
  case "com.amazonaws.transcribe#NotFoundException":
1675
- response = {
1676
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1677
- name: errorCode,
1678
- $metadata: deserializeMetadata(output),
1679
- };
1680
- break;
1213
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1681
1214
  default:
1682
1215
  const parsedBody = parsedOutput.body;
1683
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1684
- response = {
1685
- ...parsedBody,
1686
- name: `${errorCode}`,
1687
- message: parsedBody.message || parsedBody.Message || errorCode,
1216
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1217
+ name: parsedBody.code || parsedBody.Code || errorCode,
1688
1218
  $fault: "client",
1689
1219
  $metadata: deserializeMetadata(output),
1690
- };
1220
+ });
1221
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1691
1222
  }
1692
- const message = response.message || response.Message || errorCode;
1693
- response.message = message;
1694
- delete response.Message;
1695
- return Promise.reject(Object.assign(new Error(message), response));
1696
1223
  };
1697
1224
  const deserializeAws_json1_1GetVocabularyCommand = async (output, context) => {
1698
1225
  if (output.statusCode >= 300) {
@@ -1719,51 +1246,25 @@ const deserializeAws_json1_1GetVocabularyCommandError = async (output, context)
1719
1246
  switch (errorCode) {
1720
1247
  case "BadRequestException":
1721
1248
  case "com.amazonaws.transcribe#BadRequestException":
1722
- response = {
1723
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1724
- name: errorCode,
1725
- $metadata: deserializeMetadata(output),
1726
- };
1727
- break;
1249
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1728
1250
  case "InternalFailureException":
1729
1251
  case "com.amazonaws.transcribe#InternalFailureException":
1730
- response = {
1731
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1732
- name: errorCode,
1733
- $metadata: deserializeMetadata(output),
1734
- };
1735
- break;
1252
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1736
1253
  case "LimitExceededException":
1737
1254
  case "com.amazonaws.transcribe#LimitExceededException":
1738
- response = {
1739
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1740
- name: errorCode,
1741
- $metadata: deserializeMetadata(output),
1742
- };
1743
- break;
1255
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1744
1256
  case "NotFoundException":
1745
1257
  case "com.amazonaws.transcribe#NotFoundException":
1746
- response = {
1747
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1748
- name: errorCode,
1749
- $metadata: deserializeMetadata(output),
1750
- };
1751
- break;
1258
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1752
1259
  default:
1753
1260
  const parsedBody = parsedOutput.body;
1754
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1755
- response = {
1756
- ...parsedBody,
1757
- name: `${errorCode}`,
1758
- message: parsedBody.message || parsedBody.Message || errorCode,
1261
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1262
+ name: parsedBody.code || parsedBody.Code || errorCode,
1759
1263
  $fault: "client",
1760
1264
  $metadata: deserializeMetadata(output),
1761
- };
1265
+ });
1266
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1762
1267
  }
1763
- const message = response.message || response.Message || errorCode;
1764
- response.message = message;
1765
- delete response.Message;
1766
- return Promise.reject(Object.assign(new Error(message), response));
1767
1268
  };
1768
1269
  const deserializeAws_json1_1GetVocabularyFilterCommand = async (output, context) => {
1769
1270
  if (output.statusCode >= 300) {
@@ -1790,51 +1291,25 @@ const deserializeAws_json1_1GetVocabularyFilterCommandError = async (output, con
1790
1291
  switch (errorCode) {
1791
1292
  case "BadRequestException":
1792
1293
  case "com.amazonaws.transcribe#BadRequestException":
1793
- response = {
1794
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1795
- name: errorCode,
1796
- $metadata: deserializeMetadata(output),
1797
- };
1798
- break;
1294
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1799
1295
  case "InternalFailureException":
1800
1296
  case "com.amazonaws.transcribe#InternalFailureException":
1801
- response = {
1802
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1803
- name: errorCode,
1804
- $metadata: deserializeMetadata(output),
1805
- };
1806
- break;
1297
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1807
1298
  case "LimitExceededException":
1808
1299
  case "com.amazonaws.transcribe#LimitExceededException":
1809
- response = {
1810
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1811
- name: errorCode,
1812
- $metadata: deserializeMetadata(output),
1813
- };
1814
- break;
1300
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1815
1301
  case "NotFoundException":
1816
1302
  case "com.amazonaws.transcribe#NotFoundException":
1817
- response = {
1818
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
1819
- name: errorCode,
1820
- $metadata: deserializeMetadata(output),
1821
- };
1822
- break;
1303
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1823
1304
  default:
1824
1305
  const parsedBody = parsedOutput.body;
1825
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1826
- response = {
1827
- ...parsedBody,
1828
- name: `${errorCode}`,
1829
- message: parsedBody.message || parsedBody.Message || errorCode,
1306
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1307
+ name: parsedBody.code || parsedBody.Code || errorCode,
1830
1308
  $fault: "client",
1831
1309
  $metadata: deserializeMetadata(output),
1832
- };
1310
+ });
1311
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1833
1312
  }
1834
- const message = response.message || response.Message || errorCode;
1835
- response.message = message;
1836
- delete response.Message;
1837
- return Promise.reject(Object.assign(new Error(message), response));
1838
1313
  };
1839
1314
  const deserializeAws_json1_1ListCallAnalyticsCategoriesCommand = async (output, context) => {
1840
1315
  if (output.statusCode >= 300) {
@@ -1861,43 +1336,22 @@ const deserializeAws_json1_1ListCallAnalyticsCategoriesCommandError = async (out
1861
1336
  switch (errorCode) {
1862
1337
  case "BadRequestException":
1863
1338
  case "com.amazonaws.transcribe#BadRequestException":
1864
- response = {
1865
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1866
- name: errorCode,
1867
- $metadata: deserializeMetadata(output),
1868
- };
1869
- break;
1339
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1870
1340
  case "InternalFailureException":
1871
1341
  case "com.amazonaws.transcribe#InternalFailureException":
1872
- response = {
1873
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1874
- name: errorCode,
1875
- $metadata: deserializeMetadata(output),
1876
- };
1877
- break;
1342
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1878
1343
  case "LimitExceededException":
1879
1344
  case "com.amazonaws.transcribe#LimitExceededException":
1880
- response = {
1881
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1882
- name: errorCode,
1883
- $metadata: deserializeMetadata(output),
1884
- };
1885
- break;
1345
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1886
1346
  default:
1887
1347
  const parsedBody = parsedOutput.body;
1888
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1889
- response = {
1890
- ...parsedBody,
1891
- name: `${errorCode}`,
1892
- message: parsedBody.message || parsedBody.Message || errorCode,
1348
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1349
+ name: parsedBody.code || parsedBody.Code || errorCode,
1893
1350
  $fault: "client",
1894
1351
  $metadata: deserializeMetadata(output),
1895
- };
1352
+ });
1353
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1896
1354
  }
1897
- const message = response.message || response.Message || errorCode;
1898
- response.message = message;
1899
- delete response.Message;
1900
- return Promise.reject(Object.assign(new Error(message), response));
1901
1355
  };
1902
1356
  const deserializeAws_json1_1ListCallAnalyticsJobsCommand = async (output, context) => {
1903
1357
  if (output.statusCode >= 300) {
@@ -1924,43 +1378,22 @@ const deserializeAws_json1_1ListCallAnalyticsJobsCommandError = async (output, c
1924
1378
  switch (errorCode) {
1925
1379
  case "BadRequestException":
1926
1380
  case "com.amazonaws.transcribe#BadRequestException":
1927
- response = {
1928
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1929
- name: errorCode,
1930
- $metadata: deserializeMetadata(output),
1931
- };
1932
- break;
1381
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1933
1382
  case "InternalFailureException":
1934
1383
  case "com.amazonaws.transcribe#InternalFailureException":
1935
- response = {
1936
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
1937
- name: errorCode,
1938
- $metadata: deserializeMetadata(output),
1939
- };
1940
- break;
1384
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
1941
1385
  case "LimitExceededException":
1942
1386
  case "com.amazonaws.transcribe#LimitExceededException":
1943
- response = {
1944
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1945
- name: errorCode,
1946
- $metadata: deserializeMetadata(output),
1947
- };
1948
- break;
1387
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1949
1388
  default:
1950
1389
  const parsedBody = parsedOutput.body;
1951
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1952
- response = {
1953
- ...parsedBody,
1954
- name: `${errorCode}`,
1955
- message: parsedBody.message || parsedBody.Message || errorCode,
1390
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1391
+ name: parsedBody.code || parsedBody.Code || errorCode,
1956
1392
  $fault: "client",
1957
1393
  $metadata: deserializeMetadata(output),
1958
- };
1394
+ });
1395
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1959
1396
  }
1960
- const message = response.message || response.Message || errorCode;
1961
- response.message = message;
1962
- delete response.Message;
1963
- return Promise.reject(Object.assign(new Error(message), response));
1964
1397
  };
1965
1398
  const deserializeAws_json1_1ListLanguageModelsCommand = async (output, context) => {
1966
1399
  if (output.statusCode >= 300) {
@@ -1987,43 +1420,22 @@ const deserializeAws_json1_1ListLanguageModelsCommandError = async (output, cont
1987
1420
  switch (errorCode) {
1988
1421
  case "BadRequestException":
1989
1422
  case "com.amazonaws.transcribe#BadRequestException":
1990
- response = {
1991
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
1992
- name: errorCode,
1993
- $metadata: deserializeMetadata(output),
1994
- };
1995
- break;
1423
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
1996
1424
  case "InternalFailureException":
1997
1425
  case "com.amazonaws.transcribe#InternalFailureException":
1998
- response = {
1999
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2000
- name: errorCode,
2001
- $metadata: deserializeMetadata(output),
2002
- };
2003
- break;
1426
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2004
1427
  case "LimitExceededException":
2005
1428
  case "com.amazonaws.transcribe#LimitExceededException":
2006
- response = {
2007
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2008
- name: errorCode,
2009
- $metadata: deserializeMetadata(output),
2010
- };
2011
- break;
1429
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2012
1430
  default:
2013
1431
  const parsedBody = parsedOutput.body;
2014
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2015
- response = {
2016
- ...parsedBody,
2017
- name: `${errorCode}`,
2018
- message: parsedBody.message || parsedBody.Message || errorCode,
1432
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1433
+ name: parsedBody.code || parsedBody.Code || errorCode,
2019
1434
  $fault: "client",
2020
1435
  $metadata: deserializeMetadata(output),
2021
- };
1436
+ });
1437
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2022
1438
  }
2023
- const message = response.message || response.Message || errorCode;
2024
- response.message = message;
2025
- delete response.Message;
2026
- return Promise.reject(Object.assign(new Error(message), response));
2027
1439
  };
2028
1440
  const deserializeAws_json1_1ListMedicalTranscriptionJobsCommand = async (output, context) => {
2029
1441
  if (output.statusCode >= 300) {
@@ -2050,43 +1462,22 @@ const deserializeAws_json1_1ListMedicalTranscriptionJobsCommandError = async (ou
2050
1462
  switch (errorCode) {
2051
1463
  case "BadRequestException":
2052
1464
  case "com.amazonaws.transcribe#BadRequestException":
2053
- response = {
2054
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2055
- name: errorCode,
2056
- $metadata: deserializeMetadata(output),
2057
- };
2058
- break;
1465
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2059
1466
  case "InternalFailureException":
2060
1467
  case "com.amazonaws.transcribe#InternalFailureException":
2061
- response = {
2062
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2063
- name: errorCode,
2064
- $metadata: deserializeMetadata(output),
2065
- };
2066
- break;
1468
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2067
1469
  case "LimitExceededException":
2068
1470
  case "com.amazonaws.transcribe#LimitExceededException":
2069
- response = {
2070
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2071
- name: errorCode,
2072
- $metadata: deserializeMetadata(output),
2073
- };
2074
- break;
1471
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2075
1472
  default:
2076
1473
  const parsedBody = parsedOutput.body;
2077
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2078
- response = {
2079
- ...parsedBody,
2080
- name: `${errorCode}`,
2081
- message: parsedBody.message || parsedBody.Message || errorCode,
1474
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1475
+ name: parsedBody.code || parsedBody.Code || errorCode,
2082
1476
  $fault: "client",
2083
1477
  $metadata: deserializeMetadata(output),
2084
- };
1478
+ });
1479
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2085
1480
  }
2086
- const message = response.message || response.Message || errorCode;
2087
- response.message = message;
2088
- delete response.Message;
2089
- return Promise.reject(Object.assign(new Error(message), response));
2090
1481
  };
2091
1482
  const deserializeAws_json1_1ListMedicalVocabulariesCommand = async (output, context) => {
2092
1483
  if (output.statusCode >= 300) {
@@ -2113,43 +1504,22 @@ const deserializeAws_json1_1ListMedicalVocabulariesCommandError = async (output,
2113
1504
  switch (errorCode) {
2114
1505
  case "BadRequestException":
2115
1506
  case "com.amazonaws.transcribe#BadRequestException":
2116
- response = {
2117
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2118
- name: errorCode,
2119
- $metadata: deserializeMetadata(output),
2120
- };
2121
- break;
1507
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2122
1508
  case "InternalFailureException":
2123
1509
  case "com.amazonaws.transcribe#InternalFailureException":
2124
- response = {
2125
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2126
- name: errorCode,
2127
- $metadata: deserializeMetadata(output),
2128
- };
2129
- break;
1510
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2130
1511
  case "LimitExceededException":
2131
1512
  case "com.amazonaws.transcribe#LimitExceededException":
2132
- response = {
2133
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2134
- name: errorCode,
2135
- $metadata: deserializeMetadata(output),
2136
- };
2137
- break;
1513
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2138
1514
  default:
2139
1515
  const parsedBody = parsedOutput.body;
2140
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2141
- response = {
2142
- ...parsedBody,
2143
- name: `${errorCode}`,
2144
- message: parsedBody.message || parsedBody.Message || errorCode,
1516
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1517
+ name: parsedBody.code || parsedBody.Code || errorCode,
2145
1518
  $fault: "client",
2146
1519
  $metadata: deserializeMetadata(output),
2147
- };
1520
+ });
1521
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2148
1522
  }
2149
- const message = response.message || response.Message || errorCode;
2150
- response.message = message;
2151
- delete response.Message;
2152
- return Promise.reject(Object.assign(new Error(message), response));
2153
1523
  };
2154
1524
  const deserializeAws_json1_1ListTagsForResourceCommand = async (output, context) => {
2155
1525
  if (output.statusCode >= 300) {
@@ -2176,51 +1546,25 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async (output, con
2176
1546
  switch (errorCode) {
2177
1547
  case "BadRequestException":
2178
1548
  case "com.amazonaws.transcribe#BadRequestException":
2179
- response = {
2180
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2181
- name: errorCode,
2182
- $metadata: deserializeMetadata(output),
2183
- };
2184
- break;
1549
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2185
1550
  case "InternalFailureException":
2186
1551
  case "com.amazonaws.transcribe#InternalFailureException":
2187
- response = {
2188
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2189
- name: errorCode,
2190
- $metadata: deserializeMetadata(output),
2191
- };
2192
- break;
1552
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2193
1553
  case "LimitExceededException":
2194
1554
  case "com.amazonaws.transcribe#LimitExceededException":
2195
- response = {
2196
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2197
- name: errorCode,
2198
- $metadata: deserializeMetadata(output),
2199
- };
2200
- break;
1555
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2201
1556
  case "NotFoundException":
2202
1557
  case "com.amazonaws.transcribe#NotFoundException":
2203
- response = {
2204
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
2205
- name: errorCode,
2206
- $metadata: deserializeMetadata(output),
2207
- };
2208
- break;
1558
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2209
1559
  default:
2210
1560
  const parsedBody = parsedOutput.body;
2211
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2212
- response = {
2213
- ...parsedBody,
2214
- name: `${errorCode}`,
2215
- message: parsedBody.message || parsedBody.Message || errorCode,
1561
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1562
+ name: parsedBody.code || parsedBody.Code || errorCode,
2216
1563
  $fault: "client",
2217
1564
  $metadata: deserializeMetadata(output),
2218
- };
1565
+ });
1566
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2219
1567
  }
2220
- const message = response.message || response.Message || errorCode;
2221
- response.message = message;
2222
- delete response.Message;
2223
- return Promise.reject(Object.assign(new Error(message), response));
2224
1568
  };
2225
1569
  const deserializeAws_json1_1ListTranscriptionJobsCommand = async (output, context) => {
2226
1570
  if (output.statusCode >= 300) {
@@ -2247,43 +1591,22 @@ const deserializeAws_json1_1ListTranscriptionJobsCommandError = async (output, c
2247
1591
  switch (errorCode) {
2248
1592
  case "BadRequestException":
2249
1593
  case "com.amazonaws.transcribe#BadRequestException":
2250
- response = {
2251
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2252
- name: errorCode,
2253
- $metadata: deserializeMetadata(output),
2254
- };
2255
- break;
1594
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2256
1595
  case "InternalFailureException":
2257
1596
  case "com.amazonaws.transcribe#InternalFailureException":
2258
- response = {
2259
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2260
- name: errorCode,
2261
- $metadata: deserializeMetadata(output),
2262
- };
2263
- break;
1597
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2264
1598
  case "LimitExceededException":
2265
1599
  case "com.amazonaws.transcribe#LimitExceededException":
2266
- response = {
2267
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2268
- name: errorCode,
2269
- $metadata: deserializeMetadata(output),
2270
- };
2271
- break;
1600
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2272
1601
  default:
2273
1602
  const parsedBody = parsedOutput.body;
2274
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2275
- response = {
2276
- ...parsedBody,
2277
- name: `${errorCode}`,
2278
- message: parsedBody.message || parsedBody.Message || errorCode,
1603
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1604
+ name: parsedBody.code || parsedBody.Code || errorCode,
2279
1605
  $fault: "client",
2280
1606
  $metadata: deserializeMetadata(output),
2281
- };
1607
+ });
1608
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2282
1609
  }
2283
- const message = response.message || response.Message || errorCode;
2284
- response.message = message;
2285
- delete response.Message;
2286
- return Promise.reject(Object.assign(new Error(message), response));
2287
1610
  };
2288
1611
  const deserializeAws_json1_1ListVocabulariesCommand = async (output, context) => {
2289
1612
  if (output.statusCode >= 300) {
@@ -2310,43 +1633,22 @@ const deserializeAws_json1_1ListVocabulariesCommandError = async (output, contex
2310
1633
  switch (errorCode) {
2311
1634
  case "BadRequestException":
2312
1635
  case "com.amazonaws.transcribe#BadRequestException":
2313
- response = {
2314
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2315
- name: errorCode,
2316
- $metadata: deserializeMetadata(output),
2317
- };
2318
- break;
1636
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2319
1637
  case "InternalFailureException":
2320
1638
  case "com.amazonaws.transcribe#InternalFailureException":
2321
- response = {
2322
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2323
- name: errorCode,
2324
- $metadata: deserializeMetadata(output),
2325
- };
2326
- break;
1639
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2327
1640
  case "LimitExceededException":
2328
1641
  case "com.amazonaws.transcribe#LimitExceededException":
2329
- response = {
2330
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2331
- name: errorCode,
2332
- $metadata: deserializeMetadata(output),
2333
- };
2334
- break;
1642
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2335
1643
  default:
2336
1644
  const parsedBody = parsedOutput.body;
2337
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2338
- response = {
2339
- ...parsedBody,
2340
- name: `${errorCode}`,
2341
- message: parsedBody.message || parsedBody.Message || errorCode,
1645
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1646
+ name: parsedBody.code || parsedBody.Code || errorCode,
2342
1647
  $fault: "client",
2343
1648
  $metadata: deserializeMetadata(output),
2344
- };
1649
+ });
1650
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2345
1651
  }
2346
- const message = response.message || response.Message || errorCode;
2347
- response.message = message;
2348
- delete response.Message;
2349
- return Promise.reject(Object.assign(new Error(message), response));
2350
1652
  };
2351
1653
  const deserializeAws_json1_1ListVocabularyFiltersCommand = async (output, context) => {
2352
1654
  if (output.statusCode >= 300) {
@@ -2373,43 +1675,22 @@ const deserializeAws_json1_1ListVocabularyFiltersCommandError = async (output, c
2373
1675
  switch (errorCode) {
2374
1676
  case "BadRequestException":
2375
1677
  case "com.amazonaws.transcribe#BadRequestException":
2376
- response = {
2377
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2378
- name: errorCode,
2379
- $metadata: deserializeMetadata(output),
2380
- };
2381
- break;
1678
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2382
1679
  case "InternalFailureException":
2383
1680
  case "com.amazonaws.transcribe#InternalFailureException":
2384
- response = {
2385
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2386
- name: errorCode,
2387
- $metadata: deserializeMetadata(output),
2388
- };
2389
- break;
1681
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2390
1682
  case "LimitExceededException":
2391
1683
  case "com.amazonaws.transcribe#LimitExceededException":
2392
- response = {
2393
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2394
- name: errorCode,
2395
- $metadata: deserializeMetadata(output),
2396
- };
2397
- break;
1684
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2398
1685
  default:
2399
1686
  const parsedBody = parsedOutput.body;
2400
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2401
- response = {
2402
- ...parsedBody,
2403
- name: `${errorCode}`,
2404
- message: parsedBody.message || parsedBody.Message || errorCode,
1687
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1688
+ name: parsedBody.code || parsedBody.Code || errorCode,
2405
1689
  $fault: "client",
2406
1690
  $metadata: deserializeMetadata(output),
2407
- };
1691
+ });
1692
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2408
1693
  }
2409
- const message = response.message || response.Message || errorCode;
2410
- response.message = message;
2411
- delete response.Message;
2412
- return Promise.reject(Object.assign(new Error(message), response));
2413
1694
  };
2414
1695
  const deserializeAws_json1_1StartCallAnalyticsJobCommand = async (output, context) => {
2415
1696
  if (output.statusCode >= 300) {
@@ -2436,51 +1717,25 @@ const deserializeAws_json1_1StartCallAnalyticsJobCommandError = async (output, c
2436
1717
  switch (errorCode) {
2437
1718
  case "BadRequestException":
2438
1719
  case "com.amazonaws.transcribe#BadRequestException":
2439
- response = {
2440
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2441
- name: errorCode,
2442
- $metadata: deserializeMetadata(output),
2443
- };
2444
- break;
1720
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2445
1721
  case "ConflictException":
2446
1722
  case "com.amazonaws.transcribe#ConflictException":
2447
- response = {
2448
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
2449
- name: errorCode,
2450
- $metadata: deserializeMetadata(output),
2451
- };
2452
- break;
1723
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
2453
1724
  case "InternalFailureException":
2454
1725
  case "com.amazonaws.transcribe#InternalFailureException":
2455
- response = {
2456
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2457
- name: errorCode,
2458
- $metadata: deserializeMetadata(output),
2459
- };
2460
- break;
1726
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2461
1727
  case "LimitExceededException":
2462
1728
  case "com.amazonaws.transcribe#LimitExceededException":
2463
- response = {
2464
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2465
- name: errorCode,
2466
- $metadata: deserializeMetadata(output),
2467
- };
2468
- break;
1729
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2469
1730
  default:
2470
1731
  const parsedBody = parsedOutput.body;
2471
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2472
- response = {
2473
- ...parsedBody,
2474
- name: `${errorCode}`,
2475
- message: parsedBody.message || parsedBody.Message || errorCode,
1732
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1733
+ name: parsedBody.code || parsedBody.Code || errorCode,
2476
1734
  $fault: "client",
2477
1735
  $metadata: deserializeMetadata(output),
2478
- };
1736
+ });
1737
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2479
1738
  }
2480
- const message = response.message || response.Message || errorCode;
2481
- response.message = message;
2482
- delete response.Message;
2483
- return Promise.reject(Object.assign(new Error(message), response));
2484
1739
  };
2485
1740
  const deserializeAws_json1_1StartMedicalTranscriptionJobCommand = async (output, context) => {
2486
1741
  if (output.statusCode >= 300) {
@@ -2507,51 +1762,25 @@ const deserializeAws_json1_1StartMedicalTranscriptionJobCommandError = async (ou
2507
1762
  switch (errorCode) {
2508
1763
  case "BadRequestException":
2509
1764
  case "com.amazonaws.transcribe#BadRequestException":
2510
- response = {
2511
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2512
- name: errorCode,
2513
- $metadata: deserializeMetadata(output),
2514
- };
2515
- break;
1765
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2516
1766
  case "ConflictException":
2517
1767
  case "com.amazonaws.transcribe#ConflictException":
2518
- response = {
2519
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
2520
- name: errorCode,
2521
- $metadata: deserializeMetadata(output),
2522
- };
2523
- break;
1768
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
2524
1769
  case "InternalFailureException":
2525
1770
  case "com.amazonaws.transcribe#InternalFailureException":
2526
- response = {
2527
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2528
- name: errorCode,
2529
- $metadata: deserializeMetadata(output),
2530
- };
2531
- break;
1771
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2532
1772
  case "LimitExceededException":
2533
1773
  case "com.amazonaws.transcribe#LimitExceededException":
2534
- response = {
2535
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2536
- name: errorCode,
2537
- $metadata: deserializeMetadata(output),
2538
- };
2539
- break;
1774
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2540
1775
  default:
2541
1776
  const parsedBody = parsedOutput.body;
2542
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2543
- response = {
2544
- ...parsedBody,
2545
- name: `${errorCode}`,
2546
- message: parsedBody.message || parsedBody.Message || errorCode,
1777
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1778
+ name: parsedBody.code || parsedBody.Code || errorCode,
2547
1779
  $fault: "client",
2548
1780
  $metadata: deserializeMetadata(output),
2549
- };
1781
+ });
1782
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2550
1783
  }
2551
- const message = response.message || response.Message || errorCode;
2552
- response.message = message;
2553
- delete response.Message;
2554
- return Promise.reject(Object.assign(new Error(message), response));
2555
1784
  };
2556
1785
  const deserializeAws_json1_1StartTranscriptionJobCommand = async (output, context) => {
2557
1786
  if (output.statusCode >= 300) {
@@ -2578,51 +1807,25 @@ const deserializeAws_json1_1StartTranscriptionJobCommandError = async (output, c
2578
1807
  switch (errorCode) {
2579
1808
  case "BadRequestException":
2580
1809
  case "com.amazonaws.transcribe#BadRequestException":
2581
- response = {
2582
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2583
- name: errorCode,
2584
- $metadata: deserializeMetadata(output),
2585
- };
2586
- break;
1810
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2587
1811
  case "ConflictException":
2588
1812
  case "com.amazonaws.transcribe#ConflictException":
2589
- response = {
2590
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
2591
- name: errorCode,
2592
- $metadata: deserializeMetadata(output),
2593
- };
2594
- break;
1813
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
2595
1814
  case "InternalFailureException":
2596
1815
  case "com.amazonaws.transcribe#InternalFailureException":
2597
- response = {
2598
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2599
- name: errorCode,
2600
- $metadata: deserializeMetadata(output),
2601
- };
2602
- break;
1816
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2603
1817
  case "LimitExceededException":
2604
1818
  case "com.amazonaws.transcribe#LimitExceededException":
2605
- response = {
2606
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2607
- name: errorCode,
2608
- $metadata: deserializeMetadata(output),
2609
- };
2610
- break;
1819
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2611
1820
  default:
2612
1821
  const parsedBody = parsedOutput.body;
2613
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2614
- response = {
2615
- ...parsedBody,
2616
- name: `${errorCode}`,
2617
- message: parsedBody.message || parsedBody.Message || errorCode,
1822
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1823
+ name: parsedBody.code || parsedBody.Code || errorCode,
2618
1824
  $fault: "client",
2619
1825
  $metadata: deserializeMetadata(output),
2620
- };
1826
+ });
1827
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2621
1828
  }
2622
- const message = response.message || response.Message || errorCode;
2623
- response.message = message;
2624
- delete response.Message;
2625
- return Promise.reject(Object.assign(new Error(message), response));
2626
1829
  };
2627
1830
  const deserializeAws_json1_1TagResourceCommand = async (output, context) => {
2628
1831
  if (output.statusCode >= 300) {
@@ -2649,59 +1852,28 @@ const deserializeAws_json1_1TagResourceCommandError = async (output, context) =>
2649
1852
  switch (errorCode) {
2650
1853
  case "BadRequestException":
2651
1854
  case "com.amazonaws.transcribe#BadRequestException":
2652
- response = {
2653
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2654
- name: errorCode,
2655
- $metadata: deserializeMetadata(output),
2656
- };
2657
- break;
1855
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2658
1856
  case "ConflictException":
2659
1857
  case "com.amazonaws.transcribe#ConflictException":
2660
- response = {
2661
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
2662
- name: errorCode,
2663
- $metadata: deserializeMetadata(output),
2664
- };
2665
- break;
1858
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
2666
1859
  case "InternalFailureException":
2667
1860
  case "com.amazonaws.transcribe#InternalFailureException":
2668
- response = {
2669
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2670
- name: errorCode,
2671
- $metadata: deserializeMetadata(output),
2672
- };
2673
- break;
1861
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2674
1862
  case "LimitExceededException":
2675
1863
  case "com.amazonaws.transcribe#LimitExceededException":
2676
- response = {
2677
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2678
- name: errorCode,
2679
- $metadata: deserializeMetadata(output),
2680
- };
2681
- break;
1864
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2682
1865
  case "NotFoundException":
2683
1866
  case "com.amazonaws.transcribe#NotFoundException":
2684
- response = {
2685
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
2686
- name: errorCode,
2687
- $metadata: deserializeMetadata(output),
2688
- };
2689
- break;
1867
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2690
1868
  default:
2691
1869
  const parsedBody = parsedOutput.body;
2692
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2693
- response = {
2694
- ...parsedBody,
2695
- name: `${errorCode}`,
2696
- message: parsedBody.message || parsedBody.Message || errorCode,
1870
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1871
+ name: parsedBody.code || parsedBody.Code || errorCode,
2697
1872
  $fault: "client",
2698
1873
  $metadata: deserializeMetadata(output),
2699
- };
1874
+ });
1875
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2700
1876
  }
2701
- const message = response.message || response.Message || errorCode;
2702
- response.message = message;
2703
- delete response.Message;
2704
- return Promise.reject(Object.assign(new Error(message), response));
2705
1877
  };
2706
1878
  const deserializeAws_json1_1UntagResourceCommand = async (output, context) => {
2707
1879
  if (output.statusCode >= 300) {
@@ -2728,59 +1900,28 @@ const deserializeAws_json1_1UntagResourceCommandError = async (output, context)
2728
1900
  switch (errorCode) {
2729
1901
  case "BadRequestException":
2730
1902
  case "com.amazonaws.transcribe#BadRequestException":
2731
- response = {
2732
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2733
- name: errorCode,
2734
- $metadata: deserializeMetadata(output),
2735
- };
2736
- break;
1903
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2737
1904
  case "ConflictException":
2738
1905
  case "com.amazonaws.transcribe#ConflictException":
2739
- response = {
2740
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
2741
- name: errorCode,
2742
- $metadata: deserializeMetadata(output),
2743
- };
2744
- break;
1906
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
2745
1907
  case "InternalFailureException":
2746
1908
  case "com.amazonaws.transcribe#InternalFailureException":
2747
- response = {
2748
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2749
- name: errorCode,
2750
- $metadata: deserializeMetadata(output),
2751
- };
2752
- break;
1909
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2753
1910
  case "LimitExceededException":
2754
1911
  case "com.amazonaws.transcribe#LimitExceededException":
2755
- response = {
2756
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2757
- name: errorCode,
2758
- $metadata: deserializeMetadata(output),
2759
- };
2760
- break;
1912
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2761
1913
  case "NotFoundException":
2762
1914
  case "com.amazonaws.transcribe#NotFoundException":
2763
- response = {
2764
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
2765
- name: errorCode,
2766
- $metadata: deserializeMetadata(output),
2767
- };
2768
- break;
1915
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2769
1916
  default:
2770
1917
  const parsedBody = parsedOutput.body;
2771
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2772
- response = {
2773
- ...parsedBody,
2774
- name: `${errorCode}`,
2775
- message: parsedBody.message || parsedBody.Message || errorCode,
1918
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1919
+ name: parsedBody.code || parsedBody.Code || errorCode,
2776
1920
  $fault: "client",
2777
1921
  $metadata: deserializeMetadata(output),
2778
- };
1922
+ });
1923
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2779
1924
  }
2780
- const message = response.message || response.Message || errorCode;
2781
- response.message = message;
2782
- delete response.Message;
2783
- return Promise.reject(Object.assign(new Error(message), response));
2784
1925
  };
2785
1926
  const deserializeAws_json1_1UpdateCallAnalyticsCategoryCommand = async (output, context) => {
2786
1927
  if (output.statusCode >= 300) {
@@ -2807,59 +1948,28 @@ const deserializeAws_json1_1UpdateCallAnalyticsCategoryCommandError = async (out
2807
1948
  switch (errorCode) {
2808
1949
  case "BadRequestException":
2809
1950
  case "com.amazonaws.transcribe#BadRequestException":
2810
- response = {
2811
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2812
- name: errorCode,
2813
- $metadata: deserializeMetadata(output),
2814
- };
2815
- break;
1951
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2816
1952
  case "ConflictException":
2817
1953
  case "com.amazonaws.transcribe#ConflictException":
2818
- response = {
2819
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
2820
- name: errorCode,
2821
- $metadata: deserializeMetadata(output),
2822
- };
2823
- break;
1954
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
2824
1955
  case "InternalFailureException":
2825
1956
  case "com.amazonaws.transcribe#InternalFailureException":
2826
- response = {
2827
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2828
- name: errorCode,
2829
- $metadata: deserializeMetadata(output),
2830
- };
2831
- break;
1957
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2832
1958
  case "LimitExceededException":
2833
1959
  case "com.amazonaws.transcribe#LimitExceededException":
2834
- response = {
2835
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2836
- name: errorCode,
2837
- $metadata: deserializeMetadata(output),
2838
- };
2839
- break;
1960
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2840
1961
  case "NotFoundException":
2841
1962
  case "com.amazonaws.transcribe#NotFoundException":
2842
- response = {
2843
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
2844
- name: errorCode,
2845
- $metadata: deserializeMetadata(output),
2846
- };
2847
- break;
1963
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2848
1964
  default:
2849
1965
  const parsedBody = parsedOutput.body;
2850
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2851
- response = {
2852
- ...parsedBody,
2853
- name: `${errorCode}`,
2854
- message: parsedBody.message || parsedBody.Message || errorCode,
1966
+ response = new TranscribeServiceException_1.TranscribeServiceException({
1967
+ name: parsedBody.code || parsedBody.Code || errorCode,
2855
1968
  $fault: "client",
2856
1969
  $metadata: deserializeMetadata(output),
2857
- };
1970
+ });
1971
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2858
1972
  }
2859
- const message = response.message || response.Message || errorCode;
2860
- response.message = message;
2861
- delete response.Message;
2862
- return Promise.reject(Object.assign(new Error(message), response));
2863
1973
  };
2864
1974
  const deserializeAws_json1_1UpdateMedicalVocabularyCommand = async (output, context) => {
2865
1975
  if (output.statusCode >= 300) {
@@ -2886,59 +1996,28 @@ const deserializeAws_json1_1UpdateMedicalVocabularyCommandError = async (output,
2886
1996
  switch (errorCode) {
2887
1997
  case "BadRequestException":
2888
1998
  case "com.amazonaws.transcribe#BadRequestException":
2889
- response = {
2890
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2891
- name: errorCode,
2892
- $metadata: deserializeMetadata(output),
2893
- };
2894
- break;
1999
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2895
2000
  case "ConflictException":
2896
2001
  case "com.amazonaws.transcribe#ConflictException":
2897
- response = {
2898
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
2899
- name: errorCode,
2900
- $metadata: deserializeMetadata(output),
2901
- };
2902
- break;
2002
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
2903
2003
  case "InternalFailureException":
2904
2004
  case "com.amazonaws.transcribe#InternalFailureException":
2905
- response = {
2906
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2907
- name: errorCode,
2908
- $metadata: deserializeMetadata(output),
2909
- };
2910
- break;
2005
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2911
2006
  case "LimitExceededException":
2912
2007
  case "com.amazonaws.transcribe#LimitExceededException":
2913
- response = {
2914
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2915
- name: errorCode,
2916
- $metadata: deserializeMetadata(output),
2917
- };
2918
- break;
2008
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2919
2009
  case "NotFoundException":
2920
2010
  case "com.amazonaws.transcribe#NotFoundException":
2921
- response = {
2922
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
2923
- name: errorCode,
2924
- $metadata: deserializeMetadata(output),
2925
- };
2926
- break;
2011
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
2927
2012
  default:
2928
2013
  const parsedBody = parsedOutput.body;
2929
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2930
- response = {
2931
- ...parsedBody,
2932
- name: `${errorCode}`,
2933
- message: parsedBody.message || parsedBody.Message || errorCode,
2014
+ response = new TranscribeServiceException_1.TranscribeServiceException({
2015
+ name: parsedBody.code || parsedBody.Code || errorCode,
2934
2016
  $fault: "client",
2935
2017
  $metadata: deserializeMetadata(output),
2936
- };
2018
+ });
2019
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2937
2020
  }
2938
- const message = response.message || response.Message || errorCode;
2939
- response.message = message;
2940
- delete response.Message;
2941
- return Promise.reject(Object.assign(new Error(message), response));
2942
2021
  };
2943
2022
  const deserializeAws_json1_1UpdateVocabularyCommand = async (output, context) => {
2944
2023
  if (output.statusCode >= 300) {
@@ -2965,59 +2044,28 @@ const deserializeAws_json1_1UpdateVocabularyCommandError = async (output, contex
2965
2044
  switch (errorCode) {
2966
2045
  case "BadRequestException":
2967
2046
  case "com.amazonaws.transcribe#BadRequestException":
2968
- response = {
2969
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
2970
- name: errorCode,
2971
- $metadata: deserializeMetadata(output),
2972
- };
2973
- break;
2047
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
2974
2048
  case "ConflictException":
2975
2049
  case "com.amazonaws.transcribe#ConflictException":
2976
- response = {
2977
- ...(await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context)),
2978
- name: errorCode,
2979
- $metadata: deserializeMetadata(output),
2980
- };
2981
- break;
2050
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
2982
2051
  case "InternalFailureException":
2983
2052
  case "com.amazonaws.transcribe#InternalFailureException":
2984
- response = {
2985
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
2986
- name: errorCode,
2987
- $metadata: deserializeMetadata(output),
2988
- };
2989
- break;
2053
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
2990
2054
  case "LimitExceededException":
2991
2055
  case "com.amazonaws.transcribe#LimitExceededException":
2992
- response = {
2993
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2994
- name: errorCode,
2995
- $metadata: deserializeMetadata(output),
2996
- };
2997
- break;
2056
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2998
2057
  case "NotFoundException":
2999
2058
  case "com.amazonaws.transcribe#NotFoundException":
3000
- response = {
3001
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
3002
- name: errorCode,
3003
- $metadata: deserializeMetadata(output),
3004
- };
3005
- break;
2059
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
3006
2060
  default:
3007
2061
  const parsedBody = parsedOutput.body;
3008
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3009
- response = {
3010
- ...parsedBody,
3011
- name: `${errorCode}`,
3012
- message: parsedBody.message || parsedBody.Message || errorCode,
2062
+ response = new TranscribeServiceException_1.TranscribeServiceException({
2063
+ name: parsedBody.code || parsedBody.Code || errorCode,
3013
2064
  $fault: "client",
3014
2065
  $metadata: deserializeMetadata(output),
3015
- };
2066
+ });
2067
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3016
2068
  }
3017
- const message = response.message || response.Message || errorCode;
3018
- response.message = message;
3019
- delete response.Message;
3020
- return Promise.reject(Object.assign(new Error(message), response));
3021
2069
  };
3022
2070
  const deserializeAws_json1_1UpdateVocabularyFilterCommand = async (output, context) => {
3023
2071
  if (output.statusCode >= 300) {
@@ -3044,106 +2092,70 @@ const deserializeAws_json1_1UpdateVocabularyFilterCommandError = async (output,
3044
2092
  switch (errorCode) {
3045
2093
  case "BadRequestException":
3046
2094
  case "com.amazonaws.transcribe#BadRequestException":
3047
- response = {
3048
- ...(await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context)),
3049
- name: errorCode,
3050
- $metadata: deserializeMetadata(output),
3051
- };
3052
- break;
2095
+ throw await deserializeAws_json1_1BadRequestExceptionResponse(parsedOutput, context);
3053
2096
  case "InternalFailureException":
3054
2097
  case "com.amazonaws.transcribe#InternalFailureException":
3055
- response = {
3056
- ...(await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context)),
3057
- name: errorCode,
3058
- $metadata: deserializeMetadata(output),
3059
- };
3060
- break;
2098
+ throw await deserializeAws_json1_1InternalFailureExceptionResponse(parsedOutput, context);
3061
2099
  case "LimitExceededException":
3062
2100
  case "com.amazonaws.transcribe#LimitExceededException":
3063
- response = {
3064
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
3065
- name: errorCode,
3066
- $metadata: deserializeMetadata(output),
3067
- };
3068
- break;
2101
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
3069
2102
  case "NotFoundException":
3070
2103
  case "com.amazonaws.transcribe#NotFoundException":
3071
- response = {
3072
- ...(await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context)),
3073
- name: errorCode,
3074
- $metadata: deserializeMetadata(output),
3075
- };
3076
- break;
2104
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
3077
2105
  default:
3078
2106
  const parsedBody = parsedOutput.body;
3079
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3080
- response = {
3081
- ...parsedBody,
3082
- name: `${errorCode}`,
3083
- message: parsedBody.message || parsedBody.Message || errorCode,
2107
+ response = new TranscribeServiceException_1.TranscribeServiceException({
2108
+ name: parsedBody.code || parsedBody.Code || errorCode,
3084
2109
  $fault: "client",
3085
2110
  $metadata: deserializeMetadata(output),
3086
- };
2111
+ });
2112
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3087
2113
  }
3088
- const message = response.message || response.Message || errorCode;
3089
- response.message = message;
3090
- delete response.Message;
3091
- return Promise.reject(Object.assign(new Error(message), response));
3092
2114
  };
3093
2115
  const deserializeAws_json1_1BadRequestExceptionResponse = async (parsedOutput, context) => {
3094
2116
  const body = parsedOutput.body;
3095
2117
  const deserialized = deserializeAws_json1_1BadRequestException(body, context);
3096
- const contents = {
3097
- name: "BadRequestException",
3098
- $fault: "client",
2118
+ const exception = new models_0_1.BadRequestException({
3099
2119
  $metadata: deserializeMetadata(parsedOutput),
3100
2120
  ...deserialized,
3101
- };
3102
- return contents;
2121
+ });
2122
+ return smithy_client_1.decorateServiceException(exception, body);
3103
2123
  };
3104
2124
  const deserializeAws_json1_1ConflictExceptionResponse = async (parsedOutput, context) => {
3105
2125
  const body = parsedOutput.body;
3106
2126
  const deserialized = deserializeAws_json1_1ConflictException(body, context);
3107
- const contents = {
3108
- name: "ConflictException",
3109
- $fault: "client",
2127
+ const exception = new models_0_1.ConflictException({
3110
2128
  $metadata: deserializeMetadata(parsedOutput),
3111
2129
  ...deserialized,
3112
- };
3113
- return contents;
2130
+ });
2131
+ return smithy_client_1.decorateServiceException(exception, body);
3114
2132
  };
3115
2133
  const deserializeAws_json1_1InternalFailureExceptionResponse = async (parsedOutput, context) => {
3116
2134
  const body = parsedOutput.body;
3117
2135
  const deserialized = deserializeAws_json1_1InternalFailureException(body, context);
3118
- const contents = {
3119
- name: "InternalFailureException",
3120
- $fault: "server",
2136
+ const exception = new models_0_1.InternalFailureException({
3121
2137
  $metadata: deserializeMetadata(parsedOutput),
3122
2138
  ...deserialized,
3123
- };
3124
- return contents;
2139
+ });
2140
+ return smithy_client_1.decorateServiceException(exception, body);
3125
2141
  };
3126
2142
  const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
3127
2143
  const body = parsedOutput.body;
3128
2144
  const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
3129
- const contents = {
3130
- name: "LimitExceededException",
3131
- $fault: "client",
2145
+ const exception = new models_0_1.LimitExceededException({
3132
2146
  $metadata: deserializeMetadata(parsedOutput),
3133
2147
  ...deserialized,
3134
- };
3135
- return contents;
2148
+ });
2149
+ return smithy_client_1.decorateServiceException(exception, body);
3136
2150
  };
3137
2151
  const deserializeAws_json1_1NotFoundExceptionResponse = async (parsedOutput, context) => {
3138
2152
  const body = parsedOutput.body;
3139
2153
  const deserialized = deserializeAws_json1_1NotFoundException(body, context);
3140
- const contents = {
3141
- name: "NotFoundException",
3142
- $fault: "client",
2154
+ const exception = new models_0_1.NotFoundException({
3143
2155
  $metadata: deserializeMetadata(parsedOutput),
3144
2156
  ...deserialized,
3145
- };
3146
- return contents;
2157
+ });
2158
+ return smithy_client_1.decorateServiceException(exception, body);
3147
2159
  };
3148
2160
  const serializeAws_json1_1AbsoluteTimeRange = (input, context) => {
3149
2161
  return {
@@ -3925,7 +2937,7 @@ const deserializeAws_json1_1CallAnalyticsJobSettings = (output, context) => {
3925
2937
  };
3926
2938
  };
3927
2939
  const deserializeAws_json1_1CallAnalyticsJobSummaries = (output, context) => {
3928
- return (output || [])
2940
+ const retVal = (output || [])
3929
2941
  .filter((e) => e != null)
3930
2942
  .map((entry) => {
3931
2943
  if (entry === null) {
@@ -3933,6 +2945,7 @@ const deserializeAws_json1_1CallAnalyticsJobSummaries = (output, context) => {
3933
2945
  }
3934
2946
  return deserializeAws_json1_1CallAnalyticsJobSummary(entry, context);
3935
2947
  });
2948
+ return retVal;
3936
2949
  };
3937
2950
  const deserializeAws_json1_1CallAnalyticsJobSummary = (output, context) => {
3938
2951
  return {
@@ -3966,7 +2979,7 @@ const deserializeAws_json1_1CategoryProperties = (output, context) => {
3966
2979
  };
3967
2980
  };
3968
2981
  const deserializeAws_json1_1CategoryPropertiesList = (output, context) => {
3969
- return (output || [])
2982
+ const retVal = (output || [])
3970
2983
  .filter((e) => e != null)
3971
2984
  .map((entry) => {
3972
2985
  if (entry === null) {
@@ -3974,6 +2987,7 @@ const deserializeAws_json1_1CategoryPropertiesList = (output, context) => {
3974
2987
  }
3975
2988
  return deserializeAws_json1_1CategoryProperties(entry, context);
3976
2989
  });
2990
+ return retVal;
3977
2991
  };
3978
2992
  const deserializeAws_json1_1ChannelDefinition = (output, context) => {
3979
2993
  return {
@@ -3982,7 +2996,7 @@ const deserializeAws_json1_1ChannelDefinition = (output, context) => {
3982
2996
  };
3983
2997
  };
3984
2998
  const deserializeAws_json1_1ChannelDefinitions = (output, context) => {
3985
- return (output || [])
2999
+ const retVal = (output || [])
3986
3000
  .filter((e) => e != null)
3987
3001
  .map((entry) => {
3988
3002
  if (entry === null) {
@@ -3990,6 +3004,7 @@ const deserializeAws_json1_1ChannelDefinitions = (output, context) => {
3990
3004
  }
3991
3005
  return deserializeAws_json1_1ChannelDefinition(entry, context);
3992
3006
  });
3007
+ return retVal;
3993
3008
  };
3994
3009
  const deserializeAws_json1_1ConflictException = (output, context) => {
3995
3010
  return {
@@ -4198,7 +3213,7 @@ const deserializeAws_json1_1LanguageModel = (output, context) => {
4198
3213
  };
4199
3214
  };
4200
3215
  const deserializeAws_json1_1LanguageOptions = (output, context) => {
4201
- return (output || [])
3216
+ const retVal = (output || [])
4202
3217
  .filter((e) => e != null)
4203
3218
  .map((entry) => {
4204
3219
  if (entry === null) {
@@ -4206,6 +3221,7 @@ const deserializeAws_json1_1LanguageOptions = (output, context) => {
4206
3221
  }
4207
3222
  return smithy_client_1.expectString(entry);
4208
3223
  });
3224
+ return retVal;
4209
3225
  };
4210
3226
  const deserializeAws_json1_1LimitExceededException = (output, context) => {
4211
3227
  return {
@@ -4335,7 +3351,7 @@ const deserializeAws_json1_1MedicalTranscriptionJob = (output, context) => {
4335
3351
  };
4336
3352
  };
4337
3353
  const deserializeAws_json1_1MedicalTranscriptionJobSummaries = (output, context) => {
4338
- return (output || [])
3354
+ const retVal = (output || [])
4339
3355
  .filter((e) => e != null)
4340
3356
  .map((entry) => {
4341
3357
  if (entry === null) {
@@ -4343,6 +3359,7 @@ const deserializeAws_json1_1MedicalTranscriptionJobSummaries = (output, context)
4343
3359
  }
4344
3360
  return deserializeAws_json1_1MedicalTranscriptionJobSummary(entry, context);
4345
3361
  });
3362
+ return retVal;
4346
3363
  };
4347
3364
  const deserializeAws_json1_1MedicalTranscriptionJobSummary = (output, context) => {
4348
3365
  return {
@@ -4376,7 +3393,7 @@ const deserializeAws_json1_1MedicalTranscriptionSetting = (output, context) => {
4376
3393
  };
4377
3394
  };
4378
3395
  const deserializeAws_json1_1Models = (output, context) => {
4379
- return (output || [])
3396
+ const retVal = (output || [])
4380
3397
  .filter((e) => e != null)
4381
3398
  .map((entry) => {
4382
3399
  if (entry === null) {
@@ -4384,6 +3401,7 @@ const deserializeAws_json1_1Models = (output, context) => {
4384
3401
  }
4385
3402
  return deserializeAws_json1_1LanguageModel(entry, context);
4386
3403
  });
3404
+ return retVal;
4387
3405
  };
4388
3406
  const deserializeAws_json1_1ModelSettings = (output, context) => {
4389
3407
  return {
@@ -4408,7 +3426,7 @@ const deserializeAws_json1_1NotFoundException = (output, context) => {
4408
3426
  };
4409
3427
  };
4410
3428
  const deserializeAws_json1_1PiiEntityTypes = (output, context) => {
4411
- return (output || [])
3429
+ const retVal = (output || [])
4412
3430
  .filter((e) => e != null)
4413
3431
  .map((entry) => {
4414
3432
  if (entry === null) {
@@ -4416,6 +3434,7 @@ const deserializeAws_json1_1PiiEntityTypes = (output, context) => {
4416
3434
  }
4417
3435
  return smithy_client_1.expectString(entry);
4418
3436
  });
3437
+ return retVal;
4419
3438
  };
4420
3439
  const deserializeAws_json1_1RelativeTimeRange = (output, context) => {
4421
3440
  return {
@@ -4449,7 +3468,7 @@ const deserializeAws_json1_1Rule = (output, context) => {
4449
3468
  return { $unknown: Object.entries(output)[0] };
4450
3469
  };
4451
3470
  const deserializeAws_json1_1RuleList = (output, context) => {
4452
- return (output || [])
3471
+ const retVal = (output || [])
4453
3472
  .filter((e) => e != null)
4454
3473
  .map((entry) => {
4455
3474
  if (entry === null) {
@@ -4457,6 +3476,7 @@ const deserializeAws_json1_1RuleList = (output, context) => {
4457
3476
  }
4458
3477
  return deserializeAws_json1_1Rule(smithy_client_1.expectUnion(entry), context);
4459
3478
  });
3479
+ return retVal;
4460
3480
  };
4461
3481
  const deserializeAws_json1_1SentimentFilter = (output, context) => {
4462
3482
  return {
@@ -4474,7 +3494,7 @@ const deserializeAws_json1_1SentimentFilter = (output, context) => {
4474
3494
  };
4475
3495
  };
4476
3496
  const deserializeAws_json1_1SentimentValueList = (output, context) => {
4477
- return (output || [])
3497
+ const retVal = (output || [])
4478
3498
  .filter((e) => e != null)
4479
3499
  .map((entry) => {
4480
3500
  if (entry === null) {
@@ -4482,6 +3502,7 @@ const deserializeAws_json1_1SentimentValueList = (output, context) => {
4482
3502
  }
4483
3503
  return smithy_client_1.expectString(entry);
4484
3504
  });
3505
+ return retVal;
4485
3506
  };
4486
3507
  const deserializeAws_json1_1Settings = (output, context) => {
4487
3508
  return {
@@ -4517,7 +3538,7 @@ const deserializeAws_json1_1StartTranscriptionJobResponse = (output, context) =>
4517
3538
  };
4518
3539
  };
4519
3540
  const deserializeAws_json1_1StringTargetList = (output, context) => {
4520
- return (output || [])
3541
+ const retVal = (output || [])
4521
3542
  .filter((e) => e != null)
4522
3543
  .map((entry) => {
4523
3544
  if (entry === null) {
@@ -4525,9 +3546,10 @@ const deserializeAws_json1_1StringTargetList = (output, context) => {
4525
3546
  }
4526
3547
  return smithy_client_1.expectString(entry);
4527
3548
  });
3549
+ return retVal;
4528
3550
  };
4529
3551
  const deserializeAws_json1_1SubtitleFileUris = (output, context) => {
4530
- return (output || [])
3552
+ const retVal = (output || [])
4531
3553
  .filter((e) => e != null)
4532
3554
  .map((entry) => {
4533
3555
  if (entry === null) {
@@ -4535,9 +3557,10 @@ const deserializeAws_json1_1SubtitleFileUris = (output, context) => {
4535
3557
  }
4536
3558
  return smithy_client_1.expectString(entry);
4537
3559
  });
3560
+ return retVal;
4538
3561
  };
4539
3562
  const deserializeAws_json1_1SubtitleFormats = (output, context) => {
4540
- return (output || [])
3563
+ const retVal = (output || [])
4541
3564
  .filter((e) => e != null)
4542
3565
  .map((entry) => {
4543
3566
  if (entry === null) {
@@ -4545,6 +3568,7 @@ const deserializeAws_json1_1SubtitleFormats = (output, context) => {
4545
3568
  }
4546
3569
  return smithy_client_1.expectString(entry);
4547
3570
  });
3571
+ return retVal;
4548
3572
  };
4549
3573
  const deserializeAws_json1_1SubtitlesOutput = (output, context) => {
4550
3574
  return {
@@ -4563,7 +3587,7 @@ const deserializeAws_json1_1Tag = (output, context) => {
4563
3587
  };
4564
3588
  };
4565
3589
  const deserializeAws_json1_1TagList = (output, context) => {
4566
- return (output || [])
3590
+ const retVal = (output || [])
4567
3591
  .filter((e) => e != null)
4568
3592
  .map((entry) => {
4569
3593
  if (entry === null) {
@@ -4571,6 +3595,7 @@ const deserializeAws_json1_1TagList = (output, context) => {
4571
3595
  }
4572
3596
  return deserializeAws_json1_1Tag(entry, context);
4573
3597
  });
3598
+ return retVal;
4574
3599
  };
4575
3600
  const deserializeAws_json1_1TagResourceResponse = (output, context) => {
4576
3601
  return {};
@@ -4649,7 +3674,7 @@ const deserializeAws_json1_1TranscriptionJob = (output, context) => {
4649
3674
  };
4650
3675
  };
4651
3676
  const deserializeAws_json1_1TranscriptionJobSummaries = (output, context) => {
4652
- return (output || [])
3677
+ const retVal = (output || [])
4653
3678
  .filter((e) => e != null)
4654
3679
  .map((entry) => {
4655
3680
  if (entry === null) {
@@ -4657,6 +3682,7 @@ const deserializeAws_json1_1TranscriptionJobSummaries = (output, context) => {
4657
3682
  }
4658
3683
  return deserializeAws_json1_1TranscriptionJobSummary(entry, context);
4659
3684
  });
3685
+ return retVal;
4660
3686
  };
4661
3687
  const deserializeAws_json1_1TranscriptionJobSummary = (output, context) => {
4662
3688
  return {
@@ -4724,7 +3750,7 @@ const deserializeAws_json1_1UpdateVocabularyResponse = (output, context) => {
4724
3750
  };
4725
3751
  };
4726
3752
  const deserializeAws_json1_1Vocabularies = (output, context) => {
4727
- return (output || [])
3753
+ const retVal = (output || [])
4728
3754
  .filter((e) => e != null)
4729
3755
  .map((entry) => {
4730
3756
  if (entry === null) {
@@ -4732,6 +3758,7 @@ const deserializeAws_json1_1Vocabularies = (output, context) => {
4732
3758
  }
4733
3759
  return deserializeAws_json1_1VocabularyInfo(entry, context);
4734
3760
  });
3761
+ return retVal;
4735
3762
  };
4736
3763
  const deserializeAws_json1_1VocabularyFilterInfo = (output, context) => {
4737
3764
  return {
@@ -4743,7 +3770,7 @@ const deserializeAws_json1_1VocabularyFilterInfo = (output, context) => {
4743
3770
  };
4744
3771
  };
4745
3772
  const deserializeAws_json1_1VocabularyFilters = (output, context) => {
4746
- return (output || [])
3773
+ const retVal = (output || [])
4747
3774
  .filter((e) => e != null)
4748
3775
  .map((entry) => {
4749
3776
  if (entry === null) {
@@ -4751,6 +3778,7 @@ const deserializeAws_json1_1VocabularyFilters = (output, context) => {
4751
3778
  }
4752
3779
  return deserializeAws_json1_1VocabularyFilterInfo(entry, context);
4753
3780
  });
3781
+ return retVal;
4754
3782
  };
4755
3783
  const deserializeAws_json1_1VocabularyInfo = (output, context) => {
4756
3784
  return {