@aws-sdk/client-fsx 3.52.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,8 @@ exports.deserializeAws_json1_1UpdateVolumeCommand = exports.deserializeAws_json1
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const uuid_1 = require("uuid");
8
+ const FSxServiceException_1 = require("../models/FSxServiceException");
9
+ const models_0_1 = require("../models/models_0");
8
10
  const serializeAws_json1_1AssociateFileSystemAliasesCommand = async (input, context) => {
9
11
  const headers = {
10
12
  "content-type": "application/x-amz-json-1.1",
@@ -400,43 +402,22 @@ const deserializeAws_json1_1AssociateFileSystemAliasesCommandError = async (outp
400
402
  switch (errorCode) {
401
403
  case "BadRequest":
402
404
  case "com.amazonaws.fsx#BadRequest":
403
- response = {
404
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
405
- name: errorCode,
406
- $metadata: deserializeMetadata(output),
407
- };
408
- break;
405
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
409
406
  case "FileSystemNotFound":
410
407
  case "com.amazonaws.fsx#FileSystemNotFound":
411
- response = {
412
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
413
- name: errorCode,
414
- $metadata: deserializeMetadata(output),
415
- };
416
- break;
408
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
417
409
  case "InternalServerError":
418
410
  case "com.amazonaws.fsx#InternalServerError":
419
- response = {
420
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
421
- name: errorCode,
422
- $metadata: deserializeMetadata(output),
423
- };
424
- break;
411
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
425
412
  default:
426
413
  const parsedBody = parsedOutput.body;
427
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
428
- response = {
429
- ...parsedBody,
430
- name: `${errorCode}`,
431
- message: parsedBody.message || parsedBody.Message || errorCode,
414
+ response = new FSxServiceException_1.FSxServiceException({
415
+ name: parsedBody.code || parsedBody.Code || errorCode,
432
416
  $fault: "client",
433
417
  $metadata: deserializeMetadata(output),
434
- };
418
+ });
419
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
435
420
  }
436
- const message = response.message || response.Message || errorCode;
437
- response.message = message;
438
- delete response.Message;
439
- return Promise.reject(Object.assign(new Error(message), response));
440
421
  };
441
422
  const deserializeAws_json1_1CancelDataRepositoryTaskCommand = async (output, context) => {
442
423
  if (output.statusCode >= 300) {
@@ -463,59 +444,28 @@ const deserializeAws_json1_1CancelDataRepositoryTaskCommandError = async (output
463
444
  switch (errorCode) {
464
445
  case "BadRequest":
465
446
  case "com.amazonaws.fsx#BadRequest":
466
- response = {
467
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
468
- name: errorCode,
469
- $metadata: deserializeMetadata(output),
470
- };
471
- break;
447
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
472
448
  case "DataRepositoryTaskEnded":
473
449
  case "com.amazonaws.fsx#DataRepositoryTaskEnded":
474
- response = {
475
- ...(await deserializeAws_json1_1DataRepositoryTaskEndedResponse(parsedOutput, context)),
476
- name: errorCode,
477
- $metadata: deserializeMetadata(output),
478
- };
479
- break;
450
+ throw await deserializeAws_json1_1DataRepositoryTaskEndedResponse(parsedOutput, context);
480
451
  case "DataRepositoryTaskNotFound":
481
452
  case "com.amazonaws.fsx#DataRepositoryTaskNotFound":
482
- response = {
483
- ...(await deserializeAws_json1_1DataRepositoryTaskNotFoundResponse(parsedOutput, context)),
484
- name: errorCode,
485
- $metadata: deserializeMetadata(output),
486
- };
487
- break;
453
+ throw await deserializeAws_json1_1DataRepositoryTaskNotFoundResponse(parsedOutput, context);
488
454
  case "InternalServerError":
489
455
  case "com.amazonaws.fsx#InternalServerError":
490
- response = {
491
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
492
- name: errorCode,
493
- $metadata: deserializeMetadata(output),
494
- };
495
- break;
456
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
496
457
  case "UnsupportedOperation":
497
458
  case "com.amazonaws.fsx#UnsupportedOperation":
498
- response = {
499
- ...(await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context)),
500
- name: errorCode,
501
- $metadata: deserializeMetadata(output),
502
- };
503
- break;
459
+ throw await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context);
504
460
  default:
505
461
  const parsedBody = parsedOutput.body;
506
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
507
- response = {
508
- ...parsedBody,
509
- name: `${errorCode}`,
510
- message: parsedBody.message || parsedBody.Message || errorCode,
462
+ response = new FSxServiceException_1.FSxServiceException({
463
+ name: parsedBody.code || parsedBody.Code || errorCode,
511
464
  $fault: "client",
512
465
  $metadata: deserializeMetadata(output),
513
- };
466
+ });
467
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
514
468
  }
515
- const message = response.message || response.Message || errorCode;
516
- response.message = message;
517
- delete response.Message;
518
- return Promise.reject(Object.assign(new Error(message), response));
519
469
  };
520
470
  const deserializeAws_json1_1CopyBackupCommand = async (output, context) => {
521
471
  if (output.statusCode >= 300) {
@@ -542,107 +492,46 @@ const deserializeAws_json1_1CopyBackupCommandError = async (output, context) =>
542
492
  switch (errorCode) {
543
493
  case "BackupNotFound":
544
494
  case "com.amazonaws.fsx#BackupNotFound":
545
- response = {
546
- ...(await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context)),
547
- name: errorCode,
548
- $metadata: deserializeMetadata(output),
549
- };
550
- break;
495
+ throw await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context);
551
496
  case "BadRequest":
552
497
  case "com.amazonaws.fsx#BadRequest":
553
- response = {
554
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
555
- name: errorCode,
556
- $metadata: deserializeMetadata(output),
557
- };
558
- break;
498
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
559
499
  case "IncompatibleParameterError":
560
500
  case "com.amazonaws.fsx#IncompatibleParameterError":
561
- response = {
562
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
563
- name: errorCode,
564
- $metadata: deserializeMetadata(output),
565
- };
566
- break;
501
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
567
502
  case "IncompatibleRegionForMultiAZ":
568
503
  case "com.amazonaws.fsx#IncompatibleRegionForMultiAZ":
569
- response = {
570
- ...(await deserializeAws_json1_1IncompatibleRegionForMultiAZResponse(parsedOutput, context)),
571
- name: errorCode,
572
- $metadata: deserializeMetadata(output),
573
- };
574
- break;
504
+ throw await deserializeAws_json1_1IncompatibleRegionForMultiAZResponse(parsedOutput, context);
575
505
  case "InternalServerError":
576
506
  case "com.amazonaws.fsx#InternalServerError":
577
- response = {
578
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
579
- name: errorCode,
580
- $metadata: deserializeMetadata(output),
581
- };
582
- break;
507
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
583
508
  case "InvalidDestinationKmsKey":
584
509
  case "com.amazonaws.fsx#InvalidDestinationKmsKey":
585
- response = {
586
- ...(await deserializeAws_json1_1InvalidDestinationKmsKeyResponse(parsedOutput, context)),
587
- name: errorCode,
588
- $metadata: deserializeMetadata(output),
589
- };
590
- break;
510
+ throw await deserializeAws_json1_1InvalidDestinationKmsKeyResponse(parsedOutput, context);
591
511
  case "InvalidRegion":
592
512
  case "com.amazonaws.fsx#InvalidRegion":
593
- response = {
594
- ...(await deserializeAws_json1_1InvalidRegionResponse(parsedOutput, context)),
595
- name: errorCode,
596
- $metadata: deserializeMetadata(output),
597
- };
598
- break;
513
+ throw await deserializeAws_json1_1InvalidRegionResponse(parsedOutput, context);
599
514
  case "InvalidSourceKmsKey":
600
515
  case "com.amazonaws.fsx#InvalidSourceKmsKey":
601
- response = {
602
- ...(await deserializeAws_json1_1InvalidSourceKmsKeyResponse(parsedOutput, context)),
603
- name: errorCode,
604
- $metadata: deserializeMetadata(output),
605
- };
606
- break;
516
+ throw await deserializeAws_json1_1InvalidSourceKmsKeyResponse(parsedOutput, context);
607
517
  case "ServiceLimitExceeded":
608
518
  case "com.amazonaws.fsx#ServiceLimitExceeded":
609
- response = {
610
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
611
- name: errorCode,
612
- $metadata: deserializeMetadata(output),
613
- };
614
- break;
519
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
615
520
  case "SourceBackupUnavailable":
616
521
  case "com.amazonaws.fsx#SourceBackupUnavailable":
617
- response = {
618
- ...(await deserializeAws_json1_1SourceBackupUnavailableResponse(parsedOutput, context)),
619
- name: errorCode,
620
- $metadata: deserializeMetadata(output),
621
- };
622
- break;
522
+ throw await deserializeAws_json1_1SourceBackupUnavailableResponse(parsedOutput, context);
623
523
  case "UnsupportedOperation":
624
524
  case "com.amazonaws.fsx#UnsupportedOperation":
625
- response = {
626
- ...(await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context)),
627
- name: errorCode,
628
- $metadata: deserializeMetadata(output),
629
- };
630
- break;
525
+ throw await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context);
631
526
  default:
632
527
  const parsedBody = parsedOutput.body;
633
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
634
- response = {
635
- ...parsedBody,
636
- name: `${errorCode}`,
637
- message: parsedBody.message || parsedBody.Message || errorCode,
528
+ response = new FSxServiceException_1.FSxServiceException({
529
+ name: parsedBody.code || parsedBody.Code || errorCode,
638
530
  $fault: "client",
639
531
  $metadata: deserializeMetadata(output),
640
- };
532
+ });
533
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
641
534
  }
642
- const message = response.message || response.Message || errorCode;
643
- response.message = message;
644
- delete response.Message;
645
- return Promise.reject(Object.assign(new Error(message), response));
646
535
  };
647
536
  const deserializeAws_json1_1CreateBackupCommand = async (output, context) => {
648
537
  if (output.statusCode >= 300) {
@@ -669,83 +558,37 @@ const deserializeAws_json1_1CreateBackupCommandError = async (output, context) =
669
558
  switch (errorCode) {
670
559
  case "BackupInProgress":
671
560
  case "com.amazonaws.fsx#BackupInProgress":
672
- response = {
673
- ...(await deserializeAws_json1_1BackupInProgressResponse(parsedOutput, context)),
674
- name: errorCode,
675
- $metadata: deserializeMetadata(output),
676
- };
677
- break;
561
+ throw await deserializeAws_json1_1BackupInProgressResponse(parsedOutput, context);
678
562
  case "BadRequest":
679
563
  case "com.amazonaws.fsx#BadRequest":
680
- response = {
681
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
682
- name: errorCode,
683
- $metadata: deserializeMetadata(output),
684
- };
685
- break;
564
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
686
565
  case "FileSystemNotFound":
687
566
  case "com.amazonaws.fsx#FileSystemNotFound":
688
- response = {
689
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
690
- name: errorCode,
691
- $metadata: deserializeMetadata(output),
692
- };
693
- break;
567
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
694
568
  case "IncompatibleParameterError":
695
569
  case "com.amazonaws.fsx#IncompatibleParameterError":
696
- response = {
697
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
698
- name: errorCode,
699
- $metadata: deserializeMetadata(output),
700
- };
701
- break;
570
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
702
571
  case "InternalServerError":
703
572
  case "com.amazonaws.fsx#InternalServerError":
704
- response = {
705
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
706
- name: errorCode,
707
- $metadata: deserializeMetadata(output),
708
- };
709
- break;
573
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
710
574
  case "ServiceLimitExceeded":
711
575
  case "com.amazonaws.fsx#ServiceLimitExceeded":
712
- response = {
713
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
714
- name: errorCode,
715
- $metadata: deserializeMetadata(output),
716
- };
717
- break;
576
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
718
577
  case "UnsupportedOperation":
719
578
  case "com.amazonaws.fsx#UnsupportedOperation":
720
- response = {
721
- ...(await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context)),
722
- name: errorCode,
723
- $metadata: deserializeMetadata(output),
724
- };
725
- break;
579
+ throw await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context);
726
580
  case "VolumeNotFound":
727
581
  case "com.amazonaws.fsx#VolumeNotFound":
728
- response = {
729
- ...(await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context)),
730
- name: errorCode,
731
- $metadata: deserializeMetadata(output),
732
- };
733
- break;
582
+ throw await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context);
734
583
  default:
735
584
  const parsedBody = parsedOutput.body;
736
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
737
- response = {
738
- ...parsedBody,
739
- name: `${errorCode}`,
740
- message: parsedBody.message || parsedBody.Message || errorCode,
585
+ response = new FSxServiceException_1.FSxServiceException({
586
+ name: parsedBody.code || parsedBody.Code || errorCode,
741
587
  $fault: "client",
742
588
  $metadata: deserializeMetadata(output),
743
- };
589
+ });
590
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
744
591
  }
745
- const message = response.message || response.Message || errorCode;
746
- response.message = message;
747
- delete response.Message;
748
- return Promise.reject(Object.assign(new Error(message), response));
749
592
  };
750
593
  const deserializeAws_json1_1CreateDataRepositoryAssociationCommand = async (output, context) => {
751
594
  if (output.statusCode >= 300) {
@@ -772,67 +615,31 @@ const deserializeAws_json1_1CreateDataRepositoryAssociationCommandError = async
772
615
  switch (errorCode) {
773
616
  case "BadRequest":
774
617
  case "com.amazonaws.fsx#BadRequest":
775
- response = {
776
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
777
- name: errorCode,
778
- $metadata: deserializeMetadata(output),
779
- };
780
- break;
618
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
781
619
  case "FileSystemNotFound":
782
620
  case "com.amazonaws.fsx#FileSystemNotFound":
783
- response = {
784
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
785
- name: errorCode,
786
- $metadata: deserializeMetadata(output),
787
- };
788
- break;
621
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
789
622
  case "IncompatibleParameterError":
790
623
  case "com.amazonaws.fsx#IncompatibleParameterError":
791
- response = {
792
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
793
- name: errorCode,
794
- $metadata: deserializeMetadata(output),
795
- };
796
- break;
624
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
797
625
  case "InternalServerError":
798
626
  case "com.amazonaws.fsx#InternalServerError":
799
- response = {
800
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
801
- name: errorCode,
802
- $metadata: deserializeMetadata(output),
803
- };
804
- break;
627
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
805
628
  case "ServiceLimitExceeded":
806
629
  case "com.amazonaws.fsx#ServiceLimitExceeded":
807
- response = {
808
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
809
- name: errorCode,
810
- $metadata: deserializeMetadata(output),
811
- };
812
- break;
630
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
813
631
  case "UnsupportedOperation":
814
632
  case "com.amazonaws.fsx#UnsupportedOperation":
815
- response = {
816
- ...(await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context)),
817
- name: errorCode,
818
- $metadata: deserializeMetadata(output),
819
- };
820
- break;
633
+ throw await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context);
821
634
  default:
822
635
  const parsedBody = parsedOutput.body;
823
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
824
- response = {
825
- ...parsedBody,
826
- name: `${errorCode}`,
827
- message: parsedBody.message || parsedBody.Message || errorCode,
636
+ response = new FSxServiceException_1.FSxServiceException({
637
+ name: parsedBody.code || parsedBody.Code || errorCode,
828
638
  $fault: "client",
829
639
  $metadata: deserializeMetadata(output),
830
- };
640
+ });
641
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
831
642
  }
832
- const message = response.message || response.Message || errorCode;
833
- response.message = message;
834
- delete response.Message;
835
- return Promise.reject(Object.assign(new Error(message), response));
836
643
  };
837
644
  const deserializeAws_json1_1CreateDataRepositoryTaskCommand = async (output, context) => {
838
645
  if (output.statusCode >= 300) {
@@ -859,75 +666,34 @@ const deserializeAws_json1_1CreateDataRepositoryTaskCommandError = async (output
859
666
  switch (errorCode) {
860
667
  case "BadRequest":
861
668
  case "com.amazonaws.fsx#BadRequest":
862
- response = {
863
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
864
- name: errorCode,
865
- $metadata: deserializeMetadata(output),
866
- };
867
- break;
669
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
868
670
  case "DataRepositoryTaskExecuting":
869
671
  case "com.amazonaws.fsx#DataRepositoryTaskExecuting":
870
- response = {
871
- ...(await deserializeAws_json1_1DataRepositoryTaskExecutingResponse(parsedOutput, context)),
872
- name: errorCode,
873
- $metadata: deserializeMetadata(output),
874
- };
875
- break;
672
+ throw await deserializeAws_json1_1DataRepositoryTaskExecutingResponse(parsedOutput, context);
876
673
  case "FileSystemNotFound":
877
674
  case "com.amazonaws.fsx#FileSystemNotFound":
878
- response = {
879
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
880
- name: errorCode,
881
- $metadata: deserializeMetadata(output),
882
- };
883
- break;
675
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
884
676
  case "IncompatibleParameterError":
885
677
  case "com.amazonaws.fsx#IncompatibleParameterError":
886
- response = {
887
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
888
- name: errorCode,
889
- $metadata: deserializeMetadata(output),
890
- };
891
- break;
678
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
892
679
  case "InternalServerError":
893
680
  case "com.amazonaws.fsx#InternalServerError":
894
- response = {
895
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
896
- name: errorCode,
897
- $metadata: deserializeMetadata(output),
898
- };
899
- break;
681
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
900
682
  case "ServiceLimitExceeded":
901
683
  case "com.amazonaws.fsx#ServiceLimitExceeded":
902
- response = {
903
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
904
- name: errorCode,
905
- $metadata: deserializeMetadata(output),
906
- };
907
- break;
684
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
908
685
  case "UnsupportedOperation":
909
686
  case "com.amazonaws.fsx#UnsupportedOperation":
910
- response = {
911
- ...(await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context)),
912
- name: errorCode,
913
- $metadata: deserializeMetadata(output),
914
- };
915
- break;
687
+ throw await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context);
916
688
  default:
917
689
  const parsedBody = parsedOutput.body;
918
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
919
- response = {
920
- ...parsedBody,
921
- name: `${errorCode}`,
922
- message: parsedBody.message || parsedBody.Message || errorCode,
690
+ response = new FSxServiceException_1.FSxServiceException({
691
+ name: parsedBody.code || parsedBody.Code || errorCode,
923
692
  $fault: "client",
924
693
  $metadata: deserializeMetadata(output),
925
- };
694
+ });
695
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
926
696
  }
927
- const message = response.message || response.Message || errorCode;
928
- response.message = message;
929
- delete response.Message;
930
- return Promise.reject(Object.assign(new Error(message), response));
931
697
  };
