@aws-sdk/client-polly 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.
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_restJson1SynthesizeSpeechCommand = exports.deserializeAws_restJson1StartSpeechSynthesisTaskCommand = exports.deserializeAws_restJson1PutLexiconCommand = exports.deserializeAws_restJson1ListSpeechSynthesisTasksCommand = exports.deserializeAws_restJson1ListLexiconsCommand = exports.deserializeAws_restJson1GetSpeechSynthesisTaskCommand = exports.deserializeAws_restJson1GetLexiconCommand = exports.deserializeAws_restJson1DescribeVoicesCommand = exports.deserializeAws_restJson1DeleteLexiconCommand = exports.serializeAws_restJson1SynthesizeSpeechCommand = exports.serializeAws_restJson1StartSpeechSynthesisTaskCommand = exports.serializeAws_restJson1PutLexiconCommand = exports.serializeAws_restJson1ListSpeechSynthesisTasksCommand = exports.serializeAws_restJson1ListLexiconsCommand = exports.serializeAws_restJson1GetSpeechSynthesisTaskCommand = exports.serializeAws_restJson1GetLexiconCommand = exports.serializeAws_restJson1DescribeVoicesCommand = exports.serializeAws_restJson1DeleteLexiconCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const PollyServiceException_1 = require("../models/PollyServiceException");
6
8
  const serializeAws_restJson1DeleteLexiconCommand = async (input, context) => {
7
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
10
  const headers = {};
@@ -276,35 +278,19 @@ const deserializeAws_restJson1DeleteLexiconCommandError = async (output, context
276
278
  switch (errorCode) {
277
279
  case "LexiconNotFoundException":
278
280
  case "com.amazonaws.polly#LexiconNotFoundException":
279
- response = {
280
- ...(await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context)),
281
- name: errorCode,
282
- $metadata: deserializeMetadata(output),
283
- };
284
- break;
281
+ throw await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context);
285
282
  case "ServiceFailureException":
286
283
  case "com.amazonaws.polly#ServiceFailureException":
287
- response = {
288
- ...(await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)),
289
- name: errorCode,
290
- $metadata: deserializeMetadata(output),
291
- };
292
- break;
284
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
293
285
  default:
294
286
  const parsedBody = parsedOutput.body;
295
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
296
- response = {
297
- ...parsedBody,
298
- name: `${errorCode}`,
299
- message: parsedBody.message || parsedBody.Message || errorCode,
287
+ response = new PollyServiceException_1.PollyServiceException({
288
+ name: parsedBody.code || parsedBody.Code || errorCode,
300
289
  $fault: "client",
301
290
  $metadata: deserializeMetadata(output),
302
- };
291
+ });
292
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
303
293
  }
304
- const message = response.message || response.Message || errorCode;
305
- response.message = message;
306
- delete response.Message;
307
- return Promise.reject(Object.assign(new Error(message), response));
308
294
  };
309
295
  const deserializeAws_restJson1DescribeVoicesCommand = async (output, context) => {
310
296
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -336,35 +322,19 @@ const deserializeAws_restJson1DescribeVoicesCommandError = async (output, contex
336
322
  switch (errorCode) {
337
323
  case "InvalidNextTokenException":
338
324
  case "com.amazonaws.polly#InvalidNextTokenException":
339
- response = {
340
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
341
- name: errorCode,
342
- $metadata: deserializeMetadata(output),
343
- };
344
- break;
325
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
345
326
  case "ServiceFailureException":
346
327
  case "com.amazonaws.polly#ServiceFailureException":
347
- response = {
348
- ...(await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)),
349
- name: errorCode,
350
- $metadata: deserializeMetadata(output),
351
- };
352
- break;
328
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
353
329
  default:
354
330
  const parsedBody = parsedOutput.body;
355
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
356
- response = {
357
- ...parsedBody,
358
- name: `${errorCode}`,
359
- message: parsedBody.message || parsedBody.Message || errorCode,
331
+ response = new PollyServiceException_1.PollyServiceException({
332
+ name: parsedBody.code || parsedBody.Code || errorCode,
360
333
  $fault: "client",
361
334
  $metadata: deserializeMetadata(output),
362
- };
335
+ });
336
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
363
337
  }
364
- const message = response.message || response.Message || errorCode;
365
- response.message = message;
366
- delete response.Message;
367
- return Promise.reject(Object.assign(new Error(message), response));
368
338
  };
369
339
  const deserializeAws_restJson1GetLexiconCommand = async (output, context) => {
370
340
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -396,35 +366,19 @@ const deserializeAws_restJson1GetLexiconCommandError = async (output, context) =
396
366
  switch (errorCode) {
397
367
  case "LexiconNotFoundException":
398
368
  case "com.amazonaws.polly#LexiconNotFoundException":
399
- response = {
400
- ...(await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context)),
401
- name: errorCode,
402
- $metadata: deserializeMetadata(output),
403
- };
404
- break;
369
+ throw await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context);
405
370
  case "ServiceFailureException":
406
371
  case "com.amazonaws.polly#ServiceFailureException":
407
- response = {
408
- ...(await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)),
409
- name: errorCode,
410
- $metadata: deserializeMetadata(output),
411
- };
412
- break;
372
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
413
373
  default:
414
374
  const parsedBody = parsedOutput.body;
415
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
416
- response = {
417
- ...parsedBody,
418
- name: `${errorCode}`,
419
- message: parsedBody.message || parsedBody.Message || errorCode,
375
+ response = new PollyServiceException_1.PollyServiceException({
376
+ name: parsedBody.code || parsedBody.Code || errorCode,
420
377
  $fault: "client",
421
378
  $metadata: deserializeMetadata(output),
422
- };
379
+ });
380
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
423
381
  }
424
- const message = response.message || response.Message || errorCode;
425
- response.message = message;
426
- delete response.Message;
427
- return Promise.reject(Object.assign(new Error(message), response));
428
382
  };
