@aws-sdk/client-braket 3.52.0 → 3.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_re
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const uuid_1 = require("uuid");
7
+ const BraketServiceException_1 = require("../models/BraketServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_restJson1CancelJobCommand = async (input, context) => {
8
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
11
  const headers = {};
@@ -422,67 +424,31 @@ const deserializeAws_restJson1CancelJobCommandError = async (output, context) =>
422
424
  switch (errorCode) {
423
425
  case "AccessDeniedException":
424
426
  case "com.amazonaws.braket#AccessDeniedException":
425
- response = {
426
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
427
- name: errorCode,
428
- $metadata: deserializeMetadata(output),
429
- };
430
- break;
427
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
431
428
  case "ConflictException":
432
429
  case "com.amazonaws.braket#ConflictException":
433
- response = {
434
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
435
- name: errorCode,
436
- $metadata: deserializeMetadata(output),
437
- };
438
- break;
430
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
439
431
  case "InternalServiceException":
440
432
  case "com.amazonaws.braket#InternalServiceException":
441
- response = {
442
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
443
- name: errorCode,
444
- $metadata: deserializeMetadata(output),
445
- };
446
- break;
433
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
447
434
  case "ResourceNotFoundException":
448
435
  case "com.amazonaws.braket#ResourceNotFoundException":
449
- response = {
450
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
451
- name: errorCode,
452
- $metadata: deserializeMetadata(output),
453
- };
454
- break;
436
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
455
437
  case "ThrottlingException":
456
438
  case "com.amazonaws.braket#ThrottlingException":
457
- response = {
458
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
459
- name: errorCode,
460
- $metadata: deserializeMetadata(output),
461
- };
462
- break;
439
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
463
440
  case "ValidationException":
464
441
  case "com.amazonaws.braket#ValidationException":
465
- response = {
466
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
467
- name: errorCode,
468
- $metadata: deserializeMetadata(output),
469
- };
470
- break;
442
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
471
443
  default:
472
444
  const parsedBody = parsedOutput.body;
473
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
474
- response = {
475
- ...parsedBody,
476
- name: `${errorCode}`,
477
- message: parsedBody.message || parsedBody.Message || errorCode,
445
+ response = new BraketServiceException_1.BraketServiceException({
446
+ name: parsedBody.code || parsedBody.Code || errorCode,
478
447
  $fault: "client",
479
448
  $metadata: deserializeMetadata(output),
480
- };
449
+ });
450
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
481
451
  }
482
- const message = response.message || response.Message || errorCode;
483
- response.message = message;
484
- delete response.Message;
485
- return Promise.reject(Object.assign(new Error(message), response));
486
452
  };