932
698
  const deserializeAws_json1_1CreateFileSystemCommand = async (output, context) => {
933
699
  if (output.statusCode >= 300) {
@@ -954,99 +720,43 @@ const deserializeAws_json1_1CreateFileSystemCommandError = async (output, contex
954
720
  switch (errorCode) {
955
721
  case "ActiveDirectoryError":
956
722
  case "com.amazonaws.fsx#ActiveDirectoryError":
957
- response = {
958
- ...(await deserializeAws_json1_1ActiveDirectoryErrorResponse(parsedOutput, context)),
959
- name: errorCode,
960
- $metadata: deserializeMetadata(output),
961
- };
962
- break;
723
+ throw await deserializeAws_json1_1ActiveDirectoryErrorResponse(parsedOutput, context);
963
724
  case "BadRequest":
964
725
  case "com.amazonaws.fsx#BadRequest":
965
- response = {
966
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
967
- name: errorCode,
968
- $metadata: deserializeMetadata(output),
969
- };
970
- break;
726
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
971
727
  case "IncompatibleParameterError":
972
728
  case "com.amazonaws.fsx#IncompatibleParameterError":
973
- response = {
974
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
975
- name: errorCode,
976
- $metadata: deserializeMetadata(output),
977
- };
978
- break;
729
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
979
730
  case "InternalServerError":
980
731
  case "com.amazonaws.fsx#InternalServerError":
981
- response = {
982
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
983
- name: errorCode,
984
- $metadata: deserializeMetadata(output),
985
- };
986
- break;
732
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
987
733
  case "InvalidExportPath":
988
734
  case "com.amazonaws.fsx#InvalidExportPath":
989
- response = {
990
- ...(await deserializeAws_json1_1InvalidExportPathResponse(parsedOutput, context)),
991
- name: errorCode,
992
- $metadata: deserializeMetadata(output),
993
- };
994
- break;
735
+ throw await deserializeAws_json1_1InvalidExportPathResponse(parsedOutput, context);
995
736
  case "InvalidImportPath":
996
737
  case "com.amazonaws.fsx#InvalidImportPath":
997
- response = {
998
- ...(await deserializeAws_json1_1InvalidImportPathResponse(parsedOutput, context)),
999
- name: errorCode,
1000
- $metadata: deserializeMetadata(output),
1001
- };
1002
- break;
738
+ throw await deserializeAws_json1_1InvalidImportPathResponse(parsedOutput, context);
1003
739
  case "InvalidNetworkSettings":
1004
740
  case "com.amazonaws.fsx#InvalidNetworkSettings":
1005
- response = {
1006
- ...(await deserializeAws_json1_1InvalidNetworkSettingsResponse(parsedOutput, context)),
1007
- name: errorCode,
1008
- $metadata: deserializeMetadata(output),
1009
- };
1010
- break;
741
+ throw await deserializeAws_json1_1InvalidNetworkSettingsResponse(parsedOutput, context);
1011
742
  case "InvalidPerUnitStorageThroughput":
1012
743
  case "com.amazonaws.fsx#InvalidPerUnitStorageThroughput":
1013
- response = {
1014
- ...(await deserializeAws_json1_1InvalidPerUnitStorageThroughputResponse(parsedOutput, context)),
1015
- name: errorCode,
1016
- $metadata: deserializeMetadata(output),
1017
- };
1018
- break;
744
+ throw await deserializeAws_json1_1InvalidPerUnitStorageThroughputResponse(parsedOutput, context);
1019
745
  case "MissingFileSystemConfiguration":
1020
746
  case "com.amazonaws.fsx#MissingFileSystemConfiguration":
1021
- response = {
1022
- ...(await deserializeAws_json1_1MissingFileSystemConfigurationResponse(parsedOutput, context)),
1023
- name: errorCode,
1024
- $metadata: deserializeMetadata(output),
1025
- };
1026
- break;
747
+ throw await deserializeAws_json1_1MissingFileSystemConfigurationResponse(parsedOutput, context);
1027
748
  case "ServiceLimitExceeded":
1028
749
  case "com.amazonaws.fsx#ServiceLimitExceeded":
1029
- response = {
1030
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
1031
- name: errorCode,
1032
- $metadata: deserializeMetadata(output),
1033
- };
1034
- break;
750
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
1035
751
  default:
1036
752
  const parsedBody = parsedOutput.body;
1037
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1038
- response = {
1039
- ...parsedBody,
1040
- name: `${errorCode}`,
1041
- message: parsedBody.message || parsedBody.Message || errorCode,
753
+ response = new FSxServiceException_1.FSxServiceException({
754
+ name: parsedBody.code || parsedBody.Code || errorCode,
1042
755
  $fault: "client",
1043
756
  $metadata: deserializeMetadata(output),
1044
- };
757
+ });
758
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1045
759
  }
1046
- const message = response.message || response.Message || errorCode;
1047
- response.message = message;
1048
- delete response.Message;
1049
- return Promise.reject(Object.assign(new Error(message), response));
1050
760
  };
1051
761
  const deserializeAws_json1_1CreateFileSystemFromBackupCommand = async (output, context) => {
1052
762
  if (output.statusCode >= 300) {
@@ -1073,91 +783,40 @@ const deserializeAws_json1_1CreateFileSystemFromBackupCommandError = async (outp
1073
783
  switch (errorCode) {
1074
784
  case "ActiveDirectoryError":
1075
785
  case "com.amazonaws.fsx#ActiveDirectoryError":
1076
- response = {
1077
- ...(await deserializeAws_json1_1ActiveDirectoryErrorResponse(parsedOutput, context)),
1078
- name: errorCode,
1079
- $metadata: deserializeMetadata(output),
1080
- };
1081
- break;
786
+ throw await deserializeAws_json1_1ActiveDirectoryErrorResponse(parsedOutput, context);
1082
787
  case "BackupNotFound":
1083
788
  case "com.amazonaws.fsx#BackupNotFound":
1084
- response = {
1085
- ...(await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context)),
1086
- name: errorCode,
1087
- $metadata: deserializeMetadata(output),
1088
- };
1089
- break;
789
+ throw await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context);
1090
790
  case "BadRequest":
1091
791
  case "com.amazonaws.fsx#BadRequest":
1092
- response = {
1093
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1094
- name: errorCode,
1095
- $metadata: deserializeMetadata(output),
1096
- };
1097
- break;
792
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1098
793
  case "IncompatibleParameterError":
1099
794
  case "com.amazonaws.fsx#IncompatibleParameterError":
1100
- response = {
1101
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
1102
- name: errorCode,
1103
- $metadata: deserializeMetadata(output),
1104
- };
1105
- break;
795
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
1106
796
  case "InternalServerError":
1107
797
  case "com.amazonaws.fsx#InternalServerError":
1108
- response = {
1109
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1110
- name: errorCode,
1111
- $metadata: deserializeMetadata(output),
1112
- };
1113
- break;
798
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1114
799
  case "InvalidNetworkSettings":
1115
800
  case "com.amazonaws.fsx#InvalidNetworkSettings":
1116
- response = {
1117
- ...(await deserializeAws_json1_1InvalidNetworkSettingsResponse(parsedOutput, context)),
1118
- name: errorCode,
1119
- $metadata: deserializeMetadata(output),
1120
- };
1121
- break;
801
+ throw await deserializeAws_json1_1InvalidNetworkSettingsResponse(parsedOutput, context);
1122
802
  case "InvalidPerUnitStorageThroughput":
1123
803
  case "com.amazonaws.fsx#InvalidPerUnitStorageThroughput":
1124
- response = {
1125
- ...(await deserializeAws_json1_1InvalidPerUnitStorageThroughputResponse(parsedOutput, context)),
1126
- name: errorCode,
1127
- $metadata: deserializeMetadata(output),
1128
- };
1129
- break;
804
+ throw await deserializeAws_json1_1InvalidPerUnitStorageThroughputResponse(parsedOutput, context);
1130
805
  case "MissingFileSystemConfiguration":
1131
806
  case "com.amazonaws.fsx#MissingFileSystemConfiguration":
1132
- response = {
1133
- ...(await deserializeAws_json1_1MissingFileSystemConfigurationResponse(parsedOutput, context)),
1134
- name: errorCode,
1135
- $metadata: deserializeMetadata(output),
1136
- };
1137
- break;
807
+ throw await deserializeAws_json1_1MissingFileSystemConfigurationResponse(parsedOutput, context);
1138
808
  case "ServiceLimitExceeded":
1139
809
  case "com.amazonaws.fsx#ServiceLimitExceeded":
1140
- response = {
1141
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
1142
- name: errorCode,
1143
- $metadata: deserializeMetadata(output),
1144
- };
1145
- break;
810
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
1146
811
  default:
1147
812
  const parsedBody = parsedOutput.body;
1148
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1149
- response = {
1150
- ...parsedBody,
1151
- name: `${errorCode}`,
1152
- message: parsedBody.message || parsedBody.Message || errorCode,
813
+ response = new FSxServiceException_1.FSxServiceException({
814
+ name: parsedBody.code || parsedBody.Code || errorCode,
1153
815
  $fault: "client",
1154
816
  $metadata: deserializeMetadata(output),
1155
- };
817
+ });
818
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1156
819
  }
1157
- const message = response.message || response.Message || errorCode;
1158
- response.message = message;
1159
- delete response.Message;
1160
- return Promise.reject(Object.assign(new Error(message), response));
1161
820
  };
1162
821
  const deserializeAws_json1_1CreateSnapshotCommand = async (output, context) => {
1163
822
  if (output.statusCode >= 300) {
@@ -1184,51 +843,25 @@ const deserializeAws_json1_1CreateSnapshotCommandError = async (output, context)
1184
843
  switch (errorCode) {
1185
844
  case "BadRequest":
1186
845
  case "com.amazonaws.fsx#BadRequest":
1187
- response = {
1188
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1189
- name: errorCode,
1190
- $metadata: deserializeMetadata(output),
1191
- };
1192
- break;
846
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1193
847
  case "InternalServerError":
1194
848
  case "com.amazonaws.fsx#InternalServerError":
1195
- response = {
1196
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1197
- name: errorCode,
1198
- $metadata: deserializeMetadata(output),
1199
- };
1200
- break;
849
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1201
850
  case "ServiceLimitExceeded":
1202
851
  case "com.amazonaws.fsx#ServiceLimitExceeded":
1203
- response = {
1204
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
1205
- name: errorCode,
1206
- $metadata: deserializeMetadata(output),
1207
- };
1208
- break;
852
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
1209
853
  case "VolumeNotFound":
1210
854
  case "com.amazonaws.fsx#VolumeNotFound":
1211
- response = {
1212
- ...(await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context)),
1213
- name: errorCode,
1214
- $metadata: deserializeMetadata(output),
1215
- };
1216
- break;
855
+ throw await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context);
1217
856
  default:
1218
857
  const parsedBody = parsedOutput.body;
1219
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1220
- response = {
1221
- ...parsedBody,
1222
- name: `${errorCode}`,
1223
- message: parsedBody.message || parsedBody.Message || errorCode,
858
+ response = new FSxServiceException_1.FSxServiceException({
859
+ name: parsedBody.code || parsedBody.Code || errorCode,
1224
860
  $fault: "client",
1225
861
  $metadata: deserializeMetadata(output),
1226
- };
862
+ });
863
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1227
864
  }
1228
- const message = response.message || response.Message || errorCode;
1229
- response.message = message;
1230
- delete response.Message;
1231
- return Promise.reject(Object.assign(new Error(message), response));
1232
865
  };
1233
866
  const deserializeAws_json1_1CreateStorageVirtualMachineCommand = async (output, context) => {
1234
867
  if (output.statusCode >= 300) {
@@ -1255,75 +888,34 @@ const deserializeAws_json1_1CreateStorageVirtualMachineCommandError = async (out
1255
888
  switch (errorCode) {
1256
889
  case "ActiveDirectoryError":
1257
890
  case "com.amazonaws.fsx#ActiveDirectoryError":
1258
- response = {
1259
- ...(await deserializeAws_json1_1ActiveDirectoryErrorResponse(parsedOutput, context)),
1260
- name: errorCode,
1261
- $metadata: deserializeMetadata(output),
1262
- };
1263
- break;
891
+ throw await deserializeAws_json1_1ActiveDirectoryErrorResponse(parsedOutput, context);
1264
892
  case "BadRequest":
1265
893
  case "com.amazonaws.fsx#BadRequest":
1266
- response = {
1267
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1268
- name: errorCode,
1269
- $metadata: deserializeMetadata(output),
1270
- };
1271
- break;
894
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1272
895
  case "FileSystemNotFound":
1273
896
  case "com.amazonaws.fsx#FileSystemNotFound":
1274
- response = {
1275
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
1276
- name: errorCode,
1277
- $metadata: deserializeMetadata(output),
1278
- };
1279
- break;
897
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
1280
898
  case "IncompatibleParameterError":
1281
899
  case "com.amazonaws.fsx#IncompatibleParameterError":
1282
- response = {
1283
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
1284
- name: errorCode,
1285
- $metadata: deserializeMetadata(output),
1286
- };
1287
- break;
900
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
1288
901
  case "InternalServerError":
1289
902
  case "com.amazonaws.fsx#InternalServerError":
1290
- response = {
1291
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1292
- name: errorCode,
1293
- $metadata: deserializeMetadata(output),
1294
- };
1295
- break;
903
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1296
904
  case "ServiceLimitExceeded":
1297
905
  case "com.amazonaws.fsx#ServiceLimitExceeded":
1298
- response = {
1299
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
1300
- name: errorCode,
1301
- $metadata: deserializeMetadata(output),
1302
- };
1303
- break;
906
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
1304
907
  case "UnsupportedOperation":
1305
908
  case "com.amazonaws.fsx#UnsupportedOperation":
1306
- response = {
1307
- ...(await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context)),
1308
- name: errorCode,
1309
- $metadata: deserializeMetadata(output),
1310
- };
1311
- break;
909
+ throw await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context);
1312
910
  default:
1313
911
  const parsedBody = parsedOutput.body;
1314
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1315
- response = {
1316
- ...parsedBody,
1317
- name: `${errorCode}`,
1318
- message: parsedBody.message || parsedBody.Message || errorCode,
912
+ response = new FSxServiceException_1.FSxServiceException({
913
+ name: parsedBody.code || parsedBody.Code || errorCode,
1319
914
  $fault: "client",
1320
915
  $metadata: deserializeMetadata(output),
1321
- };
916
+ });
917
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1322
918
  }
1323
- const message = response.message || response.Message || errorCode;
1324
- response.message = message;
1325
- delete response.Message;
1326
- return Promise.reject(Object.assign(new Error(message), response));
1327
919
  };
1328
920
  const deserializeAws_json1_1CreateVolumeCommand = async (output, context) => {
1329
921
  if (output.statusCode >= 300) {
@@ -1350,83 +942,37 @@ const deserializeAws_json1_1CreateVolumeCommandError = async (output, context) =
1350
942
  switch (errorCode) {
1351
943
  case "BadRequest":
1352
944
  case "com.amazonaws.fsx#BadRequest":
1353
- response = {
1354
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1355
- name: errorCode,
1356
- $metadata: deserializeMetadata(output),
1357
- };
1358
- break;
945
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1359
946
  case "FileSystemNotFound":
1360
947
  case "com.amazonaws.fsx#FileSystemNotFound":
1361
- response = {
1362
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
1363
- name: errorCode,
1364
- $metadata: deserializeMetadata(output),
1365
- };
1366
- break;
948
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
1367
949
  case "IncompatibleParameterError":
1368
950
  case "com.amazonaws.fsx#IncompatibleParameterError":
1369
- response = {
1370
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
1371
- name: errorCode,
1372
- $metadata: deserializeMetadata(output),
1373
- };
1374
- break;
951
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
1375
952
  case "InternalServerError":
1376
953
  case "com.amazonaws.fsx#InternalServerError":
1377
- response = {
1378
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1379
- name: errorCode,
1380
- $metadata: deserializeMetadata(output),
1381
- };
1382
- break;
954
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1383
955
  case "MissingVolumeConfiguration":
1384
956
  case "com.amazonaws.fsx#MissingVolumeConfiguration":
1385
- response = {
1386
- ...(await deserializeAws_json1_1MissingVolumeConfigurationResponse(parsedOutput, context)),
1387
- name: errorCode,
1388
- $metadata: deserializeMetadata(output),
1389
- };
1390
- break;
957
+ throw await deserializeAws_json1_1MissingVolumeConfigurationResponse(parsedOutput, context);
1391
958
  case "ServiceLimitExceeded":
1392
959
  case "com.amazonaws.fsx#ServiceLimitExceeded":
1393
- response = {
1394
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
1395
- name: errorCode,
1396
- $metadata: deserializeMetadata(output),
1397
- };
1398
- break;
960
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
1399
961
  case "StorageVirtualMachineNotFound":
1400
962
  case "com.amazonaws.fsx#StorageVirtualMachineNotFound":
1401
- response = {
1402
- ...(await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context)),
1403
- name: errorCode,
1404
- $metadata: deserializeMetadata(output),
1405
- };
1406
- break;
963
+ throw await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context);
1407
964
  case "UnsupportedOperation":
1408
965
  case "com.amazonaws.fsx#UnsupportedOperation":
1409
- response = {
1410
- ...(await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context)),
1411
- name: errorCode,
1412
- $metadata: deserializeMetadata(output),
1413
- };
1414
- break;
966
+ throw await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context);
1415
967
  default:
1416
968
  const parsedBody = parsedOutput.body;
1417
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1418
- response = {
1419
- ...parsedBody,
1420
- name: `${errorCode}`,
1421
- message: parsedBody.message || parsedBody.Message || errorCode,
969
+ response = new FSxServiceException_1.FSxServiceException({
970
+ name: parsedBody.code || parsedBody.Code || errorCode,
1422
971
  $fault: "client",
1423
972
  $metadata: deserializeMetadata(output),
1424
- };
973
+ });
974
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1425
975
  }
1426
- const message = response.message || response.Message || errorCode;
1427
- response.message = message;
1428
- delete response.Message;
1429
- return Promise.reject(Object.assign(new Error(message), response));
1430
976
  };
1431
977
  const deserializeAws_json1_1CreateVolumeFromBackupCommand = async (output, context) => {
1432
978
  if (output.statusCode >= 300) {
@@ -1453,83 +999,37 @@ const deserializeAws_json1_1CreateVolumeFromBackupCommandError = async (output,
1453
999
  switch (errorCode) {
1454
1000
  case "BackupNotFound":
1455
1001
  case "com.amazonaws.fsx#BackupNotFound":
1456
- response = {
1457
- ...(await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context)),
1458
- name: errorCode,
1459
- $metadata: deserializeMetadata(output),
1460
- };
1461
- break;
1002
+ throw await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context);
1462
1003
  case "BadRequest":
1463
1004
  case "com.amazonaws.fsx#BadRequest":
1464
- response = {
1465
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1466
- name: errorCode,
1467
- $metadata: deserializeMetadata(output),
1468
- };
1469
- break;
1005
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1470
1006
  case "FileSystemNotFound":
1471
1007
  case "com.amazonaws.fsx#FileSystemNotFound":
1472
- response = {
1473
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
1474
- name: errorCode,
1475
- $metadata: deserializeMetadata(output),
1476
- };
1477
- break;
1008
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
1478
1009
  case "IncompatibleParameterError":
1479
1010
  case "com.amazonaws.fsx#IncompatibleParameterError":
1480
- response = {
1481
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
1482
- name: errorCode,
1483
- $metadata: deserializeMetadata(output),
1484
- };
1485
- break;
1011
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
1486
1012
  case "InternalServerError":
1487
1013
  case "com.amazonaws.fsx#InternalServerError":
1488
- response = {
1489
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1490
- name: errorCode,
1491
- $metadata: deserializeMetadata(output),
1492
- };
1493
- break;
1014
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1494
1015
  case "MissingVolumeConfiguration":
1495
1016
  case "com.amazonaws.fsx#MissingVolumeConfiguration":
1496
- response = {
1497
- ...(await deserializeAws_json1_1MissingVolumeConfigurationResponse(parsedOutput, context)),
1498
- name: errorCode,
1499
- $metadata: deserializeMetadata(output),
1500
- };
1501
- break;
1017
+ throw await deserializeAws_json1_1MissingVolumeConfigurationResponse(parsedOutput, context);
1502
1018
  case "ServiceLimitExceeded":
1503
1019
  case "com.amazonaws.fsx#ServiceLimitExceeded":
1504
- response = {
1505
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
1506
- name: errorCode,
1507
- $metadata: deserializeMetadata(output),
1508
- };
1509
- break;
1020
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
1510
1021
  case "StorageVirtualMachineNotFound":
1511
1022
  case "com.amazonaws.fsx#StorageVirtualMachineNotFound":
1512
- response = {
1513
- ...(await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context)),
1514
- name: errorCode,
1515
- $metadata: deserializeMetadata(output),
1516
- };
1517
- break;
1023
+ throw await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context);
1518
1024
  default:
1519
1025
  const parsedBody = parsedOutput.body;
1520
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1521
- response = {
1522
- ...parsedBody,
1523
- name: `${errorCode}`,
1524
- message: parsedBody.message || parsedBody.Message || errorCode,
1026
+ response = new FSxServiceException_1.FSxServiceException({
1027
+ name: parsedBody.code || parsedBody.Code || errorCode,
1525
1028
  $fault: "client",
1526
1029
  $metadata: deserializeMetadata(output),
1527
- };
1030
+ });
1031
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1528
1032
  }
1529
- const message = response.message || response.Message || errorCode;
1530
- response.message = message;
1531
- delete response.Message;
1532
- return Promise.reject(Object.assign(new Error(message), response));
1533
1033
  };
1534
1034
  const deserializeAws_json1_1DeleteBackupCommand = async (output, context) => {
1535
1035
  if (output.statusCode >= 300) {
@@ -1556,75 +1056,34 @@ const deserializeAws_json1_1DeleteBackupCommandError = async (output, context) =
1556
1056
  switch (errorCode) {
1557
1057
  case "BackupBeingCopied":
1558
1058
  case "com.amazonaws.fsx#BackupBeingCopied":
1559
- response = {
1560
- ...(await deserializeAws_json1_1BackupBeingCopiedResponse(parsedOutput, context)),
1561
- name: errorCode,
1562
- $metadata: deserializeMetadata(output),
1563
- };
1564
- break;
1059
+ throw await deserializeAws_json1_1BackupBeingCopiedResponse(parsedOutput, context);
1565
1060
  case "BackupInProgress":
1566
1061
  case "com.amazonaws.fsx#BackupInProgress":
1567
- response = {
1568
- ...(await deserializeAws_json1_1BackupInProgressResponse(parsedOutput, context)),
1569
- name: errorCode,
1570
- $metadata: deserializeMetadata(output),
1571
- };
1572
- break;
1062
+ throw await deserializeAws_json1_1BackupInProgressResponse(parsedOutput, context);
1573
1063
  case "BackupNotFound":
1574
1064
  case "com.amazonaws.fsx#BackupNotFound":
1575
- response = {
1576
- ...(await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context)),
1577
- name: errorCode,
1578
- $metadata: deserializeMetadata(output),
1579
- };
1580
- break;
1065
+ throw await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context);
1581
1066
  case "BackupRestoring":
1582
1067
  case "com.amazonaws.fsx#BackupRestoring":
1583
- response = {
1584
- ...(await deserializeAws_json1_1BackupRestoringResponse(parsedOutput, context)),
1585
- name: errorCode,
1586
- $metadata: deserializeMetadata(output),
1587
- };
1588
- break;
1068
+ throw await deserializeAws_json1_1BackupRestoringResponse(parsedOutput, context);
1589
1069
  case "BadRequest":
1590
1070
  case "com.amazonaws.fsx#BadRequest":
1591
- response = {
1592
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1593
- name: errorCode,
1594
- $metadata: deserializeMetadata(output),
1595
- };
1596
- break;
1071
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1597
1072
  case "IncompatibleParameterError":
1598
1073
  case "com.amazonaws.fsx#IncompatibleParameterError":
1599
- response = {
1600
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
1601
- name: errorCode,
1602
- $metadata: deserializeMetadata(output),
1603
- };
1604
- break;
1074
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
1605
1075
  case "InternalServerError":
1606
1076
  case "com.amazonaws.fsx#InternalServerError":
1607
- response = {
1608
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1609
- name: errorCode,
1610
- $metadata: deserializeMetadata(output),
1611
- };
1612
- break;
1077
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1613
1078
  default:
1614
1079
  const parsedBody = parsedOutput.body;
1615
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1616
- response = {
1617
- ...parsedBody,
1618
- name: `${errorCode}`,
1619
- message: parsedBody.message || parsedBody.Message || errorCode,
1080
+ response = new FSxServiceException_1.FSxServiceException({
1081
+ name: parsedBody.code || parsedBody.Code || errorCode,
1620
1082
  $fault: "client",
1621
1083
  $metadata: deserializeMetadata(output),
1622
- };
1084
+ });
1085
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1623
1086
  }
1624
- const message = response.message || response.Message || errorCode;
1625
- response.message = message;
1626
- delete response.Message;
1627
- return Promise.reject(Object.assign(new Error(message), response));
1628
1087
  };