429
383
  const deserializeAws_restJson1GetSpeechSynthesisTaskCommand = async (output, context) => {
430
384
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -452,43 +406,22 @@ const deserializeAws_restJson1GetSpeechSynthesisTaskCommandError = async (output
452
406
  switch (errorCode) {
453
407
  case "InvalidTaskIdException":
454
408
  case "com.amazonaws.polly#InvalidTaskIdException":
455
- response = {
456
- ...(await deserializeAws_restJson1InvalidTaskIdExceptionResponse(parsedOutput, context)),
457
- name: errorCode,
458
- $metadata: deserializeMetadata(output),
459
- };
460
- break;
409
+ throw await deserializeAws_restJson1InvalidTaskIdExceptionResponse(parsedOutput, context);
461
410
  case "ServiceFailureException":
462
411
  case "com.amazonaws.polly#ServiceFailureException":
463
- response = {
464
- ...(await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)),
465
- name: errorCode,
466
- $metadata: deserializeMetadata(output),
467
- };
468
- break;
412
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
469
413
  case "SynthesisTaskNotFoundException":
470
414
  case "com.amazonaws.polly#SynthesisTaskNotFoundException":
471
- response = {
472
- ...(await deserializeAws_restJson1SynthesisTaskNotFoundExceptionResponse(parsedOutput, context)),
473
- name: errorCode,
474
- $metadata: deserializeMetadata(output),
475
- };
476
- break;
415
+ throw await deserializeAws_restJson1SynthesisTaskNotFoundExceptionResponse(parsedOutput, context);
477
416
  default:
478
417
  const parsedBody = parsedOutput.body;
479
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
480
- response = {
481
- ...parsedBody,
482
- name: `${errorCode}`,
483
- message: parsedBody.message || parsedBody.Message || errorCode,
418
+ response = new PollyServiceException_1.PollyServiceException({
419
+ name: parsedBody.code || parsedBody.Code || errorCode,
484
420
  $fault: "client",
485
421
  $metadata: deserializeMetadata(output),
486
- };
422
+ });
423
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
487
424
  }
488
- const message = response.message || response.Message || errorCode;
489
- response.message = message;
490
- delete response.Message;
491
- return Promise.reject(Object.assign(new Error(message), response));
492
425
  };
493
426
  const deserializeAws_restJson1ListLexiconsCommand = async (output, context) => {
494
427
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -520,35 +453,19 @@ const deserializeAws_restJson1ListLexiconsCommandError = async (output, context)
520
453
  switch (errorCode) {
521
454
  case "InvalidNextTokenException":
522
455
  case "com.amazonaws.polly#InvalidNextTokenException":
523
- response = {
524
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
525
- name: errorCode,
526
- $metadata: deserializeMetadata(output),
527
- };
528
- break;
456
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
529
457
  case "ServiceFailureException":
530
458
  case "com.amazonaws.polly#ServiceFailureException":
531
- response = {
532
- ...(await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)),
533
- name: errorCode,
534
- $metadata: deserializeMetadata(output),
535
- };
536
- break;
459
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
537
460
  default:
538
461
  const parsedBody = parsedOutput.body;
539
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
540
- response = {
541
- ...parsedBody,
542
- name: `${errorCode}`,
543
- message: parsedBody.message || parsedBody.Message || errorCode,
462
+ response = new PollyServiceException_1.PollyServiceException({
463
+ name: parsedBody.code || parsedBody.Code || errorCode,
544
464
  $fault: "client",
545
465
  $metadata: deserializeMetadata(output),
546
- };
466
+ });
467
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
547
468
  }
548
- const message = response.message || response.Message || errorCode;
549
- response.message = message;
550
- delete response.Message;
551
- return Promise.reject(Object.assign(new Error(message), response));
552
469
  };
553
470
  const deserializeAws_restJson1ListSpeechSynthesisTasksCommand = async (output, context) => {
554
471
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -580,35 +497,19 @@ const deserializeAws_restJson1ListSpeechSynthesisTasksCommandError = async (outp
580
497
  switch (errorCode) {
581
498
  case "InvalidNextTokenException":
582
499
  case "com.amazonaws.polly#InvalidNextTokenException":
583
- response = {
584
- ...(await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context)),
585
- name: errorCode,
586
- $metadata: deserializeMetadata(output),
587
- };
588
- break;
500
+ throw await deserializeAws_restJson1InvalidNextTokenExceptionResponse(parsedOutput, context);
589
501
  case "ServiceFailureException":
590
502
  case "com.amazonaws.polly#ServiceFailureException":
591
- response = {
592
- ...(await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)),
593
- name: errorCode,
594
- $metadata: deserializeMetadata(output),
595
- };
596
- break;
503
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
597
504
  default:
598
505
  const parsedBody = parsedOutput.body;
599
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
600
- response = {
601
- ...parsedBody,
602
- name: `${errorCode}`,
603
- message: parsedBody.message || parsedBody.Message || errorCode,
506
+ response = new PollyServiceException_1.PollyServiceException({
507
+ name: parsedBody.code || parsedBody.Code || errorCode,
604
508
  $fault: "client",
605
509
  $metadata: deserializeMetadata(output),
606
- };
510
+ });
511
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
607
512
  }
608
- const message = response.message || response.Message || errorCode;
609
- response.message = message;
610
- delete response.Message;
611
- return Promise.reject(Object.assign(new Error(message), response));
612
513
  };
