@aws-sdk/client-kinesis 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.
@@ -4,6 +4,8 @@ exports.deserializeAws_json1_1PutRecordsCommand = exports.deserializeAws_json1_1
4
4
  exports.deserializeAws_json1_1UpdateStreamModeCommand = exports.deserializeAws_json1_1UpdateShardCountCommand = exports.deserializeAws_json1_1SubscribeToShardCommand = exports.deserializeAws_json1_1StopStreamEncryptionCommand = exports.deserializeAws_json1_1StartStreamEncryptionCommand = exports.deserializeAws_json1_1SplitShardCommand = exports.deserializeAws_json1_1RemoveTagsFromStreamCommand = exports.deserializeAws_json1_1RegisterStreamConsumerCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ const KinesisServiceException_1 = require("../models/KinesisServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_json1_1AddTagsToStreamCommand = async (input, context) => {
8
10
  const headers = {
9
11
  "content-type": "application/x-amz-json-1.1",
@@ -316,51 +318,25 @@ const deserializeAws_json1_1AddTagsToStreamCommandError = async (output, context
316
318
  switch (errorCode) {
317
319
  case "InvalidArgumentException":
318
320
  case "com.amazonaws.kinesis#InvalidArgumentException":
319
- response = {
320
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
321
- name: errorCode,
322
- $metadata: deserializeMetadata(output),
323
- };
324
- break;
321
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
325
322
  case "LimitExceededException":
326
323
  case "com.amazonaws.kinesis#LimitExceededException":
327
- response = {
328
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
329
- name: errorCode,
330
- $metadata: deserializeMetadata(output),
331
- };
332
- break;
324
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
333
325
  case "ResourceInUseException":
334
326
  case "com.amazonaws.kinesis#ResourceInUseException":
335
- response = {
336
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
337
- name: errorCode,
338
- $metadata: deserializeMetadata(output),
339
- };
340
- break;
327
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
341
328
  case "ResourceNotFoundException":
342
329
  case "com.amazonaws.kinesis#ResourceNotFoundException":
343
- response = {
344
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
345
- name: errorCode,
346
- $metadata: deserializeMetadata(output),
347
- };
348
- break;
330
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
349
331
  default:
350
332
  const parsedBody = parsedOutput.body;
351
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
352
- response = {
353
- ...parsedBody,
354
- name: `${errorCode}`,
355
- message: parsedBody.message || parsedBody.Message || errorCode,
333
+ response = new KinesisServiceException_1.KinesisServiceException({
334
+ name: parsedBody.code || parsedBody.Code || errorCode,
356
335
  $fault: "client",
357
336
  $metadata: deserializeMetadata(output),
358
- };
337
+ });
338
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
359
339
  }
360
- const message = response.message || response.Message || errorCode;
361
- response.message = message;
362
- delete response.Message;
363
- return Promise.reject(Object.assign(new Error(message), response));
364
340
  };
365
341
  const deserializeAws_json1_1CreateStreamCommand = async (output, context) => {
366
342
  if (output.statusCode >= 300) {
@@ -384,43 +360,22 @@ const deserializeAws_json1_1CreateStreamCommandError = async (output, context) =
384
360
  switch (errorCode) {
385
361
  case "InvalidArgumentException":
386
362
  case "com.amazonaws.kinesis#InvalidArgumentException":
387
- response = {
388
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
389
- name: errorCode,
390
- $metadata: deserializeMetadata(output),
391
- };
392
- break;
363
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
393
364
  case "LimitExceededException":
394
365
  case "com.amazonaws.kinesis#LimitExceededException":
395
- response = {
396
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
397
- name: errorCode,
398
- $metadata: deserializeMetadata(output),
399
- };
400
- break;
366
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
401
367
  case "ResourceInUseException":
402
368
  case "com.amazonaws.kinesis#ResourceInUseException":
403
- response = {
404
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
405
- name: errorCode,
406
- $metadata: deserializeMetadata(output),
407
- };
408
- break;
369
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
409
370
  default:
410
371
  const parsedBody = parsedOutput.body;
411
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
412
- response = {
413
- ...parsedBody,
414
- name: `${errorCode}`,
415
- message: parsedBody.message || parsedBody.Message || errorCode,
372
+ response = new KinesisServiceException_1.KinesisServiceException({
373
+ name: parsedBody.code || parsedBody.Code || errorCode,
416
374
  $fault: "client",
417
375
  $metadata: deserializeMetadata(output),
418
- };
376
+ });
377
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
419
378
  }
420
- const message = response.message || response.Message || errorCode;
421
- response.message = message;
422
- delete response.Message;
423
- return Promise.reject(Object.assign(new Error(message), response));
424
379
  };
425
380
  const deserializeAws_json1_1DecreaseStreamRetentionPeriodCommand = async (output, context) => {
426
381
  if (output.statusCode >= 300) {
@@ -444,51 +399,25 @@ const deserializeAws_json1_1DecreaseStreamRetentionPeriodCommandError = async (o
444
399
  switch (errorCode) {
445
400
  case "InvalidArgumentException":
446
401
  case "com.amazonaws.kinesis#InvalidArgumentException":
447
- response = {
448
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
449
- name: errorCode,
450
- $metadata: deserializeMetadata(output),
451
- };
452
- break;
402
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
453
403
  case "LimitExceededException":
454
404
  case "com.amazonaws.kinesis#LimitExceededException":
455
- response = {
456
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
457
- name: errorCode,
458
- $metadata: deserializeMetadata(output),
459
- };
460
- break;
405
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
461
406
  case "ResourceInUseException":
462
407
  case "com.amazonaws.kinesis#ResourceInUseException":
463
- response = {
464
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
465
- name: errorCode,
466
- $metadata: deserializeMetadata(output),
467
- };
468
- break;
408
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
469
409
  case "ResourceNotFoundException":
470
410
  case "com.amazonaws.kinesis#ResourceNotFoundException":
471
- response = {
472
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
473
- name: errorCode,
474
- $metadata: deserializeMetadata(output),
475
- };
476
- break;
411
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
477
412
  default:
478
413
  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,
414
+ response = new KinesisServiceException_1.KinesisServiceException({
415
+ name: parsedBody.code || parsedBody.Code || errorCode,
484
416
  $fault: "client",
485
417
  $metadata: deserializeMetadata(output),
486
- };
418
+ });
419
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
487
420
  }
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
421
  };
493
422
  const deserializeAws_json1_1DeleteStreamCommand = async (output, context) => {
494
423
  if (output.statusCode >= 300) {
@@ -512,43 +441,22 @@ const deserializeAws_json1_1DeleteStreamCommandError = async (output, context) =
512
441
  switch (errorCode) {
513
442
  case "LimitExceededException":
514
443
  case "com.amazonaws.kinesis#LimitExceededException":
515
- response = {
516
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
517
- name: errorCode,
518
- $metadata: deserializeMetadata(output),
519
- };
520
- break;
444
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
521
445
  case "ResourceInUseException":
522
446
  case "com.amazonaws.kinesis#ResourceInUseException":
523
- response = {
524
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
525
- name: errorCode,
526
- $metadata: deserializeMetadata(output),
527
- };
528
- break;
447
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
529
448
  case "ResourceNotFoundException":
530
449
  case "com.amazonaws.kinesis#ResourceNotFoundException":
531
- response = {
532
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
533
- name: errorCode,
534
- $metadata: deserializeMetadata(output),
535
- };
536
- break;
450
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
537
451
  default:
538
452
  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,
453
+ response = new KinesisServiceException_1.KinesisServiceException({
454
+ name: parsedBody.code || parsedBody.Code || errorCode,
544
455
  $fault: "client",
545
456
  $metadata: deserializeMetadata(output),
546
- };
457
+ });
458
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
547
459
  }
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
460
  };
553
461
  const deserializeAws_json1_1DeregisterStreamConsumerCommand = async (output, context) => {
554
462
  if (output.statusCode >= 300) {
@@ -572,43 +480,22 @@ const deserializeAws_json1_1DeregisterStreamConsumerCommandError = async (output
572
480
  switch (errorCode) {
573
481
  case "InvalidArgumentException":
574
482
  case "com.amazonaws.kinesis#InvalidArgumentException":
575
- response = {
576
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
577
- name: errorCode,
578
- $metadata: deserializeMetadata(output),
579
- };
580
- break;
483
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
581
484
  case "LimitExceededException":
582
485
  case "com.amazonaws.kinesis#LimitExceededException":
583
- response = {
584
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
585
- name: errorCode,
586
- $metadata: deserializeMetadata(output),
587
- };
588
- break;
486
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
589
487
  case "ResourceNotFoundException":
590
488
  case "com.amazonaws.kinesis#ResourceNotFoundException":
591
- response = {
592
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
593
- name: errorCode,
594
- $metadata: deserializeMetadata(output),
595
- };
596
- break;
489
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
597
490
  default:
598
491
  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,
492
+ response = new KinesisServiceException_1.KinesisServiceException({
493
+ name: parsedBody.code || parsedBody.Code || errorCode,
604
494
  $fault: "client",
605
495
  $metadata: deserializeMetadata(output),
606
- };
496
+ });
497
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
607
498
  }
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
499
  };
613
500
  const deserializeAws_json1_1DescribeLimitsCommand = async (output, context) => {
614
501
  if (output.statusCode >= 300) {
@@ -635,27 +522,16 @@ const deserializeAws_json1_1DescribeLimitsCommandError = async (output, context)
635
522
  switch (errorCode) {
636
523
  case "LimitExceededException":
637
524
  case "com.amazonaws.kinesis#LimitExceededException":
638
- response = {
639
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
640
- name: errorCode,
641
- $metadata: deserializeMetadata(output),
642
- };
643
- break;
525
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
644
526
  default:
645
527
  const parsedBody = parsedOutput.body;
646
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
647
- response = {
648
- ...parsedBody,
649
- name: `${errorCode}`,
650
- message: parsedBody.message || parsedBody.Message || errorCode,
528
+ response = new KinesisServiceException_1.KinesisServiceException({
529
+ name: parsedBody.code || parsedBody.Code || errorCode,
651
530
  $fault: "client",
652
531
  $metadata: deserializeMetadata(output),
653
- };
532
+ });
533
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
654
534
  }
655
- const message = response.message || response.Message || errorCode;
656
- response.message = message;
657
- delete response.Message;
658
- return Promise.reject(Object.assign(new Error(message), response));
659
535
  };
660
536
  const deserializeAws_json1_1DescribeStreamCommand = async (output, context) => {
661
537
  if (output.statusCode >= 300) {
@@ -682,35 +558,19 @@ const deserializeAws_json1_1DescribeStreamCommandError = async (output, context)
682
558
  switch (errorCode) {
683
559
  case "LimitExceededException":
684
560
  case "com.amazonaws.kinesis#LimitExceededException":
685
- response = {
686
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
687
- name: errorCode,
688
- $metadata: deserializeMetadata(output),
689
- };
690
- break;
561
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
691
562
  case "ResourceNotFoundException":
692
563
  case "com.amazonaws.kinesis#ResourceNotFoundException":
693
- response = {
694
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
695
- name: errorCode,
696
- $metadata: deserializeMetadata(output),
697
- };
698
- break;
564
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
699
565
  default:
700
566
  const parsedBody = parsedOutput.body;
701
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
702
- response = {
703
- ...parsedBody,
704
- name: `${errorCode}`,
705
- message: parsedBody.message || parsedBody.Message || errorCode,
567
+ response = new KinesisServiceException_1.KinesisServiceException({
568
+ name: parsedBody.code || parsedBody.Code || errorCode,
706
569
  $fault: "client",
707
570
  $metadata: deserializeMetadata(output),
708
- };
571
+ });
572
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
709
573
  }
710
- const message = response.message || response.Message || errorCode;
711
- response.message = message;
712
- delete response.Message;
713
- return Promise.reject(Object.assign(new Error(message), response));
714
574
  };
715
575
  const deserializeAws_json1_1DescribeStreamConsumerCommand = async (output, context) => {
716
576
  if (output.statusCode >= 300) {
@@ -737,43 +597,22 @@ const deserializeAws_json1_1DescribeStreamConsumerCommandError = async (output,
737
597
  switch (errorCode) {
738
598
  case "InvalidArgumentException":
739
599
  case "com.amazonaws.kinesis#InvalidArgumentException":
740
- response = {
741
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
742
- name: errorCode,
743
- $metadata: deserializeMetadata(output),
744
- };
745
- break;
600
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
746
601
  case "LimitExceededException":
747
602
  case "com.amazonaws.kinesis#LimitExceededException":
748
- response = {
749
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
750
- name: errorCode,
751
- $metadata: deserializeMetadata(output),
752
- };
753
- break;
603
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
754
604
  case "ResourceNotFoundException":
755
605
  case "com.amazonaws.kinesis#ResourceNotFoundException":
756
- response = {
757
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
758
- name: errorCode,
759
- $metadata: deserializeMetadata(output),
760
- };
761
- break;
606
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
762
607
  default:
763
608
  const parsedBody = parsedOutput.body;
764
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
765
- response = {
766
- ...parsedBody,
767
- name: `${errorCode}`,
768
- message: parsedBody.message || parsedBody.Message || errorCode,
609
+ response = new KinesisServiceException_1.KinesisServiceException({
610
+ name: parsedBody.code || parsedBody.Code || errorCode,
769
611
  $fault: "client",
770
612
  $metadata: deserializeMetadata(output),
771
- };
613
+ });
614
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
772
615
  }
773
- const message = response.message || response.Message || errorCode;
774
- response.message = message;
775
- delete response.Message;
776
- return Promise.reject(Object.assign(new Error(message), response));
777
616
  };
778
617
  const deserializeAws_json1_1DescribeStreamSummaryCommand = async (output, context) => {
779
618
  if (output.statusCode >= 300) {
@@ -800,35 +639,19 @@ const deserializeAws_json1_1DescribeStreamSummaryCommandError = async (output, c
800
639
  switch (errorCode) {
801
640
  case "LimitExceededException":
802
641
  case "com.amazonaws.kinesis#LimitExceededException":
803
- response = {
804
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
805
- name: errorCode,
806
- $metadata: deserializeMetadata(output),
807
- };
808
- break;
642
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
809
643
  case "ResourceNotFoundException":
810
644
  case "com.amazonaws.kinesis#ResourceNotFoundException":
811
- response = {
812
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
813
- name: errorCode,
814
- $metadata: deserializeMetadata(output),
815
- };
816
- break;
645
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
817
646
  default:
818
647
  const parsedBody = parsedOutput.body;
819
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
820
- response = {
821
- ...parsedBody,
822
- name: `${errorCode}`,
823
- message: parsedBody.message || parsedBody.Message || errorCode,
648
+ response = new KinesisServiceException_1.KinesisServiceException({
649
+ name: parsedBody.code || parsedBody.Code || errorCode,
824
650
  $fault: "client",
825
651
  $metadata: deserializeMetadata(output),
826
- };
652
+ });
653
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
827
654
  }
828
- const message = response.message || response.Message || errorCode;
829
- response.message = message;
830
- delete response.Message;
831
- return Promise.reject(Object.assign(new Error(message), response));
832
655
  };
833
656
  const deserializeAws_json1_1DisableEnhancedMonitoringCommand = async (output, context) => {
834
657
  if (output.statusCode >= 300) {
@@ -855,51 +678,25 @@ const deserializeAws_json1_1DisableEnhancedMonitoringCommandError = async (outpu
855
678
  switch (errorCode) {
856
679
  case "InvalidArgumentException":
857
680
  case "com.amazonaws.kinesis#InvalidArgumentException":
858
- response = {
859
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
860
- name: errorCode,
861
- $metadata: deserializeMetadata(output),
862
- };
863
- break;
681
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
864
682
  case "LimitExceededException":
865
683
  case "com.amazonaws.kinesis#LimitExceededException":
866
- response = {
867
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
868
- name: errorCode,
869
- $metadata: deserializeMetadata(output),
870
- };
871
- break;
684
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
872
685
  case "ResourceInUseException":
873
686
  case "com.amazonaws.kinesis#ResourceInUseException":
874
- response = {
875
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
876
- name: errorCode,
877
- $metadata: deserializeMetadata(output),
878
- };
879
- break;
687
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
880
688
  case "ResourceNotFoundException":
881
689
  case "com.amazonaws.kinesis#ResourceNotFoundException":
882
- response = {
883
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
884
- name: errorCode,
885
- $metadata: deserializeMetadata(output),
886
- };
887
- break;
690
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
888
691
  default:
889
692
  const parsedBody = parsedOutput.body;
890
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
891
- response = {
892
- ...parsedBody,
893
- name: `${errorCode}`,
894
- message: parsedBody.message || parsedBody.Message || errorCode,
693
+ response = new KinesisServiceException_1.KinesisServiceException({
694
+ name: parsedBody.code || parsedBody.Code || errorCode,
895
695
  $fault: "client",
896
696
  $metadata: deserializeMetadata(output),
897
- };
697
+ });
698
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
898
699
  }
899
- const message = response.message || response.Message || errorCode;
900
- response.message = message;
901
- delete response.Message;
902
- return Promise.reject(Object.assign(new Error(message), response));
903
700
  };
904
701
  const deserializeAws_json1_1EnableEnhancedMonitoringCommand = async (output, context) => {
905
702
  if (output.statusCode >= 300) {
@@ -926,51 +723,25 @@ const deserializeAws_json1_1EnableEnhancedMonitoringCommandError = async (output
926
723
  switch (errorCode) {
927
724
  case "InvalidArgumentException":
928
725
  case "com.amazonaws.kinesis#InvalidArgumentException":
929
- response = {
930
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
931
- name: errorCode,
932
- $metadata: deserializeMetadata(output),
933
- };
934
- break;
726
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
935
727
  case "LimitExceededException":
936
728
  case "com.amazonaws.kinesis#LimitExceededException":
937
- response = {
938
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
939
- name: errorCode,
940
- $metadata: deserializeMetadata(output),
941
- };
942
- break;
729
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
943
730
  case "ResourceInUseException":
944
731
  case "com.amazonaws.kinesis#ResourceInUseException":
945
- response = {
946
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
947
- name: errorCode,
948
- $metadata: deserializeMetadata(output),
949
- };
950
- break;
732
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
951
733
  case "ResourceNotFoundException":
952
734
  case "com.amazonaws.kinesis#ResourceNotFoundException":
953
- response = {
954
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
955
- name: errorCode,
956
- $metadata: deserializeMetadata(output),
957
- };
958
- break;
735
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
959
736
  default:
960
737
  const parsedBody = parsedOutput.body;
961
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
962
- response = {
963
- ...parsedBody,
964
- name: `${errorCode}`,
965
- message: parsedBody.message || parsedBody.Message || errorCode,
738
+ response = new KinesisServiceException_1.KinesisServiceException({
739
+ name: parsedBody.code || parsedBody.Code || errorCode,
966
740
  $fault: "client",
967
741
  $metadata: deserializeMetadata(output),
968
- };
742
+ });
743
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
969
744
  }
970
- const message = response.message || response.Message || errorCode;
971
- response.message = message;
972
- delete response.Message;
973
- return Promise.reject(Object.assign(new Error(message), response));
974
745
  };
975
746
  const deserializeAws_json1_1GetRecordsCommand = async (output, context) => {
976
747
  if (output.statusCode >= 300) {
@@ -997,99 +768,43 @@ const deserializeAws_json1_1GetRecordsCommandError = async (output, context) =>
997
768
  switch (errorCode) {
998
769
  case "ExpiredIteratorException":
999
770
  case "com.amazonaws.kinesis#ExpiredIteratorException":
1000
- response = {
1001
- ...(await deserializeAws_json1_1ExpiredIteratorExceptionResponse(parsedOutput, context)),
1002
- name: errorCode,
1003
- $metadata: deserializeMetadata(output),
1004
- };
1005
- break;
771
+ throw await deserializeAws_json1_1ExpiredIteratorExceptionResponse(parsedOutput, context);
1006
772
  case "InvalidArgumentException":
1007
773
  case "com.amazonaws.kinesis#InvalidArgumentException":
1008
- response = {
1009
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1010
- name: errorCode,
1011
- $metadata: deserializeMetadata(output),
1012
- };
1013
- break;
774
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1014
775
  case "KMSAccessDeniedException":
1015
776
  case "com.amazonaws.kinesis#KMSAccessDeniedException":
1016
- response = {
1017
- ...(await deserializeAws_json1_1KMSAccessDeniedExceptionResponse(parsedOutput, context)),
1018
- name: errorCode,
1019
- $metadata: deserializeMetadata(output),
1020
- };
1021
- break;
777
+ throw await deserializeAws_json1_1KMSAccessDeniedExceptionResponse(parsedOutput, context);
1022
778
  case "KMSDisabledException":
1023
779
  case "com.amazonaws.kinesis#KMSDisabledException":
1024
- response = {
1025
- ...(await deserializeAws_json1_1KMSDisabledExceptionResponse(parsedOutput, context)),
1026
- name: errorCode,
1027
- $metadata: deserializeMetadata(output),
1028
- };
1029
- break;
780
+ throw await deserializeAws_json1_1KMSDisabledExceptionResponse(parsedOutput, context);
1030
781
  case "KMSInvalidStateException":
1031
782
  case "com.amazonaws.kinesis#KMSInvalidStateException":
1032
- response = {
1033
- ...(await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context)),
1034
- name: errorCode,
1035
- $metadata: deserializeMetadata(output),
1036
- };
1037
- break;
783
+ throw await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context);
1038
784
  case "KMSNotFoundException":
1039
785
  case "com.amazonaws.kinesis#KMSNotFoundException":
1040
- response = {
1041
- ...(await deserializeAws_json1_1KMSNotFoundExceptionResponse(parsedOutput, context)),
1042
- name: errorCode,
1043
- $metadata: deserializeMetadata(output),
1044
- };
1045
- break;
786
+ throw await deserializeAws_json1_1KMSNotFoundExceptionResponse(parsedOutput, context);
1046
787
  case "KMSOptInRequired":
1047
788
  case "com.amazonaws.kinesis#KMSOptInRequired":
1048
- response = {
1049
- ...(await deserializeAws_json1_1KMSOptInRequiredResponse(parsedOutput, context)),
1050
- name: errorCode,
1051
- $metadata: deserializeMetadata(output),
1052
- };
1053
- break;
789
+ throw await deserializeAws_json1_1KMSOptInRequiredResponse(parsedOutput, context);
1054
790
  case "KMSThrottlingException":
1055
791
  case "com.amazonaws.kinesis#KMSThrottlingException":
1056
- response = {
1057
- ...(await deserializeAws_json1_1KMSThrottlingExceptionResponse(parsedOutput, context)),
1058
- name: errorCode,
1059
- $metadata: deserializeMetadata(output),
1060
- };
1061
- break;
792
+ throw await deserializeAws_json1_1KMSThrottlingExceptionResponse(parsedOutput, context);
1062
793
  case "ProvisionedThroughputExceededException":
1063
794
  case "com.amazonaws.kinesis#ProvisionedThroughputExceededException":
1064
- response = {
1065
- ...(await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)),
1066
- name: errorCode,
1067
- $metadata: deserializeMetadata(output),
1068
- };
1069
- break;
795
+ throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
1070
796
  case "ResourceNotFoundException":
1071
797
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1072
- response = {
1073
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1074
- name: errorCode,
1075
- $metadata: deserializeMetadata(output),
1076
- };
1077
- break;
798
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1078
799
  default:
1079
800
  const parsedBody = parsedOutput.body;
1080
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1081
- response = {
1082
- ...parsedBody,
1083
- name: `${errorCode}`,
1084
- message: parsedBody.message || parsedBody.Message || errorCode,
801
+ response = new KinesisServiceException_1.KinesisServiceException({
802
+ name: parsedBody.code || parsedBody.Code || errorCode,
1085
803
  $fault: "client",
1086
804
  $metadata: deserializeMetadata(output),
1087
- };
805
+ });
806
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1088
807
  }
1089
- const message = response.message || response.Message || errorCode;
1090
- response.message = message;
1091
- delete response.Message;
1092
- return Promise.reject(Object.assign(new Error(message), response));
1093
808
  };
1094
809
  const deserializeAws_json1_1GetShardIteratorCommand = async (output, context) => {
1095
810
  if (output.statusCode >= 300) {
@@ -1116,43 +831,22 @@ const deserializeAws_json1_1GetShardIteratorCommandError = async (output, contex
1116
831
  switch (errorCode) {
1117
832
  case "InvalidArgumentException":
1118
833
  case "com.amazonaws.kinesis#InvalidArgumentException":
1119
- response = {
1120
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1121
- name: errorCode,
1122
- $metadata: deserializeMetadata(output),
1123
- };
1124
- break;
834
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1125
835
  case "ProvisionedThroughputExceededException":
1126
836
  case "com.amazonaws.kinesis#ProvisionedThroughputExceededException":
1127
- response = {
1128
- ...(await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)),
1129
- name: errorCode,
1130
- $metadata: deserializeMetadata(output),
1131
- };
1132
- break;
837
+ throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
1133
838
  case "ResourceNotFoundException":
1134
839
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1135
- response = {
1136
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1137
- name: errorCode,
1138
- $metadata: deserializeMetadata(output),
1139
- };
1140
- break;
840
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1141
841
  default:
1142
842
  const parsedBody = parsedOutput.body;
1143
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1144
- response = {
1145
- ...parsedBody,
1146
- name: `${errorCode}`,
1147
- message: parsedBody.message || parsedBody.Message || errorCode,
843
+ response = new KinesisServiceException_1.KinesisServiceException({
844
+ name: parsedBody.code || parsedBody.Code || errorCode,
1148
845
  $fault: "client",
1149
846
  $metadata: deserializeMetadata(output),
1150
- };
847
+ });
848
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1151
849
  }
1152
- const message = response.message || response.Message || errorCode;
1153
- response.message = message;
1154
- delete response.Message;
1155
- return Promise.reject(Object.assign(new Error(message), response));
1156
850
  };
1157
851
  const deserializeAws_json1_1IncreaseStreamRetentionPeriodCommand = async (output, context) => {
1158
852
  if (output.statusCode >= 300) {
@@ -1176,51 +870,25 @@ const deserializeAws_json1_1IncreaseStreamRetentionPeriodCommandError = async (o
1176
870
  switch (errorCode) {
1177
871
  case "InvalidArgumentException":
1178
872
  case "com.amazonaws.kinesis#InvalidArgumentException":
1179
- response = {
1180
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1181
- name: errorCode,
1182
- $metadata: deserializeMetadata(output),
1183
- };
1184
- break;
873
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1185
874
  case "LimitExceededException":
1186
875
  case "com.amazonaws.kinesis#LimitExceededException":
1187
- response = {
1188
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1189
- name: errorCode,
1190
- $metadata: deserializeMetadata(output),
1191
- };
1192
- break;
876
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1193
877
  case "ResourceInUseException":
1194
878
  case "com.amazonaws.kinesis#ResourceInUseException":
1195
- response = {
1196
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
1197
- name: errorCode,
1198
- $metadata: deserializeMetadata(output),
1199
- };
1200
- break;
879
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
1201
880
  case "ResourceNotFoundException":
1202
881
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1203
- response = {
1204
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1205
- name: errorCode,
1206
- $metadata: deserializeMetadata(output),
1207
- };
1208
- break;
882
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1209
883
  default:
1210
884
  const parsedBody = parsedOutput.body;
1211
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1212
- response = {
1213
- ...parsedBody,
1214
- name: `${errorCode}`,
1215
- message: parsedBody.message || parsedBody.Message || errorCode,
885
+ response = new KinesisServiceException_1.KinesisServiceException({
886
+ name: parsedBody.code || parsedBody.Code || errorCode,
1216
887
  $fault: "client",
1217
888
  $metadata: deserializeMetadata(output),
1218
- };
889
+ });
890
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1219
891
  }
1220
- const message = response.message || response.Message || errorCode;
1221
- response.message = message;
1222
- delete response.Message;
1223
- return Promise.reject(Object.assign(new Error(message), response));
1224
892
  };
1225
893
  const deserializeAws_json1_1ListShardsCommand = async (output, context) => {
1226
894
  if (output.statusCode >= 300) {
@@ -1247,59 +915,28 @@ const deserializeAws_json1_1ListShardsCommandError = async (output, context) =>
1247
915
  switch (errorCode) {
1248
916
  case "ExpiredNextTokenException":
1249
917
  case "com.amazonaws.kinesis#ExpiredNextTokenException":
1250
- response = {
1251
- ...(await deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context)),
1252
- name: errorCode,
1253
- $metadata: deserializeMetadata(output),
1254
- };
1255
- break;
918
+ throw await deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context);
1256
919
  case "InvalidArgumentException":
1257
920
  case "com.amazonaws.kinesis#InvalidArgumentException":
1258
- response = {
1259
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1260
- name: errorCode,
1261
- $metadata: deserializeMetadata(output),
1262
- };
1263
- break;
921
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1264
922
  case "LimitExceededException":
1265
923
  case "com.amazonaws.kinesis#LimitExceededException":
1266
- response = {
1267
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1268
- name: errorCode,
1269
- $metadata: deserializeMetadata(output),
1270
- };
1271
- break;
924
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1272
925
  case "ResourceInUseException":
1273
926
  case "com.amazonaws.kinesis#ResourceInUseException":
1274
- response = {
1275
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
1276
- name: errorCode,
1277
- $metadata: deserializeMetadata(output),
1278
- };
1279
- break;
927
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
1280
928
  case "ResourceNotFoundException":
1281
929
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1282
- response = {
1283
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1284
- name: errorCode,
1285
- $metadata: deserializeMetadata(output),
1286
- };
1287
- break;
930
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1288
931
  default:
1289
932
  const parsedBody = parsedOutput.body;
1290
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1291
- response = {
1292
- ...parsedBody,
1293
- name: `${errorCode}`,
1294
- message: parsedBody.message || parsedBody.Message || errorCode,
933
+ response = new KinesisServiceException_1.KinesisServiceException({
934
+ name: parsedBody.code || parsedBody.Code || errorCode,
1295
935
  $fault: "client",
1296
936
  $metadata: deserializeMetadata(output),
1297
- };
937
+ });
938
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1298
939
  }
1299
- const message = response.message || response.Message || errorCode;
1300
- response.message = message;
1301
- delete response.Message;
1302
- return Promise.reject(Object.assign(new Error(message), response));
1303
940
  };
1304
941
  const deserializeAws_json1_1ListStreamConsumersCommand = async (output, context) => {
1305
942
  if (output.statusCode >= 300) {
@@ -1326,59 +963,28 @@ const deserializeAws_json1_1ListStreamConsumersCommandError = async (output, con
1326
963
  switch (errorCode) {
1327
964
  case "ExpiredNextTokenException":
1328
965
  case "com.amazonaws.kinesis#ExpiredNextTokenException":
1329
- response = {
1330
- ...(await deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context)),
1331
- name: errorCode,
1332
- $metadata: deserializeMetadata(output),
1333
- };
1334
- break;
966
+ throw await deserializeAws_json1_1ExpiredNextTokenExceptionResponse(parsedOutput, context);
1335
967
  case "InvalidArgumentException":
1336
968
  case "com.amazonaws.kinesis#InvalidArgumentException":
1337
- response = {
1338
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1339
- name: errorCode,
1340
- $metadata: deserializeMetadata(output),
1341
- };
1342
- break;
969
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1343
970
  case "LimitExceededException":
1344
971
  case "com.amazonaws.kinesis#LimitExceededException":
1345
- response = {
1346
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1347
- name: errorCode,
1348
- $metadata: deserializeMetadata(output),
1349
- };
1350
- break;
972
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1351
973
  case "ResourceInUseException":
1352
974
  case "com.amazonaws.kinesis#ResourceInUseException":
1353
- response = {
1354
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
1355
- name: errorCode,
1356
- $metadata: deserializeMetadata(output),
1357
- };
1358
- break;
975
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
1359
976
  case "ResourceNotFoundException":
1360
977
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1361
- response = {
1362
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1363
- name: errorCode,
1364
- $metadata: deserializeMetadata(output),
1365
- };
1366
- break;
978
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1367
979
  default:
1368
980
  const parsedBody = parsedOutput.body;
1369
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1370
- response = {
1371
- ...parsedBody,
1372
- name: `${errorCode}`,
1373
- message: parsedBody.message || parsedBody.Message || errorCode,
981
+ response = new KinesisServiceException_1.KinesisServiceException({
982
+ name: parsedBody.code || parsedBody.Code || errorCode,
1374
983
  $fault: "client",
1375
984
  $metadata: deserializeMetadata(output),
1376
- };
985
+ });
986
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1377
987
  }
1378
- const message = response.message || response.Message || errorCode;
1379
- response.message = message;
1380
- delete response.Message;
1381
- return Promise.reject(Object.assign(new Error(message), response));
1382
988
  };
1383
989
  const deserializeAws_json1_1ListStreamsCommand = async (output, context) => {
1384
990
  if (output.statusCode >= 300) {
@@ -1405,27 +1011,16 @@ const deserializeAws_json1_1ListStreamsCommandError = async (output, context) =>
1405
1011
  switch (errorCode) {
1406
1012
  case "LimitExceededException":
1407
1013
  case "com.amazonaws.kinesis#LimitExceededException":
1408
- response = {
1409
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1410
- name: errorCode,
1411
- $metadata: deserializeMetadata(output),
1412
- };
1413
- break;
1014
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1414
1015
  default:
1415
1016
  const parsedBody = parsedOutput.body;
1416
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1417
- response = {
1418
- ...parsedBody,
1419
- name: `${errorCode}`,
1420
- message: parsedBody.message || parsedBody.Message || errorCode,
1017
+ response = new KinesisServiceException_1.KinesisServiceException({
1018
+ name: parsedBody.code || parsedBody.Code || errorCode,
1421
1019
  $fault: "client",
1422
1020
  $metadata: deserializeMetadata(output),
1423
- };
1021
+ });
1022
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1424
1023
  }
1425
- const message = response.message || response.Message || errorCode;
1426
- response.message = message;
1427
- delete response.Message;
1428
- return Promise.reject(Object.assign(new Error(message), response));
1429
1024
  };
1430
1025
  const deserializeAws_json1_1ListTagsForStreamCommand = async (output, context) => {
1431
1026
  if (output.statusCode >= 300) {
@@ -1452,43 +1047,22 @@ const deserializeAws_json1_1ListTagsForStreamCommandError = async (output, conte
1452
1047
  switch (errorCode) {
1453
1048
  case "InvalidArgumentException":
1454
1049
  case "com.amazonaws.kinesis#InvalidArgumentException":
1455
- response = {
1456
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1457
- name: errorCode,
1458
- $metadata: deserializeMetadata(output),
1459
- };
1460
- break;
1050
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1461
1051
  case "LimitExceededException":
1462
1052
  case "com.amazonaws.kinesis#LimitExceededException":
1463
- response = {
1464
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1465
- name: errorCode,
1466
- $metadata: deserializeMetadata(output),
1467
- };
1468
- break;
1053
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1469
1054
  case "ResourceNotFoundException":
1470
1055
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1471
- response = {
1472
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1473
- name: errorCode,
1474
- $metadata: deserializeMetadata(output),
1475
- };
1476
- break;
1056
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1477
1057
  default:
1478
1058
  const parsedBody = parsedOutput.body;
1479
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1480
- response = {
1481
- ...parsedBody,
1482
- name: `${errorCode}`,
1483
- message: parsedBody.message || parsedBody.Message || errorCode,
1059
+ response = new KinesisServiceException_1.KinesisServiceException({
1060
+ name: parsedBody.code || parsedBody.Code || errorCode,
1484
1061
  $fault: "client",
1485
1062
  $metadata: deserializeMetadata(output),
1486
- };
1063
+ });
1064
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1487
1065
  }
1488
- const message = response.message || response.Message || errorCode;
1489
- response.message = message;
1490
- delete response.Message;
1491
- return Promise.reject(Object.assign(new Error(message), response));
1492
1066
  };
1493
1067
  const deserializeAws_json1_1MergeShardsCommand = async (output, context) => {
1494
1068
  if (output.statusCode >= 300) {
@@ -1512,59 +1086,28 @@ const deserializeAws_json1_1MergeShardsCommandError = async (output, context) =>
1512
1086
  switch (errorCode) {
1513
1087
  case "InvalidArgumentException":
1514
1088
  case "com.amazonaws.kinesis#InvalidArgumentException":
1515
- response = {
1516
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1517
- name: errorCode,
1518
- $metadata: deserializeMetadata(output),
1519
- };
1520
- break;
1089
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1521
1090
  case "LimitExceededException":
1522
1091
  case "com.amazonaws.kinesis#LimitExceededException":
1523
- response = {
1524
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1525
- name: errorCode,
1526
- $metadata: deserializeMetadata(output),
1527
- };
1528
- break;
1092
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1529
1093
  case "ResourceInUseException":
1530
1094
  case "com.amazonaws.kinesis#ResourceInUseException":
1531
- response = {
1532
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
1533
- name: errorCode,
1534
- $metadata: deserializeMetadata(output),
1535
- };
1536
- break;
1095
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
1537
1096
  case "ResourceNotFoundException":
1538
1097
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1539
- response = {
1540
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1541
- name: errorCode,
1542
- $metadata: deserializeMetadata(output),
1543
- };
1544
- break;
1098
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1545
1099
  case "ValidationException":
1546
1100
  case "com.amazonaws.kinesis#ValidationException":
1547
- response = {
1548
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
1549
- name: errorCode,
1550
- $metadata: deserializeMetadata(output),
1551
- };
1552
- break;
1101
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
1553
1102
  default:
1554
1103
  const parsedBody = parsedOutput.body;
1555
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1556
- response = {
1557
- ...parsedBody,
1558
- name: `${errorCode}`,
1559
- message: parsedBody.message || parsedBody.Message || errorCode,
1104
+ response = new KinesisServiceException_1.KinesisServiceException({
1105
+ name: parsedBody.code || parsedBody.Code || errorCode,
1560
1106
  $fault: "client",
1561
1107
  $metadata: deserializeMetadata(output),
1562
- };
1108
+ });
1109
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1563
1110
  }
1564
- const message = response.message || response.Message || errorCode;
1565
- response.message = message;
1566
- delete response.Message;
1567
- return Promise.reject(Object.assign(new Error(message), response));
1568
1111
  };
1569
1112
  const deserializeAws_json1_1PutRecordCommand = async (output, context) => {
1570
1113
  if (output.statusCode >= 300) {
@@ -1591,91 +1134,40 @@ const deserializeAws_json1_1PutRecordCommandError = async (output, context) => {
1591
1134
  switch (errorCode) {
1592
1135
  case "InvalidArgumentException":
1593
1136
  case "com.amazonaws.kinesis#InvalidArgumentException":
1594
- response = {
1595
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1596
- name: errorCode,
1597
- $metadata: deserializeMetadata(output),
1598
- };
1599
- break;
1137
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1600
1138
  case "KMSAccessDeniedException":
1601
1139
  case "com.amazonaws.kinesis#KMSAccessDeniedException":
1602
- response = {
1603
- ...(await deserializeAws_json1_1KMSAccessDeniedExceptionResponse(parsedOutput, context)),
1604
- name: errorCode,
1605
- $metadata: deserializeMetadata(output),
1606
- };
1607
- break;
1140
+ throw await deserializeAws_json1_1KMSAccessDeniedExceptionResponse(parsedOutput, context);
1608
1141
  case "KMSDisabledException":
1609
1142
  case "com.amazonaws.kinesis#KMSDisabledException":
1610
- response = {
1611
- ...(await deserializeAws_json1_1KMSDisabledExceptionResponse(parsedOutput, context)),
1612
- name: errorCode,
1613
- $metadata: deserializeMetadata(output),
1614
- };
1615
- break;
1143
+ throw await deserializeAws_json1_1KMSDisabledExceptionResponse(parsedOutput, context);
1616
1144
  case "KMSInvalidStateException":
1617
1145
  case "com.amazonaws.kinesis#KMSInvalidStateException":
1618
- response = {
1619
- ...(await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context)),
1620
- name: errorCode,
1621
- $metadata: deserializeMetadata(output),
1622
- };
1623
- break;
1146
+ throw await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context);
1624
1147
  case "KMSNotFoundException":
1625
1148
  case "com.amazonaws.kinesis#KMSNotFoundException":
1626
- response = {
1627
- ...(await deserializeAws_json1_1KMSNotFoundExceptionResponse(parsedOutput, context)),
1628
- name: errorCode,
1629
- $metadata: deserializeMetadata(output),
1630
- };
1631
- break;
1149
+ throw await deserializeAws_json1_1KMSNotFoundExceptionResponse(parsedOutput, context);
1632
1150
  case "KMSOptInRequired":
1633
1151
  case "com.amazonaws.kinesis#KMSOptInRequired":
1634
- response = {
1635
- ...(await deserializeAws_json1_1KMSOptInRequiredResponse(parsedOutput, context)),
1636
- name: errorCode,
1637
- $metadata: deserializeMetadata(output),
1638
- };
1639
- break;
1152
+ throw await deserializeAws_json1_1KMSOptInRequiredResponse(parsedOutput, context);
1640
1153
  case "KMSThrottlingException":
1641
1154
  case "com.amazonaws.kinesis#KMSThrottlingException":
1642
- response = {
1643
- ...(await deserializeAws_json1_1KMSThrottlingExceptionResponse(parsedOutput, context)),
1644
- name: errorCode,
1645
- $metadata: deserializeMetadata(output),
1646
- };
1647
- break;
1155
+ throw await deserializeAws_json1_1KMSThrottlingExceptionResponse(parsedOutput, context);
1648
1156
  case "ProvisionedThroughputExceededException":
1649
1157
  case "com.amazonaws.kinesis#ProvisionedThroughputExceededException":
1650
- response = {
1651
- ...(await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)),
1652
- name: errorCode,
1653
- $metadata: deserializeMetadata(output),
1654
- };
1655
- break;
1158
+ throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
1656
1159
  case "ResourceNotFoundException":
1657
1160
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1658
- response = {
1659
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1660
- name: errorCode,
1661
- $metadata: deserializeMetadata(output),
1662
- };
1663
- break;
1161
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1664
1162
  default:
1665
1163
  const parsedBody = parsedOutput.body;
1666
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1667
- response = {
1668
- ...parsedBody,
1669
- name: `${errorCode}`,
1670
- message: parsedBody.message || parsedBody.Message || errorCode,
1164
+ response = new KinesisServiceException_1.KinesisServiceException({
1165
+ name: parsedBody.code || parsedBody.Code || errorCode,
1671
1166
  $fault: "client",
1672
1167
  $metadata: deserializeMetadata(output),
1673
- };
1168
+ });
1169
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1674
1170
  }
1675
- const message = response.message || response.Message || errorCode;
1676
- response.message = message;
1677
- delete response.Message;
1678
- return Promise.reject(Object.assign(new Error(message), response));
1679
1171
  };
1680
1172
  const deserializeAws_json1_1PutRecordsCommand = async (output, context) => {
1681
1173
  if (output.statusCode >= 300) {
@@ -1702,91 +1194,40 @@ const deserializeAws_json1_1PutRecordsCommandError = async (output, context) =>
1702
1194
  switch (errorCode) {
1703
1195
  case "InvalidArgumentException":
1704
1196
  case "com.amazonaws.kinesis#InvalidArgumentException":
1705
- response = {
1706
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1707
- name: errorCode,
1708
- $metadata: deserializeMetadata(output),
1709
- };
1710
- break;
1197
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1711
1198
  case "KMSAccessDeniedException":
1712
1199
  case "com.amazonaws.kinesis#KMSAccessDeniedException":
1713
- response = {
1714
- ...(await deserializeAws_json1_1KMSAccessDeniedExceptionResponse(parsedOutput, context)),
1715
- name: errorCode,
1716
- $metadata: deserializeMetadata(output),
1717
- };
1718
- break;
1200
+ throw await deserializeAws_json1_1KMSAccessDeniedExceptionResponse(parsedOutput, context);
1719
1201
  case "KMSDisabledException":
1720
1202
  case "com.amazonaws.kinesis#KMSDisabledException":
1721
- response = {
1722
- ...(await deserializeAws_json1_1KMSDisabledExceptionResponse(parsedOutput, context)),
1723
- name: errorCode,
1724
- $metadata: deserializeMetadata(output),
1725
- };
1726
- break;
1203
+ throw await deserializeAws_json1_1KMSDisabledExceptionResponse(parsedOutput, context);
1727
1204
  case "KMSInvalidStateException":
1728
1205
  case "com.amazonaws.kinesis#KMSInvalidStateException":
1729
- response = {
1730
- ...(await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context)),
1731
- name: errorCode,
1732
- $metadata: deserializeMetadata(output),
1733
- };
1734
- break;
1206
+ throw await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context);
1735
1207
  case "KMSNotFoundException":
1736
1208
  case "com.amazonaws.kinesis#KMSNotFoundException":
1737
- response = {
1738
- ...(await deserializeAws_json1_1KMSNotFoundExceptionResponse(parsedOutput, context)),
1739
- name: errorCode,
1740
- $metadata: deserializeMetadata(output),
1741
- };
1742
- break;
1209
+ throw await deserializeAws_json1_1KMSNotFoundExceptionResponse(parsedOutput, context);
1743
1210
  case "KMSOptInRequired":
1744
1211
  case "com.amazonaws.kinesis#KMSOptInRequired":
1745
- response = {
1746
- ...(await deserializeAws_json1_1KMSOptInRequiredResponse(parsedOutput, context)),
1747
- name: errorCode,
1748
- $metadata: deserializeMetadata(output),
1749
- };
1750
- break;
1212
+ throw await deserializeAws_json1_1KMSOptInRequiredResponse(parsedOutput, context);
1751
1213
  case "KMSThrottlingException":
1752
1214
  case "com.amazonaws.kinesis#KMSThrottlingException":
1753
- response = {
1754
- ...(await deserializeAws_json1_1KMSThrottlingExceptionResponse(parsedOutput, context)),
1755
- name: errorCode,
1756
- $metadata: deserializeMetadata(output),
1757
- };
1758
- break;
1215
+ throw await deserializeAws_json1_1KMSThrottlingExceptionResponse(parsedOutput, context);
1759
1216
  case "ProvisionedThroughputExceededException":
1760
1217
  case "com.amazonaws.kinesis#ProvisionedThroughputExceededException":
1761
- response = {
1762
- ...(await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)),
1763
- name: errorCode,
1764
- $metadata: deserializeMetadata(output),
1765
- };
1766
- break;
1218
+ throw await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context);
1767
1219
  case "ResourceNotFoundException":
1768
1220
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1769
- response = {
1770
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1771
- name: errorCode,
1772
- $metadata: deserializeMetadata(output),
1773
- };
1774
- break;
1221
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1775
1222
  default:
1776
1223
  const parsedBody = parsedOutput.body;
1777
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1778
- response = {
1779
- ...parsedBody,
1780
- name: `${errorCode}`,
1781
- message: parsedBody.message || parsedBody.Message || errorCode,
1224
+ response = new KinesisServiceException_1.KinesisServiceException({
1225
+ name: parsedBody.code || parsedBody.Code || errorCode,
1782
1226
  $fault: "client",
1783
1227
  $metadata: deserializeMetadata(output),
1784
- };
1228
+ });
1229
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1785
1230
  }
1786
- const message = response.message || response.Message || errorCode;
1787
- response.message = message;
1788
- delete response.Message;
1789
- return Promise.reject(Object.assign(new Error(message), response));
1790
1231
  };
1791
1232
  const deserializeAws_json1_1RegisterStreamConsumerCommand = async (output, context) => {
1792
1233
  if (output.statusCode >= 300) {
@@ -1813,51 +1254,25 @@ const deserializeAws_json1_1RegisterStreamConsumerCommandError = async (output,
1813
1254
  switch (errorCode) {
1814
1255
  case "InvalidArgumentException":
1815
1256
  case "com.amazonaws.kinesis#InvalidArgumentException":
1816
- response = {
1817
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1818
- name: errorCode,
1819
- $metadata: deserializeMetadata(output),
1820
- };
1821
- break;
1257
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1822
1258
  case "LimitExceededException":
1823
1259
  case "com.amazonaws.kinesis#LimitExceededException":
1824
- response = {
1825
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1826
- name: errorCode,
1827
- $metadata: deserializeMetadata(output),
1828
- };
1829
- break;
1260
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1830
1261
  case "ResourceInUseException":
1831
1262
  case "com.amazonaws.kinesis#ResourceInUseException":
1832
- response = {
1833
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
1834
- name: errorCode,
1835
- $metadata: deserializeMetadata(output),
1836
- };
1837
- break;
1263
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
1838
1264
  case "ResourceNotFoundException":
1839
1265
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1840
- response = {
1841
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1842
- name: errorCode,
1843
- $metadata: deserializeMetadata(output),
1844
- };
1845
- break;
1266
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1846
1267
  default:
1847
1268
  const parsedBody = parsedOutput.body;
1848
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1849
- response = {
1850
- ...parsedBody,
1851
- name: `${errorCode}`,
1852
- message: parsedBody.message || parsedBody.Message || errorCode,
1269
+ response = new KinesisServiceException_1.KinesisServiceException({
1270
+ name: parsedBody.code || parsedBody.Code || errorCode,
1853
1271
  $fault: "client",
1854
1272
  $metadata: deserializeMetadata(output),
1855
- };
1273
+ });
1274
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1856
1275
  }
1857
- const message = response.message || response.Message || errorCode;
1858
- response.message = message;
1859
- delete response.Message;
1860
- return Promise.reject(Object.assign(new Error(message), response));
1861
1276
  };
1862
1277
  const deserializeAws_json1_1RemoveTagsFromStreamCommand = async (output, context) => {
1863
1278
  if (output.statusCode >= 300) {
@@ -1881,51 +1296,25 @@ const deserializeAws_json1_1RemoveTagsFromStreamCommandError = async (output, co
1881
1296
  switch (errorCode) {
1882
1297
  case "InvalidArgumentException":
1883
1298
  case "com.amazonaws.kinesis#InvalidArgumentException":
1884
- response = {
1885
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1886
- name: errorCode,
1887
- $metadata: deserializeMetadata(output),
1888
- };
1889
- break;
1299
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1890
1300
  case "LimitExceededException":
1891
1301
  case "com.amazonaws.kinesis#LimitExceededException":
1892
- response = {
1893
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1894
- name: errorCode,
1895
- $metadata: deserializeMetadata(output),
1896
- };
1897
- break;
1302
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1898
1303
  case "ResourceInUseException":
1899
1304
  case "com.amazonaws.kinesis#ResourceInUseException":
1900
- response = {
1901
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
1902
- name: errorCode,
1903
- $metadata: deserializeMetadata(output),
1904
- };
1905
- break;
1305
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
1906
1306
  case "ResourceNotFoundException":
1907
1307
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1908
- response = {
1909
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1910
- name: errorCode,
1911
- $metadata: deserializeMetadata(output),
1912
- };
1913
- break;
1308
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1914
1309
  default:
1915
1310
  const parsedBody = parsedOutput.body;
1916
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1917
- response = {
1918
- ...parsedBody,
1919
- name: `${errorCode}`,
1920
- message: parsedBody.message || parsedBody.Message || errorCode,
1311
+ response = new KinesisServiceException_1.KinesisServiceException({
1312
+ name: parsedBody.code || parsedBody.Code || errorCode,
1921
1313
  $fault: "client",
1922
1314
  $metadata: deserializeMetadata(output),
1923
- };
1315
+ });
1316
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1924
1317
  }
1925
- const message = response.message || response.Message || errorCode;
1926
- response.message = message;
1927
- delete response.Message;
1928
- return Promise.reject(Object.assign(new Error(message), response));
1929
1318
  };
1930
1319
  const deserializeAws_json1_1SplitShardCommand = async (output, context) => {
1931
1320
  if (output.statusCode >= 300) {
@@ -1949,59 +1338,28 @@ const deserializeAws_json1_1SplitShardCommandError = async (output, context) =>
1949
1338
  switch (errorCode) {
1950
1339
  case "InvalidArgumentException":
1951
1340
  case "com.amazonaws.kinesis#InvalidArgumentException":
1952
- response = {
1953
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
1954
- name: errorCode,
1955
- $metadata: deserializeMetadata(output),
1956
- };
1957
- break;
1341
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
1958
1342
  case "LimitExceededException":
1959
1343
  case "com.amazonaws.kinesis#LimitExceededException":
1960
- response = {
1961
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
1962
- name: errorCode,
1963
- $metadata: deserializeMetadata(output),
1964
- };
1965
- break;
1344
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
1966
1345
  case "ResourceInUseException":
1967
1346
  case "com.amazonaws.kinesis#ResourceInUseException":
1968
- response = {
1969
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
1970
- name: errorCode,
1971
- $metadata: deserializeMetadata(output),
1972
- };
1973
- break;
1347
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
1974
1348
  case "ResourceNotFoundException":
1975
1349
  case "com.amazonaws.kinesis#ResourceNotFoundException":
1976
- response = {
1977
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1978
- name: errorCode,
1979
- $metadata: deserializeMetadata(output),
1980
- };
1981
- break;
1350
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
1982
1351
  case "ValidationException":
1983
1352
  case "com.amazonaws.kinesis#ValidationException":
1984
- response = {
1985
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
1986
- name: errorCode,
1987
- $metadata: deserializeMetadata(output),
1988
- };
1989
- break;
1353
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
1990
1354
  default:
1991
1355
  const parsedBody = parsedOutput.body;
1992
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1993
- response = {
1994
- ...parsedBody,
1995
- name: `${errorCode}`,
1996
- message: parsedBody.message || parsedBody.Message || errorCode,
1356
+ response = new KinesisServiceException_1.KinesisServiceException({
1357
+ name: parsedBody.code || parsedBody.Code || errorCode,
1997
1358
  $fault: "client",
1998
1359
  $metadata: deserializeMetadata(output),
1999
- };
1360
+ });
1361
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2000
1362
  }
2001
- const message = response.message || response.Message || errorCode;
2002
- response.message = message;
2003
- delete response.Message;
2004
- return Promise.reject(Object.assign(new Error(message), response));
2005
1363
  };
2006
1364
  const deserializeAws_json1_1StartStreamEncryptionCommand = async (output, context) => {
2007
1365
  if (output.statusCode >= 300) {
@@ -2025,99 +1383,43 @@ const deserializeAws_json1_1StartStreamEncryptionCommandError = async (output, c
2025
1383
  switch (errorCode) {
2026
1384
  case "InvalidArgumentException":
2027
1385
  case "com.amazonaws.kinesis#InvalidArgumentException":
2028
- response = {
2029
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
2030
- name: errorCode,
2031
- $metadata: deserializeMetadata(output),
2032
- };
2033
- break;
1386
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
2034
1387
  case "KMSAccessDeniedException":
2035
1388
  case "com.amazonaws.kinesis#KMSAccessDeniedException":
2036
- response = {
2037
- ...(await deserializeAws_json1_1KMSAccessDeniedExceptionResponse(parsedOutput, context)),
2038
- name: errorCode,
2039
- $metadata: deserializeMetadata(output),
2040
- };
2041
- break;
1389
+ throw await deserializeAws_json1_1KMSAccessDeniedExceptionResponse(parsedOutput, context);
2042
1390
  case "KMSDisabledException":
2043
1391
  case "com.amazonaws.kinesis#KMSDisabledException":
2044
- response = {
2045
- ...(await deserializeAws_json1_1KMSDisabledExceptionResponse(parsedOutput, context)),
2046
- name: errorCode,
2047
- $metadata: deserializeMetadata(output),
2048
- };
2049
- break;
1392
+ throw await deserializeAws_json1_1KMSDisabledExceptionResponse(parsedOutput, context);
2050
1393
  case "KMSInvalidStateException":
2051
1394
  case "com.amazonaws.kinesis#KMSInvalidStateException":
2052
- response = {
2053
- ...(await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context)),
2054
- name: errorCode,
2055
- $metadata: deserializeMetadata(output),
2056
- };
2057
- break;
1395
+ throw await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context);
2058
1396
  case "KMSNotFoundException":
2059
1397
  case "com.amazonaws.kinesis#KMSNotFoundException":
2060
- response = {
2061
- ...(await deserializeAws_json1_1KMSNotFoundExceptionResponse(parsedOutput, context)),
2062
- name: errorCode,
2063
- $metadata: deserializeMetadata(output),
2064
- };
2065
- break;
1398
+ throw await deserializeAws_json1_1KMSNotFoundExceptionResponse(parsedOutput, context);
2066
1399
  case "KMSOptInRequired":
2067
1400
  case "com.amazonaws.kinesis#KMSOptInRequired":
2068
- response = {
2069
- ...(await deserializeAws_json1_1KMSOptInRequiredResponse(parsedOutput, context)),
2070
- name: errorCode,
2071
- $metadata: deserializeMetadata(output),
2072
- };
2073
- break;
1401
+ throw await deserializeAws_json1_1KMSOptInRequiredResponse(parsedOutput, context);
2074
1402
  case "KMSThrottlingException":
2075
1403
  case "com.amazonaws.kinesis#KMSThrottlingException":
2076
- response = {
2077
- ...(await deserializeAws_json1_1KMSThrottlingExceptionResponse(parsedOutput, context)),
2078
- name: errorCode,
2079
- $metadata: deserializeMetadata(output),
2080
- };
2081
- break;
1404
+ throw await deserializeAws_json1_1KMSThrottlingExceptionResponse(parsedOutput, context);
2082
1405
  case "LimitExceededException":
2083
1406
  case "com.amazonaws.kinesis#LimitExceededException":
2084
- response = {
2085
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2086
- name: errorCode,
2087
- $metadata: deserializeMetadata(output),
2088
- };
2089
- break;
1407
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2090
1408
  case "ResourceInUseException":
2091
1409
  case "com.amazonaws.kinesis#ResourceInUseException":
2092
- response = {
2093
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2094
- name: errorCode,
2095
- $metadata: deserializeMetadata(output),
2096
- };
2097
- break;
1410
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2098
1411
  case "ResourceNotFoundException":
2099
1412
  case "com.amazonaws.kinesis#ResourceNotFoundException":
2100
- response = {
2101
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2102
- name: errorCode,
2103
- $metadata: deserializeMetadata(output),
2104
- };
2105
- break;
1413
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2106
1414
  default:
2107
1415
  const parsedBody = parsedOutput.body;
2108
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2109
- response = {
2110
- ...parsedBody,
2111
- name: `${errorCode}`,
2112
- message: parsedBody.message || parsedBody.Message || errorCode,
1416
+ response = new KinesisServiceException_1.KinesisServiceException({
1417
+ name: parsedBody.code || parsedBody.Code || errorCode,
2113
1418
  $fault: "client",
2114
1419
  $metadata: deserializeMetadata(output),
2115
- };
1420
+ });
1421
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2116
1422
  }
2117
- const message = response.message || response.Message || errorCode;
2118
- response.message = message;
2119
- delete response.Message;
2120
- return Promise.reject(Object.assign(new Error(message), response));
2121
1423
  };
2122
1424
  const deserializeAws_json1_1StopStreamEncryptionCommand = async (output, context) => {
2123
1425
  if (output.statusCode >= 300) {
@@ -2141,51 +1443,25 @@ const deserializeAws_json1_1StopStreamEncryptionCommandError = async (output, co
2141
1443
  switch (errorCode) {
2142
1444
  case "InvalidArgumentException":
2143
1445
  case "com.amazonaws.kinesis#InvalidArgumentException":
2144
- response = {
2145
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
2146
- name: errorCode,
2147
- $metadata: deserializeMetadata(output),
2148
- };
2149
- break;
1446
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
2150
1447
  case "LimitExceededException":
2151
1448
  case "com.amazonaws.kinesis#LimitExceededException":
2152
- response = {
2153
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2154
- name: errorCode,
2155
- $metadata: deserializeMetadata(output),
2156
- };
2157
- break;
1449
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2158
1450
  case "ResourceInUseException":
2159
1451
  case "com.amazonaws.kinesis#ResourceInUseException":
2160
- response = {
2161
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2162
- name: errorCode,
2163
- $metadata: deserializeMetadata(output),
2164
- };
2165
- break;
1452
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2166
1453
  case "ResourceNotFoundException":
2167
1454
  case "com.amazonaws.kinesis#ResourceNotFoundException":
2168
- response = {
2169
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2170
- name: errorCode,
2171
- $metadata: deserializeMetadata(output),
2172
- };
2173
- break;
1455
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2174
1456
  default:
2175
1457
  const parsedBody = parsedOutput.body;
2176
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2177
- response = {
2178
- ...parsedBody,
2179
- name: `${errorCode}`,
2180
- message: parsedBody.message || parsedBody.Message || errorCode,
1458
+ response = new KinesisServiceException_1.KinesisServiceException({
1459
+ name: parsedBody.code || parsedBody.Code || errorCode,
2181
1460
  $fault: "client",
2182
1461
  $metadata: deserializeMetadata(output),
2183
- };
1462
+ });
1463
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2184
1464
  }
2185
- const message = response.message || response.Message || errorCode;
2186
- response.message = message;
2187
- delete response.Message;
2188
- return Promise.reject(Object.assign(new Error(message), response));
2189
1465
  };
2190
1466
  const deserializeAws_json1_1SubscribeToShardCommand = async (output, context) => {
2191
1467
  if (output.statusCode >= 300) {
@@ -2212,51 +1488,25 @@ const deserializeAws_json1_1SubscribeToShardCommandError = async (output, contex
2212
1488
  switch (errorCode) {
2213
1489
  case "InvalidArgumentException":
2214
1490
  case "com.amazonaws.kinesis#InvalidArgumentException":
2215
- response = {
2216
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
2217
- name: errorCode,
2218
- $metadata: deserializeMetadata(output),
2219
- };
2220
- break;
1491
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
2221
1492
  case "LimitExceededException":
2222
1493
  case "com.amazonaws.kinesis#LimitExceededException":
2223
- response = {
2224
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2225
- name: errorCode,
2226
- $metadata: deserializeMetadata(output),
2227
- };
2228
- break;
1494
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2229
1495
  case "ResourceInUseException":
2230
1496
  case "com.amazonaws.kinesis#ResourceInUseException":
2231
- response = {
2232
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2233
- name: errorCode,
2234
- $metadata: deserializeMetadata(output),
2235
- };
2236
- break;
1497
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2237
1498
  case "ResourceNotFoundException":
2238
1499
  case "com.amazonaws.kinesis#ResourceNotFoundException":
2239
- response = {
2240
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2241
- name: errorCode,
2242
- $metadata: deserializeMetadata(output),
2243
- };
2244
- break;
1500
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2245
1501
  default:
2246
1502
  const parsedBody = parsedOutput.body;
2247
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2248
- response = {
2249
- ...parsedBody,
2250
- name: `${errorCode}`,
2251
- message: parsedBody.message || parsedBody.Message || errorCode,
1503
+ response = new KinesisServiceException_1.KinesisServiceException({
1504
+ name: parsedBody.code || parsedBody.Code || errorCode,
2252
1505
  $fault: "client",
2253
1506
  $metadata: deserializeMetadata(output),
2254
- };
1507
+ });
1508
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2255
1509
  }
2256
- const message = response.message || response.Message || errorCode;
2257
- response.message = message;
2258
- delete response.Message;
2259
- return Promise.reject(Object.assign(new Error(message), response));
2260
1510
  };
2261
1511
  const deserializeAws_json1_1UpdateShardCountCommand = async (output, context) => {
2262
1512
  if (output.statusCode >= 300) {
@@ -2283,59 +1533,28 @@ const deserializeAws_json1_1UpdateShardCountCommandError = async (output, contex
2283
1533
  switch (errorCode) {
2284
1534
  case "InvalidArgumentException":
2285
1535
  case "com.amazonaws.kinesis#InvalidArgumentException":
2286
- response = {
2287
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
2288
- name: errorCode,
2289
- $metadata: deserializeMetadata(output),
2290
- };
2291
- break;
1536
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
2292
1537
  case "LimitExceededException":
2293
1538
  case "com.amazonaws.kinesis#LimitExceededException":
2294
- response = {
2295
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2296
- name: errorCode,
2297
- $metadata: deserializeMetadata(output),
2298
- };
2299
- break;
1539
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2300
1540
  case "ResourceInUseException":
2301
1541
  case "com.amazonaws.kinesis#ResourceInUseException":
2302
- response = {
2303
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2304
- name: errorCode,
2305
- $metadata: deserializeMetadata(output),
2306
- };
2307
- break;
1542
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2308
1543
  case "ResourceNotFoundException":
2309
1544
  case "com.amazonaws.kinesis#ResourceNotFoundException":
2310
- response = {
2311
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2312
- name: errorCode,
2313
- $metadata: deserializeMetadata(output),
2314
- };
2315
- break;
1545
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2316
1546
  case "ValidationException":
2317
1547
  case "com.amazonaws.kinesis#ValidationException":
2318
- response = {
2319
- ...(await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)),
2320
- name: errorCode,
2321
- $metadata: deserializeMetadata(output),
2322
- };
2323
- break;
1548
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
2324
1549
  default:
2325
1550
  const parsedBody = parsedOutput.body;
2326
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2327
- response = {
2328
- ...parsedBody,
2329
- name: `${errorCode}`,
2330
- message: parsedBody.message || parsedBody.Message || errorCode,
1551
+ response = new KinesisServiceException_1.KinesisServiceException({
1552
+ name: parsedBody.code || parsedBody.Code || errorCode,
2331
1553
  $fault: "client",
2332
1554
  $metadata: deserializeMetadata(output),
2333
- };
1555
+ });
1556
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2334
1557
  }
2335
- const message = response.message || response.Message || errorCode;
2336
- response.message = message;
2337
- delete response.Message;
2338
- return Promise.reject(Object.assign(new Error(message), response));
2339
1558
  };
2340
1559
  const deserializeAws_json1_1UpdateStreamModeCommand = async (output, context) => {
2341
1560
  if (output.statusCode >= 300) {
@@ -2359,205 +1578,151 @@ const deserializeAws_json1_1UpdateStreamModeCommandError = async (output, contex
2359
1578
  switch (errorCode) {
2360
1579
  case "InvalidArgumentException":
2361
1580
  case "com.amazonaws.kinesis#InvalidArgumentException":
2362
- response = {
2363
- ...(await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context)),
2364
- name: errorCode,
2365
- $metadata: deserializeMetadata(output),
2366
- };
2367
- break;
1581
+ throw await deserializeAws_json1_1InvalidArgumentExceptionResponse(parsedOutput, context);
2368
1582
  case "LimitExceededException":
2369
1583
  case "com.amazonaws.kinesis#LimitExceededException":
2370
- response = {
2371
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2372
- name: errorCode,
2373
- $metadata: deserializeMetadata(output),
2374
- };
2375
- break;
1584
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2376
1585
  case "ResourceInUseException":
2377
1586
  case "com.amazonaws.kinesis#ResourceInUseException":
2378
- response = {
2379
- ...(await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context)),
2380
- name: errorCode,
2381
- $metadata: deserializeMetadata(output),
2382
- };
2383
- break;
1587
+ throw await deserializeAws_json1_1ResourceInUseExceptionResponse(parsedOutput, context);
2384
1588
  case "ResourceNotFoundException":
2385
1589
  case "com.amazonaws.kinesis#ResourceNotFoundException":
2386
- response = {
2387
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2388
- name: errorCode,
2389
- $metadata: deserializeMetadata(output),
2390
- };
2391
- break;
1590
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
2392
1591
  default:
2393
1592
  const parsedBody = parsedOutput.body;
2394
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2395
- response = {
2396
- ...parsedBody,
2397
- name: `${errorCode}`,
2398
- message: parsedBody.message || parsedBody.Message || errorCode,
1593
+ response = new KinesisServiceException_1.KinesisServiceException({
1594
+ name: parsedBody.code || parsedBody.Code || errorCode,
2399
1595
  $fault: "client",
2400
1596
  $metadata: deserializeMetadata(output),
2401
- };
1597
+ });
1598
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2402
1599
  }
2403
- const message = response.message || response.Message || errorCode;
2404
- response.message = message;
2405
- delete response.Message;
2406
- return Promise.reject(Object.assign(new Error(message), response));
2407
1600
  };
2408
1601
  const deserializeAws_json1_1ExpiredIteratorExceptionResponse = async (parsedOutput, context) => {
2409
1602
  const body = parsedOutput.body;
2410
1603
  const deserialized = deserializeAws_json1_1ExpiredIteratorException(body, context);
2411
- const contents = {
2412
- name: "ExpiredIteratorException",
2413
- $fault: "client",
1604
+ const exception = new models_0_1.ExpiredIteratorException({
2414
1605
  $metadata: deserializeMetadata(parsedOutput),
2415
1606
  ...deserialized,
2416
- };
2417
- return contents;
1607
+ });
1608
+ return smithy_client_1.decorateServiceException(exception, body);
2418
1609
  };
2419
1610
  const deserializeAws_json1_1ExpiredNextTokenExceptionResponse = async (parsedOutput, context) => {
2420
1611
  const body = parsedOutput.body;
2421
1612
  const deserialized = deserializeAws_json1_1ExpiredNextTokenException(body, context);
2422
- const contents = {
2423
- name: "ExpiredNextTokenException",
2424
- $fault: "client",
1613
+ const exception = new models_0_1.ExpiredNextTokenException({
2425
1614
  $metadata: deserializeMetadata(parsedOutput),
2426
1615
  ...deserialized,
2427
- };
2428
- return contents;
1616
+ });
1617
+ return smithy_client_1.decorateServiceException(exception, body);
2429
1618
  };
2430
1619
  const deserializeAws_json1_1InvalidArgumentExceptionResponse = async (parsedOutput, context) => {
2431
1620
  const body = parsedOutput.body;
2432
1621
  const deserialized = deserializeAws_json1_1InvalidArgumentException(body, context);
2433
- const contents = {
2434
- name: "InvalidArgumentException",
2435
- $fault: "client",
1622
+ const exception = new models_0_1.InvalidArgumentException({
2436
1623
  $metadata: deserializeMetadata(parsedOutput),
2437
1624
  ...deserialized,
2438
- };
2439
- return contents;
1625
+ });
1626
+ return smithy_client_1.decorateServiceException(exception, body);
2440
1627
  };
2441
1628
  const deserializeAws_json1_1KMSAccessDeniedExceptionResponse = async (parsedOutput, context) => {
2442
1629
  const body = parsedOutput.body;
2443
1630
  const deserialized = deserializeAws_json1_1KMSAccessDeniedException(body, context);
2444
- const contents = {
2445
- name: "KMSAccessDeniedException",
2446
- $fault: "client",
1631
+ const exception = new models_0_1.KMSAccessDeniedException({
2447
1632
  $metadata: deserializeMetadata(parsedOutput),
2448
1633
  ...deserialized,
2449
- };
2450
- return contents;
1634
+ });
1635
+ return smithy_client_1.decorateServiceException(exception, body);
2451
1636
  };
2452
1637
  const deserializeAws_json1_1KMSDisabledExceptionResponse = async (parsedOutput, context) => {
2453
1638
  const body = parsedOutput.body;
2454
1639
  const deserialized = deserializeAws_json1_1KMSDisabledException(body, context);
2455
- const contents = {
2456
- name: "KMSDisabledException",
2457
- $fault: "client",
1640
+ const exception = new models_0_1.KMSDisabledException({
2458
1641
  $metadata: deserializeMetadata(parsedOutput),
2459
1642
  ...deserialized,
2460
- };
2461
- return contents;
1643
+ });
1644
+ return smithy_client_1.decorateServiceException(exception, body);
2462
1645
  };
2463
1646
  const deserializeAws_json1_1KMSInvalidStateExceptionResponse = async (parsedOutput, context) => {
2464
1647
  const body = parsedOutput.body;
2465
1648
  const deserialized = deserializeAws_json1_1KMSInvalidStateException(body, context);
2466
- const contents = {
2467
- name: "KMSInvalidStateException",
2468
- $fault: "client",
1649
+ const exception = new models_0_1.KMSInvalidStateException({
2469
1650
  $metadata: deserializeMetadata(parsedOutput),
2470
1651
  ...deserialized,
2471
- };
2472
- return contents;
1652
+ });
1653
+ return smithy_client_1.decorateServiceException(exception, body);
2473
1654
  };
2474
1655
  const deserializeAws_json1_1KMSNotFoundExceptionResponse = async (parsedOutput, context) => {
2475
1656
  const body = parsedOutput.body;
2476
1657
  const deserialized = deserializeAws_json1_1KMSNotFoundException(body, context);
2477
- const contents = {
2478
- name: "KMSNotFoundException",
2479
- $fault: "client",
1658
+ const exception = new models_0_1.KMSNotFoundException({
2480
1659
  $metadata: deserializeMetadata(parsedOutput),
2481
1660
  ...deserialized,
2482
- };
2483
- return contents;
1661
+ });
1662
+ return smithy_client_1.decorateServiceException(exception, body);
2484
1663
  };
2485
1664
  const deserializeAws_json1_1KMSOptInRequiredResponse = async (parsedOutput, context) => {
2486
1665
  const body = parsedOutput.body;
2487
1666
  const deserialized = deserializeAws_json1_1KMSOptInRequired(body, context);
2488
- const contents = {
2489
- name: "KMSOptInRequired",
2490
- $fault: "client",
1667
+ const exception = new models_0_1.KMSOptInRequired({
2491
1668
  $metadata: deserializeMetadata(parsedOutput),
2492
1669
  ...deserialized,
2493
- };
2494
- return contents;
1670
+ });
1671
+ return smithy_client_1.decorateServiceException(exception, body);
2495
1672
  };
2496
1673
  const deserializeAws_json1_1KMSThrottlingExceptionResponse = async (parsedOutput, context) => {
2497
1674
  const body = parsedOutput.body;
2498
1675
  const deserialized = deserializeAws_json1_1KMSThrottlingException(body, context);
2499
- const contents = {
2500
- name: "KMSThrottlingException",
2501
- $fault: "client",
1676
+ const exception = new models_0_1.KMSThrottlingException({
2502
1677
  $metadata: deserializeMetadata(parsedOutput),
2503
1678
  ...deserialized,
2504
- };
2505
- return contents;
1679
+ });
1680
+ return smithy_client_1.decorateServiceException(exception, body);
2506
1681
  };
2507
1682
  const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
2508
1683
  const body = parsedOutput.body;
2509
1684
  const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
2510
- const contents = {
2511
- name: "LimitExceededException",
2512
- $fault: "client",
1685
+ const exception = new models_0_1.LimitExceededException({
2513
1686
  $metadata: deserializeMetadata(parsedOutput),
2514
1687
  ...deserialized,
2515
- };
2516
- return contents;
1688
+ });
1689
+ return smithy_client_1.decorateServiceException(exception, body);
2517
1690
  };
2518
1691
  const deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse = async (parsedOutput, context) => {
2519
1692
  const body = parsedOutput.body;
2520
1693
  const deserialized = deserializeAws_json1_1ProvisionedThroughputExceededException(body, context);
2521
- const contents = {
2522
- name: "ProvisionedThroughputExceededException",
2523
- $fault: "client",
1694
+ const exception = new models_0_1.ProvisionedThroughputExceededException({
2524
1695
  $metadata: deserializeMetadata(parsedOutput),
2525
1696
  ...deserialized,
2526
- };
2527
- return contents;
1697
+ });
1698
+ return smithy_client_1.decorateServiceException(exception, body);
2528
1699
  };
2529
1700
  const deserializeAws_json1_1ResourceInUseExceptionResponse = async (parsedOutput, context) => {
2530
1701
  const body = parsedOutput.body;
2531
1702
  const deserialized = deserializeAws_json1_1ResourceInUseException(body, context);
2532
- const contents = {
2533
- name: "ResourceInUseException",
2534
- $fault: "client",
1703
+ const exception = new models_0_1.ResourceInUseException({
2535
1704
  $metadata: deserializeMetadata(parsedOutput),
2536
1705
  ...deserialized,
2537
- };
2538
- return contents;
1706
+ });
1707
+ return smithy_client_1.decorateServiceException(exception, body);
2539
1708
  };
2540
1709
  const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
2541
1710
  const body = parsedOutput.body;
2542
1711
  const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
2543
- const contents = {
2544
- name: "ResourceNotFoundException",
2545
- $fault: "client",
1712
+ const exception = new models_0_1.ResourceNotFoundException({
2546
1713
  $metadata: deserializeMetadata(parsedOutput),
2547
1714
  ...deserialized,
2548
- };
2549
- return contents;
1715
+ });
1716
+ return smithy_client_1.decorateServiceException(exception, body);
2550
1717
  };
2551
1718
  const deserializeAws_json1_1ValidationExceptionResponse = async (parsedOutput, context) => {
2552
1719
  const body = parsedOutput.body;
2553
1720
  const deserialized = deserializeAws_json1_1ValidationException(body, context);
2554
- const contents = {
2555
- name: "ValidationException",
2556
- $fault: "client",
1721
+ const exception = new models_0_1.ValidationException({
2557
1722
  $metadata: deserializeMetadata(parsedOutput),
2558
1723
  ...deserialized,
2559
- };
2560
- return contents;
1724
+ });
1725
+ return smithy_client_1.decorateServiceException(exception, body);
2561
1726
  };
2562
1727
  const serializeAws_json1_1AddTagsToStreamInput = (input, context) => {
2563
1728
  return {
@@ -2876,7 +2041,7 @@ const deserializeAws_json1_1ChildShard = (output, context) => {
2876
2041
  };
2877
2042
  };
2878
2043
  const deserializeAws_json1_1ChildShardList = (output, context) => {
2879
- return (output || [])
2044
+ const retVal = (output || [])
2880
2045
  .filter((e) => e != null)
2881
2046
  .map((entry) => {
2882
2047
  if (entry === null) {
@@ -2884,6 +2049,7 @@ const deserializeAws_json1_1ChildShardList = (output, context) => {
2884
2049
  }
2885
2050
  return deserializeAws_json1_1ChildShard(entry, context);
2886
2051
  });
2052
+ return retVal;
2887
2053
  };
2888
2054
  const deserializeAws_json1_1Consumer = (output, context) => {
2889
2055
  return {
@@ -2907,7 +2073,7 @@ const deserializeAws_json1_1ConsumerDescription = (output, context) => {
2907
2073
  };
2908
2074
  };
2909
2075
  const deserializeAws_json1_1ConsumerList = (output, context) => {
2910
- return (output || [])
2076
+ const retVal = (output || [])
2911
2077
  .filter((e) => e != null)
2912
2078
  .map((entry) => {
2913
2079
  if (entry === null) {
@@ -2915,6 +2081,7 @@ const deserializeAws_json1_1ConsumerList = (output, context) => {
2915
2081
  }
2916
2082
  return deserializeAws_json1_1Consumer(entry, context);
2917
2083
  });
2084
+ return retVal;
2918
2085
  };
2919
2086
  const deserializeAws_json1_1DescribeLimitsOutput = (output, context) => {
2920
2087
  return {
@@ -2953,7 +2120,7 @@ const deserializeAws_json1_1EnhancedMetrics = (output, context) => {
2953
2120
  };
2954
2121
  };
2955
2122
  const deserializeAws_json1_1EnhancedMonitoringList = (output, context) => {
2956
- return (output || [])
2123
+ const retVal = (output || [])
2957
2124
  .filter((e) => e != null)
2958
2125
  .map((entry) => {
2959
2126
  if (entry === null) {
@@ -2961,6 +2128,7 @@ const deserializeAws_json1_1EnhancedMonitoringList = (output, context) => {
2961
2128
  }
2962
2129
  return deserializeAws_json1_1EnhancedMetrics(entry, context);
2963
2130
  });
2131
+ return retVal;
2964
2132
  };
2965
2133
  const deserializeAws_json1_1EnhancedMonitoringOutput = (output, context) => {
2966
2134
  return {
@@ -3084,7 +2252,7 @@ const deserializeAws_json1_1ListTagsForStreamOutput = (output, context) => {
3084
2252
  };
3085
2253
  };
3086
2254
  const deserializeAws_json1_1MetricsNameList = (output, context) => {
3087
- return (output || [])
2255
+ const retVal = (output || [])
3088
2256
  .filter((e) => e != null)
3089
2257
  .map((entry) => {
3090
2258
  if (entry === null) {
@@ -3092,6 +2260,7 @@ const deserializeAws_json1_1MetricsNameList = (output, context) => {
3092
2260
  }
3093
2261
  return smithy_client_1.expectString(entry);
3094
2262
  });
2263
+ return retVal;
3095
2264
  };
3096
2265
  const deserializeAws_json1_1ProvisionedThroughputExceededException = (output, context) => {
3097
2266
  return {
@@ -3123,7 +2292,7 @@ const deserializeAws_json1_1PutRecordsResultEntry = (output, context) => {
3123
2292
  };
3124
2293
  };
3125
2294
  const deserializeAws_json1_1PutRecordsResultEntryList = (output, context) => {
3126
- return (output || [])
2295
+ const retVal = (output || [])
3127
2296
  .filter((e) => e != null)
3128
2297
  .map((entry) => {
3129
2298
  if (entry === null) {
@@ -3131,6 +2300,7 @@ const deserializeAws_json1_1PutRecordsResultEntryList = (output, context) => {
3131
2300
  }
3132
2301
  return deserializeAws_json1_1PutRecordsResultEntry(entry, context);
3133
2302
  });
2303
+ return retVal;
3134
2304
  };
3135
2305
  const deserializeAws_json1_1_Record = (output, context) => {
3136
2306
  return {
@@ -3144,7 +2314,7 @@ const deserializeAws_json1_1_Record = (output, context) => {
3144
2314
  };
3145
2315
  };
3146
2316
  const deserializeAws_json1_1RecordList = (output, context) => {
3147
- return (output || [])
2317
+ const retVal = (output || [])
3148
2318
  .filter((e) => e != null)
3149
2319
  .map((entry) => {
3150
2320
  if (entry === null) {
@@ -3152,6 +2322,7 @@ const deserializeAws_json1_1RecordList = (output, context) => {
3152
2322
  }
3153
2323
  return deserializeAws_json1_1_Record(entry, context);
3154
2324
  });
2325
+ return retVal;
3155
2326
  };
3156
2327
  const deserializeAws_json1_1RegisterStreamConsumerOutput = (output, context) => {
3157
2328
  return {
@@ -3190,7 +2361,7 @@ const deserializeAws_json1_1Shard = (output, context) => {
3190
2361
  };
3191
2362
  };
3192
2363
  const deserializeAws_json1_1ShardIdList = (output, context) => {
3193
- return (output || [])
2364
+ const retVal = (output || [])
3194
2365
  .filter((e) => e != null)
3195
2366
  .map((entry) => {
3196
2367
  if (entry === null) {
@@ -3198,9 +2369,10 @@ const deserializeAws_json1_1ShardIdList = (output, context) => {
3198
2369
  }
3199
2370
  return smithy_client_1.expectString(entry);
3200
2371
  });
2372
+ return retVal;
3201
2373
  };
3202
2374
  const deserializeAws_json1_1ShardList = (output, context) => {
3203
- return (output || [])
2375
+ const retVal = (output || [])
3204
2376
  .filter((e) => e != null)
3205
2377
  .map((entry) => {
3206
2378
  if (entry === null) {
@@ -3208,6 +2380,7 @@ const deserializeAws_json1_1ShardList = (output, context) => {
3208
2380
  }
3209
2381
  return deserializeAws_json1_1Shard(entry, context);
3210
2382
  });
2383
+ return retVal;
3211
2384
  };
3212
2385
  const deserializeAws_json1_1StreamDescription = (output, context) => {
3213
2386
  return {
@@ -3259,7 +2432,7 @@ const deserializeAws_json1_1StreamModeDetails = (output, context) => {
3259
2432
  };
3260
2433
  };
3261
2434
  const deserializeAws_json1_1StreamNameList = (output, context) => {
3262
- return (output || [])
2435
+ const retVal = (output || [])
3263
2436
  .filter((e) => e != null)
3264
2437
  .map((entry) => {
3265
2438
  if (entry === null) {
@@ -3267,6 +2440,7 @@ const deserializeAws_json1_1StreamNameList = (output, context) => {
3267
2440
  }
3268
2441
  return smithy_client_1.expectString(entry);
3269
2442
  });
2443
+ return retVal;
3270
2444
  };
3271
2445
  const deserializeAws_json1_1SubscribeToShardEvent = (output, context) => {
3272
2446
  return {
@@ -3347,7 +2521,7 @@ const deserializeAws_json1_1Tag = (output, context) => {
3347
2521
  };
3348
2522
  };
3349
2523
  const deserializeAws_json1_1TagList = (output, context) => {
3350
- return (output || [])
2524
+ const retVal = (output || [])
3351
2525
  .filter((e) => e != null)
3352
2526
  .map((entry) => {
3353
2527
  if (entry === null) {
@@ -3355,6 +2529,7 @@ const deserializeAws_json1_1TagList = (output, context) => {
3355
2529
  }
3356
2530
  return deserializeAws_json1_1Tag(entry, context);
3357
2531
  });
2532
+ return retVal;
3358
2533
  };
3359
2534
  const deserializeAws_json1_1UpdateShardCountOutput = (output, context) => {
3360
2535
  return {