487
453
  const deserializeAws_restJson1CancelQuantumTaskCommand = async (output, context) => {
488
454
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -514,67 +480,31 @@ const deserializeAws_restJson1CancelQuantumTaskCommandError = async (output, con
514
480
  switch (errorCode) {
515
481
  case "AccessDeniedException":
516
482
  case "com.amazonaws.braket#AccessDeniedException":
517
- response = {
518
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
519
- name: errorCode,
520
- $metadata: deserializeMetadata(output),
521
- };
522
- break;
483
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
523
484
  case "ConflictException":
524
485
  case "com.amazonaws.braket#ConflictException":
525
- response = {
526
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
527
- name: errorCode,
528
- $metadata: deserializeMetadata(output),
529
- };
530
- break;
486
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
531
487
  case "InternalServiceException":
532
488
  case "com.amazonaws.braket#InternalServiceException":
533
- response = {
534
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
535
- name: errorCode,
536
- $metadata: deserializeMetadata(output),
537
- };
538
- break;
489
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
539
490
  case "ResourceNotFoundException":
540
491
  case "com.amazonaws.braket#ResourceNotFoundException":
541
- response = {
542
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
543
- name: errorCode,
544
- $metadata: deserializeMetadata(output),
545
- };
546
- break;
492
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
547
493
  case "ThrottlingException":
548
494
  case "com.amazonaws.braket#ThrottlingException":
549
- response = {
550
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
551
- name: errorCode,
552
- $metadata: deserializeMetadata(output),
553
- };
554
- break;
495
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
555
496
  case "ValidationException":
556
497
  case "com.amazonaws.braket#ValidationException":
557
- response = {
558
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
559
- name: errorCode,
560
- $metadata: deserializeMetadata(output),
561
- };
562
- break;
498
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
563
499
  default:
564
500
  const parsedBody = parsedOutput.body;
565
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
566
- response = {
567
- ...parsedBody,
568
- name: `${errorCode}`,
569
- message: parsedBody.message || parsedBody.Message || errorCode,
501
+ response = new BraketServiceException_1.BraketServiceException({
502
+ name: parsedBody.code || parsedBody.Code || errorCode,
570
503
  $fault: "client",
571
504
  $metadata: deserializeMetadata(output),
572
- };
505
+ });
506
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
573
507
  }
574
- const message = response.message || response.Message || errorCode;
575
- response.message = message;
576
- delete response.Message;
577
- return Promise.reject(Object.assign(new Error(message), response));
578
508
  };
579
509
  const deserializeAws_restJson1CreateJobCommand = async (output, context) => {
580
510
  if (output.statusCode !== 201 && output.statusCode >= 300) {
@@ -602,75 +532,34 @@ const deserializeAws_restJson1CreateJobCommandError = async (output, context) =>
602
532
  switch (errorCode) {
603
533
  case "AccessDeniedException":
604
534
  case "com.amazonaws.braket#AccessDeniedException":
605
- response = {
606
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
607
- name: errorCode,
608
- $metadata: deserializeMetadata(output),
609
- };
610
- break;
535
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
611
536
  case "ConflictException":
612
537
  case "com.amazonaws.braket#ConflictException":
613
- response = {
614
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
615
- name: errorCode,
616
- $metadata: deserializeMetadata(output),
617
- };
618
- break;
538
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
619
539
  case "DeviceRetiredException":
620
540
  case "com.amazonaws.braket#DeviceRetiredException":
621
- response = {
622
- ...(await deserializeAws_restJson1DeviceRetiredExceptionResponse(parsedOutput, context)),
623
- name: errorCode,
624
- $metadata: deserializeMetadata(output),
625
- };
626
- break;
541
+ throw await deserializeAws_restJson1DeviceRetiredExceptionResponse(parsedOutput, context);
627
542
  case "InternalServiceException":
628
543
  case "com.amazonaws.braket#InternalServiceException":
629
- response = {
630
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
631
- name: errorCode,
632
- $metadata: deserializeMetadata(output),
633
- };
634
- break;
544
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
635
545
  case "ServiceQuotaExceededException":
636
546
  case "com.amazonaws.braket#ServiceQuotaExceededException":
637
- response = {
638
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
639
- name: errorCode,
640
- $metadata: deserializeMetadata(output),
641
- };
642
- break;
547
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
643
548
  case "ThrottlingException":
644
549
  case "com.amazonaws.braket#ThrottlingException":
645
- response = {
646
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
647
- name: errorCode,
648
- $metadata: deserializeMetadata(output),
649
- };
650
- break;
550
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
651
551
  case "ValidationException":
652
552
  case "com.amazonaws.braket#ValidationException":
653
- response = {
654
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
655
- name: errorCode,
656
- $metadata: deserializeMetadata(output),
657
- };
658
- break;
553
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
659
554
  default:
660
555
  const parsedBody = parsedOutput.body;
661
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
662
- response = {
663
- ...parsedBody,
664
- name: `${errorCode}`,
665
- message: parsedBody.message || parsedBody.Message || errorCode,
556
+ response = new BraketServiceException_1.BraketServiceException({
557
+ name: parsedBody.code || parsedBody.Code || errorCode,
666
558
  $fault: "client",
667
559
  $metadata: deserializeMetadata(output),
668
- };
560
+ });
561
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
669
562
  }
670
- const message = response.message || response.Message || errorCode;
671
- response.message = message;
672
- delete response.Message;
673
- return Promise.reject(Object.assign(new Error(message), response));
674
563
  };
675
564
  const deserializeAws_restJson1CreateQuantumTaskCommand = async (output, context) => {
676
565
  if (output.statusCode !== 201 && output.statusCode >= 300) {
@@ -698,75 +587,34 @@ const deserializeAws_restJson1CreateQuantumTaskCommandError = async (output, con
698
587
  switch (errorCode) {
699
588
  case "AccessDeniedException":
700
589
  case "com.amazonaws.braket#AccessDeniedException":
701
- response = {
702
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
703
- name: errorCode,
704
- $metadata: deserializeMetadata(output),
705
- };
706
- break;
590
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
707
591
  case "DeviceOfflineException":
708
592
  case "com.amazonaws.braket#DeviceOfflineException":
709
- response = {
710
- ...(await deserializeAws_restJson1DeviceOfflineExceptionResponse(parsedOutput, context)),
711
- name: errorCode,
712
- $metadata: deserializeMetadata(output),
713
- };
714
- break;
593
+ throw await deserializeAws_restJson1DeviceOfflineExceptionResponse(parsedOutput, context);
715
594
  case "DeviceRetiredException":
716
595
  case "com.amazonaws.braket#DeviceRetiredException":
717
- response = {
718
- ...(await deserializeAws_restJson1DeviceRetiredExceptionResponse(parsedOutput, context)),
719
- name: errorCode,
720
- $metadata: deserializeMetadata(output),
721
- };
722
- break;
596
+ throw await deserializeAws_restJson1DeviceRetiredExceptionResponse(parsedOutput, context);
723
597
  case "InternalServiceException":
724
598
  case "com.amazonaws.braket#InternalServiceException":
725
- response = {
726
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
727
- name: errorCode,
728
- $metadata: deserializeMetadata(output),
729
- };
730
- break;
599
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
731
600
  case "ServiceQuotaExceededException":
732
601
  case "com.amazonaws.braket#ServiceQuotaExceededException":
733
- response = {
734
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
735
- name: errorCode,
736
- $metadata: deserializeMetadata(output),
737
- };
738
- break;
602
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
739
603
  case "ThrottlingException":
740
604
  case "com.amazonaws.braket#ThrottlingException":
741
- response = {
742
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
743
- name: errorCode,
744
- $metadata: deserializeMetadata(output),
745
- };
746
- break;
605
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
747
606
  case "ValidationException":
748
607
  case "com.amazonaws.braket#ValidationException":
749
- response = {
750
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
751
- name: errorCode,
752
- $metadata: deserializeMetadata(output),
753
- };
754
- break;
608
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
755
609
  default:
756
610
  const parsedBody = parsedOutput.body;
757
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
758
- response = {
759
- ...parsedBody,
760
- name: `${errorCode}`,
761
- message: parsedBody.message || parsedBody.Message || errorCode,
611
+ response = new BraketServiceException_1.BraketServiceException({
612
+ name: parsedBody.code || parsedBody.Code || errorCode,
762
613
  $fault: "client",
763
614
  $metadata: deserializeMetadata(output),
764
- };
615
+ });
616
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
765
617
  }
766
- const message = response.message || response.Message || errorCode;
767
- response.message = message;
768
- delete response.Message;
769
- return Promise.reject(Object.assign(new Error(message), response));
770
618
  };
771
619
  const deserializeAws_restJson1GetDeviceCommand = async (output, context) => {
772
620
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -814,59 +662,28 @@ const deserializeAws_restJson1GetDeviceCommandError = async (output, context) =>
814
662
  switch (errorCode) {
815
663
  case "AccessDeniedException":
816
664
  case "com.amazonaws.braket#AccessDeniedException":
817
- response = {
818
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
819
- name: errorCode,
820
- $metadata: deserializeMetadata(output),
821
- };
822
- break;
665
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
823
666
  case "InternalServiceException":
824
667
  case "com.amazonaws.braket#InternalServiceException":
825
- response = {
826
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
827
- name: errorCode,
828
- $metadata: deserializeMetadata(output),
829
- };
830
- break;
668
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
831
669
  case "ResourceNotFoundException":
832
670
  case "com.amazonaws.braket#ResourceNotFoundException":
833
- response = {
834
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
835
- name: errorCode,
836
- $metadata: deserializeMetadata(output),
837
- };
838
- break;
671
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
839
672
  case "ThrottlingException":
840
673
  case "com.amazonaws.braket#ThrottlingException":
841
- response = {
842
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
843
- name: errorCode,
844
- $metadata: deserializeMetadata(output),
845
- };
846
- break;
674
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
847
675
  case "ValidationException":
848
676
  case "com.amazonaws.braket#ValidationException":
849
- response = {
850
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
851
- name: errorCode,
852
- $metadata: deserializeMetadata(output),
853
- };
854
- break;
677
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
855
678
  default:
856
679
  const parsedBody = parsedOutput.body;
857
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
858
- response = {
859
- ...parsedBody,
860
- name: `${errorCode}`,
861
- message: parsedBody.message || parsedBody.Message || errorCode,
680
+ response = new BraketServiceException_1.BraketServiceException({
681
+ name: parsedBody.code || parsedBody.Code || errorCode,
862
682
  $fault: "client",
863
683
  $metadata: deserializeMetadata(output),
864
- };
684
+ });
685
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
865
686
  }
866
- const message = response.message || response.Message || errorCode;
867
- response.message = message;
868
- delete response.Message;
869
- return Promise.reject(Object.assign(new Error(message), response));
870
687
  };
871
688
  const deserializeAws_restJson1GetJobCommand = async (output, context) => {
872
689
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -966,59 +783,28 @@ const deserializeAws_restJson1GetJobCommandError = async (output, context) => {
966
783
  switch (errorCode) {
967
784
  case "AccessDeniedException":
968
785
  case "com.amazonaws.braket#AccessDeniedException":
969
- response = {
970
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
971
- name: errorCode,
972
- $metadata: deserializeMetadata(output),
973
- };
974
- break;
786
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
975
787
  case "InternalServiceException":
976
788
  case "com.amazonaws.braket#InternalServiceException":
977
- response = {
978
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
979
- name: errorCode,
980
- $metadata: deserializeMetadata(output),
981
- };
982
- break;
789
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
983
790
  case "ResourceNotFoundException":
984
791
  case "com.amazonaws.braket#ResourceNotFoundException":
985
- response = {
986
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
987
- name: errorCode,
988
- $metadata: deserializeMetadata(output),
989
- };
990
- break;
792
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
991
793
  case "ThrottlingException":
992
794
  case "com.amazonaws.braket#ThrottlingException":
993
- response = {
994
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
995
- name: errorCode,
996
- $metadata: deserializeMetadata(output),
997
- };
998
- break;
795
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
999
796
  case "ValidationException":
1000
797
  case "com.amazonaws.braket#ValidationException":
1001
- response = {
1002
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1003
- name: errorCode,
1004
- $metadata: deserializeMetadata(output),
1005
- };
1006
- break;
798
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1007
799
  default:
1008
800
  const parsedBody = parsedOutput.body;
1009
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1010
- response = {
1011
- ...parsedBody,
1012
- name: `${errorCode}`,
1013
- message: parsedBody.message || parsedBody.Message || errorCode,
801
+ response = new BraketServiceException_1.BraketServiceException({
802
+ name: parsedBody.code || parsedBody.Code || errorCode,
1014
803
  $fault: "client",
1015
804
  $metadata: deserializeMetadata(output),
1016
- };
805
+ });
806
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1017
807
  }
1018
- const message = response.message || response.Message || errorCode;
1019
- response.message = message;
1020
- delete response.Message;
1021
- return Promise.reject(Object.assign(new Error(message), response));
1022
808
  };
1023
809
  const deserializeAws_restJson1GetQuantumTaskCommand = async (output, context) => {
1024
810
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1090,59 +876,28 @@ const deserializeAws_restJson1GetQuantumTaskCommandError = async (output, contex
1090
876
  switch (errorCode) {
1091
877
  case "AccessDeniedException":
1092
878
  case "com.amazonaws.braket#AccessDeniedException":
1093
- response = {
1094
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1095
- name: errorCode,
1096
- $metadata: deserializeMetadata(output),
1097
- };
1098
- break;
879
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1099
880
  case "InternalServiceException":
1100
881
  case "com.amazonaws.braket#InternalServiceException":
1101
- response = {
1102
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
1103
- name: errorCode,
1104
- $metadata: deserializeMetadata(output),
1105
- };
1106
- break;
882
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
1107
883
  case "ResourceNotFoundException":
1108
884
  case "com.amazonaws.braket#ResourceNotFoundException":
1109
- response = {
1110
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1111
- name: errorCode,
1112
- $metadata: deserializeMetadata(output),
1113
- };
1114
- break;
885
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1115
886
  case "ThrottlingException":
1116
887
  case "com.amazonaws.braket#ThrottlingException":
1117
- response = {
1118
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1119
- name: errorCode,
1120
- $metadata: deserializeMetadata(output),
1121
- };
1122
- break;
888
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1123
889
  case "ValidationException":
1124
890
  case "com.amazonaws.braket#ValidationException":
1125
- response = {
1126
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1127
- name: errorCode,
1128
- $metadata: deserializeMetadata(output),
1129
- };
1130
- break;
891
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1131
892
  default:
1132
893
  const parsedBody = parsedOutput.body;
1133
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1134
- response = {
1135
- ...parsedBody,
1136
- name: `${errorCode}`,
1137
- message: parsedBody.message || parsedBody.Message || errorCode,
894
+ response = new BraketServiceException_1.BraketServiceException({
895
+ name: parsedBody.code || parsedBody.Code || errorCode,
1138
896
  $fault: "client",
1139
897
  $metadata: deserializeMetadata(output),
1140
- };
898
+ });
899
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1141
900
  }
1142
- const message = response.message || response.Message || errorCode;
1143
- response.message = message;
1144
- delete response.Message;
1145
- return Promise.reject(Object.assign(new Error(message), response));
1146
901
  };
1147
902
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1148
903
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1170,43 +925,22 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1170
925
  switch (errorCode) {
1171
926
  case "InternalServiceException":
1172
927
  case "com.amazonaws.braket#InternalServiceException":
1173
- response = {
1174
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
1175
- name: errorCode,
1176
- $metadata: deserializeMetadata(output),
1177
- };
1178
- break;
928
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
1179
929
  case "ResourceNotFoundException":
1180
930
  case "com.amazonaws.braket#ResourceNotFoundException":
1181
- response = {
1182
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1183
- name: errorCode,
1184
- $metadata: deserializeMetadata(output),
1185
- };
1186
- break;
931
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1187
932
  case "ValidationException":
1188
933
  case "com.amazonaws.braket#ValidationException":
1189
- response = {
1190
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1191
- name: errorCode,
1192
- $metadata: deserializeMetadata(output),
1193
- };
1194
- break;
934
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1195
935
  default:
1196
936
  const parsedBody = parsedOutput.body;
1197
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1198
- response = {
1199
- ...parsedBody,
1200
- name: `${errorCode}`,
1201
- message: parsedBody.message || parsedBody.Message || errorCode,
937
+ response = new BraketServiceException_1.BraketServiceException({
938
+ name: parsedBody.code || parsedBody.Code || errorCode,
1202
939
  $fault: "client",
1203
940
  $metadata: deserializeMetadata(output),
1204
- };
941
+ });
942
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1205
943
  }
1206
- const message = response.message || response.Message || errorCode;
1207
- response.message = message;
1208
- delete response.Message;
1209
- return Promise.reject(Object.assign(new Error(message), response));
1210
944
  };
1211
945
  const deserializeAws_restJson1SearchDevicesCommand = async (output, context) => {
1212
946
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1238,51 +972,25 @@ const deserializeAws_restJson1SearchDevicesCommandError = async (output, context
1238
972
  switch (errorCode) {
1239
973
  case "AccessDeniedException":
1240
974
  case "com.amazonaws.braket#AccessDeniedException":
1241
- response = {
1242
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1243
- name: errorCode,
1244
- $metadata: deserializeMetadata(output),
1245
- };
1246
- break;
975
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1247
976
  case "InternalServiceException":
1248
977
  case "com.amazonaws.braket#InternalServiceException":
1249
- response = {
1250
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
1251
- name: errorCode,
1252
- $metadata: deserializeMetadata(output),
1253
- };
1254
- break;
978
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
1255
979
  case "ThrottlingException":
1256
980
  case "com.amazonaws.braket#ThrottlingException":
1257
- response = {
1258
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1259
- name: errorCode,
1260
- $metadata: deserializeMetadata(output),
1261
- };
1262
- break;
981
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1263
982
  case "ValidationException":
1264
983
  case "com.amazonaws.braket#ValidationException":
1265
- response = {
1266
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1267
- name: errorCode,
1268
- $metadata: deserializeMetadata(output),
1269
- };
1270
- break;
984
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1271
985
  default:
1272
986
  const parsedBody = parsedOutput.body;
1273
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1274
- response = {
1275
- ...parsedBody,
1276
- name: `${errorCode}`,
1277
- message: parsedBody.message || parsedBody.Message || errorCode,
987
+ response = new BraketServiceException_1.BraketServiceException({
988
+ name: parsedBody.code || parsedBody.Code || errorCode,
1278
989
  $fault: "client",
1279
990
  $metadata: deserializeMetadata(output),
1280
- };
991
+ });
992
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1281
993
  }
1282
- const message = response.message || response.Message || errorCode;
1283
- response.message = message;
1284
- delete response.Message;
1285
- return Promise.reject(Object.assign(new Error(message), response));
1286
994
  };
1287
995
  const deserializeAws_restJson1SearchJobsCommand = async (output, context) => {
1288
996
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1314,51 +1022,25 @@ const deserializeAws_restJson1SearchJobsCommandError = async (output, context) =
1314
1022
  switch (errorCode) {
1315
1023
  case "AccessDeniedException":
1316
1024
  case "com.amazonaws.braket#AccessDeniedException":
1317
- response = {
1318
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1319
- name: errorCode,
1320
- $metadata: deserializeMetadata(output),
1321
- };
1322
- break;
1025
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1323
1026
  case "InternalServiceException":
1324
1027
  case "com.amazonaws.braket#InternalServiceException":
1325
- response = {
1326
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
1327
- name: errorCode,
1328
- $metadata: deserializeMetadata(output),
1329
- };
1330
- break;
1028
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
1331
1029
  case "ThrottlingException":
1332
1030
  case "com.amazonaws.braket#ThrottlingException":
1333
- response = {
1334
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1335
- name: errorCode,
1336
- $metadata: deserializeMetadata(output),
1337
- };
1338
- break;
1031
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1339
1032
  case "ValidationException":
1340
1033
  case "com.amazonaws.braket#ValidationException":
1341
- response = {
1342
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1343
- name: errorCode,
1344
- $metadata: deserializeMetadata(output),
1345
- };
1346
- break;
1034
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1347
1035
  default:
1348
1036
  const parsedBody = parsedOutput.body;
1349
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1350
- response = {
1351
- ...parsedBody,
1352
- name: `${errorCode}`,
1353
- message: parsedBody.message || parsedBody.Message || errorCode,
1037
+ response = new BraketServiceException_1.BraketServiceException({
1038
+ name: parsedBody.code || parsedBody.Code || errorCode,
1354
1039
  $fault: "client",
1355
1040
  $metadata: deserializeMetadata(output),
1356
- };
1041
+ });
1042
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1357
1043
  }
1358
- const message = response.message || response.Message || errorCode;
1359
- response.message = message;
1360
- delete response.Message;
1361
- return Promise.reject(Object.assign(new Error(message), response));
1362
1044
  };
1363
1045
  const deserializeAws_restJson1SearchQuantumTasksCommand = async (output, context) => {
1364
1046
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1390,51 +1072,25 @@ const deserializeAws_restJson1SearchQuantumTasksCommandError = async (output, co
1390
1072
  switch (errorCode) {
1391
1073
  case "AccessDeniedException":
1392
1074
  case "com.amazonaws.braket#AccessDeniedException":
1393
- response = {
1394
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1395
- name: errorCode,
1396
- $metadata: deserializeMetadata(output),
1397
- };
1398
- break;
1075
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1399
1076
  case "InternalServiceException":
1400
1077
  case "com.amazonaws.braket#InternalServiceException":
1401
- response = {
1402
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
1403
- name: errorCode,
1404
- $metadata: deserializeMetadata(output),
1405
- };
1406
- break;
1078
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
1407
1079
  case "ThrottlingException":
1408
1080
  case "com.amazonaws.braket#ThrottlingException":
1409
- response = {
1410
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1411
- name: errorCode,
1412
- $metadata: deserializeMetadata(output),
1413
- };
1414
- break;
1081
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1415
1082
  case "ValidationException":
1416
1083
  case "com.amazonaws.braket#ValidationException":
1417
- response = {
1418
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1419
- name: errorCode,
1420
- $metadata: deserializeMetadata(output),
1421
- };
1422
- break;
1084
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1423
1085
  default:
1424
1086
  const parsedBody = parsedOutput.body;
1425
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1426
- response = {
1427
- ...parsedBody,
1428
- name: `${errorCode}`,
1429
- message: parsedBody.message || parsedBody.Message || errorCode,
1087
+ response = new BraketServiceException_1.BraketServiceException({
1088
+ name: parsedBody.code || parsedBody.Code || errorCode,
1430
1089
  $fault: "client",
1431
1090
  $metadata: deserializeMetadata(output),
1432
- };
1091
+ });
1092
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1433
1093
  }
1434
- const message = response.message || response.Message || errorCode;
1435
- response.message = message;
1436
- delete response.Message;
1437
- return Promise.reject(Object.assign(new Error(message), response));
1438
1094
  };
1439
1095
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1440
1096
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1458,43 +1114,22 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1458
1114
  switch (errorCode) {
1459
1115
  case "InternalServiceException":
1460
1116
  case "com.amazonaws.braket#InternalServiceException":
1461
- response = {
1462
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
1463
- name: errorCode,
1464
- $metadata: deserializeMetadata(output),
1465
- };
1466
- break;
1117
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
1467
1118
  case "ResourceNotFoundException":
1468
1119
  case "com.amazonaws.braket#ResourceNotFoundException":
1469
- response = {
1470
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1471
- name: errorCode,
1472
- $metadata: deserializeMetadata(output),
1473
- };
1474
- break;
1120
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1475
1121
  case "ValidationException":
1476
1122
  case "com.amazonaws.braket#ValidationException":
1477
- response = {
1478
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1479
- name: errorCode,
1480
- $metadata: deserializeMetadata(output),
1481
- };
1482
- break;
1123
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1483
1124
  default:
1484
1125
  const parsedBody = parsedOutput.body;
1485
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1486
- response = {
1487
- ...parsedBody,
1488
- name: `${errorCode}`,
1489
- message: parsedBody.message || parsedBody.Message || errorCode,
1126
+ response = new BraketServiceException_1.BraketServiceException({
1127
+ name: parsedBody.code || parsedBody.Code || errorCode,
1490
1128
  $fault: "client",
1491
1129
  $metadata: deserializeMetadata(output),
1492
- };
1130
+ });
1131
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1493
1132
  }
1494
- const message = response.message || response.Message || errorCode;
1495
- response.message = message;
1496
- delete response.Message;
1497
- return Promise.reject(Object.assign(new Error(message), response));
1498
1133
  };
1499
1134
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1500
1135
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1518,160 +1153,130 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1518
1153
  switch (errorCode) {
1519
1154
  case "InternalServiceException":
1520
1155
  case "com.amazonaws.braket#InternalServiceException":
1521
- response = {
1522
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
1523
- name: errorCode,
1524
- $metadata: deserializeMetadata(output),
1525
- };
1526
- break;
1156
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
1527
1157
  case "ResourceNotFoundException":
1528
1158
  case "com.amazonaws.braket#ResourceNotFoundException":
1529
- response = {
1530
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1531
- name: errorCode,
1532
- $metadata: deserializeMetadata(output),
1533
- };
1534
- break;
1159
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1535
1160
  case "ValidationException":
1536
1161
  case "com.amazonaws.braket#ValidationException":
1537
- response = {
1538
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1539
- name: errorCode,
1540
- $metadata: deserializeMetadata(output),
1541
- };
1542
- break;
1162
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1543
1163
  default:
1544
1164
  const parsedBody = parsedOutput.body;
1545
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1546
- response = {
1547
- ...parsedBody,
1548
- name: `${errorCode}`,
1549
- message: parsedBody.message || parsedBody.Message || errorCode,
1165
+ response = new BraketServiceException_1.BraketServiceException({
1166
+ name: parsedBody.code || parsedBody.Code || errorCode,
1550
1167
  $fault: "client",
1551
1168
  $metadata: deserializeMetadata(output),
1552
- };
1169
+ });
1170
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1553
1171
  }
1554
- const message = response.message || response.Message || errorCode;
1555
- response.message = message;
1556
- delete response.Message;
1557
- return Promise.reject(Object.assign(new Error(message), response));
1558
1172
  };
1559
1173
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1560
- const contents = {
1561
- name: "AccessDeniedException",
1562
- $fault: "client",
1563
- $metadata: deserializeMetadata(parsedOutput),
1564
- message: undefined,
1565
- };
1174
+ const contents = {};
1566
1175
  const data = parsedOutput.body;
1567
1176
  if (data.message !== undefined && data.message !== null) {
1568
1177
  contents.message = smithy_client_1.expectString(data.message);
1569
1178
  }
1570
- return contents;
1179
+ const exception = new models_0_1.AccessDeniedException({
1180
+ $metadata: deserializeMetadata(parsedOutput),
1181
+ ...contents,
1182
+ });
1183
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1571
1184
  };
1572
1185
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1573
- const contents = {
1574
- name: "ConflictException",
1575
- $fault: "client",
1576
- $metadata: deserializeMetadata(parsedOutput),
1577
- message: undefined,
1578
- };
1186
+ const contents = {};
1579
1187
  const data = parsedOutput.body;
1580
1188
  if (data.message !== undefined && data.message !== null) {
1581
1189
  contents.message = smithy_client_1.expectString(data.message);
1582
1190
  }
1583
- return contents;
1191
+ const exception = new models_0_1.ConflictException({
1192
+ $metadata: deserializeMetadata(parsedOutput),
1193
+ ...contents,
1194
+ });
1195
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1584
1196
  };
1585
1197
  const deserializeAws_restJson1DeviceOfflineExceptionResponse = async (parsedOutput, context) => {
1586
- const contents = {
1587
- name: "DeviceOfflineException",
1588
- $fault: "client",
1589
- $metadata: deserializeMetadata(parsedOutput),
1590
- message: undefined,
1591
- };
1198
+ const contents = {};
1592
1199
  const data = parsedOutput.body;
1593
1200
  if (data.message !== undefined && data.message !== null) {
1594
1201
  contents.message = smithy_client_1.expectString(data.message);
1595
1202
  }
1596
- return contents;
1203
+ const exception = new models_0_1.DeviceOfflineException({
1204
+ $metadata: deserializeMetadata(parsedOutput),
1205
+ ...contents,
1206
+ });
1207
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1597
1208
  };
1598
1209
  const deserializeAws_restJson1DeviceRetiredExceptionResponse = async (parsedOutput, context) => {
1599
- const contents = {
1600
- name: "DeviceRetiredException",
1601
- $fault: "client",
1602
- $metadata: deserializeMetadata(parsedOutput),
1603
- message: undefined,
1604
- };
1210
+ const contents = {};
1605
1211
  const data = parsedOutput.body;
1606
1212
  if (data.message !== undefined && data.message !== null) {
1607
1213
  contents.message = smithy_client_1.expectString(data.message);
1608
1214
  }
1609
- return contents;
1215
+ const exception = new models_0_1.DeviceRetiredException({
1216
+ $metadata: deserializeMetadata(parsedOutput),
1217
+ ...contents,
1218
+ });
1219
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1610
1220
  };
1611
1221
  const deserializeAws_restJson1InternalServiceExceptionResponse = async (parsedOutput, context) => {
1612
- const contents = {
1613
- name: "InternalServiceException",
1614
- $fault: "server",
1615
- $metadata: deserializeMetadata(parsedOutput),
1616
- message: undefined,
1617
- };
1222
+ const contents = {};
1618
1223
  const data = parsedOutput.body;
1619
1224
  if (data.message !== undefined && data.message !== null) {
1620
1225
  contents.message = smithy_client_1.expectString(data.message);
1621
1226
  }
1622
- return contents;
1227
+ const exception = new models_0_1.InternalServiceException({
1228
+ $metadata: deserializeMetadata(parsedOutput),
1229
+ ...contents,
1230
+ });
1231
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1623
1232
  };
1624
1233
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1625
- const contents = {
1626
- name: "ResourceNotFoundException",
1627
- $fault: "client",
1628
- $metadata: deserializeMetadata(parsedOutput),
1629
- message: undefined,
1630
- };
1234
+ const contents = {};
1631
1235
  const data = parsedOutput.body;
1632
1236
  if (data.message !== undefined && data.message !== null) {
1633
1237
  contents.message = smithy_client_1.expectString(data.message);
1634
1238
  }
1635
- return contents;
1239
+ const exception = new models_0_1.ResourceNotFoundException({
1240
+ $metadata: deserializeMetadata(parsedOutput),
1241
+ ...contents,
1242
+ });
1243
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1636
1244
  };
1637
1245
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1638
- const contents = {
1639
- name: "ServiceQuotaExceededException",
1640
- $fault: "client",
1641
- $metadata: deserializeMetadata(parsedOutput),
1642
- message: undefined,
1643
- };
1246
+ const contents = {};
1644
1247
  const data = parsedOutput.body;
1645
1248
  if (data.message !== undefined && data.message !== null) {
1646
1249
  contents.message = smithy_client_1.expectString(data.message);
1647
1250
  }
1648
- return contents;
1251
+ const exception = new models_0_1.ServiceQuotaExceededException({
1252
+ $metadata: deserializeMetadata(parsedOutput),
1253
+ ...contents,
1254
+ });
1255
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1649
1256
  };
1650
1257
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1651
- const contents = {
1652
- name: "ThrottlingException",
1653
- $fault: "client",
1654
- $metadata: deserializeMetadata(parsedOutput),
1655
- message: undefined,
1656
- };
1258
+ const contents = {};
1657
1259
  const data = parsedOutput.body;
1658
1260
  if (data.message !== undefined && data.message !== null) {
1659
1261
  contents.message = smithy_client_1.expectString(data.message);
1660
1262
  }
1661
- return contents;
1263
+ const exception = new models_0_1.ThrottlingException({
1264
+ $metadata: deserializeMetadata(parsedOutput),
1265
+ ...contents,
1266
+ });
1267
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1662
1268
  };