613
514
  const deserializeAws_restJson1PutLexiconCommand = async (output, context) => {
614
515
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -632,75 +533,34 @@ const deserializeAws_restJson1PutLexiconCommandError = async (output, context) =
632
533
  switch (errorCode) {
633
534
  case "InvalidLexiconException":
634
535
  case "com.amazonaws.polly#InvalidLexiconException":
635
- response = {
636
- ...(await deserializeAws_restJson1InvalidLexiconExceptionResponse(parsedOutput, context)),
637
- name: errorCode,
638
- $metadata: deserializeMetadata(output),
639
- };
640
- break;
536
+ throw await deserializeAws_restJson1InvalidLexiconExceptionResponse(parsedOutput, context);
641
537
  case "LexiconSizeExceededException":
642
538
  case "com.amazonaws.polly#LexiconSizeExceededException":
643
- response = {
644
- ...(await deserializeAws_restJson1LexiconSizeExceededExceptionResponse(parsedOutput, context)),
645
- name: errorCode,
646
- $metadata: deserializeMetadata(output),
647
- };
648
- break;
539
+ throw await deserializeAws_restJson1LexiconSizeExceededExceptionResponse(parsedOutput, context);
649
540
  case "MaxLexemeLengthExceededException":
650
541
  case "com.amazonaws.polly#MaxLexemeLengthExceededException":
651
- response = {
652
- ...(await deserializeAws_restJson1MaxLexemeLengthExceededExceptionResponse(parsedOutput, context)),
653
- name: errorCode,
654
- $metadata: deserializeMetadata(output),
655
- };
656
- break;
542
+ throw await deserializeAws_restJson1MaxLexemeLengthExceededExceptionResponse(parsedOutput, context);
657
543
  case "MaxLexiconsNumberExceededException":
658
544
  case "com.amazonaws.polly#MaxLexiconsNumberExceededException":
659
- response = {
660
- ...(await deserializeAws_restJson1MaxLexiconsNumberExceededExceptionResponse(parsedOutput, context)),
661
- name: errorCode,
662
- $metadata: deserializeMetadata(output),
663
- };
664
- break;
545
+ throw await deserializeAws_restJson1MaxLexiconsNumberExceededExceptionResponse(parsedOutput, context);
665
546
  case "ServiceFailureException":
666
547
  case "com.amazonaws.polly#ServiceFailureException":
667
- response = {
668
- ...(await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)),
669
- name: errorCode,
670
- $metadata: deserializeMetadata(output),
671
- };
672
- break;
548
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
673
549
  case "UnsupportedPlsAlphabetException":
674
550
  case "com.amazonaws.polly#UnsupportedPlsAlphabetException":
675
- response = {
676
- ...(await deserializeAws_restJson1UnsupportedPlsAlphabetExceptionResponse(parsedOutput, context)),
677
- name: errorCode,
678
- $metadata: deserializeMetadata(output),
679
- };
680
- break;
551
+ throw await deserializeAws_restJson1UnsupportedPlsAlphabetExceptionResponse(parsedOutput, context);
681
552
  case "UnsupportedPlsLanguageException":
682
553
  case "com.amazonaws.polly#UnsupportedPlsLanguageException":
683
- response = {
684
- ...(await deserializeAws_restJson1UnsupportedPlsLanguageExceptionResponse(parsedOutput, context)),
685
- name: errorCode,
686
- $metadata: deserializeMetadata(output),
687
- };
688
- break;
554
+ throw await deserializeAws_restJson1UnsupportedPlsLanguageExceptionResponse(parsedOutput, context);
689
555
  default:
690
556
  const parsedBody = parsedOutput.body;
691
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
692
- response = {
693
- ...parsedBody,
694
- name: `${errorCode}`,
695
- message: parsedBody.message || parsedBody.Message || errorCode,
557
+ response = new PollyServiceException_1.PollyServiceException({
558
+ name: parsedBody.code || parsedBody.Code || errorCode,
696
559
  $fault: "client",
697
560
  $metadata: deserializeMetadata(output),
698
- };
561
+ });
562
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
699
563
  }
700
- const message = response.message || response.Message || errorCode;
701
- response.message = message;
702
- delete response.Message;
703
- return Promise.reject(Object.assign(new Error(message), response));
704
564
  };
705
565
  const deserializeAws_restJson1StartSpeechSynthesisTaskCommand = async (output, context) => {
706
566
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -728,115 +588,49 @@ const deserializeAws_restJson1StartSpeechSynthesisTaskCommandError = async (outp
728
588
  switch (errorCode) {
729
589
  case "EngineNotSupportedException":
730
590
  case "com.amazonaws.polly#EngineNotSupportedException":
731
- response = {
732
- ...(await deserializeAws_restJson1EngineNotSupportedExceptionResponse(parsedOutput, context)),
733
- name: errorCode,
734
- $metadata: deserializeMetadata(output),
735
- };
736
- break;
591
+ throw await deserializeAws_restJson1EngineNotSupportedExceptionResponse(parsedOutput, context);
737
592
  case "InvalidS3BucketException":
738
593
  case "com.amazonaws.polly#InvalidS3BucketException":
739
- response = {
740
- ...(await deserializeAws_restJson1InvalidS3BucketExceptionResponse(parsedOutput, context)),
741
- name: errorCode,
742
- $metadata: deserializeMetadata(output),
743
- };
744
- break;
594
+ throw await deserializeAws_restJson1InvalidS3BucketExceptionResponse(parsedOutput, context);
745
595
  case "InvalidS3KeyException":
746
596
  case "com.amazonaws.polly#InvalidS3KeyException":
747
- response = {
748
- ...(await deserializeAws_restJson1InvalidS3KeyExceptionResponse(parsedOutput, context)),
749
- name: errorCode,
750
- $metadata: deserializeMetadata(output),
751
- };
752
- break;
597
+ throw await deserializeAws_restJson1InvalidS3KeyExceptionResponse(parsedOutput, context);
753
598
  case "InvalidSampleRateException":
754
599
  case "com.amazonaws.polly#InvalidSampleRateException":
755
- response = {
756
- ...(await deserializeAws_restJson1InvalidSampleRateExceptionResponse(parsedOutput, context)),
757
- name: errorCode,
758
- $metadata: deserializeMetadata(output),
759
- };
760
- break;
600
+ throw await deserializeAws_restJson1InvalidSampleRateExceptionResponse(parsedOutput, context);
761
601
  case "InvalidSnsTopicArnException":
762
602
  case "com.amazonaws.polly#InvalidSnsTopicArnException":
763
- response = {
764
- ...(await deserializeAws_restJson1InvalidSnsTopicArnExceptionResponse(parsedOutput, context)),
765
- name: errorCode,
766
- $metadata: deserializeMetadata(output),
767
- };
768
- break;
603
+ throw await deserializeAws_restJson1InvalidSnsTopicArnExceptionResponse(parsedOutput, context);
769
604
  case "InvalidSsmlException":
770
605
  case "com.amazonaws.polly#InvalidSsmlException":
771
- response = {
772
- ...(await deserializeAws_restJson1InvalidSsmlExceptionResponse(parsedOutput, context)),
773
- name: errorCode,
774
- $metadata: deserializeMetadata(output),
775
- };
776
- break;
606
+ throw await deserializeAws_restJson1InvalidSsmlExceptionResponse(parsedOutput, context);
777
607
  case "LanguageNotSupportedException":
778
608
  case "com.amazonaws.polly#LanguageNotSupportedException":
779
- response = {
780
- ...(await deserializeAws_restJson1LanguageNotSupportedExceptionResponse(parsedOutput, context)),
781
- name: errorCode,
782
- $metadata: deserializeMetadata(output),
783
- };
784
- break;
609
+ throw await deserializeAws_restJson1LanguageNotSupportedExceptionResponse(parsedOutput, context);
785
610
  case "LexiconNotFoundException":
786
611
  case "com.amazonaws.polly#LexiconNotFoundException":
787
- response = {
788
- ...(await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context)),
789
- name: errorCode,
790
- $metadata: deserializeMetadata(output),
791
- };
792
- break;
612
+ throw await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context);
793
613
  case "MarksNotSupportedForFormatException":
794
614
  case "com.amazonaws.polly#MarksNotSupportedForFormatException":
795
- response = {
796
- ...(await deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse(parsedOutput, context)),
797
- name: errorCode,
798
- $metadata: deserializeMetadata(output),
799
- };
800
- break;
615
+ throw await deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse(parsedOutput, context);
801
616
  case "ServiceFailureException":
802
617
  case "com.amazonaws.polly#ServiceFailureException":
803
- response = {
804
- ...(await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)),
805
- name: errorCode,
806
- $metadata: deserializeMetadata(output),
807
- };
808
- break;
618
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
809
619
  case "SsmlMarksNotSupportedForTextTypeException":