1629
1088
  const deserializeAws_json1_1DeleteDataRepositoryAssociationCommand = async (output, context) => {
1630
1089
  if (output.statusCode >= 300) {
@@ -1651,59 +1110,28 @@ const deserializeAws_json1_1DeleteDataRepositoryAssociationCommandError = async
1651
1110
  switch (errorCode) {
1652
1111
  case "BadRequest":
1653
1112
  case "com.amazonaws.fsx#BadRequest":
1654
- response = {
1655
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1656
- name: errorCode,
1657
- $metadata: deserializeMetadata(output),
1658
- };
1659
- break;
1113
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1660
1114
  case "DataRepositoryAssociationNotFound":
1661
1115
  case "com.amazonaws.fsx#DataRepositoryAssociationNotFound":
1662
- response = {
1663
- ...(await deserializeAws_json1_1DataRepositoryAssociationNotFoundResponse(parsedOutput, context)),
1664
- name: errorCode,
1665
- $metadata: deserializeMetadata(output),
1666
- };
1667
- break;
1116
+ throw await deserializeAws_json1_1DataRepositoryAssociationNotFoundResponse(parsedOutput, context);
1668
1117
  case "IncompatibleParameterError":
1669
1118
  case "com.amazonaws.fsx#IncompatibleParameterError":
1670
- response = {
1671
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
1672
- name: errorCode,
1673
- $metadata: deserializeMetadata(output),
1674
- };
1675
- break;
1119
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
1676
1120
  case "InternalServerError":
1677
1121
  case "com.amazonaws.fsx#InternalServerError":
1678
- response = {
1679
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1680
- name: errorCode,
1681
- $metadata: deserializeMetadata(output),
1682
- };
1683
- break;
1122
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1684
1123
  case "ServiceLimitExceeded":
1685
1124
  case "com.amazonaws.fsx#ServiceLimitExceeded":
1686
- response = {
1687
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
1688
- name: errorCode,
1689
- $metadata: deserializeMetadata(output),
1690
- };
1691
- break;
1125
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
1692
1126
  default:
1693
1127
  const parsedBody = parsedOutput.body;
1694
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1695
- response = {
1696
- ...parsedBody,
1697
- name: `${errorCode}`,
1698
- message: parsedBody.message || parsedBody.Message || errorCode,
1128
+ response = new FSxServiceException_1.FSxServiceException({
1129
+ name: parsedBody.code || parsedBody.Code || errorCode,
1699
1130
  $fault: "client",
1700
1131
  $metadata: deserializeMetadata(output),
1701
- };
1132
+ });
1133
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1702
1134
  }
1703
- const message = response.message || response.Message || errorCode;
1704
- response.message = message;
1705
- delete response.Message;
1706
- return Promise.reject(Object.assign(new Error(message), response));
1707
1135
  };
1708
1136
  const deserializeAws_json1_1DeleteFileSystemCommand = async (output, context) => {
1709
1137
  if (output.statusCode >= 300) {
@@ -1730,59 +1158,28 @@ const deserializeAws_json1_1DeleteFileSystemCommandError = async (output, contex
1730
1158
  switch (errorCode) {
1731
1159
  case "BadRequest":
1732
1160
  case "com.amazonaws.fsx#BadRequest":
1733
- response = {
1734
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1735
- name: errorCode,
1736
- $metadata: deserializeMetadata(output),
1737
- };
1738
- break;
1161
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1739
1162
  case "FileSystemNotFound":
1740
1163
  case "com.amazonaws.fsx#FileSystemNotFound":
1741
- response = {
1742
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
1743
- name: errorCode,
1744
- $metadata: deserializeMetadata(output),
1745
- };
1746
- break;
1164
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
1747
1165
  case "IncompatibleParameterError":
1748
1166
  case "com.amazonaws.fsx#IncompatibleParameterError":
1749
- response = {
1750
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
1751
- name: errorCode,
1752
- $metadata: deserializeMetadata(output),
1753
- };
1754
- break;
1167
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
1755
1168
  case "InternalServerError":
1756
1169
  case "com.amazonaws.fsx#InternalServerError":
1757
- response = {
1758
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1759
- name: errorCode,
1760
- $metadata: deserializeMetadata(output),
1761
- };
1762
- break;
1170
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1763
1171
  case "ServiceLimitExceeded":
1764
1172
  case "com.amazonaws.fsx#ServiceLimitExceeded":
1765
- response = {
1766
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
1767
- name: errorCode,
1768
- $metadata: deserializeMetadata(output),
1769
- };
1770
- break;
1173
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
1771
1174
  default:
1772
1175
  const parsedBody = parsedOutput.body;
1773
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1774
- response = {
1775
- ...parsedBody,
1776
- name: `${errorCode}`,
1777
- message: parsedBody.message || parsedBody.Message || errorCode,
1176
+ response = new FSxServiceException_1.FSxServiceException({
1177
+ name: parsedBody.code || parsedBody.Code || errorCode,
1778
1178
  $fault: "client",
1779
1179
  $metadata: deserializeMetadata(output),
1780
- };
1180
+ });
1181
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1781
1182
  }
1782
- const message = response.message || response.Message || errorCode;
1783
- response.message = message;
1784
- delete response.Message;
1785
- return Promise.reject(Object.assign(new Error(message), response));
1786
1183
  };
1787
1184
  const deserializeAws_json1_1DeleteSnapshotCommand = async (output, context) => {
1788
1185
  if (output.statusCode >= 300) {
@@ -1809,43 +1206,22 @@ const deserializeAws_json1_1DeleteSnapshotCommandError = async (output, context)
1809
1206
  switch (errorCode) {
1810
1207
  case "BadRequest":
1811
1208
  case "com.amazonaws.fsx#BadRequest":
1812
- response = {
1813
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1814
- name: errorCode,
1815
- $metadata: deserializeMetadata(output),
1816
- };
1817
- break;
1209
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1818
1210
  case "InternalServerError":
1819
1211
  case "com.amazonaws.fsx#InternalServerError":
1820
- response = {
1821
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1822
- name: errorCode,
1823
- $metadata: deserializeMetadata(output),
1824
- };
1825
- break;
1212
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1826
1213
  case "SnapshotNotFound":
1827
1214
  case "com.amazonaws.fsx#SnapshotNotFound":
1828
- response = {
1829
- ...(await deserializeAws_json1_1SnapshotNotFoundResponse(parsedOutput, context)),
1830
- name: errorCode,
1831
- $metadata: deserializeMetadata(output),
1832
- };
1833
- break;
1215
+ throw await deserializeAws_json1_1SnapshotNotFoundResponse(parsedOutput, context);
1834
1216
  default:
1835
1217
  const parsedBody = parsedOutput.body;
1836
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1837
- response = {
1838
- ...parsedBody,
1839
- name: `${errorCode}`,
1840
- message: parsedBody.message || parsedBody.Message || errorCode,
1218
+ response = new FSxServiceException_1.FSxServiceException({
1219
+ name: parsedBody.code || parsedBody.Code || errorCode,
1841
1220
  $fault: "client",
1842
1221
  $metadata: deserializeMetadata(output),
1843
- };
1222
+ });
1223
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1844
1224
  }
1845
- const message = response.message || response.Message || errorCode;
1846
- response.message = message;
1847
- delete response.Message;
1848
- return Promise.reject(Object.assign(new Error(message), response));
1849
1225
  };
1850
1226
  const deserializeAws_json1_1DeleteStorageVirtualMachineCommand = async (output, context) => {
1851
1227
  if (output.statusCode >= 300) {
@@ -1872,51 +1248,25 @@ const deserializeAws_json1_1DeleteStorageVirtualMachineCommandError = async (out
1872
1248
  switch (errorCode) {
1873
1249
  case "BadRequest":
1874
1250
  case "com.amazonaws.fsx#BadRequest":
1875
- response = {
1876
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1877
- name: errorCode,
1878
- $metadata: deserializeMetadata(output),
1879
- };
1880
- break;
1251
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1881
1252
  case "IncompatibleParameterError":
1882
1253
  case "com.amazonaws.fsx#IncompatibleParameterError":
1883
- response = {
1884
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
1885
- name: errorCode,
1886
- $metadata: deserializeMetadata(output),
1887
- };
1888
- break;
1254
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
1889
1255
  case "InternalServerError":
1890
1256
  case "com.amazonaws.fsx#InternalServerError":
1891
- response = {
1892
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1893
- name: errorCode,
1894
- $metadata: deserializeMetadata(output),
1895
- };
1896
- break;
1257
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1897
1258
  case "StorageVirtualMachineNotFound":
1898
1259
  case "com.amazonaws.fsx#StorageVirtualMachineNotFound":
1899
- response = {
1900
- ...(await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context)),
1901
- name: errorCode,
1902
- $metadata: deserializeMetadata(output),
1903
- };
1904
- break;
1260
+ throw await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context);
1905
1261
  default:
1906
1262
  const parsedBody = parsedOutput.body;
1907
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1908
- response = {
1909
- ...parsedBody,
1910
- name: `${errorCode}`,
1911
- message: parsedBody.message || parsedBody.Message || errorCode,
1263
+ response = new FSxServiceException_1.FSxServiceException({
1264
+ name: parsedBody.code || parsedBody.Code || errorCode,
1912
1265
  $fault: "client",
1913
1266
  $metadata: deserializeMetadata(output),
1914
- };
1267
+ });
1268
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1915
1269
  }
1916
- const message = response.message || response.Message || errorCode;
1917
- response.message = message;
1918
- delete response.Message;
1919
- return Promise.reject(Object.assign(new Error(message), response));
1920
1270
  };
1921
1271
  const deserializeAws_json1_1DeleteVolumeCommand = async (output, context) => {
1922
1272
  if (output.statusCode >= 300) {
@@ -1943,51 +1293,25 @@ const deserializeAws_json1_1DeleteVolumeCommandError = async (output, context) =
1943
1293
  switch (errorCode) {
1944
1294
  case "BadRequest":
1945
1295
  case "com.amazonaws.fsx#BadRequest":
1946
- response = {
1947
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
1948
- name: errorCode,
1949
- $metadata: deserializeMetadata(output),
1950
- };
1951
- break;
1296
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
1952
1297
  case "IncompatibleParameterError":
1953
1298
  case "com.amazonaws.fsx#IncompatibleParameterError":
1954
- response = {
1955
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
1956
- name: errorCode,
1957
- $metadata: deserializeMetadata(output),
1958
- };
1959
- break;
1299
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
1960
1300
  case "InternalServerError":
1961
1301
  case "com.amazonaws.fsx#InternalServerError":
1962
- response = {
1963
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
1964
- name: errorCode,
1965
- $metadata: deserializeMetadata(output),
1966
- };
1967
- break;
1302
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
1968
1303
  case "VolumeNotFound":
1969
1304
  case "com.amazonaws.fsx#VolumeNotFound":
1970
- response = {
1971
- ...(await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context)),
1972
- name: errorCode,
1973
- $metadata: deserializeMetadata(output),
1974
- };
1975
- break;
1305
+ throw await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context);
1976
1306
  default:
1977
1307
  const parsedBody = parsedOutput.body;
1978
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1979
- response = {
1980
- ...parsedBody,
1981
- name: `${errorCode}`,
1982
- message: parsedBody.message || parsedBody.Message || errorCode,
1308
+ response = new FSxServiceException_1.FSxServiceException({
1309
+ name: parsedBody.code || parsedBody.Code || errorCode,
1983
1310
  $fault: "client",
1984
1311
  $metadata: deserializeMetadata(output),
1985
- };
1312
+ });
1313
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1986
1314
  }
1987
- const message = response.message || response.Message || errorCode;
1988
- response.message = message;
1989
- delete response.Message;
1990
- return Promise.reject(Object.assign(new Error(message), response));
1991
1315
  };
1992
1316
  const deserializeAws_json1_1DescribeBackupsCommand = async (output, context) => {
1993
1317
  if (output.statusCode >= 300) {
@@ -2014,59 +1338,28 @@ const deserializeAws_json1_1DescribeBackupsCommandError = async (output, context
2014
1338
  switch (errorCode) {
2015
1339
  case "BackupNotFound":
2016
1340
  case "com.amazonaws.fsx#BackupNotFound":
2017
- response = {
2018
- ...(await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context)),
2019
- name: errorCode,
2020
- $metadata: deserializeMetadata(output),
2021
- };
2022
- break;
1341
+ throw await deserializeAws_json1_1BackupNotFoundResponse(parsedOutput, context);
2023
1342
  case "BadRequest":
2024
1343
  case "com.amazonaws.fsx#BadRequest":
2025
- response = {
2026
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2027
- name: errorCode,
2028
- $metadata: deserializeMetadata(output),
2029
- };
2030
- break;
1344
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2031
1345
  case "FileSystemNotFound":
2032
1346
  case "com.amazonaws.fsx#FileSystemNotFound":
2033
- response = {
2034
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
2035
- name: errorCode,
2036
- $metadata: deserializeMetadata(output),
2037
- };
2038
- break;
1347
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
2039
1348
  case "InternalServerError":
2040
1349
  case "com.amazonaws.fsx#InternalServerError":
2041
- response = {
2042
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2043
- name: errorCode,
2044
- $metadata: deserializeMetadata(output),
2045
- };
2046
- break;
1350
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2047
1351
  case "VolumeNotFound":
2048
1352
  case "com.amazonaws.fsx#VolumeNotFound":
2049
- response = {
2050
- ...(await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context)),
2051
- name: errorCode,
2052
- $metadata: deserializeMetadata(output),
2053
- };
2054
- break;
1353
+ throw await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context);
2055
1354
  default:
2056
1355
  const parsedBody = parsedOutput.body;
2057
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2058
- response = {
2059
- ...parsedBody,
2060
- name: `${errorCode}`,
2061
- message: parsedBody.message || parsedBody.Message || errorCode,
1356
+ response = new FSxServiceException_1.FSxServiceException({
1357
+ name: parsedBody.code || parsedBody.Code || errorCode,
2062
1358
  $fault: "client",
2063
1359
  $metadata: deserializeMetadata(output),
2064
- };
1360
+ });
1361
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2065
1362
  }
2066
- const message = response.message || response.Message || errorCode;
2067
- response.message = message;
2068
- delete response.Message;
2069
- return Promise.reject(Object.assign(new Error(message), response));
2070
1363
  };
2071
1364
  const deserializeAws_json1_1DescribeDataRepositoryAssociationsCommand = async (output, context) => {
2072
1365
  if (output.statusCode >= 300) {
@@ -2093,59 +1386,28 @@ const deserializeAws_json1_1DescribeDataRepositoryAssociationsCommandError = asy
2093
1386
  switch (errorCode) {
2094
1387
  case "BadRequest":
2095
1388
  case "com.amazonaws.fsx#BadRequest":
2096
- response = {
2097
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2098
- name: errorCode,
2099
- $metadata: deserializeMetadata(output),
2100
- };
2101
- break;
1389
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2102
1390
  case "DataRepositoryAssociationNotFound":
2103
1391
  case "com.amazonaws.fsx#DataRepositoryAssociationNotFound":
2104
- response = {
2105
- ...(await deserializeAws_json1_1DataRepositoryAssociationNotFoundResponse(parsedOutput, context)),
2106
- name: errorCode,
2107
- $metadata: deserializeMetadata(output),
2108
- };
2109
- break;
1392
+ throw await deserializeAws_json1_1DataRepositoryAssociationNotFoundResponse(parsedOutput, context);
2110
1393
  case "FileSystemNotFound":
2111
1394
  case "com.amazonaws.fsx#FileSystemNotFound":
2112
- response = {
2113
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
2114
- name: errorCode,
2115
- $metadata: deserializeMetadata(output),
2116
- };
2117
- break;
1395
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
2118
1396
  case "InternalServerError":
2119
1397
  case "com.amazonaws.fsx#InternalServerError":
2120
- response = {
2121
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2122
- name: errorCode,
2123
- $metadata: deserializeMetadata(output),
2124
- };
2125
- break;
1398
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2126
1399
  case "InvalidDataRepositoryType":
2127
1400
  case "com.amazonaws.fsx#InvalidDataRepositoryType":
2128
- response = {
2129
- ...(await deserializeAws_json1_1InvalidDataRepositoryTypeResponse(parsedOutput, context)),
2130
- name: errorCode,
2131
- $metadata: deserializeMetadata(output),
2132
- };
2133
- break;
1401
+ throw await deserializeAws_json1_1InvalidDataRepositoryTypeResponse(parsedOutput, context);
2134
1402
  default:
2135
1403
  const parsedBody = parsedOutput.body;
2136
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2137
- response = {
2138
- ...parsedBody,
2139
- name: `${errorCode}`,
2140
- message: parsedBody.message || parsedBody.Message || errorCode,
1404
+ response = new FSxServiceException_1.FSxServiceException({
1405
+ name: parsedBody.code || parsedBody.Code || errorCode,
2141
1406
  $fault: "client",
2142
1407
  $metadata: deserializeMetadata(output),
2143
- };
1408
+ });
1409
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2144
1410
  }
2145
- const message = response.message || response.Message || errorCode;
2146
- response.message = message;
2147
- delete response.Message;
2148
- return Promise.reject(Object.assign(new Error(message), response));
2149
1411
  };
2150
1412
  const deserializeAws_json1_1DescribeDataRepositoryTasksCommand = async (output, context) => {
2151
1413
  if (output.statusCode >= 300) {
@@ -2172,51 +1434,25 @@ const deserializeAws_json1_1DescribeDataRepositoryTasksCommandError = async (out
2172
1434
  switch (errorCode) {
2173
1435
  case "BadRequest":
2174
1436
  case "com.amazonaws.fsx#BadRequest":
2175
- response = {
2176
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2177
- name: errorCode,
2178
- $metadata: deserializeMetadata(output),
2179
- };
2180
- break;
1437
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2181
1438
  case "DataRepositoryTaskNotFound":
2182
1439
  case "com.amazonaws.fsx#DataRepositoryTaskNotFound":
2183
- response = {
2184
- ...(await deserializeAws_json1_1DataRepositoryTaskNotFoundResponse(parsedOutput, context)),
2185
- name: errorCode,
2186
- $metadata: deserializeMetadata(output),
2187
- };
2188
- break;
1440
+ throw await deserializeAws_json1_1DataRepositoryTaskNotFoundResponse(parsedOutput, context);
2189
1441
  case "FileSystemNotFound":
2190
1442
  case "com.amazonaws.fsx#FileSystemNotFound":
2191
- response = {
2192
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
2193
- name: errorCode,
2194
- $metadata: deserializeMetadata(output),
2195
- };
2196
- break;
1443
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
2197
1444
  case "InternalServerError":
2198
1445
  case "com.amazonaws.fsx#InternalServerError":
2199
- response = {
2200
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2201
- name: errorCode,
2202
- $metadata: deserializeMetadata(output),
2203
- };
2204
- break;
1446
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2205
1447
  default:
2206
1448
  const parsedBody = parsedOutput.body;
2207
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2208
- response = {
2209
- ...parsedBody,
2210
- name: `${errorCode}`,
2211
- message: parsedBody.message || parsedBody.Message || errorCode,
1449
+ response = new FSxServiceException_1.FSxServiceException({
1450
+ name: parsedBody.code || parsedBody.Code || errorCode,
2212
1451
  $fault: "client",
2213
1452
  $metadata: deserializeMetadata(output),
2214
- };
1453
+ });
1454
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2215
1455
  }
2216
- const message = response.message || response.Message || errorCode;
2217
- response.message = message;
2218
- delete response.Message;
2219
- return Promise.reject(Object.assign(new Error(message), response));
2220
1456
  };
2221
1457
  const deserializeAws_json1_1DescribeFileSystemAliasesCommand = async (output, context) => {
2222
1458
  if (output.statusCode >= 300) {
@@ -2243,43 +1479,22 @@ const deserializeAws_json1_1DescribeFileSystemAliasesCommandError = async (outpu
2243
1479
  switch (errorCode) {
2244
1480
  case "BadRequest":
2245
1481
  case "com.amazonaws.fsx#BadRequest":
2246
- response = {
2247
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2248
- name: errorCode,
2249
- $metadata: deserializeMetadata(output),
2250
- };
2251
- break;
1482
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2252
1483
  case "FileSystemNotFound":
2253
1484
  case "com.amazonaws.fsx#FileSystemNotFound":
2254
- response = {
2255
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
2256
- name: errorCode,
2257
- $metadata: deserializeMetadata(output),
2258
- };
2259
- break;
1485
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
2260
1486
  case "InternalServerError":
2261
1487
  case "com.amazonaws.fsx#InternalServerError":
2262
- response = {
2263
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2264
- name: errorCode,
2265
- $metadata: deserializeMetadata(output),
2266
- };
2267
- break;
1488
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2268
1489
  default:
2269
1490
  const parsedBody = parsedOutput.body;
2270
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2271
- response = {
2272
- ...parsedBody,
2273
- name: `${errorCode}`,
2274
- message: parsedBody.message || parsedBody.Message || errorCode,
1491
+ response = new FSxServiceException_1.FSxServiceException({
1492
+ name: parsedBody.code || parsedBody.Code || errorCode,
2275
1493
  $fault: "client",
2276
1494
  $metadata: deserializeMetadata(output),
2277
- };
1495
+ });
1496
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2278
1497
  }
2279
- const message = response.message || response.Message || errorCode;
2280
- response.message = message;
2281
- delete response.Message;
2282
- return Promise.reject(Object.assign(new Error(message), response));
2283
1498
  };
2284
1499
  const deserializeAws_json1_1DescribeFileSystemsCommand = async (output, context) => {
2285
1500
  if (output.statusCode >= 300) {
@@ -2306,43 +1521,22 @@ const deserializeAws_json1_1DescribeFileSystemsCommandError = async (output, con
2306
1521
  switch (errorCode) {
2307
1522
  case "BadRequest":
2308
1523
  case "com.amazonaws.fsx#BadRequest":
2309
- response = {
2310
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2311
- name: errorCode,
2312
- $metadata: deserializeMetadata(output),
2313
- };
2314
- break;
1524
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2315
1525
  case "FileSystemNotFound":
2316
1526
  case "com.amazonaws.fsx#FileSystemNotFound":
2317
- response = {
2318
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
2319
- name: errorCode,
2320
- $metadata: deserializeMetadata(output),
2321
- };
2322
- break;
1527
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
2323
1528
  case "InternalServerError":
2324
1529
  case "com.amazonaws.fsx#InternalServerError":
2325
- response = {
2326
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2327
- name: errorCode,
2328
- $metadata: deserializeMetadata(output),
2329
- };
2330
- break;
1530
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2331
1531
  default:
2332
1532
  const parsedBody = parsedOutput.body;
2333
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2334
- response = {
2335
- ...parsedBody,
2336
- name: `${errorCode}`,
2337
- message: parsedBody.message || parsedBody.Message || errorCode,
1533
+ response = new FSxServiceException_1.FSxServiceException({
1534
+ name: parsedBody.code || parsedBody.Code || errorCode,
2338
1535
  $fault: "client",
2339
1536
  $metadata: deserializeMetadata(output),
2340
- };
1537
+ });
1538
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2341
1539
  }
2342
- const message = response.message || response.Message || errorCode;
2343
- response.message = message;
2344
- delete response.Message;
2345
- return Promise.reject(Object.assign(new Error(message), response));
2346
1540
  };
2347
1541
  const deserializeAws_json1_1DescribeSnapshotsCommand = async (output, context) => {
2348
1542
  if (output.statusCode >= 300) {
@@ -2369,43 +1563,22 @@ const deserializeAws_json1_1DescribeSnapshotsCommandError = async (output, conte
2369
1563
  switch (errorCode) {
2370
1564
  case "BadRequest":
2371
1565
  case "com.amazonaws.fsx#BadRequest":
2372
- response = {
2373
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2374
- name: errorCode,
2375
- $metadata: deserializeMetadata(output),
2376
- };
2377
- break;
1566
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2378
1567
  case "InternalServerError":
2379
1568
  case "com.amazonaws.fsx#InternalServerError":
2380
- response = {
2381
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2382
- name: errorCode,
2383
- $metadata: deserializeMetadata(output),
2384
- };
2385
- break;
1569
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2386
1570
  case "SnapshotNotFound":
2387
1571
  case "com.amazonaws.fsx#SnapshotNotFound":
2388
- response = {
2389
- ...(await deserializeAws_json1_1SnapshotNotFoundResponse(parsedOutput, context)),
2390
- name: errorCode,
2391
- $metadata: deserializeMetadata(output),
2392
- };
2393
- break;
1572
+ throw await deserializeAws_json1_1SnapshotNotFoundResponse(parsedOutput, context);
2394
1573
  default:
2395
1574
  const parsedBody = parsedOutput.body;
2396
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2397
- response = {
2398
- ...parsedBody,
2399
- name: `${errorCode}`,
2400
- message: parsedBody.message || parsedBody.Message || errorCode,
1575
+ response = new FSxServiceException_1.FSxServiceException({
1576
+ name: parsedBody.code || parsedBody.Code || errorCode,
2401
1577
  $fault: "client",
2402
1578
  $metadata: deserializeMetadata(output),
2403
- };
1579
+ });
1580
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2404
1581
  }
2405
- const message = response.message || response.Message || errorCode;
2406
- response.message = message;
2407
- delete response.Message;
2408
- return Promise.reject(Object.assign(new Error(message), response));
2409
1582
  };
2410
1583
  const deserializeAws_json1_1DescribeStorageVirtualMachinesCommand = async (output, context) => {
2411
1584
  if (output.statusCode >= 300) {
@@ -2432,43 +1605,22 @@ const deserializeAws_json1_1DescribeStorageVirtualMachinesCommandError = async (
2432
1605
  switch (errorCode) {
2433
1606
  case "BadRequest":
2434
1607
  case "com.amazonaws.fsx#BadRequest":
2435
- response = {
2436
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2437
- name: errorCode,
2438
- $metadata: deserializeMetadata(output),
2439
- };
2440
- break;
1608
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2441
1609
  case "InternalServerError":
2442
1610
  case "com.amazonaws.fsx#InternalServerError":
2443
- response = {
2444
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2445
- name: errorCode,
2446
- $metadata: deserializeMetadata(output),
2447
- };
2448
- break;
1611
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2449
1612
  case "StorageVirtualMachineNotFound":
2450
1613
  case "com.amazonaws.fsx#StorageVirtualMachineNotFound":
2451
- response = {
2452
- ...(await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context)),
2453
- name: errorCode,
2454
- $metadata: deserializeMetadata(output),
2455
- };
2456
- break;
1614
+ throw await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context);
2457
1615
  default:
2458
1616
  const parsedBody = parsedOutput.body;
2459
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2460
- response = {
2461
- ...parsedBody,
2462
- name: `${errorCode}`,
2463
- message: parsedBody.message || parsedBody.Message || errorCode,
1617
+ response = new FSxServiceException_1.FSxServiceException({
1618
+ name: parsedBody.code || parsedBody.Code || errorCode,
2464
1619
  $fault: "client",
2465
1620
  $metadata: deserializeMetadata(output),
2466
- };
1621
+ });
1622
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2467
1623
  }
2468
- const message = response.message || response.Message || errorCode;
2469
- response.message = message;
2470
- delete response.Message;
2471
- return Promise.reject(Object.assign(new Error(message), response));
2472
1624
  };
2473
1625
  const deserializeAws_json1_1DescribeVolumesCommand = async (output, context) => {
2474
1626
  if (output.statusCode >= 300) {
@@ -2495,43 +1647,22 @@ const deserializeAws_json1_1DescribeVolumesCommandError = async (output, context
2495
1647
  switch (errorCode) {
2496
1648
  case "BadRequest":
2497
1649
  case "com.amazonaws.fsx#BadRequest":
2498
- response = {
2499
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2500
- name: errorCode,
2501
- $metadata: deserializeMetadata(output),
2502
- };
2503
- break;
1650
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2504
1651
  case "InternalServerError":
2505
1652
  case "com.amazonaws.fsx#InternalServerError":
2506
- response = {
2507
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2508
- name: errorCode,
2509
- $metadata: deserializeMetadata(output),
2510
- };
2511
- break;
1653
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2512
1654
  case "VolumeNotFound":
2513
1655
  case "com.amazonaws.fsx#VolumeNotFound":
2514
- response = {
2515
- ...(await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context)),
2516
- name: errorCode,
2517
- $metadata: deserializeMetadata(output),
2518
- };
2519
- break;
1656
+ throw await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context);
2520
1657
  default:
2521
1658
  const parsedBody = parsedOutput.body;
2522
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2523
- response = {
2524
- ...parsedBody,
2525
- name: `${errorCode}`,
2526
- message: parsedBody.message || parsedBody.Message || errorCode,
1659
+ response = new FSxServiceException_1.FSxServiceException({
1660
+ name: parsedBody.code || parsedBody.Code || errorCode,
2527
1661
  $fault: "client",
2528
1662
  $metadata: deserializeMetadata(output),
2529
- };
1663
+ });
1664
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2530
1665
  }
2531
- const message = response.message || response.Message || errorCode;
2532
- response.message = message;
2533
- delete response.Message;
2534
- return Promise.reject(Object.assign(new Error(message), response));
2535
1666
  };
2536
1667
  const deserializeAws_json1_1DisassociateFileSystemAliasesCommand = async (output, context) => {
2537
1668
  if (output.statusCode >= 300) {
@@ -2558,43 +1689,22 @@ const deserializeAws_json1_1DisassociateFileSystemAliasesCommandError = async (o
2558
1689
  switch (errorCode) {
2559
1690
  case "BadRequest":
2560
1691
  case "com.amazonaws.fsx#BadRequest":
2561
- response = {
2562
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2563
- name: errorCode,
2564
- $metadata: deserializeMetadata(output),
2565
- };
2566
- break;
1692
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2567
1693
  case "FileSystemNotFound":
2568
1694
  case "com.amazonaws.fsx#FileSystemNotFound":
2569
- response = {
2570
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
2571
- name: errorCode,
2572
- $metadata: deserializeMetadata(output),
2573
- };
2574
- break;
1695
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
2575
1696
  case "InternalServerError":
2576
1697
  case "com.amazonaws.fsx#InternalServerError":
2577
- response = {
2578
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2579
- name: errorCode,
2580
- $metadata: deserializeMetadata(output),
2581
- };
2582
- break;
1698
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2583
1699
  default:
2584
1700
  const parsedBody = parsedOutput.body;
2585
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2586
- response = {
2587
- ...parsedBody,
2588
- name: `${errorCode}`,
2589
- message: parsedBody.message || parsedBody.Message || errorCode,
1701
+ response = new FSxServiceException_1.FSxServiceException({
1702
+ name: parsedBody.code || parsedBody.Code || errorCode,
2590
1703
  $fault: "client",
2591
1704
  $metadata: deserializeMetadata(output),
2592
- };
1705
+ });
1706
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2593
1707
  }
2594
- const message = response.message || response.Message || errorCode;
2595
- response.message = message;
2596
- delete response.Message;
2597
- return Promise.reject(Object.assign(new Error(message), response));
2598
1708
  };
2599
1709
  const deserializeAws_json1_1ListTagsForResourceCommand = async (output, context) => {
2600
1710
  if (output.statusCode >= 300) {
@@ -2621,59 +1731,28 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async (output, con
2621
1731
  switch (errorCode) {
2622
1732
  case "BadRequest":
2623
1733
  case "com.amazonaws.fsx#BadRequest":
2624
- response = {
2625
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2626
- name: errorCode,
2627
- $metadata: deserializeMetadata(output),
2628
- };
2629
- break;
1734
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2630
1735
  case "InternalServerError":
2631
1736
  case "com.amazonaws.fsx#InternalServerError":
2632
- response = {
2633
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2634
- name: errorCode,
2635
- $metadata: deserializeMetadata(output),
2636
- };
2637
- break;
1737
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2638
1738
  case "NotServiceResourceError":
2639
1739
  case "com.amazonaws.fsx#NotServiceResourceError":
2640
- response = {
2641
- ...(await deserializeAws_json1_1NotServiceResourceErrorResponse(parsedOutput, context)),
2642
- name: errorCode,
2643
- $metadata: deserializeMetadata(output),
2644
- };
2645
- break;
1740
+ throw await deserializeAws_json1_1NotServiceResourceErrorResponse(parsedOutput, context);
2646
1741
  case "ResourceDoesNotSupportTagging":
2647
1742
  case "com.amazonaws.fsx#ResourceDoesNotSupportTagging":
2648
- response = {
2649
- ...(await deserializeAws_json1_1ResourceDoesNotSupportTaggingResponse(parsedOutput, context)),
2650
- name: errorCode,
2651
- $metadata: deserializeMetadata(output),
2652
- };
2653
- break;
1743
+ throw await deserializeAws_json1_1ResourceDoesNotSupportTaggingResponse(parsedOutput, context);
2654
1744
  case "ResourceNotFound":
2655
1745
  case "com.amazonaws.fsx#ResourceNotFound":
2656
- response = {
2657
- ...(await deserializeAws_json1_1ResourceNotFoundResponse(parsedOutput, context)),
2658
- name: errorCode,
2659
- $metadata: deserializeMetadata(output),
2660
- };
2661
- break;
1746
+ throw await deserializeAws_json1_1ResourceNotFoundResponse(parsedOutput, context);
2662
1747
  default:
2663
1748
  const parsedBody = parsedOutput.body;
2664
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2665
- response = {
2666
- ...parsedBody,
2667
- name: `${errorCode}`,
2668
- message: parsedBody.message || parsedBody.Message || errorCode,
1749
+ response = new FSxServiceException_1.FSxServiceException({
1750
+ name: parsedBody.code || parsedBody.Code || errorCode,
2669
1751
  $fault: "client",
2670
1752
  $metadata: deserializeMetadata(output),
2671
- };
1753
+ });
1754
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2672
1755
  }
2673
- const message = response.message || response.Message || errorCode;
2674
- response.message = message;
2675
- delete response.Message;
2676
- return Promise.reject(Object.assign(new Error(message), response));
2677
1756
  };
2678
1757
  const deserializeAws_json1_1ReleaseFileSystemNfsV3LocksCommand = async (output, context) => {
2679
1758
  if (output.statusCode >= 300) {
@@ -2700,59 +1779,28 @@ const deserializeAws_json1_1ReleaseFileSystemNfsV3LocksCommandError = async (out
2700
1779
  switch (errorCode) {
2701
1780
  case "BadRequest":
2702
1781
  case "com.amazonaws.fsx#BadRequest":
2703
- response = {
2704
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2705
- name: errorCode,
2706
- $metadata: deserializeMetadata(output),
2707
- };
2708
- break;
1782
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2709
1783
  case "FileSystemNotFound":
2710
1784
  case "com.amazonaws.fsx#FileSystemNotFound":
2711
- response = {
2712
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
2713
- name: errorCode,
2714
- $metadata: deserializeMetadata(output),
2715
- };
2716
- break;
1785
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
2717
1786
  case "IncompatibleParameterError":
2718
1787
  case "com.amazonaws.fsx#IncompatibleParameterError":
2719
- response = {
2720
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
2721
- name: errorCode,
2722
- $metadata: deserializeMetadata(output),
2723
- };
2724
- break;
1788
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
2725
1789
  case "InternalServerError":
2726
1790
  case "com.amazonaws.fsx#InternalServerError":
2727
- response = {
2728
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2729
- name: errorCode,
2730
- $metadata: deserializeMetadata(output),
2731
- };
2732
- break;
1791
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2733
1792
  case "ServiceLimitExceeded":
2734
1793
  case "com.amazonaws.fsx#ServiceLimitExceeded":
2735
- response = {
2736
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
2737
- name: errorCode,
2738
- $metadata: deserializeMetadata(output),
2739
- };
2740
- break;
1794
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
2741
1795
  default:
2742
1796
  const parsedBody = parsedOutput.body;
2743
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2744
- response = {
2745
- ...parsedBody,
2746
- name: `${errorCode}`,
2747
- message: parsedBody.message || parsedBody.Message || errorCode,
1797
+ response = new FSxServiceException_1.FSxServiceException({
1798
+ name: parsedBody.code || parsedBody.Code || errorCode,
2748
1799
  $fault: "client",
2749
1800
  $metadata: deserializeMetadata(output),
2750
- };
1801
+ });
1802
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2751
1803
  }
2752
- const message = response.message || response.Message || errorCode;
2753
- response.message = message;
2754
- delete response.Message;
2755
- return Promise.reject(Object.assign(new Error(message), response));
2756
1804
  };
2757
1805
  const deserializeAws_json1_1RestoreVolumeFromSnapshotCommand = async (output, context) => {
2758
1806
  if (output.statusCode >= 300) {
@@ -2779,43 +1827,22 @@ const deserializeAws_json1_1RestoreVolumeFromSnapshotCommandError = async (outpu
2779
1827
  switch (errorCode) {
2780
1828
  case "BadRequest":
2781
1829
  case "com.amazonaws.fsx#BadRequest":
2782
- response = {
2783
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2784
- name: errorCode,
2785
- $metadata: deserializeMetadata(output),
2786
- };
2787
- break;
1830
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2788
1831
  case "InternalServerError":
2789
1832
  case "com.amazonaws.fsx#InternalServerError":
2790
- response = {
2791
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2792
- name: errorCode,
2793
- $metadata: deserializeMetadata(output),
2794
- };
2795
- break;
1833
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2796
1834
  case "VolumeNotFound":
2797
1835
  case "com.amazonaws.fsx#VolumeNotFound":
2798
- response = {
2799
- ...(await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context)),
2800
- name: errorCode,
2801
- $metadata: deserializeMetadata(output),
2802
- };
2803
- break;
1836
+ throw await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context);
2804
1837
  default:
2805
1838
  const parsedBody = parsedOutput.body;
2806
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2807
- response = {
2808
- ...parsedBody,
2809
- name: `${errorCode}`,
2810
- message: parsedBody.message || parsedBody.Message || errorCode,
1839
+ response = new FSxServiceException_1.FSxServiceException({
1840
+ name: parsedBody.code || parsedBody.Code || errorCode,
2811
1841
  $fault: "client",
2812
1842
  $metadata: deserializeMetadata(output),
2813
- };
1843
+ });
1844
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2814
1845
  }
2815
- const message = response.message || response.Message || errorCode;
2816
- response.message = message;
2817
- delete response.Message;
2818
- return Promise.reject(Object.assign(new Error(message), response));
2819
1846
  };
2820
1847
  const deserializeAws_json1_1TagResourceCommand = async (output, context) => {
2821
1848
  if (output.statusCode >= 300) {
@@ -2842,59 +1869,28 @@ const deserializeAws_json1_1TagResourceCommandError = async (output, context) =>
2842
1869
  switch (errorCode) {
2843
1870
  case "BadRequest":
2844
1871
  case "com.amazonaws.fsx#BadRequest":
2845
- response = {
2846
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2847
- name: errorCode,
2848
- $metadata: deserializeMetadata(output),
2849
- };
2850
- break;
1872
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2851
1873
  case "InternalServerError":
2852
1874
  case "com.amazonaws.fsx#InternalServerError":
2853
- response = {
2854
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2855
- name: errorCode,
2856
- $metadata: deserializeMetadata(output),
2857
- };
2858
- break;
1875
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2859
1876
  case "NotServiceResourceError":
2860
1877
  case "com.amazonaws.fsx#NotServiceResourceError":
2861
- response = {
2862
- ...(await deserializeAws_json1_1NotServiceResourceErrorResponse(parsedOutput, context)),
2863
- name: errorCode,
2864
- $metadata: deserializeMetadata(output),
2865
- };
2866
- break;
1878
+ throw await deserializeAws_json1_1NotServiceResourceErrorResponse(parsedOutput, context);
2867
1879
  case "ResourceDoesNotSupportTagging":
2868
1880
  case "com.amazonaws.fsx#ResourceDoesNotSupportTagging":
2869
- response = {
2870
- ...(await deserializeAws_json1_1ResourceDoesNotSupportTaggingResponse(parsedOutput, context)),
2871
- name: errorCode,
2872
- $metadata: deserializeMetadata(output),
2873
- };
2874
- break;
1881
+ throw await deserializeAws_json1_1ResourceDoesNotSupportTaggingResponse(parsedOutput, context);
2875
1882
  case "ResourceNotFound":
2876
1883
  case "com.amazonaws.fsx#ResourceNotFound":
2877
- response = {
2878
- ...(await deserializeAws_json1_1ResourceNotFoundResponse(parsedOutput, context)),
2879
- name: errorCode,
2880
- $metadata: deserializeMetadata(output),
2881
- };
2882
- break;
1884
+ throw await deserializeAws_json1_1ResourceNotFoundResponse(parsedOutput, context);
2883
1885
  default:
2884
1886
  const parsedBody = parsedOutput.body;
2885
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2886
- response = {
2887
- ...parsedBody,
2888
- name: `${errorCode}`,
2889
- message: parsedBody.message || parsedBody.Message || errorCode,
1887
+ response = new FSxServiceException_1.FSxServiceException({
1888
+ name: parsedBody.code || parsedBody.Code || errorCode,
2890
1889
  $fault: "client",
2891
1890
  $metadata: deserializeMetadata(output),
2892
- };
1891
+ });
1892
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2893
1893
  }
2894
- const message = response.message || response.Message || errorCode;
2895
- response.message = message;
2896
- delete response.Message;
2897
- return Promise.reject(Object.assign(new Error(message), response));
2898
1894
  };
2899
1895
  const deserializeAws_json1_1UntagResourceCommand = async (output, context) => {
2900
1896
  if (output.statusCode >= 300) {
@@ -2921,59 +1917,28 @@ const deserializeAws_json1_1UntagResourceCommandError = async (output, context)
2921
1917
  switch (errorCode) {
2922
1918
  case "BadRequest":
2923
1919
  case "com.amazonaws.fsx#BadRequest":
2924
- response = {
2925
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
2926
- name: errorCode,
2927
- $metadata: deserializeMetadata(output),
2928
- };
2929
- break;
1920
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
2930
1921
  case "InternalServerError":
2931
1922
  case "com.amazonaws.fsx#InternalServerError":
2932
- response = {
2933
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
2934
- name: errorCode,
2935
- $metadata: deserializeMetadata(output),
2936
- };
2937
- break;
1923
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
2938
1924
  case "NotServiceResourceError":
2939
1925
  case "com.amazonaws.fsx#NotServiceResourceError":
2940
- response = {
2941
- ...(await deserializeAws_json1_1NotServiceResourceErrorResponse(parsedOutput, context)),
2942
- name: errorCode,
2943
- $metadata: deserializeMetadata(output),
2944
- };
2945
- break;
1926
+ throw await deserializeAws_json1_1NotServiceResourceErrorResponse(parsedOutput, context);
2946
1927
  case "ResourceDoesNotSupportTagging":
2947
1928
  case "com.amazonaws.fsx#ResourceDoesNotSupportTagging":
2948
- response = {
2949
- ...(await deserializeAws_json1_1ResourceDoesNotSupportTaggingResponse(parsedOutput, context)),
2950
- name: errorCode,
2951
- $metadata: deserializeMetadata(output),
2952
- };
2953
- break;
1929
+ throw await deserializeAws_json1_1ResourceDoesNotSupportTaggingResponse(parsedOutput, context);
2954
1930
  case "ResourceNotFound":
2955
1931
  case "com.amazonaws.fsx#ResourceNotFound":
2956
- response = {
2957
- ...(await deserializeAws_json1_1ResourceNotFoundResponse(parsedOutput, context)),
2958
- name: errorCode,
2959
- $metadata: deserializeMetadata(output),
2960
- };
2961
- break;
1932
+ throw await deserializeAws_json1_1ResourceNotFoundResponse(parsedOutput, context);
2962
1933
  default:
2963
1934
  const parsedBody = parsedOutput.body;
2964
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2965
- response = {
2966
- ...parsedBody,
2967
- name: `${errorCode}`,
2968
- message: parsedBody.message || parsedBody.Message || errorCode,
1935
+ response = new FSxServiceException_1.FSxServiceException({
1936
+ name: parsedBody.code || parsedBody.Code || errorCode,
2969
1937
  $fault: "client",
2970
1938
  $metadata: deserializeMetadata(output),
2971
- };
1939
+ });
1940
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2972
1941
  }
2973
- const message = response.message || response.Message || errorCode;
2974
- response.message = message;
2975
- delete response.Message;
2976
- return Promise.reject(Object.assign(new Error(message), response));
2977
1942
  };
2978
1943
  const deserializeAws_json1_1UpdateDataRepositoryAssociationCommand = async (output, context) => {
2979
1944
  if (output.statusCode >= 300) {
@@ -3000,59 +1965,28 @@ const deserializeAws_json1_1UpdateDataRepositoryAssociationCommandError = async
3000
1965
  switch (errorCode) {
3001
1966
  case "BadRequest":
3002
1967
  case "com.amazonaws.fsx#BadRequest":
3003
- response = {
3004
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
3005
- name: errorCode,
3006
- $metadata: deserializeMetadata(output),
3007
- };
3008
- break;
1968
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
3009
1969
  case "DataRepositoryAssociationNotFound":
3010
1970
  case "com.amazonaws.fsx#DataRepositoryAssociationNotFound":
3011
- response = {
3012
- ...(await deserializeAws_json1_1DataRepositoryAssociationNotFoundResponse(parsedOutput, context)),
3013
- name: errorCode,
3014
- $metadata: deserializeMetadata(output),
3015
- };
3016
- break;
1971
+ throw await deserializeAws_json1_1DataRepositoryAssociationNotFoundResponse(parsedOutput, context);
3017
1972
  case "IncompatibleParameterError":
3018
1973
  case "com.amazonaws.fsx#IncompatibleParameterError":
3019
- response = {
3020
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
3021
- name: errorCode,
3022
- $metadata: deserializeMetadata(output),
3023
- };
3024
- break;
1974
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
3025
1975
  case "InternalServerError":
3026
1976
  case "com.amazonaws.fsx#InternalServerError":
3027
- response = {
3028
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
3029
- name: errorCode,
3030
- $metadata: deserializeMetadata(output),
3031
- };
3032
- break;
1977
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
3033
1978
  case "ServiceLimitExceeded":
3034
1979
  case "com.amazonaws.fsx#ServiceLimitExceeded":
3035
- response = {
3036
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
3037
- name: errorCode,
3038
- $metadata: deserializeMetadata(output),
3039
- };
3040
- break;
1980
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
3041
1981
  default:
3042
1982
  const parsedBody = parsedOutput.body;
3043
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3044
- response = {
3045
- ...parsedBody,
3046
- name: `${errorCode}`,
3047
- message: parsedBody.message || parsedBody.Message || errorCode,
1983
+ response = new FSxServiceException_1.FSxServiceException({
1984
+ name: parsedBody.code || parsedBody.Code || errorCode,
3048
1985
  $fault: "client",
3049
1986
  $metadata: deserializeMetadata(output),
3050
- };
1987
+ });
1988
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3051
1989
  }
3052
- const message = response.message || response.Message || errorCode;
3053
- response.message = message;
3054
- delete response.Message;
3055
- return Promise.reject(Object.assign(new Error(message), response));
3056
1990
  };
3057
1991
  const deserializeAws_json1_1UpdateFileSystemCommand = async (output, context) => {
3058
1992
  if (output.statusCode >= 300) {
@@ -3079,75 +2013,34 @@ const deserializeAws_json1_1UpdateFileSystemCommandError = async (output, contex
3079
2013
  switch (errorCode) {
3080
2014
  case "BadRequest":
3081
2015
  case "com.amazonaws.fsx#BadRequest":
3082
- response = {
3083
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
3084
- name: errorCode,
3085
- $metadata: deserializeMetadata(output),
3086
- };
3087
- break;
2016
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
3088
2017
  case "FileSystemNotFound":
3089
2018
  case "com.amazonaws.fsx#FileSystemNotFound":
3090
- response = {
3091
- ...(await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context)),
3092
- name: errorCode,
3093
- $metadata: deserializeMetadata(output),
3094
- };
3095
- break;
2019
+ throw await deserializeAws_json1_1FileSystemNotFoundResponse(parsedOutput, context);
3096
2020
  case "IncompatibleParameterError":
3097
2021
  case "com.amazonaws.fsx#IncompatibleParameterError":
3098
- response = {
3099
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
3100
- name: errorCode,
3101
- $metadata: deserializeMetadata(output),
3102
- };
3103
- break;
2022
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
3104
2023
  case "InternalServerError":
3105
2024
  case "com.amazonaws.fsx#InternalServerError":
3106
- response = {
3107
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
3108
- name: errorCode,
3109
- $metadata: deserializeMetadata(output),
3110
- };
3111
- break;
2025
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
3112
2026
  case "MissingFileSystemConfiguration":
3113
2027
  case "com.amazonaws.fsx#MissingFileSystemConfiguration":
3114
- response = {
3115
- ...(await deserializeAws_json1_1MissingFileSystemConfigurationResponse(parsedOutput, context)),
3116
- name: errorCode,
3117
- $metadata: deserializeMetadata(output),
3118
- };
3119
- break;
2028
+ throw await deserializeAws_json1_1MissingFileSystemConfigurationResponse(parsedOutput, context);
3120
2029
  case "ServiceLimitExceeded":
3121
2030
  case "com.amazonaws.fsx#ServiceLimitExceeded":
3122
- response = {
3123
- ...(await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context)),
3124
- name: errorCode,
3125
- $metadata: deserializeMetadata(output),
3126
- };
3127
- break;
2031
+ throw await deserializeAws_json1_1ServiceLimitExceededResponse(parsedOutput, context);
3128
2032
  case "UnsupportedOperation":
3129
2033
  case "com.amazonaws.fsx#UnsupportedOperation":
3130
- response = {
3131
- ...(await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context)),
3132
- name: errorCode,
3133
- $metadata: deserializeMetadata(output),
3134
- };
3135
- break;
2034
+ throw await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context);
3136
2035
  default:
3137
2036
  const parsedBody = parsedOutput.body;
3138
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3139
- response = {
3140
- ...parsedBody,
3141
- name: `${errorCode}`,
3142
- message: parsedBody.message || parsedBody.Message || errorCode,
2037
+ response = new FSxServiceException_1.FSxServiceException({
2038
+ name: parsedBody.code || parsedBody.Code || errorCode,
3143
2039
  $fault: "client",
3144
2040
  $metadata: deserializeMetadata(output),
3145
- };
2041
+ });
2042
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3146
2043
  }
3147
- const message = response.message || response.Message || errorCode;
3148
- response.message = message;
3149
- delete response.Message;
3150
- return Promise.reject(Object.assign(new Error(message), response));
3151
2044
  };
3152
2045
  const deserializeAws_json1_1UpdateSnapshotCommand = async (output, context) => {
3153
2046
  if (output.statusCode >= 300) {
@@ -3174,43 +2067,22 @@ const deserializeAws_json1_1UpdateSnapshotCommandError = async (output, context)
3174
2067
  switch (errorCode) {
3175
2068
  case "BadRequest":
3176
2069
  case "com.amazonaws.fsx#BadRequest":
3177
- response = {
3178
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
3179
- name: errorCode,
3180
- $metadata: deserializeMetadata(output),
3181
- };
3182
- break;
2070
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
3183
2071
  case "InternalServerError":
3184
2072
  case "com.amazonaws.fsx#InternalServerError":
3185
- response = {
3186
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
3187
- name: errorCode,
3188
- $metadata: deserializeMetadata(output),
3189
- };
3190
- break;
2073
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
3191
2074
  case "SnapshotNotFound":
3192
2075
  case "com.amazonaws.fsx#SnapshotNotFound":
3193
- response = {
3194
- ...(await deserializeAws_json1_1SnapshotNotFoundResponse(parsedOutput, context)),
3195
- name: errorCode,
3196
- $metadata: deserializeMetadata(output),
3197
- };
3198
- break;
2076
+ throw await deserializeAws_json1_1SnapshotNotFoundResponse(parsedOutput, context);
3199
2077
  default:
3200
2078
  const parsedBody = parsedOutput.body;
3201
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3202
- response = {
3203
- ...parsedBody,
3204
- name: `${errorCode}`,
3205
- message: parsedBody.message || parsedBody.Message || errorCode,
2079
+ response = new FSxServiceException_1.FSxServiceException({
2080
+ name: parsedBody.code || parsedBody.Code || errorCode,
3206
2081
  $fault: "client",
3207
2082
  $metadata: deserializeMetadata(output),
3208
- };
2083
+ });
2084
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3209
2085
  }
3210
- const message = response.message || response.Message || errorCode;
3211
- response.message = message;
3212
- delete response.Message;
3213
- return Promise.reject(Object.assign(new Error(message), response));
3214
2086
  };
3215
2087
  const deserializeAws_json1_1UpdateStorageVirtualMachineCommand = async (output, context) => {
3216
2088
  if (output.statusCode >= 300) {
@@ -3237,59 +2109,28 @@ const deserializeAws_json1_1UpdateStorageVirtualMachineCommandError = async (out
3237
2109
  switch (errorCode) {
3238
2110
  case "BadRequest":
3239
2111
  case "com.amazonaws.fsx#BadRequest":
3240
- response = {
3241
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
3242
- name: errorCode,
3243
- $metadata: deserializeMetadata(output),
3244
- };
3245
- break;
2112
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
3246
2113
  case "IncompatibleParameterError":
3247
2114
  case "com.amazonaws.fsx#IncompatibleParameterError":
3248
- response = {
3249
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
3250
- name: errorCode,
3251
- $metadata: deserializeMetadata(output),
3252
- };
3253
- break;
2115
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
3254
2116
  case "InternalServerError":
3255
2117
  case "com.amazonaws.fsx#InternalServerError":
3256
- response = {
3257
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
3258
- name: errorCode,
3259
- $metadata: deserializeMetadata(output),
3260
- };
3261
- break;
2118
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
3262
2119
  case "StorageVirtualMachineNotFound":
3263
2120
  case "com.amazonaws.fsx#StorageVirtualMachineNotFound":
3264
- response = {
3265
- ...(await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context)),
3266
- name: errorCode,
3267
- $metadata: deserializeMetadata(output),
3268
- };
3269
- break;
2121
+ throw await deserializeAws_json1_1StorageVirtualMachineNotFoundResponse(parsedOutput, context);
3270
2122
  case "UnsupportedOperation":
3271
2123
  case "com.amazonaws.fsx#UnsupportedOperation":
3272
- response = {
3273
- ...(await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context)),
3274
- name: errorCode,
3275
- $metadata: deserializeMetadata(output),
3276
- };
3277
- break;
2124
+ throw await deserializeAws_json1_1UnsupportedOperationResponse(parsedOutput, context);
3278
2125
  default:
3279
2126
  const parsedBody = parsedOutput.body;
3280
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3281
- response = {
3282
- ...parsedBody,
3283
- name: `${errorCode}`,
3284
- message: parsedBody.message || parsedBody.Message || errorCode,
2127
+ response = new FSxServiceException_1.FSxServiceException({
2128
+ name: parsedBody.code || parsedBody.Code || errorCode,
3285
2129
  $fault: "client",
3286
2130
  $metadata: deserializeMetadata(output),
3287
- };
2131
+ });
2132
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3288
2133
  }
3289
- const message = response.message || response.Message || errorCode;
3290
- response.message = message;
3291
- delete response.Message;
3292
- return Promise.reject(Object.assign(new Error(message), response));
3293
2134
  };
3294
2135
  const deserializeAws_json1_1UpdateVolumeCommand = async (output, context) => {
3295
2136
  if (output.statusCode >= 300) {
@@ -3316,422 +2157,325 @@ const deserializeAws_json1_1UpdateVolumeCommandError = async (output, context) =
3316
2157
  switch (errorCode) {
3317
2158
  case "BadRequest":
3318
2159
  case "com.amazonaws.fsx#BadRequest":
3319
- response = {
3320
- ...(await deserializeAws_json1_1BadRequestResponse(parsedOutput, context)),
3321
- name: errorCode,
3322
- $metadata: deserializeMetadata(output),
3323
- };
3324
- break;
2160
+ throw await deserializeAws_json1_1BadRequestResponse(parsedOutput, context);
3325
2161
  case "IncompatibleParameterError":
3326
2162
  case "com.amazonaws.fsx#IncompatibleParameterError":
3327
- response = {
3328
- ...(await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context)),
3329
- name: errorCode,
3330
- $metadata: deserializeMetadata(output),
3331
- };
3332
- break;
2163
+ throw await deserializeAws_json1_1IncompatibleParameterErrorResponse(parsedOutput, context);
3333
2164
  case "InternalServerError":
3334
2165
  case "com.amazonaws.fsx#InternalServerError":
3335
- response = {
3336
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
3337
- name: errorCode,
3338
- $metadata: deserializeMetadata(output),
3339
- };
3340
- break;
2166
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
3341
2167
  case "MissingVolumeConfiguration":
3342
2168
  case "com.amazonaws.fsx#MissingVolumeConfiguration":
3343
- response = {
3344
- ...(await deserializeAws_json1_1MissingVolumeConfigurationResponse(parsedOutput, context)),
3345
- name: errorCode,
3346
- $metadata: deserializeMetadata(output),
3347
- };
3348
- break;
2169
+ throw await deserializeAws_json1_1MissingVolumeConfigurationResponse(parsedOutput, context);
3349
2170
  case "VolumeNotFound":
3350
2171
  case "com.amazonaws.fsx#VolumeNotFound":
3351
- response = {
3352
- ...(await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context)),
3353
- name: errorCode,
3354
- $metadata: deserializeMetadata(output),
3355
- };
3356
- break;
2172
+ throw await deserializeAws_json1_1VolumeNotFoundResponse(parsedOutput, context);
3357
2173
  default:
3358
2174
  const parsedBody = parsedOutput.body;
3359
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3360
- response = {
3361
- ...parsedBody,
3362
- name: `${errorCode}`,
3363
- message: parsedBody.message || parsedBody.Message || errorCode,
2175
+ response = new FSxServiceException_1.FSxServiceException({
2176
+ name: parsedBody.code || parsedBody.Code || errorCode,
3364
2177
  $fault: "client",
3365
2178
  $metadata: deserializeMetadata(output),
3366
- };
2179
+ });
2180
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3367
2181
  }
3368
- const message = response.message || response.Message || errorCode;
3369
- response.message = message;
3370
- delete response.Message;
3371
- return Promise.reject(Object.assign(new Error(message), response));
3372
2182
  };
3373
2183
  const deserializeAws_json1_1ActiveDirectoryErrorResponse = async (parsedOutput, context) => {
3374
2184
  const body = parsedOutput.body;
3375
2185
  const deserialized = deserializeAws_json1_1ActiveDirectoryError(body, context);
3376
- const contents = {
3377
- name: "ActiveDirectoryError",
3378
- $fault: "client",
2186
+ const exception = new models_0_1.ActiveDirectoryError({
3379
2187
  $metadata: deserializeMetadata(parsedOutput),
3380
2188
  ...deserialized,
3381
- };
3382
- return contents;
2189
+ });
2190
+ return smithy_client_1.decorateServiceException(exception, body);
3383
2191
  };
3384
2192
  const deserializeAws_json1_1BackupBeingCopiedResponse = async (parsedOutput, context) => {
3385
2193
  const body = parsedOutput.body;
3386
2194
  const deserialized = deserializeAws_json1_1BackupBeingCopied(body, context);
3387
- const contents = {
3388
- name: "BackupBeingCopied",
3389
- $fault: "client",
2195
+ const exception = new models_0_1.BackupBeingCopied({
3390
2196
  $metadata: deserializeMetadata(parsedOutput),
3391
2197
  ...deserialized,
3392
- };
3393
- return contents;
2198
+ });
2199
+ return smithy_client_1.decorateServiceException(exception, body);
3394
2200
  };
3395
2201
  const deserializeAws_json1_1BackupInProgressResponse = async (parsedOutput, context) => {
3396
2202
  const body = parsedOutput.body;
3397
2203
  const deserialized = deserializeAws_json1_1BackupInProgress(body, context);
3398
- const contents = {
3399
- name: "BackupInProgress",
3400
- $fault: "client",
2204
+ const exception = new models_0_1.BackupInProgress({
3401
2205
  $metadata: deserializeMetadata(parsedOutput),
3402
2206
  ...deserialized,
3403
- };
3404
- return contents;
2207
+ });
2208
+ return smithy_client_1.decorateServiceException(exception, body);
3405
2209
  };
3406
2210
  const deserializeAws_json1_1BackupNotFoundResponse = async (parsedOutput, context) => {
3407
2211
  const body = parsedOutput.body;
3408
2212
  const deserialized = deserializeAws_json1_1BackupNotFound(body, context);
3409
- const contents = {
3410
- name: "BackupNotFound",
3411
- $fault: "client",
2213
+ const exception = new models_0_1.BackupNotFound({
3412
2214
  $metadata: deserializeMetadata(parsedOutput),
3413
2215
  ...deserialized,
3414
- };
3415
- return contents;
2216
+ });
2217
+ return smithy_client_1.decorateServiceException(exception, body);
3416
2218
  };
3417
2219
  const deserializeAws_json1_1BackupRestoringResponse = async (parsedOutput, context) => {
3418
2220
  const body = parsedOutput.body;
3419
2221
  const deserialized = deserializeAws_json1_1BackupRestoring(body, context);
3420
- const contents = {
3421
- name: "BackupRestoring",
3422
- $fault: "client",
2222
+ const exception = new models_0_1.BackupRestoring({
3423
2223
  $metadata: deserializeMetadata(parsedOutput),
3424
2224
  ...deserialized,
3425
- };
3426
- return contents;
2225
+ });
2226
+ return smithy_client_1.decorateServiceException(exception, body);
3427
2227
  };
3428
2228
  const deserializeAws_json1_1BadRequestResponse = async (parsedOutput, context) => {
3429
2229
  const body = parsedOutput.body;
3430
2230
  const deserialized = deserializeAws_json1_1BadRequest(body, context);
3431
- const contents = {
3432
- name: "BadRequest",
3433
- $fault: "client",
2231
+ const exception = new models_0_1.BadRequest({
3434
2232
  $metadata: deserializeMetadata(parsedOutput),
3435
2233
  ...deserialized,
3436
- };
3437
- return contents;
2234
+ });
2235
+ return smithy_client_1.decorateServiceException(exception, body);
3438
2236
  };
3439
2237
  const deserializeAws_json1_1DataRepositoryAssociationNotFoundResponse = async (parsedOutput, context) => {
3440
2238
  const body = parsedOutput.body;
3441
2239
  const deserialized = deserializeAws_json1_1DataRepositoryAssociationNotFound(body, context);
3442
- const contents = {
3443
- name: "DataRepositoryAssociationNotFound",
3444
- $fault: "client",
2240
+ const exception = new models_0_1.DataRepositoryAssociationNotFound({
3445
2241
  $metadata: deserializeMetadata(parsedOutput),
3446
2242
  ...deserialized,
3447
- };
3448
- return contents;
2243
+ });
2244
+ return smithy_client_1.decorateServiceException(exception, body);
3449
2245
  };
3450
2246
  const deserializeAws_json1_1DataRepositoryTaskEndedResponse = async (parsedOutput, context) => {
3451
2247
  const body = parsedOutput.body;
3452
2248
  const deserialized = deserializeAws_json1_1DataRepositoryTaskEnded(body, context);
3453
- const contents = {
3454
- name: "DataRepositoryTaskEnded",
3455
- $fault: "client",
2249
+ const exception = new models_0_1.DataRepositoryTaskEnded({
3456
2250
  $metadata: deserializeMetadata(parsedOutput),
3457
2251
  ...deserialized,
3458
- };
3459
- return contents;
2252
+ });
2253
+ return smithy_client_1.decorateServiceException(exception, body);
3460
2254
  };
3461
2255
  const deserializeAws_json1_1DataRepositoryTaskExecutingResponse = async (parsedOutput, context) => {
3462
2256
  const body = parsedOutput.body;
3463
2257
  const deserialized = deserializeAws_json1_1DataRepositoryTaskExecuting(body, context);
3464
- const contents = {
3465
- name: "DataRepositoryTaskExecuting",
3466
- $fault: "client",
2258
+ const exception = new models_0_1.DataRepositoryTaskExecuting({
3467
2259
  $metadata: deserializeMetadata(parsedOutput),
3468
2260
  ...deserialized,
3469
- };
3470
- return contents;
2261
+ });
2262
+ return smithy_client_1.decorateServiceException(exception, body);
3471
2263
  };
3472
2264
  const deserializeAws_json1_1DataRepositoryTaskNotFoundResponse = async (parsedOutput, context) => {
3473
2265
  const body = parsedOutput.body;
3474
2266
  const deserialized = deserializeAws_json1_1DataRepositoryTaskNotFound(body, context);
3475
- const contents = {
3476
- name: "DataRepositoryTaskNotFound",
3477
- $fault: "client",
2267
+ const exception = new models_0_1.DataRepositoryTaskNotFound({
3478
2268
  $metadata: deserializeMetadata(parsedOutput),
3479
2269
  ...deserialized,
3480
- };
3481
- return contents;
2270
+ });
2271
+ return smithy_client_1.decorateServiceException(exception, body);
3482
2272
  };
3483
2273
  const deserializeAws_json1_1FileSystemNotFoundResponse = async (parsedOutput, context) => {
3484
2274
  const body = parsedOutput.body;
3485
2275
  const deserialized = deserializeAws_json1_1FileSystemNotFound(body, context);
3486
- const contents = {
3487
- name: "FileSystemNotFound",
3488
- $fault: "client",
2276
+ const exception = new models_0_1.FileSystemNotFound({
3489
2277
  $metadata: deserializeMetadata(parsedOutput),
3490
2278
  ...deserialized,
3491
- };
3492
- return contents;
2279
+ });
2280
+ return smithy_client_1.decorateServiceException(exception, body);
3493
2281
  };
3494
2282
  const deserializeAws_json1_1IncompatibleParameterErrorResponse = async (parsedOutput, context) => {
3495
2283
  const body = parsedOutput.body;
3496
2284
  const deserialized = deserializeAws_json1_1IncompatibleParameterError(body, context);
3497
- const contents = {
3498
- name: "IncompatibleParameterError",
3499
- $fault: "client",
2285
+ const exception = new models_0_1.IncompatibleParameterError({
3500
2286
  $metadata: deserializeMetadata(parsedOutput),
3501
2287
  ...deserialized,
3502
- };
3503
- return contents;
2288
+ });
2289
+ return smithy_client_1.decorateServiceException(exception, body);
3504
2290
  };
3505
2291
  const deserializeAws_json1_1IncompatibleRegionForMultiAZResponse = async (parsedOutput, context) => {
3506
2292
  const body = parsedOutput.body;
3507
2293
  const deserialized = deserializeAws_json1_1IncompatibleRegionForMultiAZ(body, context);
3508
- const contents = {
3509
- name: "IncompatibleRegionForMultiAZ",
3510
- $fault: "client",
2294
+ const exception = new models_0_1.IncompatibleRegionForMultiAZ({
3511
2295
  $metadata: deserializeMetadata(parsedOutput),
3512
2296
  ...deserialized,
3513
- };
3514
- return contents;
2297
+ });
2298
+ return smithy_client_1.decorateServiceException(exception, body);
3515
2299
  };
3516
2300
  const deserializeAws_json1_1InternalServerErrorResponse = async (parsedOutput, context) => {
3517
2301
  const body = parsedOutput.body;
3518
2302
  const deserialized = deserializeAws_json1_1InternalServerError(body, context);
3519
- const contents = {
3520
- name: "InternalServerError",
3521
- $fault: "server",
2303
+ const exception = new models_0_1.InternalServerError({
3522
2304
  $metadata: deserializeMetadata(parsedOutput),
3523
2305
  ...deserialized,
3524
- };
3525
- return contents;
2306
+ });
2307
+ return smithy_client_1.decorateServiceException(exception, body);
3526
2308
  };
3527
2309
  const deserializeAws_json1_1InvalidDataRepositoryTypeResponse = async (parsedOutput, context) => {
3528
2310
  const body = parsedOutput.body;
3529
2311
  const deserialized = deserializeAws_json1_1InvalidDataRepositoryType(body, context);
3530
- const contents = {
3531
- name: "InvalidDataRepositoryType",
3532
- $fault: "client",
2312
+ const exception = new models_0_1.InvalidDataRepositoryType({
3533
2313
  $metadata: deserializeMetadata(parsedOutput),
3534
2314
  ...deserialized,
3535
- };
3536
- return contents;
2315
+ });
2316
+ return smithy_client_1.decorateServiceException(exception, body);
3537
2317
  };
3538
2318
  const deserializeAws_json1_1InvalidDestinationKmsKeyResponse = async (parsedOutput, context) => {
3539
2319
  const body = parsedOutput.body;
3540
2320
  const deserialized = deserializeAws_json1_1InvalidDestinationKmsKey(body, context);
3541
- const contents = {
3542
- name: "InvalidDestinationKmsKey",
3543
- $fault: "client",
2321
+ const exception = new models_0_1.InvalidDestinationKmsKey({
3544
2322
  $metadata: deserializeMetadata(parsedOutput),
3545
2323
  ...deserialized,
3546
- };
3547
- return contents;
2324
+ });
2325
+ return smithy_client_1.decorateServiceException(exception, body);
3548
2326
  };
3549
2327
  const deserializeAws_json1_1InvalidExportPathResponse = async (parsedOutput, context) => {
3550
2328
  const body = parsedOutput.body;
3551
2329
  const deserialized = deserializeAws_json1_1InvalidExportPath(body, context);
3552
- const contents = {
3553
- name: "InvalidExportPath",
3554
- $fault: "client",
2330
+ const exception = new models_0_1.InvalidExportPath({
3555
2331
  $metadata: deserializeMetadata(parsedOutput),
3556
2332
  ...deserialized,
3557
- };
3558
- return contents;
2333
+ });
2334
+ return smithy_client_1.decorateServiceException(exception, body);
3559
2335
  };
3560
2336
  const deserializeAws_json1_1InvalidImportPathResponse = async (parsedOutput, context) => {
3561
2337
  const body = parsedOutput.body;
3562
2338
  const deserialized = deserializeAws_json1_1InvalidImportPath(body, context);
3563
- const contents = {
3564
- name: "InvalidImportPath",
3565
- $fault: "client",
2339
+ const exception = new models_0_1.InvalidImportPath({
3566
2340
  $metadata: deserializeMetadata(parsedOutput),
3567
2341
  ...deserialized,
3568
- };
3569
- return contents;
2342
+ });
2343
+ return smithy_client_1.decorateServiceException(exception, body);
3570
2344
  };
3571
2345
  const deserializeAws_json1_1InvalidNetworkSettingsResponse = async (parsedOutput, context) => {
3572
2346
  const body = parsedOutput.body;
3573
2347
  const deserialized = deserializeAws_json1_1InvalidNetworkSettings(body, context);
3574
- const contents = {
3575
- name: "InvalidNetworkSettings",
3576
- $fault: "client",
2348
+ const exception = new models_0_1.InvalidNetworkSettings({
3577
2349
  $metadata: deserializeMetadata(parsedOutput),
3578
2350
  ...deserialized,
3579
- };
3580
- return contents;
2351
+ });
2352
+ return smithy_client_1.decorateServiceException(exception, body);
3581
2353
  };
3582
2354
  const deserializeAws_json1_1InvalidPerUnitStorageThroughputResponse = async (parsedOutput, context) => {
3583
2355
  const body = parsedOutput.body;
3584
2356
  const deserialized = deserializeAws_json1_1InvalidPerUnitStorageThroughput(body, context);
3585
- const contents = {
3586
- name: "InvalidPerUnitStorageThroughput",
3587
- $fault: "client",
2357
+ const exception = new models_0_1.InvalidPerUnitStorageThroughput({
3588
2358
  $metadata: deserializeMetadata(parsedOutput),
3589
2359
  ...deserialized,
3590
- };
3591
- return contents;
2360
+ });
2361
+ return smithy_client_1.decorateServiceException(exception, body);
3592
2362
  };
3593
2363
  const deserializeAws_json1_1InvalidRegionResponse = async (parsedOutput, context) => {
3594
2364
  const body = parsedOutput.body;
3595
2365
  const deserialized = deserializeAws_json1_1InvalidRegion(body, context);
3596
- const contents = {
3597
- name: "InvalidRegion",
3598
- $fault: "client",
2366
+ const exception = new models_0_1.InvalidRegion({
3599
2367
  $metadata: deserializeMetadata(parsedOutput),
3600
2368
  ...deserialized,
3601
- };
3602
- return contents;
2369
+ });
2370
+ return smithy_client_1.decorateServiceException(exception, body);
3603
2371
  };
3604
2372
  const deserializeAws_json1_1InvalidSourceKmsKeyResponse = async (parsedOutput, context) => {
3605
2373
  const body = parsedOutput.body;
3606
2374
  const deserialized = deserializeAws_json1_1InvalidSourceKmsKey(body, context);
3607
- const contents = {
3608
- name: "InvalidSourceKmsKey",
3609
- $fault: "client",
2375
+ const exception = new models_0_1.InvalidSourceKmsKey({
3610
2376
  $metadata: deserializeMetadata(parsedOutput),
3611
2377
  ...deserialized,
3612
- };
3613
- return contents;
2378
+ });
2379
+ return smithy_client_1.decorateServiceException(exception, body);
3614
2380
  };
3615
2381
  const deserializeAws_json1_1MissingFileSystemConfigurationResponse = async (parsedOutput, context) => {
3616
2382
  const body = parsedOutput.body;
3617
2383
  const deserialized = deserializeAws_json1_1MissingFileSystemConfiguration(body, context);
3618
- const contents = {
3619
- name: "MissingFileSystemConfiguration",
3620
- $fault: "client",
2384
+ const exception = new models_0_1.MissingFileSystemConfiguration({
3621
2385
  $metadata: deserializeMetadata(parsedOutput),
3622
2386
  ...deserialized,
3623
- };
3624
- return contents;
2387
+ });
2388
+ return smithy_client_1.decorateServiceException(exception, body);
3625
2389
  };
3626
2390
  const deserializeAws_json1_1MissingVolumeConfigurationResponse = async (parsedOutput, context) => {
3627
2391
  const body = parsedOutput.body;
3628
2392
  const deserialized = deserializeAws_json1_1MissingVolumeConfiguration(body, context);
3629
- const contents = {
3630
- name: "MissingVolumeConfiguration",
3631
- $fault: "client",
2393
+ const exception = new models_0_1.MissingVolumeConfiguration({
3632
2394
  $metadata: deserializeMetadata(parsedOutput),
3633
2395
  ...deserialized,
3634
- };
3635
- return contents;
2396
+ });
2397
+ return smithy_client_1.decorateServiceException(exception, body);
3636
2398
  };
3637
2399
  const deserializeAws_json1_1NotServiceResourceErrorResponse = async (parsedOutput, context) => {
3638
2400
  const body = parsedOutput.body;
3639
2401
  const deserialized = deserializeAws_json1_1NotServiceResourceError(body, context);
3640
- const contents = {
3641
- name: "NotServiceResourceError",
3642
- $fault: "client",
2402
+ const exception = new models_0_1.NotServiceResourceError({
3643
2403
  $metadata: deserializeMetadata(parsedOutput),
3644
2404
  ...deserialized,
3645
- };
3646
- return contents;
2405
+ });
2406
+ return smithy_client_1.decorateServiceException(exception, body);
3647
2407
  };
3648
2408
  const deserializeAws_json1_1ResourceDoesNotSupportTaggingResponse = async (parsedOutput, context) => {
3649
2409
  const body = parsedOutput.body;
3650
2410
  const deserialized = deserializeAws_json1_1ResourceDoesNotSupportTagging(body, context);
3651
- const contents = {
3652
- name: "ResourceDoesNotSupportTagging",
3653
- $fault: "client",
2411
+ const exception = new models_0_1.ResourceDoesNotSupportTagging({
3654
2412
  $metadata: deserializeMetadata(parsedOutput),
3655
2413
  ...deserialized,
3656
- };
3657
- return contents;
2414
+ });
2415
+ return smithy_client_1.decorateServiceException(exception, body);
3658
2416
  };
3659
2417
  const deserializeAws_json1_1ResourceNotFoundResponse = async (parsedOutput, context) => {
3660
2418
  const body = parsedOutput.body;
3661
2419
  const deserialized = deserializeAws_json1_1ResourceNotFound(body, context);
3662
- const contents = {
3663
- name: "ResourceNotFound",
3664
- $fault: "client",
2420
+ const exception = new models_0_1.ResourceNotFound({
3665
2421
  $metadata: deserializeMetadata(parsedOutput),
3666
2422
  ...deserialized,
3667
- };
3668
- return contents;
2423
+ });
2424
+ return smithy_client_1.decorateServiceException(exception, body);
3669
2425
  };
3670
2426
  const deserializeAws_json1_1ServiceLimitExceededResponse = async (parsedOutput, context) => {
3671
2427
  const body = parsedOutput.body;
3672
2428
  const deserialized = deserializeAws_json1_1ServiceLimitExceeded(body, context);
3673
- const contents = {
3674
- name: "ServiceLimitExceeded",
3675
- $fault: "client",
2429
+ const exception = new models_0_1.ServiceLimitExceeded({
3676
2430
  $metadata: deserializeMetadata(parsedOutput),
3677
2431
  ...deserialized,
3678
- };
3679
- return contents;
2432
+ });
2433
+ return smithy_client_1.decorateServiceException(exception, body);
3680
2434
  };
3681
2435
  const deserializeAws_json1_1SnapshotNotFoundResponse = async (parsedOutput, context) => {
3682
2436
  const body = parsedOutput.body;
3683
2437
  const deserialized = deserializeAws_json1_1SnapshotNotFound(body, context);
3684
- const contents = {
3685
- name: "SnapshotNotFound",
3686
- $fault: "client",
2438
+ const exception = new models_0_1.SnapshotNotFound({
3687
2439
  $metadata: deserializeMetadata(parsedOutput),
3688
2440
  ...deserialized,
3689
- };
3690
- return contents;
2441
+ });
2442
+ return smithy_client_1.decorateServiceException(exception, body);
3691
2443
  };
3692
2444
  const deserializeAws_json1_1SourceBackupUnavailableResponse = async (parsedOutput, context) => {
3693
2445
  const body = parsedOutput.body;
3694
2446
  const deserialized = deserializeAws_json1_1SourceBackupUnavailable(body, context);
3695
- const contents = {
3696
- name: "SourceBackupUnavailable",
3697
- $fault: "client",
2447
+ const exception = new models_0_1.SourceBackupUnavailable({
3698
2448
  $metadata: deserializeMetadata(parsedOutput),
3699
2449
  ...deserialized,
3700
- };
3701
- return contents;
2450
+ });
2451
+ return smithy_client_1.decorateServiceException(exception, body);
3702
2452
  };
3703
2453
  const deserializeAws_json1_1StorageVirtualMachineNotFoundResponse = async (parsedOutput, context) => {
3704
2454
  const body = parsedOutput.body;
3705
2455
  const deserialized = deserializeAws_json1_1StorageVirtualMachineNotFound(body, context);
3706
- const contents = {
3707
- name: "StorageVirtualMachineNotFound",
3708
- $fault: "client",
2456
+ const exception = new models_0_1.StorageVirtualMachineNotFound({
3709
2457
  $metadata: deserializeMetadata(parsedOutput),
3710
2458
  ...deserialized,
3711
- };
3712
- return contents;
2459
+ });
2460
+ return smithy_client_1.decorateServiceException(exception, body);
3713
2461
  };
3714
2462
  const deserializeAws_json1_1UnsupportedOperationResponse = async (parsedOutput, context) => {
3715
2463
  const body = parsedOutput.body;
3716
2464
  const deserialized = deserializeAws_json1_1UnsupportedOperation(body, context);
3717
- const contents = {
3718
- name: "UnsupportedOperation",
3719
- $fault: "client",
2465
+ const exception = new models_0_1.UnsupportedOperation({
3720
2466
  $metadata: deserializeMetadata(parsedOutput),
3721
2467
  ...deserialized,
3722
- };
3723
- return contents;
2468
+ });
2469
+ return smithy_client_1.decorateServiceException(exception, body);
3724
2470
  };
3725
2471
  const deserializeAws_json1_1VolumeNotFoundResponse = async (parsedOutput, context) => {
3726
2472
  const body = parsedOutput.body;
3727
2473
  const deserialized = deserializeAws_json1_1VolumeNotFound(body, context);
3728
- const contents = {
3729
- name: "VolumeNotFound",
3730
- $fault: "client",
2474
+ const exception = new models_0_1.VolumeNotFound({
3731
2475
  $metadata: deserializeMetadata(parsedOutput),
3732
2476
  ...deserialized,
3733
- };
3734
- return contents;
2477
+ });
2478
+ return smithy_client_1.decorateServiceException(exception, body);
3735
2479
  };
3736
2480
  const serializeAws_json1_1AlternateDNSNames = (input, context) => {
3737
2481
  return input
@@ -5077,7 +3821,7 @@ const deserializeAws_json1_1AdministrativeActionFailureDetails = (output, contex
5077
3821
  };
5078
3822
  };
5079
3823
  const deserializeAws_json1_1AdministrativeActions = (output, context) => {
5080
- return (output || [])
3824
+ const retVal = (output || [])
5081
3825
  .filter((e) => e != null)
5082
3826
  .map((entry) => {
5083
3827
  if (entry === null) {
@@ -5085,6 +3829,7 @@ const deserializeAws_json1_1AdministrativeActions = (output, context) => {
5085
3829
  }
5086
3830
  return deserializeAws_json1_1AdministrativeAction(entry, context);
5087
3831
  });
3832
+ return retVal;
5088
3833
  };
5089
3834
  const deserializeAws_json1_1Alias = (output, context) => {
5090
3835
  return {
@@ -5093,7 +3838,7 @@ const deserializeAws_json1_1Alias = (output, context) => {
5093
3838
  };
5094
3839
  };
5095
3840
  const deserializeAws_json1_1Aliases = (output, context) => {
5096
- return (output || [])
3841
+ const retVal = (output || [])
5097
3842
  .filter((e) => e != null)
5098
3843
  .map((entry) => {
5099
3844
  if (entry === null) {
@@ -5101,6 +3846,7 @@ const deserializeAws_json1_1Aliases = (output, context) => {
5101
3846
  }
5102
3847
  return deserializeAws_json1_1Alias(entry, context);
5103
3848
  });
3849
+ return retVal;
5104
3850
  };
5105
3851
  const deserializeAws_json1_1AssociateFileSystemAliasesResponse = (output, context) => {
5106
3852
  return {
@@ -5181,7 +3927,7 @@ const deserializeAws_json1_1BackupRestoring = (output, context) => {
5181
3927
  };
5182
3928
  };
5183
3929
  const deserializeAws_json1_1Backups = (output, context) => {
5184
- return (output || [])
3930
+ const retVal = (output || [])
5185
3931
  .filter((e) => e != null)
5186
3932
  .map((entry) => {
5187
3933
  if (entry === null) {
@@ -5189,6 +3935,7 @@ const deserializeAws_json1_1Backups = (output, context) => {
5189
3935
  }
5190
3936
  return deserializeAws_json1_1Backup(entry, context);
5191
3937
  });
3938
+ return retVal;
5192
3939
  };
5193
3940
  const deserializeAws_json1_1BadRequest = (output, context) => {
5194
3941
  return {
@@ -5307,7 +4054,7 @@ const deserializeAws_json1_1DataRepositoryAssociationNotFound = (output, context
5307
4054
  };
5308
4055
  };
5309
4056
  const deserializeAws_json1_1DataRepositoryAssociations = (output, context) => {
5310
- return (output || [])
4057
+ const retVal = (output || [])
5311
4058
  .filter((e) => e != null)
5312
4059
  .map((entry) => {
5313
4060
  if (entry === null) {
@@ -5315,6 +4062,7 @@ const deserializeAws_json1_1DataRepositoryAssociations = (output, context) => {
5315
4062
  }
5316
4063
  return deserializeAws_json1_1DataRepositoryAssociation(entry, context);
5317
4064
  });
4065
+ return retVal;
5318
4066
  };
5319
4067
  const deserializeAws_json1_1DataRepositoryConfiguration = (output, context) => {
5320
4068
  return {
@@ -5385,7 +4133,7 @@ const deserializeAws_json1_1DataRepositoryTaskNotFound = (output, context) => {
5385
4133
  };
5386
4134
  };
5387
4135
  const deserializeAws_json1_1DataRepositoryTaskPaths = (output, context) => {
5388
- return (output || [])
4136
+ const retVal = (output || [])
5389
4137
  .filter((e) => e != null)
5390
4138
  .map((entry) => {
5391
4139
  if (entry === null) {
@@ -5393,9 +4141,10 @@ const deserializeAws_json1_1DataRepositoryTaskPaths = (output, context) => {
5393
4141
  }
5394
4142
  return smithy_client_1.expectString(entry);
5395
4143
  });
4144
+ return retVal;
5396
4145
  };
5397
4146
  const deserializeAws_json1_1DataRepositoryTasks = (output, context) => {
5398
- return (output || [])
4147
+ const retVal = (output || [])
5399
4148
  .filter((e) => e != null)
5400
4149
  .map((entry) => {
5401
4150
  if (entry === null) {
@@ -5403,6 +4152,7 @@ const deserializeAws_json1_1DataRepositoryTasks = (output, context) => {
5403
4152
  }
5404
4153
  return deserializeAws_json1_1DataRepositoryTask(entry, context);
5405
4154
  });
4155
+ return retVal;
5406
4156
  };
5407
4157
  const deserializeAws_json1_1DataRepositoryTaskStatus = (output, context) => {
5408
4158
  return {
@@ -5573,7 +4323,7 @@ const deserializeAws_json1_1DiskIopsConfiguration = (output, context) => {
5573
4323
  };
5574
4324
  };
5575
4325
  const deserializeAws_json1_1DnsIps = (output, context) => {
5576
- return (output || [])
4326
+ const retVal = (output || [])
5577
4327
  .filter((e) => e != null)
5578
4328
  .map((entry) => {
5579
4329
  if (entry === null) {
@@ -5581,9 +4331,10 @@ const deserializeAws_json1_1DnsIps = (output, context) => {
5581
4331
  }
5582
4332
  return smithy_client_1.expectString(entry);
5583
4333
  });
4334
+ return retVal;
5584
4335
  };
5585
4336
  const deserializeAws_json1_1EventTypes = (output, context) => {
5586
- return (output || [])
4337
+ const retVal = (output || [])
5587
4338
  .filter((e) => e != null)
5588
4339
  .map((entry) => {
5589
4340
  if (entry === null) {
@@ -5591,6 +4342,7 @@ const deserializeAws_json1_1EventTypes = (output, context) => {
5591
4342
  }
5592
4343
  return smithy_client_1.expectString(entry);
5593
4344
  });
4345
+ return retVal;
5594
4346
  };
5595
4347
  const deserializeAws_json1_1FileSystem = (output, context) => {
5596
4348
  return {
@@ -5659,7 +4411,7 @@ const deserializeAws_json1_1FileSystemFailureDetails = (output, context) => {
5659
4411
  };
5660
4412
  };
5661
4413
  const deserializeAws_json1_1FileSystemMaintenanceOperations = (output, context) => {
5662
- return (output || [])
4414
+ const retVal = (output || [])
5663
4415
  .filter((e) => e != null)
5664
4416
  .map((entry) => {
5665
4417
  if (entry === null) {
@@ -5667,6 +4419,7 @@ const deserializeAws_json1_1FileSystemMaintenanceOperations = (output, context)
5667
4419
  }
5668
4420
  return smithy_client_1.expectString(entry);
5669
4421
  });
4422
+ return retVal;
5670
4423
  };
5671
4424
  const deserializeAws_json1_1FileSystemNotFound = (output, context) => {
5672
4425
  return {
@@ -5674,7 +4427,7 @@ const deserializeAws_json1_1FileSystemNotFound = (output, context) => {
5674
4427
  };
5675
4428
  };
5676
4429
  const deserializeAws_json1_1FileSystems = (output, context) => {
5677
- return (output || [])
4430
+ const retVal = (output || [])
5678
4431
  .filter((e) => e != null)
5679
4432
  .map((entry) => {
5680
4433
  if (entry === null) {
@@ -5682,6 +4435,7 @@ const deserializeAws_json1_1FileSystems = (output, context) => {
5682
4435
  }
5683
4436
  return deserializeAws_json1_1FileSystem(entry, context);
5684
4437
  });
4438
+ return retVal;
5685
4439
  };
5686
4440
  const deserializeAws_json1_1IncompatibleParameterError = (output, context) => {
5687
4441
  return {
@@ -5789,7 +4543,7 @@ const deserializeAws_json1_1MissingVolumeConfiguration = (output, context) => {
5789
4543
  };
5790
4544
  };
5791
4545
  const deserializeAws_json1_1NetworkInterfaceIds = (output, context) => {
5792
- return (output || [])
4546
+ const retVal = (output || [])
5793
4547
  .filter((e) => e != null)
5794
4548
  .map((entry) => {
5795
4549
  if (entry === null) {
@@ -5797,6 +4551,7 @@ const deserializeAws_json1_1NetworkInterfaceIds = (output, context) => {
5797
4551
  }
5798
4552
  return smithy_client_1.expectString(entry);
5799
4553
  });
4554
+ return retVal;
5800
4555
  };
5801
4556
  const deserializeAws_json1_1NotServiceResourceError = (output, context) => {
5802
4557
  return {
@@ -5805,7 +4560,7 @@ const deserializeAws_json1_1NotServiceResourceError = (output, context) => {
5805
4560
  };
5806
4561
  };
5807
4562
  const deserializeAws_json1_1OntapEndpointIpAddresses = (output, context) => {
5808
- return (output || [])
4563
+ const retVal = (output || [])
5809
4564
  .filter((e) => e != null)
5810
4565
  .map((entry) => {
5811
4566
  if (entry === null) {
@@ -5813,6 +4568,7 @@ const deserializeAws_json1_1OntapEndpointIpAddresses = (output, context) => {
5813
4568
  }
5814
4569
  return smithy_client_1.expectString(entry);
5815
4570
  });
4571
+ return retVal;
5816
4572
  };
5817
4573
  const deserializeAws_json1_1OntapFileSystemConfiguration = (output, context) => {
5818
4574
  return {
@@ -5859,7 +4615,7 @@ const deserializeAws_json1_1OpenZFSClientConfiguration = (output, context) => {
5859
4615
  };
5860
4616
  };
5861
4617
  const deserializeAws_json1_1OpenZFSClientConfigurations = (output, context) => {
5862
- return (output || [])
4618
+ const retVal = (output || [])
5863
4619
  .filter((e) => e != null)
5864
4620
  .map((entry) => {
5865
4621
  if (entry === null) {
@@ -5867,6 +4623,7 @@ const deserializeAws_json1_1OpenZFSClientConfigurations = (output, context) => {
5867
4623
  }
5868
4624
  return deserializeAws_json1_1OpenZFSClientConfiguration(entry, context);
5869
4625
  });
4626
+ return retVal;
5870
4627
  };
5871
4628
  const deserializeAws_json1_1OpenZFSFileSystemConfiguration = (output, context) => {
5872
4629
  return {
@@ -5891,7 +4648,7 @@ const deserializeAws_json1_1OpenZFSNfsExport = (output, context) => {
5891
4648
  };
5892
4649
  };
5893
4650
  const deserializeAws_json1_1OpenZFSNfsExportOptions = (output, context) => {
5894
- return (output || [])
4651
+ const retVal = (output || [])
5895
4652
  .filter((e) => e != null)
5896
4653
  .map((entry) => {
5897
4654
  if (entry === null) {
@@ -5899,9 +4656,10 @@ const deserializeAws_json1_1OpenZFSNfsExportOptions = (output, context) => {
5899
4656
  }
5900
4657
  return smithy_client_1.expectString(entry);
5901
4658
  });
4659
+ return retVal;
5902
4660
  };
5903
4661
  const deserializeAws_json1_1OpenZFSNfsExports = (output, context) => {
5904
- return (output || [])
4662
+ const retVal = (output || [])
5905
4663
  .filter((e) => e != null)
5906
4664
  .map((entry) => {
5907
4665
  if (entry === null) {
@@ -5909,6 +4667,7 @@ const deserializeAws_json1_1OpenZFSNfsExports = (output, context) => {
5909
4667
  }
5910
4668
  return deserializeAws_json1_1OpenZFSNfsExport(entry, context);
5911
4669
  });
4670
+ return retVal;
5912
4671
  };
5913
4672
  const deserializeAws_json1_1OpenZFSOriginSnapshotConfiguration = (output, context) => {
5914
4673
  return {
@@ -5917,7 +4676,7 @@ const deserializeAws_json1_1OpenZFSOriginSnapshotConfiguration = (output, contex
5917
4676
  };
5918
4677
  };
5919
4678
  const deserializeAws_json1_1OpenZFSUserAndGroupQuotas = (output, context) => {
5920
- return (output || [])
4679
+ const retVal = (output || [])
5921
4680
  .filter((e) => e != null)
5922
4681
  .map((entry) => {
5923
4682
  if (entry === null) {
@@ -5925,6 +4684,7 @@ const deserializeAws_json1_1OpenZFSUserAndGroupQuotas = (output, context) => {
5925
4684
  }
5926
4685
  return deserializeAws_json1_1OpenZFSUserOrGroupQuota(entry, context);
5927
4686
  });
4687
+ return retVal;
5928
4688
  };
5929
4689
  const deserializeAws_json1_1OpenZFSUserOrGroupQuota = (output, context) => {
5930
4690
  return {
@@ -5979,7 +4739,7 @@ const deserializeAws_json1_1RestoreVolumeFromSnapshotResponse = (output, context
5979
4739
  };
5980
4740
  };
5981
4741
  const deserializeAws_json1_1RouteTableIds = (output, context) => {
5982
- return (output || [])
4742
+ const retVal = (output || [])
5983
4743
  .filter((e) => e != null)
5984
4744
  .map((entry) => {
5985
4745
  if (entry === null) {
@@ -5987,6 +4747,7 @@ const deserializeAws_json1_1RouteTableIds = (output, context) => {
5987
4747
  }
5988
4748
  return smithy_client_1.expectString(entry);
5989
4749
  });
4750
+ return retVal;
5990
4751
  };
5991
4752
  const deserializeAws_json1_1S3DataRepositoryConfiguration = (output, context) => {
5992
4753
  return {
@@ -6037,7 +4798,7 @@ const deserializeAws_json1_1SnapshotNotFound = (output, context) => {
6037
4798
  };
6038
4799
  };
6039
4800
  const deserializeAws_json1_1Snapshots = (output, context) => {
6040
- return (output || [])
4801
+ const retVal = (output || [])
6041
4802
  .filter((e) => e != null)
6042
4803
  .map((entry) => {
6043
4804
  if (entry === null) {
@@ -6045,6 +4806,7 @@ const deserializeAws_json1_1Snapshots = (output, context) => {
6045
4806
  }
6046
4807
  return deserializeAws_json1_1Snapshot(entry, context);
6047
4808
  });
4809
+ return retVal;
6048
4810
  };
6049
4811
  const deserializeAws_json1_1SourceBackupUnavailable = (output, context) => {
6050
4812
  return {
@@ -6083,7 +4845,7 @@ const deserializeAws_json1_1StorageVirtualMachineNotFound = (output, context) =>
6083
4845
  };
6084
4846
  };
6085
4847
  const deserializeAws_json1_1StorageVirtualMachines = (output, context) => {
6086
- return (output || [])
4848
+ const retVal = (output || [])
6087
4849
  .filter((e) => e != null)
6088
4850
  .map((entry) => {
6089
4851
  if (entry === null) {
@@ -6091,9 +4853,10 @@ const deserializeAws_json1_1StorageVirtualMachines = (output, context) => {
6091
4853
  }
6092
4854
  return deserializeAws_json1_1StorageVirtualMachine(entry, context);
6093
4855
  });
4856
+ return retVal;
6094
4857
  };
6095
4858
  const deserializeAws_json1_1SubnetIds = (output, context) => {
6096
- return (output || [])
4859
+ const retVal = (output || [])
6097
4860
  .filter((e) => e != null)
6098
4861
  .map((entry) => {
6099
4862
  if (entry === null) {
@@ -6101,6 +4864,7 @@ const deserializeAws_json1_1SubnetIds = (output, context) => {
6101
4864
  }
6102
4865
  return smithy_client_1.expectString(entry);
6103
4866
  });
4867
+ return retVal;
6104
4868
  };
6105
4869
  const deserializeAws_json1_1SvmActiveDirectoryConfiguration = (output, context) => {
6106
4870
  return {
@@ -6145,7 +4909,7 @@ const deserializeAws_json1_1TagResourceResponse = (output, context) => {
6145
4909
  return {};
6146
4910
  };
6147
4911
  const deserializeAws_json1_1Tags = (output, context) => {
6148
- return (output || [])
4912
+ const retVal = (output || [])
6149
4913
  .filter((e) => e != null)
6150
4914
  .map((entry) => {
6151
4915
  if (entry === null) {
@@ -6153,6 +4917,7 @@ const deserializeAws_json1_1Tags = (output, context) => {
6153
4917
  }
6154
4918
  return deserializeAws_json1_1Tag(entry, context);
6155
4919
  });
4920
+ return retVal;
6156
4921
  };
6157
4922
  const deserializeAws_json1_1TieringPolicy = (output, context) => {
6158
4923
  return {
@@ -6235,7 +5000,7 @@ const deserializeAws_json1_1VolumeNotFound = (output, context) => {
6235
5000
  };
6236
5001
  };
6237
5002
  const deserializeAws_json1_1Volumes = (output, context) => {
6238
- return (output || [])
5003
+ const retVal = (output || [])
6239
5004
  .filter((e) => e != null)
6240
5005
  .map((entry) => {
6241
5006
  if (entry === null) {
@@ -6243,6 +5008,7 @@ const deserializeAws_json1_1Volumes = (output, context) => {
6243
5008
  }
6244
5009
  return deserializeAws_json1_1Volume(entry, context);
6245
5010
  });
5011
+ return retVal;
6246
5012
  };
6247
5013
  const deserializeAws_json1_1WindowsAuditLogConfiguration = (output, context) => {
6248
5014
  return {