1663
1269
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1664
- const contents = {
1665
- name: "ValidationException",
1666
- $fault: "client",
1667
- $metadata: deserializeMetadata(parsedOutput),
1668
- message: undefined,
1669
- };
1270
+ const contents = {};
1670
1271
  const data = parsedOutput.body;
1671
1272
  if (data.message !== undefined && data.message !== null) {
1672
1273
  contents.message = smithy_client_1.expectString(data.message);
1673
1274
  }
1674
- return contents;
1275
+ const exception = new models_0_1.ValidationException({
1276
+ $metadata: deserializeMetadata(parsedOutput),
1277
+ ...contents,
1278
+ });
1279
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1675
1280
  };
1676
1281
  const serializeAws_restJson1AlgorithmSpecification = (input, context) => {
1677
1282
  return {
@@ -1879,7 +1484,7 @@ const deserializeAws_restJson1DeviceSummary = (output, context) => {
1879
1484
  };
1880
1485
  };
1881
1486
  const deserializeAws_restJson1DeviceSummaryList = (output, context) => {
1882
- return (output || [])
1487
+ const retVal = (output || [])
1883
1488
  .filter((e) => e != null)
1884
1489
  .map((entry) => {
1885
1490
  if (entry === null) {
@@ -1887,6 +1492,7 @@ const deserializeAws_restJson1DeviceSummaryList = (output, context) => {
1887
1492
  }
1888
1493
  return deserializeAws_restJson1DeviceSummary(entry, context);
1889
1494
  });
1495
+ return retVal;
1890
1496
  };
1891
1497
  const deserializeAws_restJson1HyperParameters = (output, context) => {
1892
1498
  return Object.entries(output).reduce((acc, [key, value]) => {
@@ -1900,7 +1506,7 @@ const deserializeAws_restJson1HyperParameters = (output, context) => {
1900
1506
  }, {});
1901
1507
  };
1902
1508
  const deserializeAws_restJson1InputConfigList = (output, context) => {
1903
- return (output || [])
1509
+ const retVal = (output || [])
1904
1510
  .filter((e) => e != null)
1905
1511
  .map((entry) => {
1906
1512
  if (entry === null) {
@@ -1908,6 +1514,7 @@ const deserializeAws_restJson1InputConfigList = (output, context) => {
1908
1514
  }
1909
1515
  return deserializeAws_restJson1InputFileConfig(entry, context);
1910
1516
  });
1517
+ return retVal;
1911
1518
  };
1912
1519
  const deserializeAws_restJson1InputFileConfig = (output, context) => {
1913
1520
  return {
@@ -1940,7 +1547,7 @@ const deserializeAws_restJson1JobEventDetails = (output, context) => {
1940
1547
  };
1941
1548
  };
1942
1549
  const deserializeAws_restJson1JobEvents = (output, context) => {
1943
- return (output || [])
1550
+ const retVal = (output || [])
1944
1551
  .filter((e) => e != null)
1945
1552
  .map((entry) => {
1946
1553
  if (entry === null) {
@@ -1948,6 +1555,7 @@ const deserializeAws_restJson1JobEvents = (output, context) => {
1948
1555
  }
1949
1556
  return deserializeAws_restJson1JobEventDetails(entry, context);
1950
1557
  });
1558
+ return retVal;
1951
1559
  };
1952
1560
  const deserializeAws_restJson1JobOutputDataConfig = (output, context) => {
1953
1561
  return {
@@ -1981,7 +1589,7 @@ const deserializeAws_restJson1JobSummary = (output, context) => {
1981
1589
  };
1982
1590
  };
1983
1591
  const deserializeAws_restJson1JobSummaryList = (output, context) => {
1984
- return (output || [])
1592
+ const retVal = (output || [])
1985
1593
  .filter((e) => e != null)
1986
1594
  .map((entry) => {
1987
1595
  if (entry === null) {
@@ -1989,6 +1597,7 @@ const deserializeAws_restJson1JobSummaryList = (output, context) => {
1989
1597
  }
1990
1598
  return deserializeAws_restJson1JobSummary(entry, context);
1991
1599
  });
1600
+ return retVal;
1992
1601
  };
1993
1602
  const deserializeAws_restJson1QuantumTaskSummary = (output, context) => {
1994
1603
  return {
@@ -2010,7 +1619,7 @@ const deserializeAws_restJson1QuantumTaskSummary = (output, context) => {
2010
1619
  };
2011
1620
  };
2012
1621
  const deserializeAws_restJson1QuantumTaskSummaryList = (output, context) => {
2013
- return (output || [])
1622
+ const retVal = (output || [])
2014
1623
  .filter((e) => e != null)
2015
1624
  .map((entry) => {
2016
1625
  if (entry === null) {
@@ -2018,6 +1627,7 @@ const deserializeAws_restJson1QuantumTaskSummaryList = (output, context) => {
2018
1627
  }
2019
1628
  return deserializeAws_restJson1QuantumTaskSummary(entry, context);
2020
1629
  });
1630
+ return retVal;
2021
1631
  };
2022
1632
  const deserializeAws_restJson1S3DataSource = (output, context) => {
2023
1633
  return {