810
620
  case "com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException":
811
- response = {
812
- ...(await deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse(parsedOutput, context)),
813
- name: errorCode,
814
- $metadata: deserializeMetadata(output),
815
- };
816
- break;
621
+ throw await deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse(parsedOutput, context);
817
622
  case "TextLengthExceededException":
818
623
  case "com.amazonaws.polly#TextLengthExceededException":
819
- response = {
820
- ...(await deserializeAws_restJson1TextLengthExceededExceptionResponse(parsedOutput, context)),
821
- name: errorCode,
822
- $metadata: deserializeMetadata(output),
823
- };
824
- break;
624
+ throw await deserializeAws_restJson1TextLengthExceededExceptionResponse(parsedOutput, context);
825
625
  default:
826
626
  const parsedBody = parsedOutput.body;
827
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
828
- response = {
829
- ...parsedBody,
830
- name: `${errorCode}`,
831
- message: parsedBody.message || parsedBody.Message || errorCode,
627
+ response = new PollyServiceException_1.PollyServiceException({
628
+ name: parsedBody.code || parsedBody.Code || errorCode,
832
629
  $fault: "client",
833
630
  $metadata: deserializeMetadata(output),
834
- };
631
+ });
632
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
835
633
  }
836
- const message = response.message || response.Message || errorCode;
837
- response.message = message;
838
- delete response.Message;
839
- return Promise.reject(Object.assign(new Error(message), response));
840
634
  };
841
635
  const deserializeAws_restJson1SynthesizeSpeechCommand = async (output, context) => {
842
636
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -870,364 +664,292 @@ const deserializeAws_restJson1SynthesizeSpeechCommandError = async (output, cont
870
664
  switch (errorCode) {
871
665
  case "EngineNotSupportedException":
872
666
  case "com.amazonaws.polly#EngineNotSupportedException":
873
- response = {
874
- ...(await deserializeAws_restJson1EngineNotSupportedExceptionResponse(parsedOutput, context)),
875
- name: errorCode,
876
- $metadata: deserializeMetadata(output),
877
- };
878
- break;
667
+ throw await deserializeAws_restJson1EngineNotSupportedExceptionResponse(parsedOutput, context);
879
668
  case "InvalidSampleRateException":
880
669
  case "com.amazonaws.polly#InvalidSampleRateException":
881
- response = {
882
- ...(await deserializeAws_restJson1InvalidSampleRateExceptionResponse(parsedOutput, context)),
883
- name: errorCode,
884
- $metadata: deserializeMetadata(output),
885
- };
886
- break;
670
+ throw await deserializeAws_restJson1InvalidSampleRateExceptionResponse(parsedOutput, context);
887
671
  case "InvalidSsmlException":
888
672
  case "com.amazonaws.polly#InvalidSsmlException":
889
- response = {
890
- ...(await deserializeAws_restJson1InvalidSsmlExceptionResponse(parsedOutput, context)),
891
- name: errorCode,
892
- $metadata: deserializeMetadata(output),
893
- };
894
- break;
673
+ throw await deserializeAws_restJson1InvalidSsmlExceptionResponse(parsedOutput, context);
895
674
  case "LanguageNotSupportedException":
896
675
  case "com.amazonaws.polly#LanguageNotSupportedException":
897
- response = {
898
- ...(await deserializeAws_restJson1LanguageNotSupportedExceptionResponse(parsedOutput, context)),
899
- name: errorCode,
900
- $metadata: deserializeMetadata(output),
901
- };
902
- break;
676
+ throw await deserializeAws_restJson1LanguageNotSupportedExceptionResponse(parsedOutput, context);
903
677
  case "LexiconNotFoundException":
904
678
  case "com.amazonaws.polly#LexiconNotFoundException":
905
- response = {
906
- ...(await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context)),
907
- name: errorCode,
908
- $metadata: deserializeMetadata(output),
909
- };
910
- break;
679
+ throw await deserializeAws_restJson1LexiconNotFoundExceptionResponse(parsedOutput, context);
911
680
  case "MarksNotSupportedForFormatException":
912
681
  case "com.amazonaws.polly#MarksNotSupportedForFormatException":
913
- response = {
914
- ...(await deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse(parsedOutput, context)),
915
- name: errorCode,
916
- $metadata: deserializeMetadata(output),
917
- };
918
- break;
682
+ throw await deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse(parsedOutput, context);
919
683
  case "ServiceFailureException":
920
684
  case "com.amazonaws.polly#ServiceFailureException":
921
- response = {
922
- ...(await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context)),
923
- name: errorCode,
924
- $metadata: deserializeMetadata(output),
925
- };
926
- break;
685
+ throw await deserializeAws_restJson1ServiceFailureExceptionResponse(parsedOutput, context);
927
686
  case "SsmlMarksNotSupportedForTextTypeException":
928
687
  case "com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException":
929
- response = {
930
- ...(await deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse(parsedOutput, context)),
931
- name: errorCode,
932
- $metadata: deserializeMetadata(output),
933
- };
934
- break;
688
+ throw await deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse(parsedOutput, context);
935
689
  case "TextLengthExceededException":
936
690
  case "com.amazonaws.polly#TextLengthExceededException":
937
- response = {
938
- ...(await deserializeAws_restJson1TextLengthExceededExceptionResponse(parsedOutput, context)),
939
- name: errorCode,
940
- $metadata: deserializeMetadata(output),
941
- };
942
- break;
691
+ throw await deserializeAws_restJson1TextLengthExceededExceptionResponse(parsedOutput, context);
943
692
  default:
944
693
  const parsedBody = parsedOutput.body;
945
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
946
- response = {
947
- ...parsedBody,
948
- name: `${errorCode}`,
949
- message: parsedBody.message || parsedBody.Message || errorCode,
694
+ response = new PollyServiceException_1.PollyServiceException({
695
+ name: parsedBody.code || parsedBody.Code || errorCode,
950
696
  $fault: "client",
951
697
  $metadata: deserializeMetadata(output),
952
- };
698
+ });
699
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
953
700
  }
954
- const message = response.message || response.Message || errorCode;
955
- response.message = message;
956
- delete response.Message;
957
- return Promise.reject(Object.assign(new Error(message), response));
958
701
  };
959
702
  const deserializeAws_restJson1EngineNotSupportedExceptionResponse = async (parsedOutput, context) => {
960
- const contents = {
961
- name: "EngineNotSupportedException",
962
- $fault: "client",
963
- $metadata: deserializeMetadata(parsedOutput),
964
- message: undefined,
965
- };
703
+ const contents = {};
966
704
  const data = parsedOutput.body;
967
705
  if (data.message !== undefined && data.message !== null) {
968
706
  contents.message = smithy_client_1.expectString(data.message);
969
707
  }
970
- return contents;
708
+ const exception = new models_0_1.EngineNotSupportedException({
709
+ $metadata: deserializeMetadata(parsedOutput),
710
+ ...contents,
711
+ });
712
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
971
713
  };
972
714
  const deserializeAws_restJson1InvalidLexiconExceptionResponse = async (parsedOutput, context) => {
973
- const contents = {
974
- name: "InvalidLexiconException",
975
- $fault: "client",
976
- $metadata: deserializeMetadata(parsedOutput),
977
- message: undefined,
978
- };
715
+ const contents = {};
979
716
  const data = parsedOutput.body;
980
717
  if (data.message !== undefined && data.message !== null) {
981
718
  contents.message = smithy_client_1.expectString(data.message);
982
719
  }
983
- return contents;
720
+ const exception = new models_0_1.InvalidLexiconException({
721
+ $metadata: deserializeMetadata(parsedOutput),
722
+ ...contents,
723
+ });
724
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
984
725
  };
985
726
  const deserializeAws_restJson1InvalidNextTokenExceptionResponse = async (parsedOutput, context) => {
986
- const contents = {
987
- name: "InvalidNextTokenException",
988
- $fault: "client",
989
- $metadata: deserializeMetadata(parsedOutput),
990
- message: undefined,
991
- };
727
+ const contents = {};
992
728
  const data = parsedOutput.body;
993
729
  if (data.message !== undefined && data.message !== null) {
994
730
  contents.message = smithy_client_1.expectString(data.message);
995
731
  }
996
- return contents;
732
+ const exception = new models_0_1.InvalidNextTokenException({
733
+ $metadata: deserializeMetadata(parsedOutput),
734
+ ...contents,
735
+ });
736
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
997
737
  };
998
738
  const deserializeAws_restJson1InvalidS3BucketExceptionResponse = async (parsedOutput, context) => {
999
- const contents = {
1000
- name: "InvalidS3BucketException",
1001
- $fault: "client",
1002
- $metadata: deserializeMetadata(parsedOutput),
1003
- message: undefined,
1004
- };
739
+ const contents = {};
1005
740
  const data = parsedOutput.body;
1006
741
  if (data.message !== undefined && data.message !== null) {
1007
742
  contents.message = smithy_client_1.expectString(data.message);
1008
743
  }
1009
- return contents;
744
+ const exception = new models_0_1.InvalidS3BucketException({
745
+ $metadata: deserializeMetadata(parsedOutput),
746
+ ...contents,
747
+ });
748
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1010
749
  };
1011
750
  const deserializeAws_restJson1InvalidS3KeyExceptionResponse = async (parsedOutput, context) => {
1012
- const contents = {
1013
- name: "InvalidS3KeyException",
1014
- $fault: "client",
1015
- $metadata: deserializeMetadata(parsedOutput),
1016
- message: undefined,
1017
- };
751
+ const contents = {};
1018
752
  const data = parsedOutput.body;
1019
753
  if (data.message !== undefined && data.message !== null) {
1020
754
  contents.message = smithy_client_1.expectString(data.message);
1021
755
  }
1022
- return contents;
756
+ const exception = new models_0_1.InvalidS3KeyException({
757
+ $metadata: deserializeMetadata(parsedOutput),
758
+ ...contents,
759
+ });
760
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1023
761
  };
1024
762
  const deserializeAws_restJson1InvalidSampleRateExceptionResponse = async (parsedOutput, context) => {
1025
- const contents = {
1026
- name: "InvalidSampleRateException",
1027
- $fault: "client",
1028
- $metadata: deserializeMetadata(parsedOutput),
1029
- message: undefined,
1030
- };
763
+ const contents = {};
1031
764
  const data = parsedOutput.body;
1032
765
  if (data.message !== undefined && data.message !== null) {
1033
766
  contents.message = smithy_client_1.expectString(data.message);
1034
767
  }
1035
- return contents;
768
+ const exception = new models_0_1.InvalidSampleRateException({
769
+ $metadata: deserializeMetadata(parsedOutput),
770
+ ...contents,
771
+ });
772
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1036
773
  };
1037
774
  const deserializeAws_restJson1InvalidSnsTopicArnExceptionResponse = async (parsedOutput, context) => {
1038
- const contents = {
1039
- name: "InvalidSnsTopicArnException",
1040
- $fault: "client",
1041
- $metadata: deserializeMetadata(parsedOutput),
1042
- message: undefined,
1043
- };
775
+ const contents = {};
1044
776
  const data = parsedOutput.body;
1045
777
  if (data.message !== undefined && data.message !== null) {
1046
778
  contents.message = smithy_client_1.expectString(data.message);
1047
779
  }
1048
- return contents;
780
+ const exception = new models_0_1.InvalidSnsTopicArnException({
781
+ $metadata: deserializeMetadata(parsedOutput),
782
+ ...contents,
783
+ });
784
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1049
785
  };
1050
786
  const deserializeAws_restJson1InvalidSsmlExceptionResponse = async (parsedOutput, context) => {
1051
- const contents = {
1052
- name: "InvalidSsmlException",
1053
- $fault: "client",
1054
- $metadata: deserializeMetadata(parsedOutput),
1055
- message: undefined,
1056
- };
787
+ const contents = {};
1057
788
  const data = parsedOutput.body;
1058
789
  if (data.message !== undefined && data.message !== null) {
1059
790
  contents.message = smithy_client_1.expectString(data.message);
1060
791
  }
1061
- return contents;
792
+ const exception = new models_0_1.InvalidSsmlException({
793
+ $metadata: deserializeMetadata(parsedOutput),
794
+ ...contents,
795
+ });
796
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1062
797
  };
1063
798
  const deserializeAws_restJson1InvalidTaskIdExceptionResponse = async (parsedOutput, context) => {
1064
- const contents = {
1065
- name: "InvalidTaskIdException",
1066
- $fault: "client",
1067
- $metadata: deserializeMetadata(parsedOutput),
1068
- message: undefined,
1069
- };
799
+ const contents = {};
1070
800
  const data = parsedOutput.body;
1071
801
  if (data.message !== undefined && data.message !== null) {
1072
802
  contents.message = smithy_client_1.expectString(data.message);
1073
803
  }
1074
- return contents;
804
+ const exception = new models_0_1.InvalidTaskIdException({
805
+ $metadata: deserializeMetadata(parsedOutput),
806
+ ...contents,
807
+ });
808
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1075
809
  };
1076
810
  const deserializeAws_restJson1LanguageNotSupportedExceptionResponse = async (parsedOutput, context) => {
1077
- const contents = {
1078
- name: "LanguageNotSupportedException",
1079
- $fault: "client",
1080
- $metadata: deserializeMetadata(parsedOutput),
1081
- message: undefined,
1082
- };
811
+ const contents = {};
1083
812
  const data = parsedOutput.body;
1084
813
  if (data.message !== undefined && data.message !== null) {
1085
814
  contents.message = smithy_client_1.expectString(data.message);
1086
815
  }
1087
- return contents;
816
+ const exception = new models_0_1.LanguageNotSupportedException({
817
+ $metadata: deserializeMetadata(parsedOutput),
818
+ ...contents,
819
+ });
820
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1088
821
  };
1089
822
  const deserializeAws_restJson1LexiconNotFoundExceptionResponse = async (parsedOutput, context) => {
1090
- const contents = {
1091
- name: "LexiconNotFoundException",
1092
- $fault: "client",
1093
- $metadata: deserializeMetadata(parsedOutput),
1094
- message: undefined,
1095
- };
823
+ const contents = {};
1096
824
  const data = parsedOutput.body;
1097
825
  if (data.message !== undefined && data.message !== null) {
1098
826
  contents.message = smithy_client_1.expectString(data.message);
1099
827
  }
1100
- return contents;
828
+ const exception = new models_0_1.LexiconNotFoundException({
829
+ $metadata: deserializeMetadata(parsedOutput),
830
+ ...contents,
831
+ });
832
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1101
833
  };
1102
834
  const deserializeAws_restJson1LexiconSizeExceededExceptionResponse = async (parsedOutput, context) => {
1103
- const contents = {
1104
- name: "LexiconSizeExceededException",
1105
- $fault: "client",
1106
- $metadata: deserializeMetadata(parsedOutput),
1107
- message: undefined,
1108
- };
835
+ const contents = {};
1109
836
  const data = parsedOutput.body;
1110
837
  if (data.message !== undefined && data.message !== null) {
1111
838
  contents.message = smithy_client_1.expectString(data.message);
1112
839
  }
1113
- return contents;
840
+ const exception = new models_0_1.LexiconSizeExceededException({
841
+ $metadata: deserializeMetadata(parsedOutput),
842
+ ...contents,
843
+ });
844
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1114
845
  };
1115
846
  const deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse = async (parsedOutput, context) => {
1116
- const contents = {
1117
- name: "MarksNotSupportedForFormatException",
1118
- $fault: "client",
1119
- $metadata: deserializeMetadata(parsedOutput),
1120
- message: undefined,
1121
- };
847
+ const contents = {};
1122
848
  const data = parsedOutput.body;
1123
849
  if (data.message !== undefined && data.message !== null) {
1124
850
  contents.message = smithy_client_1.expectString(data.message);
1125
851
  }
1126
- return contents;
852
+ const exception = new models_0_1.MarksNotSupportedForFormatException({
853
+ $metadata: deserializeMetadata(parsedOutput),
854
+ ...contents,
855
+ });
856
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1127
857
  };
1128
858
  const deserializeAws_restJson1MaxLexemeLengthExceededExceptionResponse = async (parsedOutput, context) => {
1129
- const contents = {
1130
- name: "MaxLexemeLengthExceededException",
1131
- $fault: "client",
1132
- $metadata: deserializeMetadata(parsedOutput),
1133
- message: undefined,
1134
- };
859
+ const contents = {};
1135
860
  const data = parsedOutput.body;
1136
861
  if (data.message !== undefined && data.message !== null) {
1137
862
  contents.message = smithy_client_1.expectString(data.message);
1138
863
  }
1139
- return contents;
864
+ const exception = new models_0_1.MaxLexemeLengthExceededException({
865
+ $metadata: deserializeMetadata(parsedOutput),
866
+ ...contents,
867
+ });
868
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1140
869
  };
1141
870
  const deserializeAws_restJson1MaxLexiconsNumberExceededExceptionResponse = async (parsedOutput, context) => {
1142
- const contents = {
1143
- name: "MaxLexiconsNumberExceededException",
1144
- $fault: "client",
1145
- $metadata: deserializeMetadata(parsedOutput),
1146
- message: undefined,
1147
- };
871
+ const contents = {};
1148
872
  const data = parsedOutput.body;
1149
873
  if (data.message !== undefined && data.message !== null) {
1150
874
  contents.message = smithy_client_1.expectString(data.message);
1151
875
  }
1152
- return contents;
876
+ const exception = new models_0_1.MaxLexiconsNumberExceededException({
877
+ $metadata: deserializeMetadata(parsedOutput),
878
+ ...contents,
879
+ });
880
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1153
881
  };
1154
882
  const deserializeAws_restJson1ServiceFailureExceptionResponse = async (parsedOutput, context) => {
1155
- const contents = {
1156
- name: "ServiceFailureException",
1157
- $fault: "server",
1158
- $metadata: deserializeMetadata(parsedOutput),
1159
- message: undefined,
1160
- };
883
+ const contents = {};
1161
884
  const data = parsedOutput.body;
1162
885
  if (data.message !== undefined && data.message !== null) {
1163
886
  contents.message = smithy_client_1.expectString(data.message);
1164
887
  }
1165
- return contents;
888
+ const exception = new models_0_1.ServiceFailureException({
889
+ $metadata: deserializeMetadata(parsedOutput),
890
+ ...contents,
891
+ });
892
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1166
893
  };
1167
894
  const deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse = async (parsedOutput, context) => {
1168
- const contents = {
1169
- name: "SsmlMarksNotSupportedForTextTypeException",
1170
- $fault: "client",
1171
- $metadata: deserializeMetadata(parsedOutput),
1172
- message: undefined,
1173
- };
895
+ const contents = {};
1174
896
  const data = parsedOutput.body;
1175
897
  if (data.message !== undefined && data.message !== null) {
1176
898
  contents.message = smithy_client_1.expectString(data.message);
1177
899
  }
1178
- return contents;
900
+ const exception = new models_0_1.SsmlMarksNotSupportedForTextTypeException({
901
+ $metadata: deserializeMetadata(parsedOutput),
902
+ ...contents,
903
+ });
904
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1179
905
  };
1180
906
  const deserializeAws_restJson1SynthesisTaskNotFoundExceptionResponse = async (parsedOutput, context) => {
1181
- const contents = {
1182
- name: "SynthesisTaskNotFoundException",
1183
- $fault: "client",
1184
- $metadata: deserializeMetadata(parsedOutput),
1185
- message: undefined,
1186
- };
907
+ const contents = {};
1187
908
  const data = parsedOutput.body;
1188
909
  if (data.message !== undefined && data.message !== null) {
1189
910
  contents.message = smithy_client_1.expectString(data.message);
1190
911
  }
1191
- return contents;
912
+ const exception = new models_0_1.SynthesisTaskNotFoundException({
913
+ $metadata: deserializeMetadata(parsedOutput),
914
+ ...contents,
915
+ });
916
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1192
917
  };
1193
918
  const deserializeAws_restJson1TextLengthExceededExceptionResponse = async (parsedOutput, context) => {
1194
- const contents = {
1195
- name: "TextLengthExceededException",
1196
- $fault: "client",
1197
- $metadata: deserializeMetadata(parsedOutput),
1198
- message: undefined,
1199
- };
919
+ const contents = {};
1200
920
  const data = parsedOutput.body;
1201
921
  if (data.message !== undefined && data.message !== null) {
1202
922
  contents.message = smithy_client_1.expectString(data.message);
1203
923
  }
1204
- return contents;
924
+ const exception = new models_0_1.TextLengthExceededException({
925
+ $metadata: deserializeMetadata(parsedOutput),
926
+ ...contents,
927
+ });
928
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1205
929
  };
1206
930
  const deserializeAws_restJson1UnsupportedPlsAlphabetExceptionResponse = async (parsedOutput, context) => {
1207
- const contents = {
1208
- name: "UnsupportedPlsAlphabetException",
1209
- $fault: "client",
1210
- $metadata: deserializeMetadata(parsedOutput),
1211
- message: undefined,
1212
- };
931
+ const contents = {};
1213
932
  const data = parsedOutput.body;
1214
933
  if (data.message !== undefined && data.message !== null) {
1215
934
  contents.message = smithy_client_1.expectString(data.message);
1216
935
  }
1217
- return contents;
936
+ const exception = new models_0_1.UnsupportedPlsAlphabetException({
937
+ $metadata: deserializeMetadata(parsedOutput),
938
+ ...contents,
939
+ });
940
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1218
941
  };
1219
942
  const deserializeAws_restJson1UnsupportedPlsLanguageExceptionResponse = async (parsedOutput, context) => {
1220
- const contents = {
1221
- name: "UnsupportedPlsLanguageException",
1222
- $fault: "client",
1223
- $metadata: deserializeMetadata(parsedOutput),
1224
- message: undefined,
1225
- };
943
+ const contents = {};
1226
944
  const data = parsedOutput.body;
1227
945
  if (data.message !== undefined && data.message !== null) {
1228
946
  contents.message = smithy_client_1.expectString(data.message);
1229
947
  }
1230
- return contents;
948
+ const exception = new models_0_1.UnsupportedPlsLanguageException({
949
+ $metadata: deserializeMetadata(parsedOutput),
950
+ ...contents,
951
+ });
952
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1231
953
  };
1232
954
  const serializeAws_restJson1LexiconNameList = (input, context) => {
1233
955
  return input
@@ -1250,7 +972,7 @@ const serializeAws_restJson1SpeechMarkTypeList = (input, context) => {
1250
972
  });
1251
973
  };
1252
974
  const deserializeAws_restJson1EngineList = (output, context) => {
1253
- return (output || [])
975
+ const retVal = (output || [])
1254
976
  .filter((e) => e != null)
1255
977
  .map((entry) => {
1256
978
  if (entry === null) {
@@ -1258,9 +980,10 @@ const deserializeAws_restJson1EngineList = (output, context) => {
1258
980
  }
1259
981
  return smithy_client_1.expectString(entry);
1260
982
  });
983
+ return retVal;
1261
984
  };
1262
985
  const deserializeAws_restJson1LanguageCodeList = (output, context) => {
1263
- return (output || [])
986
+ const retVal = (output || [])
1264
987
  .filter((e) => e != null)
1265
988
  .map((entry) => {
1266
989
  if (entry === null) {
@@ -1268,6 +991,7 @@ const deserializeAws_restJson1LanguageCodeList = (output, context) => {
1268
991
  }
1269
992
  return smithy_client_1.expectString(entry);
1270
993
  });
994
+ return retVal;
1271
995
  };
1272
996
  const deserializeAws_restJson1Lexicon = (output, context) => {
1273
997
  return {
@@ -1296,7 +1020,7 @@ const deserializeAws_restJson1LexiconDescription = (output, context) => {
1296
1020
  };
1297
1021
  };
1298
1022
  const deserializeAws_restJson1LexiconDescriptionList = (output, context) => {
1299
- return (output || [])
1023
+ const retVal = (output || [])
1300
1024
  .filter((e) => e != null)
1301
1025
  .map((entry) => {
1302
1026
  if (entry === null) {
@@ -1304,9 +1028,10 @@ const deserializeAws_restJson1LexiconDescriptionList = (output, context) => {
1304
1028
  }
1305
1029
  return deserializeAws_restJson1LexiconDescription(entry, context);
1306
1030
  });
1031
+ return retVal;
1307
1032
  };
1308
1033
  const deserializeAws_restJson1LexiconNameList = (output, context) => {
1309
- return (output || [])
1034
+ const retVal = (output || [])
1310
1035
  .filter((e) => e != null)
1311
1036
  .map((entry) => {
1312
1037
  if (entry === null) {
@@ -1314,9 +1039,10 @@ const deserializeAws_restJson1LexiconNameList = (output, context) => {
1314
1039
  }
1315
1040
  return smithy_client_1.expectString(entry);
1316
1041
  });
1042
+ return retVal;
1317
1043
  };
1318
1044
  const deserializeAws_restJson1SpeechMarkTypeList = (output, context) => {
1319
- return (output || [])
1045
+ const retVal = (output || [])
1320
1046
  .filter((e) => e != null)
1321
1047
  .map((entry) => {
1322
1048
  if (entry === null) {
@@ -1324,6 +1050,7 @@ const deserializeAws_restJson1SpeechMarkTypeList = (output, context) => {
1324
1050
  }
1325
1051
  return smithy_client_1.expectString(entry);
1326
1052
  });
1053
+ return retVal;
1327
1054
  };
1328
1055
  const deserializeAws_restJson1SynthesisTask = (output, context) => {
1329
1056
  return {
@@ -1351,7 +1078,7 @@ const deserializeAws_restJson1SynthesisTask = (output, context) => {
1351
1078
  };
1352
1079
  };
1353
1080
  const deserializeAws_restJson1SynthesisTasks = (output, context) => {
1354
- return (output || [])
1081
+ const retVal = (output || [])
1355
1082
  .filter((e) => e != null)
1356
1083
  .map((entry) => {
1357
1084
  if (entry === null) {
@@ -1359,6 +1086,7 @@ const deserializeAws_restJson1SynthesisTasks = (output, context) => {
1359
1086
  }
1360
1087
  return deserializeAws_restJson1SynthesisTask(entry, context);
1361
1088
  });
1089
+ return retVal;
1362
1090
  };
1363
1091
  const deserializeAws_restJson1Voice = (output, context) => {
1364
1092
  return {
@@ -1376,7 +1104,7 @@ const deserializeAws_restJson1Voice = (output, context) => {
1376
1104
  };
1377
1105
  };
1378
1106
  const deserializeAws_restJson1VoiceList = (output, context) => {
1379
- return (output || [])
1107
+ const retVal = (output || [])
1380
1108
  .filter((e) => e != null)
1381
1109
  .map((entry) => {
1382
1110
  if (entry === null) {
@@ -1384,6 +1112,7 @@ const deserializeAws_restJson1VoiceList = (output, context) => {
1384
1112
  }
1385
1113
  return deserializeAws_restJson1Voice(entry, context);
1386
1114
  });
1115
+ return retVal;
1387
1116
  };
1388
1117
  const deserializeMetadata = (output) => {
1389
1118
  var _a;