@aws-sdk/client-inspector 3.52.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,8 @@ exports.deserializeAws_json1_1DescribeExclusionsCommand = exports.deserializeAws
4
4
  exports.deserializeAws_json1_1UpdateAssessmentTargetCommand = exports.deserializeAws_json1_1UnsubscribeFromEventCommand = exports.deserializeAws_json1_1SubscribeToEventCommand = exports.deserializeAws_json1_1StopAssessmentRunCommand = exports.deserializeAws_json1_1StartAssessmentRunCommand = exports.deserializeAws_json1_1SetTagsForResourceCommand = exports.deserializeAws_json1_1RemoveAttributesFromFindingsCommand = exports.deserializeAws_json1_1RegisterCrossAccountAccessRoleCommand = exports.deserializeAws_json1_1PreviewAgentsCommand = exports.deserializeAws_json1_1ListTagsForResourceCommand = exports.deserializeAws_json1_1ListRulesPackagesCommand = exports.deserializeAws_json1_1ListFindingsCommand = exports.deserializeAws_json1_1ListExclusionsCommand = exports.deserializeAws_json1_1ListEventSubscriptionsCommand = exports.deserializeAws_json1_1ListAssessmentTemplatesCommand = exports.deserializeAws_json1_1ListAssessmentTargetsCommand = exports.deserializeAws_json1_1ListAssessmentRunsCommand = exports.deserializeAws_json1_1ListAssessmentRunAgentsCommand = exports.deserializeAws_json1_1GetTelemetryMetadataCommand = exports.deserializeAws_json1_1GetExclusionsPreviewCommand = exports.deserializeAws_json1_1GetAssessmentReportCommand = exports.deserializeAws_json1_1DescribeRulesPackagesCommand = exports.deserializeAws_json1_1DescribeResourceGroupsCommand = exports.deserializeAws_json1_1DescribeFindingsCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ const InspectorServiceException_1 = require("../models/InspectorServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_json1_1AddAttributesToFindingsCommand = async (input, context) => {
8
10
  const headers = {
9
11
  "content-type": "application/x-amz-json-1.1",
@@ -398,59 +400,28 @@ const deserializeAws_json1_1AddAttributesToFindingsCommandError = async (output,
398
400
  switch (errorCode) {
399
401
  case "AccessDeniedException":
400
402
  case "com.amazonaws.inspector#AccessDeniedException":
401
- response = {
402
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
403
- name: errorCode,
404
- $metadata: deserializeMetadata(output),
405
- };
406
- break;
403
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
407
404
  case "InternalException":
408
405
  case "com.amazonaws.inspector#InternalException":
409
- response = {
410
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
411
- name: errorCode,
412
- $metadata: deserializeMetadata(output),
413
- };
414
- break;
406
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
415
407
  case "InvalidInputException":
416
408
  case "com.amazonaws.inspector#InvalidInputException":
417
- response = {
418
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
419
- name: errorCode,
420
- $metadata: deserializeMetadata(output),
421
- };
422
- break;
409
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
423
410
  case "NoSuchEntityException":
424
411
  case "com.amazonaws.inspector#NoSuchEntityException":
425
- response = {
426
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
427
- name: errorCode,
428
- $metadata: deserializeMetadata(output),
429
- };
430
- break;
412
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
431
413
  case "ServiceTemporarilyUnavailableException":
432
414
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
433
- response = {
434
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
435
- name: errorCode,
436
- $metadata: deserializeMetadata(output),
437
- };
438
- break;
415
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
439
416
  default:
440
417
  const parsedBody = parsedOutput.body;
441
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
442
- response = {
443
- ...parsedBody,
444
- name: `${errorCode}`,
445
- message: parsedBody.message || parsedBody.Message || errorCode,
418
+ response = new InspectorServiceException_1.InspectorServiceException({
419
+ name: parsedBody.code || parsedBody.Code || errorCode,
446
420
  $fault: "client",
447
421
  $metadata: deserializeMetadata(output),
448
- };
422
+ });
423
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
449
424
  }
450
- const message = response.message || response.Message || errorCode;
451
- response.message = message;
452
- delete response.Message;
453
- return Promise.reject(Object.assign(new Error(message), response));
454
425
  };
455
426
  const deserializeAws_json1_1CreateAssessmentTargetCommand = async (output, context) => {
456
427
  if (output.statusCode >= 300) {
@@ -477,75 +448,34 @@ const deserializeAws_json1_1CreateAssessmentTargetCommandError = async (output,
477
448
  switch (errorCode) {
478
449
  case "AccessDeniedException":
479
450
  case "com.amazonaws.inspector#AccessDeniedException":
480
- response = {
481
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
482
- name: errorCode,
483
- $metadata: deserializeMetadata(output),
484
- };
485
- break;
451
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
486
452
  case "InternalException":
487
453
  case "com.amazonaws.inspector#InternalException":
488
- response = {
489
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
490
- name: errorCode,
491
- $metadata: deserializeMetadata(output),
492
- };
493
- break;
454
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
494
455
  case "InvalidCrossAccountRoleException":
495
456
  case "com.amazonaws.inspector#InvalidCrossAccountRoleException":
496
- response = {
497
- ...(await deserializeAws_json1_1InvalidCrossAccountRoleExceptionResponse(parsedOutput, context)),
498
- name: errorCode,
499
- $metadata: deserializeMetadata(output),
500
- };
501
- break;
457
+ throw await deserializeAws_json1_1InvalidCrossAccountRoleExceptionResponse(parsedOutput, context);
502
458
  case "InvalidInputException":
503
459
  case "com.amazonaws.inspector#InvalidInputException":
504
- response = {
505
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
506
- name: errorCode,
507
- $metadata: deserializeMetadata(output),
508
- };
509
- break;
460
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
510
461
  case "LimitExceededException":
511
462
  case "com.amazonaws.inspector#LimitExceededException":
512
- response = {
513
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
514
- name: errorCode,
515
- $metadata: deserializeMetadata(output),
516
- };
517
- break;
463
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
518
464
  case "NoSuchEntityException":
519
465
  case "com.amazonaws.inspector#NoSuchEntityException":
520
- response = {
521
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
522
- name: errorCode,
523
- $metadata: deserializeMetadata(output),
524
- };
525
- break;
466
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
526
467
  case "ServiceTemporarilyUnavailableException":
527
468
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
528
- response = {
529
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
530
- name: errorCode,
531
- $metadata: deserializeMetadata(output),
532
- };
533
- break;
469
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
534
470
  default:
535
471
  const parsedBody = parsedOutput.body;
536
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
537
- response = {
538
- ...parsedBody,
539
- name: `${errorCode}`,
540
- message: parsedBody.message || parsedBody.Message || errorCode,
472
+ response = new InspectorServiceException_1.InspectorServiceException({
473
+ name: parsedBody.code || parsedBody.Code || errorCode,
541
474
  $fault: "client",
542
475
  $metadata: deserializeMetadata(output),
543
- };
476
+ });
477
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
544
478
  }
545
- const message = response.message || response.Message || errorCode;
546
- response.message = message;
547
- delete response.Message;
548
- return Promise.reject(Object.assign(new Error(message), response));
549
479
  };
550
480
  const deserializeAws_json1_1CreateAssessmentTemplateCommand = async (output, context) => {
551
481
  if (output.statusCode >= 300) {
@@ -572,67 +502,31 @@ const deserializeAws_json1_1CreateAssessmentTemplateCommandError = async (output
572
502
  switch (errorCode) {
573
503
  case "AccessDeniedException":
574
504
  case "com.amazonaws.inspector#AccessDeniedException":
575
- response = {
576
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
577
- name: errorCode,
578
- $metadata: deserializeMetadata(output),
579
- };
580
- break;
505
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
581
506
  case "InternalException":
582
507
  case "com.amazonaws.inspector#InternalException":
583
- response = {
584
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
585
- name: errorCode,
586
- $metadata: deserializeMetadata(output),
587
- };
588
- break;
508
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
589
509
  case "InvalidInputException":
590
510
  case "com.amazonaws.inspector#InvalidInputException":
591
- response = {
592
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
593
- name: errorCode,
594
- $metadata: deserializeMetadata(output),
595
- };
596
- break;
511
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
597
512
  case "LimitExceededException":
598
513
  case "com.amazonaws.inspector#LimitExceededException":
599
- response = {
600
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
601
- name: errorCode,
602
- $metadata: deserializeMetadata(output),
603
- };
604
- break;
514
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
605
515
  case "NoSuchEntityException":
606
516
  case "com.amazonaws.inspector#NoSuchEntityException":
607
- response = {
608
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
609
- name: errorCode,
610
- $metadata: deserializeMetadata(output),
611
- };
612
- break;
517
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
613
518
  case "ServiceTemporarilyUnavailableException":
614
519
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
615
- response = {
616
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
617
- name: errorCode,
618
- $metadata: deserializeMetadata(output),
619
- };
620
- break;
520
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
621
521
  default:
622
522
  const parsedBody = parsedOutput.body;
623
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
624
- response = {
625
- ...parsedBody,
626
- name: `${errorCode}`,
627
- message: parsedBody.message || parsedBody.Message || errorCode,
523
+ response = new InspectorServiceException_1.InspectorServiceException({
524
+ name: parsedBody.code || parsedBody.Code || errorCode,
628
525
  $fault: "client",
629
526
  $metadata: deserializeMetadata(output),
630
- };
527
+ });
528
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
631
529
  }
632
- const message = response.message || response.Message || errorCode;
633
- response.message = message;
634
- delete response.Message;
635
- return Promise.reject(Object.assign(new Error(message), response));
636
530
  };
637
531
  const deserializeAws_json1_1CreateExclusionsPreviewCommand = async (output, context) => {
638
532
  if (output.statusCode >= 300) {
@@ -659,67 +553,31 @@ const deserializeAws_json1_1CreateExclusionsPreviewCommandError = async (output,
659
553
  switch (errorCode) {
660
554
  case "AccessDeniedException":
661
555
  case "com.amazonaws.inspector#AccessDeniedException":
662
- response = {
663
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
664
- name: errorCode,
665
- $metadata: deserializeMetadata(output),
666
- };
667
- break;
556
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
668
557
  case "InternalException":
669
558
  case "com.amazonaws.inspector#InternalException":
670
- response = {
671
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
672
- name: errorCode,
673
- $metadata: deserializeMetadata(output),
674
- };
675
- break;
559
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
676
560
  case "InvalidInputException":
677
561
  case "com.amazonaws.inspector#InvalidInputException":
678
- response = {
679
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
680
- name: errorCode,
681
- $metadata: deserializeMetadata(output),
682
- };
683
- break;
562
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
684
563
  case "NoSuchEntityException":
685
564
  case "com.amazonaws.inspector#NoSuchEntityException":
686
- response = {
687
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
688
- name: errorCode,
689
- $metadata: deserializeMetadata(output),
690
- };
691
- break;
565
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
692
566
  case "PreviewGenerationInProgressException":
693
567
  case "com.amazonaws.inspector#PreviewGenerationInProgressException":
694
- response = {
695
- ...(await deserializeAws_json1_1PreviewGenerationInProgressExceptionResponse(parsedOutput, context)),
696
- name: errorCode,
697
- $metadata: deserializeMetadata(output),
698
- };
699
- break;
568
+ throw await deserializeAws_json1_1PreviewGenerationInProgressExceptionResponse(parsedOutput, context);
700
569
  case "ServiceTemporarilyUnavailableException":
701
570
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
702
- response = {
703
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
704
- name: errorCode,
705
- $metadata: deserializeMetadata(output),
706
- };
707
- break;
571
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
708
572
  default:
709
573
  const parsedBody = parsedOutput.body;
710
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
711
- response = {
712
- ...parsedBody,
713
- name: `${errorCode}`,
714
- message: parsedBody.message || parsedBody.Message || errorCode,
574
+ response = new InspectorServiceException_1.InspectorServiceException({
575
+ name: parsedBody.code || parsedBody.Code || errorCode,
715
576
  $fault: "client",
716
577
  $metadata: deserializeMetadata(output),
717
- };
578
+ });
579
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
718
580
  }
719
- const message = response.message || response.Message || errorCode;
720
- response.message = message;
721
- delete response.Message;
722
- return Promise.reject(Object.assign(new Error(message), response));
723
581
  };
724
582
  const deserializeAws_json1_1CreateResourceGroupCommand = async (output, context) => {
725
583
  if (output.statusCode >= 300) {
@@ -746,59 +604,28 @@ const deserializeAws_json1_1CreateResourceGroupCommandError = async (output, con
746
604
  switch (errorCode) {
747
605
  case "AccessDeniedException":
748
606
  case "com.amazonaws.inspector#AccessDeniedException":
749
- response = {
750
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
751
- name: errorCode,
752
- $metadata: deserializeMetadata(output),
753
- };
754
- break;
607
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
755
608
  case "InternalException":
756
609
  case "com.amazonaws.inspector#InternalException":
757
- response = {
758
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
759
- name: errorCode,
760
- $metadata: deserializeMetadata(output),
761
- };
762
- break;
610
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
763
611
  case "InvalidInputException":
764
612
  case "com.amazonaws.inspector#InvalidInputException":
765
- response = {
766
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
767
- name: errorCode,
768
- $metadata: deserializeMetadata(output),
769
- };
770
- break;
613
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
771
614
  case "LimitExceededException":
772
615
  case "com.amazonaws.inspector#LimitExceededException":
773
- response = {
774
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
775
- name: errorCode,
776
- $metadata: deserializeMetadata(output),
777
- };
778
- break;
616
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
779
617
  case "ServiceTemporarilyUnavailableException":
780
618
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
781
- response = {
782
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
783
- name: errorCode,
784
- $metadata: deserializeMetadata(output),
785
- };
786
- break;
619
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
787
620
  default:
788
621
  const parsedBody = parsedOutput.body;
789
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
790
- response = {
791
- ...parsedBody,
792
- name: `${errorCode}`,
793
- message: parsedBody.message || parsedBody.Message || errorCode,
622
+ response = new InspectorServiceException_1.InspectorServiceException({
623
+ name: parsedBody.code || parsedBody.Code || errorCode,
794
624
  $fault: "client",
795
625
  $metadata: deserializeMetadata(output),
796
- };
626
+ });
627
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
797
628
  }
798
- const message = response.message || response.Message || errorCode;
799
- response.message = message;
800
- delete response.Message;
801
- return Promise.reject(Object.assign(new Error(message), response));
802
629
  };
803
630
  const deserializeAws_json1_1DeleteAssessmentRunCommand = async (output, context) => {
804
631
  if (output.statusCode >= 300) {
@@ -822,67 +649,31 @@ const deserializeAws_json1_1DeleteAssessmentRunCommandError = async (output, con
822
649
  switch (errorCode) {
823
650
  case "AccessDeniedException":
824
651
  case "com.amazonaws.inspector#AccessDeniedException":
825
- response = {
826
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
827
- name: errorCode,
828
- $metadata: deserializeMetadata(output),
829
- };
830
- break;
652
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
831
653
  case "AssessmentRunInProgressException":
832
654
  case "com.amazonaws.inspector#AssessmentRunInProgressException":
833
- response = {
834
- ...(await deserializeAws_json1_1AssessmentRunInProgressExceptionResponse(parsedOutput, context)),
835
- name: errorCode,
836
- $metadata: deserializeMetadata(output),
837
- };
838
- break;
655
+ throw await deserializeAws_json1_1AssessmentRunInProgressExceptionResponse(parsedOutput, context);
839
656
  case "InternalException":
840
657
  case "com.amazonaws.inspector#InternalException":
841
- response = {
842
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
843
- name: errorCode,
844
- $metadata: deserializeMetadata(output),
845
- };
846
- break;
658
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
847
659
  case "InvalidInputException":
848
660
  case "com.amazonaws.inspector#InvalidInputException":
849
- response = {
850
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
851
- name: errorCode,
852
- $metadata: deserializeMetadata(output),
853
- };
854
- break;
661
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
855
662
  case "NoSuchEntityException":
856
663
  case "com.amazonaws.inspector#NoSuchEntityException":
857
- response = {
858
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
859
- name: errorCode,
860
- $metadata: deserializeMetadata(output),
861
- };
862
- break;
664
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
863
665
  case "ServiceTemporarilyUnavailableException":
864
666
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
865
- response = {
866
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
867
- name: errorCode,
868
- $metadata: deserializeMetadata(output),
869
- };
870
- break;
667
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
871
668
  default:
872
669
  const parsedBody = parsedOutput.body;
873
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
874
- response = {
875
- ...parsedBody,
876
- name: `${errorCode}`,
877
- message: parsedBody.message || parsedBody.Message || errorCode,
670
+ response = new InspectorServiceException_1.InspectorServiceException({
671
+ name: parsedBody.code || parsedBody.Code || errorCode,
878
672
  $fault: "client",
879
673
  $metadata: deserializeMetadata(output),
880
- };
674
+ });
675
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
881
676
  }
882
- const message = response.message || response.Message || errorCode;
883
- response.message = message;
884
- delete response.Message;
885
- return Promise.reject(Object.assign(new Error(message), response));
886
677
  };
887
678
  const deserializeAws_json1_1DeleteAssessmentTargetCommand = async (output, context) => {
888
679
  if (output.statusCode >= 300) {
@@ -906,67 +697,31 @@ const deserializeAws_json1_1DeleteAssessmentTargetCommandError = async (output,
906
697
  switch (errorCode) {
907
698
  case "AccessDeniedException":
908
699
  case "com.amazonaws.inspector#AccessDeniedException":
909
- response = {
910
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
911
- name: errorCode,
912
- $metadata: deserializeMetadata(output),
913
- };
914
- break;
700
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
915
701
  case "AssessmentRunInProgressException":
916
702
  case "com.amazonaws.inspector#AssessmentRunInProgressException":
917
- response = {
918
- ...(await deserializeAws_json1_1AssessmentRunInProgressExceptionResponse(parsedOutput, context)),
919
- name: errorCode,
920
- $metadata: deserializeMetadata(output),
921
- };
922
- break;
703
+ throw await deserializeAws_json1_1AssessmentRunInProgressExceptionResponse(parsedOutput, context);
923
704
  case "InternalException":
924
705
  case "com.amazonaws.inspector#InternalException":
925
- response = {
926
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
927
- name: errorCode,
928
- $metadata: deserializeMetadata(output),
929
- };
930
- break;
706
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
931
707
  case "InvalidInputException":
932
708
  case "com.amazonaws.inspector#InvalidInputException":
933
- response = {
934
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
935
- name: errorCode,
936
- $metadata: deserializeMetadata(output),
937
- };
938
- break;
709
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
939
710
  case "NoSuchEntityException":
940
711
  case "com.amazonaws.inspector#NoSuchEntityException":
941
- response = {
942
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
943
- name: errorCode,
944
- $metadata: deserializeMetadata(output),
945
- };
946
- break;
712
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
947
713
  case "ServiceTemporarilyUnavailableException":
948
714
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
949
- response = {
950
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
951
- name: errorCode,
952
- $metadata: deserializeMetadata(output),
953
- };
954
- break;
715
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
955
716
  default:
956
717
  const parsedBody = parsedOutput.body;
957
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
958
- response = {
959
- ...parsedBody,
960
- name: `${errorCode}`,
961
- message: parsedBody.message || parsedBody.Message || errorCode,
718
+ response = new InspectorServiceException_1.InspectorServiceException({
719
+ name: parsedBody.code || parsedBody.Code || errorCode,
962
720
  $fault: "client",
963
721
  $metadata: deserializeMetadata(output),
964
- };
722
+ });
723
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
965
724
  }
966
- const message = response.message || response.Message || errorCode;
967
- response.message = message;
968
- delete response.Message;
969
- return Promise.reject(Object.assign(new Error(message), response));
970
725
  };
971
726
  const deserializeAws_json1_1DeleteAssessmentTemplateCommand = async (output, context) => {
972
727
  if (output.statusCode >= 300) {
@@ -990,67 +745,31 @@ const deserializeAws_json1_1DeleteAssessmentTemplateCommandError = async (output
990
745
  switch (errorCode) {
991
746
  case "AccessDeniedException":
992
747
  case "com.amazonaws.inspector#AccessDeniedException":
993
- response = {
994
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
995
- name: errorCode,
996
- $metadata: deserializeMetadata(output),
997
- };
998
- break;
748
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
999
749
  case "AssessmentRunInProgressException":
1000
750
  case "com.amazonaws.inspector#AssessmentRunInProgressException":
1001
- response = {
1002
- ...(await deserializeAws_json1_1AssessmentRunInProgressExceptionResponse(parsedOutput, context)),
1003
- name: errorCode,
1004
- $metadata: deserializeMetadata(output),
1005
- };
1006
- break;
751
+ throw await deserializeAws_json1_1AssessmentRunInProgressExceptionResponse(parsedOutput, context);
1007
752
  case "InternalException":
1008
753
  case "com.amazonaws.inspector#InternalException":
1009
- response = {
1010
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1011
- name: errorCode,
1012
- $metadata: deserializeMetadata(output),
1013
- };
1014
- break;
754
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1015
755
  case "InvalidInputException":
1016
756
  case "com.amazonaws.inspector#InvalidInputException":
1017
- response = {
1018
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1019
- name: errorCode,
1020
- $metadata: deserializeMetadata(output),
1021
- };
1022
- break;
757
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1023
758
  case "NoSuchEntityException":
1024
759
  case "com.amazonaws.inspector#NoSuchEntityException":
1025
- response = {
1026
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
1027
- name: errorCode,
1028
- $metadata: deserializeMetadata(output),
1029
- };
1030
- break;
760
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
1031
761
  case "ServiceTemporarilyUnavailableException":
1032
762
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
1033
- response = {
1034
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
1035
- name: errorCode,
1036
- $metadata: deserializeMetadata(output),
1037
- };
1038
- break;
763
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
1039
764
  default:
1040
765
  const parsedBody = parsedOutput.body;
1041
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1042
- response = {
1043
- ...parsedBody,
1044
- name: `${errorCode}`,
1045
- message: parsedBody.message || parsedBody.Message || errorCode,
766
+ response = new InspectorServiceException_1.InspectorServiceException({
767
+ name: parsedBody.code || parsedBody.Code || errorCode,
1046
768
  $fault: "client",
1047
769
  $metadata: deserializeMetadata(output),
1048
- };
770
+ });
771
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1049
772
  }
1050
- const message = response.message || response.Message || errorCode;
1051
- response.message = message;
1052
- delete response.Message;
1053
- return Promise.reject(Object.assign(new Error(message), response));
1054
773
  };
1055
774
  const deserializeAws_json1_1DescribeAssessmentRunsCommand = async (output, context) => {
1056
775
  if (output.statusCode >= 300) {
@@ -1077,35 +796,19 @@ const deserializeAws_json1_1DescribeAssessmentRunsCommandError = async (output,
1077
796
  switch (errorCode) {
1078
797
  case "InternalException":
1079
798
  case "com.amazonaws.inspector#InternalException":
1080
- response = {
1081
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1082
- name: errorCode,
1083
- $metadata: deserializeMetadata(output),
1084
- };
1085
- break;
799
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1086
800
  case "InvalidInputException":
1087
801
  case "com.amazonaws.inspector#InvalidInputException":
1088
- response = {
1089
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1090
- name: errorCode,
1091
- $metadata: deserializeMetadata(output),
1092
- };
1093
- break;
802
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1094
803
  default:
1095
804
  const parsedBody = parsedOutput.body;
1096
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1097
- response = {
1098
- ...parsedBody,
1099
- name: `${errorCode}`,
1100
- message: parsedBody.message || parsedBody.Message || errorCode,
805
+ response = new InspectorServiceException_1.InspectorServiceException({
806
+ name: parsedBody.code || parsedBody.Code || errorCode,
1101
807
  $fault: "client",
1102
808
  $metadata: deserializeMetadata(output),
1103
- };
809
+ });
810
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1104
811
  }
1105
- const message = response.message || response.Message || errorCode;
1106
- response.message = message;
1107
- delete response.Message;
1108
- return Promise.reject(Object.assign(new Error(message), response));
1109
812
  };
1110
813
  const deserializeAws_json1_1DescribeAssessmentTargetsCommand = async (output, context) => {
1111
814
  if (output.statusCode >= 300) {
@@ -1132,35 +835,19 @@ const deserializeAws_json1_1DescribeAssessmentTargetsCommandError = async (outpu
1132
835
  switch (errorCode) {
1133
836
  case "InternalException":
1134
837
  case "com.amazonaws.inspector#InternalException":
1135
- response = {
1136
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1137
- name: errorCode,
1138
- $metadata: deserializeMetadata(output),
1139
- };
1140
- break;
838
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1141
839
  case "InvalidInputException":
1142
840
  case "com.amazonaws.inspector#InvalidInputException":
1143
- response = {
1144
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1145
- name: errorCode,
1146
- $metadata: deserializeMetadata(output),
1147
- };
1148
- break;
841
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1149
842
  default:
1150
843
  const parsedBody = parsedOutput.body;
1151
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1152
- response = {
1153
- ...parsedBody,
1154
- name: `${errorCode}`,
1155
- message: parsedBody.message || parsedBody.Message || errorCode,
844
+ response = new InspectorServiceException_1.InspectorServiceException({
845
+ name: parsedBody.code || parsedBody.Code || errorCode,
1156
846
  $fault: "client",
1157
847
  $metadata: deserializeMetadata(output),
1158
- };
848
+ });
849
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1159
850
  }
1160
- const message = response.message || response.Message || errorCode;
1161
- response.message = message;
1162
- delete response.Message;
1163
- return Promise.reject(Object.assign(new Error(message), response));
1164
851
  };
1165
852
  const deserializeAws_json1_1DescribeAssessmentTemplatesCommand = async (output, context) => {
1166
853
  if (output.statusCode >= 300) {
@@ -1187,35 +874,19 @@ const deserializeAws_json1_1DescribeAssessmentTemplatesCommandError = async (out
1187
874
  switch (errorCode) {
1188
875
  case "InternalException":
1189
876
  case "com.amazonaws.inspector#InternalException":
1190
- response = {
1191
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1192
- name: errorCode,
1193
- $metadata: deserializeMetadata(output),
1194
- };
1195
- break;
877
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1196
878
  case "InvalidInputException":
1197
879
  case "com.amazonaws.inspector#InvalidInputException":
1198
- response = {
1199
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1200
- name: errorCode,
1201
- $metadata: deserializeMetadata(output),
1202
- };
1203
- break;
880
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1204
881
  default:
1205
882
  const parsedBody = parsedOutput.body;
1206
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1207
- response = {
1208
- ...parsedBody,
1209
- name: `${errorCode}`,
1210
- message: parsedBody.message || parsedBody.Message || errorCode,
883
+ response = new InspectorServiceException_1.InspectorServiceException({
884
+ name: parsedBody.code || parsedBody.Code || errorCode,
1211
885
  $fault: "client",
1212
886
  $metadata: deserializeMetadata(output),
1213
- };
887
+ });
888
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1214
889
  }
1215
- const message = response.message || response.Message || errorCode;
1216
- response.message = message;
1217
- delete response.Message;
1218
- return Promise.reject(Object.assign(new Error(message), response));
1219
890
  };
1220
891
  const deserializeAws_json1_1DescribeCrossAccountAccessRoleCommand = async (output, context) => {
1221
892
  if (output.statusCode >= 300) {
@@ -1242,27 +913,16 @@ const deserializeAws_json1_1DescribeCrossAccountAccessRoleCommandError = async (
1242
913
  switch (errorCode) {
1243
914
  case "InternalException":
1244
915
  case "com.amazonaws.inspector#InternalException":
1245
- response = {
1246
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1247
- name: errorCode,
1248
- $metadata: deserializeMetadata(output),
1249
- };
1250
- break;
916
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1251
917
  default:
1252
918
  const parsedBody = parsedOutput.body;
1253
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1254
- response = {
1255
- ...parsedBody,
1256
- name: `${errorCode}`,
1257
- message: parsedBody.message || parsedBody.Message || errorCode,
919
+ response = new InspectorServiceException_1.InspectorServiceException({
920
+ name: parsedBody.code || parsedBody.Code || errorCode,
1258
921
  $fault: "client",
1259
922
  $metadata: deserializeMetadata(output),
1260
- };
923
+ });
924
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1261
925
  }
1262
- const message = response.message || response.Message || errorCode;
1263
- response.message = message;
1264
- delete response.Message;
1265
- return Promise.reject(Object.assign(new Error(message), response));
1266
926
  };
1267
927
  const deserializeAws_json1_1DescribeExclusionsCommand = async (output, context) => {
1268
928
  if (output.statusCode >= 300) {
@@ -1289,35 +949,19 @@ const deserializeAws_json1_1DescribeExclusionsCommandError = async (output, cont
1289
949
  switch (errorCode) {
1290
950
  case "InternalException":
1291
951
  case "com.amazonaws.inspector#InternalException":
1292
- response = {
1293
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1294
- name: errorCode,
1295
- $metadata: deserializeMetadata(output),
1296
- };
1297
- break;
952
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1298
953
  case "InvalidInputException":
1299
954
  case "com.amazonaws.inspector#InvalidInputException":
1300
- response = {
1301
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1302
- name: errorCode,
1303
- $metadata: deserializeMetadata(output),
1304
- };
1305
- break;
955
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1306
956
  default:
1307
957
  const parsedBody = parsedOutput.body;
1308
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1309
- response = {
1310
- ...parsedBody,
1311
- name: `${errorCode}`,
1312
- message: parsedBody.message || parsedBody.Message || errorCode,
958
+ response = new InspectorServiceException_1.InspectorServiceException({
959
+ name: parsedBody.code || parsedBody.Code || errorCode,
1313
960
  $fault: "client",
1314
961
  $metadata: deserializeMetadata(output),
1315
- };
962
+ });
963
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1316
964
  }
1317
- const message = response.message || response.Message || errorCode;
1318
- response.message = message;
1319
- delete response.Message;
1320
- return Promise.reject(Object.assign(new Error(message), response));
1321
965
  };
1322
966
  const deserializeAws_json1_1DescribeFindingsCommand = async (output, context) => {
1323
967
  if (output.statusCode >= 300) {
@@ -1344,35 +988,19 @@ const deserializeAws_json1_1DescribeFindingsCommandError = async (output, contex
1344
988
  switch (errorCode) {
1345
989
  case "InternalException":
1346
990
  case "com.amazonaws.inspector#InternalException":
1347
- response = {
1348
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1349
- name: errorCode,
1350
- $metadata: deserializeMetadata(output),
1351
- };
1352
- break;
991
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1353
992
  case "InvalidInputException":
1354
993
  case "com.amazonaws.inspector#InvalidInputException":
1355
- response = {
1356
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1357
- name: errorCode,
1358
- $metadata: deserializeMetadata(output),
1359
- };
1360
- break;
994
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1361
995
  default:
1362
996
  const parsedBody = parsedOutput.body;
1363
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1364
- response = {
1365
- ...parsedBody,
1366
- name: `${errorCode}`,
1367
- message: parsedBody.message || parsedBody.Message || errorCode,
997
+ response = new InspectorServiceException_1.InspectorServiceException({
998
+ name: parsedBody.code || parsedBody.Code || errorCode,
1368
999
  $fault: "client",
1369
1000
  $metadata: deserializeMetadata(output),
1370
- };
1001
+ });
1002
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1371
1003
  }
1372
- const message = response.message || response.Message || errorCode;
1373
- response.message = message;
1374
- delete response.Message;
1375
- return Promise.reject(Object.assign(new Error(message), response));
1376
1004
  };
1377
1005
  const deserializeAws_json1_1DescribeResourceGroupsCommand = async (output, context) => {
1378
1006
  if (output.statusCode >= 300) {
@@ -1399,35 +1027,19 @@ const deserializeAws_json1_1DescribeResourceGroupsCommandError = async (output,
1399
1027
  switch (errorCode) {
1400
1028
  case "InternalException":
1401
1029
  case "com.amazonaws.inspector#InternalException":
1402
- response = {
1403
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1404
- name: errorCode,
1405
- $metadata: deserializeMetadata(output),
1406
- };
1407
- break;
1030
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1408
1031
  case "InvalidInputException":
1409
1032
  case "com.amazonaws.inspector#InvalidInputException":
1410
- response = {
1411
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1412
- name: errorCode,
1413
- $metadata: deserializeMetadata(output),
1414
- };
1415
- break;
1033
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1416
1034
  default:
1417
1035
  const parsedBody = parsedOutput.body;
1418
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1419
- response = {
1420
- ...parsedBody,
1421
- name: `${errorCode}`,
1422
- message: parsedBody.message || parsedBody.Message || errorCode,
1036
+ response = new InspectorServiceException_1.InspectorServiceException({
1037
+ name: parsedBody.code || parsedBody.Code || errorCode,
1423
1038
  $fault: "client",
1424
1039
  $metadata: deserializeMetadata(output),
1425
- };
1040
+ });
1041
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1426
1042
  }
1427
- const message = response.message || response.Message || errorCode;
1428
- response.message = message;
1429
- delete response.Message;
1430
- return Promise.reject(Object.assign(new Error(message), response));
1431
1043
  };
1432
1044
  const deserializeAws_json1_1DescribeRulesPackagesCommand = async (output, context) => {
1433
1045
  if (output.statusCode >= 300) {
@@ -1454,35 +1066,19 @@ const deserializeAws_json1_1DescribeRulesPackagesCommandError = async (output, c
1454
1066
  switch (errorCode) {
1455
1067
  case "InternalException":
1456
1068
  case "com.amazonaws.inspector#InternalException":
1457
- response = {
1458
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1459
- name: errorCode,
1460
- $metadata: deserializeMetadata(output),
1461
- };
1462
- break;
1069
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1463
1070
  case "InvalidInputException":
1464
1071
  case "com.amazonaws.inspector#InvalidInputException":
1465
- response = {
1466
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1467
- name: errorCode,
1468
- $metadata: deserializeMetadata(output),
1469
- };
1470
- break;
1072
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1471
1073
  default:
1472
1074
  const parsedBody = parsedOutput.body;
1473
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1474
- response = {
1475
- ...parsedBody,
1476
- name: `${errorCode}`,
1477
- message: parsedBody.message || parsedBody.Message || errorCode,
1075
+ response = new InspectorServiceException_1.InspectorServiceException({
1076
+ name: parsedBody.code || parsedBody.Code || errorCode,
1478
1077
  $fault: "client",
1479
1078
  $metadata: deserializeMetadata(output),
1480
- };
1079
+ });
1080
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1481
1081
  }
1482
- const message = response.message || response.Message || errorCode;
1483
- response.message = message;
1484
- delete response.Message;
1485
- return Promise.reject(Object.assign(new Error(message), response));
1486
1082
  };
1487
1083
  const deserializeAws_json1_1GetAssessmentReportCommand = async (output, context) => {
1488
1084
  if (output.statusCode >= 300) {
@@ -1509,75 +1105,34 @@ const deserializeAws_json1_1GetAssessmentReportCommandError = async (output, con
1509
1105
  switch (errorCode) {
1510
1106
  case "AccessDeniedException":
1511
1107
  case "com.amazonaws.inspector#AccessDeniedException":
1512
- response = {
1513
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
1514
- name: errorCode,
1515
- $metadata: deserializeMetadata(output),
1516
- };
1517
- break;
1108
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1518
1109
  case "AssessmentRunInProgressException":
1519
1110
  case "com.amazonaws.inspector#AssessmentRunInProgressException":
1520
- response = {
1521
- ...(await deserializeAws_json1_1AssessmentRunInProgressExceptionResponse(parsedOutput, context)),
1522
- name: errorCode,
1523
- $metadata: deserializeMetadata(output),
1524
- };
1525
- break;
1111
+ throw await deserializeAws_json1_1AssessmentRunInProgressExceptionResponse(parsedOutput, context);
1526
1112
  case "InternalException":
1527
1113
  case "com.amazonaws.inspector#InternalException":
1528
- response = {
1529
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1530
- name: errorCode,
1531
- $metadata: deserializeMetadata(output),
1532
- };
1533
- break;
1114
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1534
1115
  case "InvalidInputException":
1535
1116
  case "com.amazonaws.inspector#InvalidInputException":
1536
- response = {
1537
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1538
- name: errorCode,
1539
- $metadata: deserializeMetadata(output),
1540
- };
1541
- break;
1117
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1542
1118
  case "NoSuchEntityException":
1543
1119
  case "com.amazonaws.inspector#NoSuchEntityException":
1544
- response = {
1545
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
1546
- name: errorCode,
1547
- $metadata: deserializeMetadata(output),
1548
- };
1549
- break;
1120
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
1550
1121
  case "ServiceTemporarilyUnavailableException":
1551
1122
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
1552
- response = {
1553
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
1554
- name: errorCode,
1555
- $metadata: deserializeMetadata(output),
1556
- };
1557
- break;
1123
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
1558
1124
  case "UnsupportedFeatureException":
1559
1125
  case "com.amazonaws.inspector#UnsupportedFeatureException":
1560
- response = {
1561
- ...(await deserializeAws_json1_1UnsupportedFeatureExceptionResponse(parsedOutput, context)),
1562
- name: errorCode,
1563
- $metadata: deserializeMetadata(output),
1564
- };
1565
- break;
1126
+ throw await deserializeAws_json1_1UnsupportedFeatureExceptionResponse(parsedOutput, context);
1566
1127
  default:
1567
1128
  const parsedBody = parsedOutput.body;
1568
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1569
- response = {
1570
- ...parsedBody,
1571
- name: `${errorCode}`,
1572
- message: parsedBody.message || parsedBody.Message || errorCode,
1129
+ response = new InspectorServiceException_1.InspectorServiceException({
1130
+ name: parsedBody.code || parsedBody.Code || errorCode,
1573
1131
  $fault: "client",
1574
1132
  $metadata: deserializeMetadata(output),
1575
- };
1133
+ });
1134
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1576
1135
  }
1577
- const message = response.message || response.Message || errorCode;
1578
- response.message = message;
1579
- delete response.Message;
1580
- return Promise.reject(Object.assign(new Error(message), response));
1581
1136
  };
1582
1137
  const deserializeAws_json1_1GetExclusionsPreviewCommand = async (output, context) => {
1583
1138
  if (output.statusCode >= 300) {
@@ -1604,51 +1159,25 @@ const deserializeAws_json1_1GetExclusionsPreviewCommandError = async (output, co
1604
1159
  switch (errorCode) {
1605
1160
  case "AccessDeniedException":
1606
1161
  case "com.amazonaws.inspector#AccessDeniedException":
1607
- response = {
1608
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
1609
- name: errorCode,
1610
- $metadata: deserializeMetadata(output),
1611
- };
1612
- break;
1162
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1613
1163
  case "InternalException":
1614
1164
  case "com.amazonaws.inspector#InternalException":
1615
- response = {
1616
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1617
- name: errorCode,
1618
- $metadata: deserializeMetadata(output),
1619
- };
1620
- break;
1165
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1621
1166
  case "InvalidInputException":
1622
1167
  case "com.amazonaws.inspector#InvalidInputException":
1623
- response = {
1624
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1625
- name: errorCode,
1626
- $metadata: deserializeMetadata(output),
1627
- };
1628
- break;
1168
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1629
1169
  case "NoSuchEntityException":
1630
1170
  case "com.amazonaws.inspector#NoSuchEntityException":
1631
- response = {
1632
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
1633
- name: errorCode,
1634
- $metadata: deserializeMetadata(output),
1635
- };
1636
- break;
1171
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
1637
1172
  default:
1638
1173
  const parsedBody = parsedOutput.body;
1639
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1640
- response = {
1641
- ...parsedBody,
1642
- name: `${errorCode}`,
1643
- message: parsedBody.message || parsedBody.Message || errorCode,
1174
+ response = new InspectorServiceException_1.InspectorServiceException({
1175
+ name: parsedBody.code || parsedBody.Code || errorCode,
1644
1176
  $fault: "client",
1645
1177
  $metadata: deserializeMetadata(output),
1646
- };
1178
+ });
1179
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1647
1180
  }
1648
- const message = response.message || response.Message || errorCode;
1649
- response.message = message;
1650
- delete response.Message;
1651
- return Promise.reject(Object.assign(new Error(message), response));
1652
1181
  };
1653
1182
  const deserializeAws_json1_1GetTelemetryMetadataCommand = async (output, context) => {
1654
1183
  if (output.statusCode >= 300) {
@@ -1675,51 +1204,25 @@ const deserializeAws_json1_1GetTelemetryMetadataCommandError = async (output, co
1675
1204
  switch (errorCode) {
1676
1205
  case "AccessDeniedException":
1677
1206
  case "com.amazonaws.inspector#AccessDeniedException":
1678
- response = {
1679
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
1680
- name: errorCode,
1681
- $metadata: deserializeMetadata(output),
1682
- };
1683
- break;
1207
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1684
1208
  case "InternalException":
1685
1209
  case "com.amazonaws.inspector#InternalException":
1686
- response = {
1687
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1688
- name: errorCode,
1689
- $metadata: deserializeMetadata(output),
1690
- };
1691
- break;
1210
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1692
1211
  case "InvalidInputException":
1693
1212
  case "com.amazonaws.inspector#InvalidInputException":
1694
- response = {
1695
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1696
- name: errorCode,
1697
- $metadata: deserializeMetadata(output),
1698
- };
1699
- break;
1213
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1700
1214
  case "NoSuchEntityException":
1701
1215
  case "com.amazonaws.inspector#NoSuchEntityException":
1702
- response = {
1703
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
1704
- name: errorCode,
1705
- $metadata: deserializeMetadata(output),
1706
- };
1707
- break;
1216
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
1708
1217
  default:
1709
1218
  const parsedBody = parsedOutput.body;
1710
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1711
- response = {
1712
- ...parsedBody,
1713
- name: `${errorCode}`,
1714
- message: parsedBody.message || parsedBody.Message || errorCode,
1219
+ response = new InspectorServiceException_1.InspectorServiceException({
1220
+ name: parsedBody.code || parsedBody.Code || errorCode,
1715
1221
  $fault: "client",
1716
1222
  $metadata: deserializeMetadata(output),
1717
- };
1223
+ });
1224
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1718
1225
  }
1719
- const message = response.message || response.Message || errorCode;
1720
- response.message = message;
1721
- delete response.Message;
1722
- return Promise.reject(Object.assign(new Error(message), response));
1723
1226
  };
1724
1227
  const deserializeAws_json1_1ListAssessmentRunAgentsCommand = async (output, context) => {
1725
1228
  if (output.statusCode >= 300) {
@@ -1746,51 +1249,25 @@ const deserializeAws_json1_1ListAssessmentRunAgentsCommandError = async (output,
1746
1249
  switch (errorCode) {
1747
1250
  case "AccessDeniedException":
1748
1251
  case "com.amazonaws.inspector#AccessDeniedException":
1749
- response = {
1750
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
1751
- name: errorCode,
1752
- $metadata: deserializeMetadata(output),
1753
- };
1754
- break;
1252
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1755
1253
  case "InternalException":
1756
1254
  case "com.amazonaws.inspector#InternalException":
1757
- response = {
1758
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1759
- name: errorCode,
1760
- $metadata: deserializeMetadata(output),
1761
- };
1762
- break;
1255
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1763
1256
  case "InvalidInputException":
1764
1257
  case "com.amazonaws.inspector#InvalidInputException":
1765
- response = {
1766
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1767
- name: errorCode,
1768
- $metadata: deserializeMetadata(output),
1769
- };
1770
- break;
1258
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1771
1259
  case "NoSuchEntityException":
1772
1260
  case "com.amazonaws.inspector#NoSuchEntityException":
1773
- response = {
1774
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
1775
- name: errorCode,
1776
- $metadata: deserializeMetadata(output),
1777
- };
1778
- break;
1261
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
1779
1262
  default:
1780
1263
  const parsedBody = parsedOutput.body;
1781
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1782
- response = {
1783
- ...parsedBody,
1784
- name: `${errorCode}`,
1785
- message: parsedBody.message || parsedBody.Message || errorCode,
1264
+ response = new InspectorServiceException_1.InspectorServiceException({
1265
+ name: parsedBody.code || parsedBody.Code || errorCode,
1786
1266
  $fault: "client",
1787
1267
  $metadata: deserializeMetadata(output),
1788
- };
1268
+ });
1269
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1789
1270
  }
1790
- const message = response.message || response.Message || errorCode;
1791
- response.message = message;
1792
- delete response.Message;
1793
- return Promise.reject(Object.assign(new Error(message), response));
1794
1271
  };
1795
1272
  const deserializeAws_json1_1ListAssessmentRunsCommand = async (output, context) => {
1796
1273
  if (output.statusCode >= 300) {
@@ -1817,51 +1294,25 @@ const deserializeAws_json1_1ListAssessmentRunsCommandError = async (output, cont
1817
1294
  switch (errorCode) {
1818
1295
  case "AccessDeniedException":
1819
1296
  case "com.amazonaws.inspector#AccessDeniedException":
1820
- response = {
1821
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
1822
- name: errorCode,
1823
- $metadata: deserializeMetadata(output),
1824
- };
1825
- break;
1297
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1826
1298
  case "InternalException":
1827
1299
  case "com.amazonaws.inspector#InternalException":
1828
- response = {
1829
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1830
- name: errorCode,
1831
- $metadata: deserializeMetadata(output),
1832
- };
1833
- break;
1300
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1834
1301
  case "InvalidInputException":
1835
1302
  case "com.amazonaws.inspector#InvalidInputException":
1836
- response = {
1837
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1838
- name: errorCode,
1839
- $metadata: deserializeMetadata(output),
1840
- };
1841
- break;
1303
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1842
1304
  case "NoSuchEntityException":
1843
1305
  case "com.amazonaws.inspector#NoSuchEntityException":
1844
- response = {
1845
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
1846
- name: errorCode,
1847
- $metadata: deserializeMetadata(output),
1848
- };
1849
- break;
1306
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
1850
1307
  default:
1851
1308
  const parsedBody = parsedOutput.body;
1852
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1853
- response = {
1854
- ...parsedBody,
1855
- name: `${errorCode}`,
1856
- message: parsedBody.message || parsedBody.Message || errorCode,
1309
+ response = new InspectorServiceException_1.InspectorServiceException({
1310
+ name: parsedBody.code || parsedBody.Code || errorCode,
1857
1311
  $fault: "client",
1858
1312
  $metadata: deserializeMetadata(output),
1859
- };
1313
+ });
1314
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1860
1315
  }
1861
- const message = response.message || response.Message || errorCode;
1862
- response.message = message;
1863
- delete response.Message;
1864
- return Promise.reject(Object.assign(new Error(message), response));
1865
1316
  };
1866
1317
  const deserializeAws_json1_1ListAssessmentTargetsCommand = async (output, context) => {
1867
1318
  if (output.statusCode >= 300) {
@@ -1888,43 +1339,22 @@ const deserializeAws_json1_1ListAssessmentTargetsCommandError = async (output, c
1888
1339
  switch (errorCode) {
1889
1340
  case "AccessDeniedException":
1890
1341
  case "com.amazonaws.inspector#AccessDeniedException":
1891
- response = {
1892
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
1893
- name: errorCode,
1894
- $metadata: deserializeMetadata(output),
1895
- };
1896
- break;
1342
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1897
1343
  case "InternalException":
1898
1344
  case "com.amazonaws.inspector#InternalException":
1899
- response = {
1900
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1901
- name: errorCode,
1902
- $metadata: deserializeMetadata(output),
1903
- };
1904
- break;
1345
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1905
1346
  case "InvalidInputException":
1906
1347
  case "com.amazonaws.inspector#InvalidInputException":
1907
- response = {
1908
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1909
- name: errorCode,
1910
- $metadata: deserializeMetadata(output),
1911
- };
1912
- break;
1348
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1913
1349
  default:
1914
1350
  const parsedBody = parsedOutput.body;
1915
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1916
- response = {
1917
- ...parsedBody,
1918
- name: `${errorCode}`,
1919
- message: parsedBody.message || parsedBody.Message || errorCode,
1351
+ response = new InspectorServiceException_1.InspectorServiceException({
1352
+ name: parsedBody.code || parsedBody.Code || errorCode,
1920
1353
  $fault: "client",
1921
1354
  $metadata: deserializeMetadata(output),
1922
- };
1355
+ });
1356
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1923
1357
  }
1924
- const message = response.message || response.Message || errorCode;
1925
- response.message = message;
1926
- delete response.Message;
1927
- return Promise.reject(Object.assign(new Error(message), response));
1928
1358
  };
1929
1359
  const deserializeAws_json1_1ListAssessmentTemplatesCommand = async (output, context) => {
1930
1360
  if (output.statusCode >= 300) {
@@ -1951,51 +1381,25 @@ const deserializeAws_json1_1ListAssessmentTemplatesCommandError = async (output,
1951
1381
  switch (errorCode) {
1952
1382
  case "AccessDeniedException":
1953
1383
  case "com.amazonaws.inspector#AccessDeniedException":
1954
- response = {
1955
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
1956
- name: errorCode,
1957
- $metadata: deserializeMetadata(output),
1958
- };
1959
- break;
1384
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1960
1385
  case "InternalException":
1961
1386
  case "com.amazonaws.inspector#InternalException":
1962
- response = {
1963
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
1964
- name: errorCode,
1965
- $metadata: deserializeMetadata(output),
1966
- };
1967
- break;
1387
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
1968
1388
  case "InvalidInputException":
1969
1389
  case "com.amazonaws.inspector#InvalidInputException":
1970
- response = {
1971
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1972
- name: errorCode,
1973
- $metadata: deserializeMetadata(output),
1974
- };
1975
- break;
1390
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
1976
1391
  case "NoSuchEntityException":
1977
1392
  case "com.amazonaws.inspector#NoSuchEntityException":
1978
- response = {
1979
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
1980
- name: errorCode,
1981
- $metadata: deserializeMetadata(output),
1982
- };
1983
- break;
1393
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
1984
1394
  default:
1985
1395
  const parsedBody = parsedOutput.body;
1986
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1987
- response = {
1988
- ...parsedBody,
1989
- name: `${errorCode}`,
1990
- message: parsedBody.message || parsedBody.Message || errorCode,
1396
+ response = new InspectorServiceException_1.InspectorServiceException({
1397
+ name: parsedBody.code || parsedBody.Code || errorCode,
1991
1398
  $fault: "client",
1992
1399
  $metadata: deserializeMetadata(output),
1993
- };
1400
+ });
1401
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1994
1402
  }
1995
- const message = response.message || response.Message || errorCode;
1996
- response.message = message;
1997
- delete response.Message;
1998
- return Promise.reject(Object.assign(new Error(message), response));
1999
1403
  };
2000
1404
  const deserializeAws_json1_1ListEventSubscriptionsCommand = async (output, context) => {
2001
1405
  if (output.statusCode >= 300) {
@@ -2022,51 +1426,25 @@ const deserializeAws_json1_1ListEventSubscriptionsCommandError = async (output,
2022
1426
  switch (errorCode) {
2023
1427
  case "AccessDeniedException":
2024
1428
  case "com.amazonaws.inspector#AccessDeniedException":
2025
- response = {
2026
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2027
- name: errorCode,
2028
- $metadata: deserializeMetadata(output),
2029
- };
2030
- break;
1429
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2031
1430
  case "InternalException":
2032
1431
  case "com.amazonaws.inspector#InternalException":
2033
- response = {
2034
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2035
- name: errorCode,
2036
- $metadata: deserializeMetadata(output),
2037
- };
2038
- break;
1432
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2039
1433
  case "InvalidInputException":
2040
1434
  case "com.amazonaws.inspector#InvalidInputException":
2041
- response = {
2042
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2043
- name: errorCode,
2044
- $metadata: deserializeMetadata(output),
2045
- };
2046
- break;
1435
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2047
1436
  case "NoSuchEntityException":
2048
1437
  case "com.amazonaws.inspector#NoSuchEntityException":
2049
- response = {
2050
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2051
- name: errorCode,
2052
- $metadata: deserializeMetadata(output),
2053
- };
2054
- break;
1438
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2055
1439
  default:
2056
1440
  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,
1441
+ response = new InspectorServiceException_1.InspectorServiceException({
1442
+ name: parsedBody.code || parsedBody.Code || errorCode,
2062
1443
  $fault: "client",
2063
1444
  $metadata: deserializeMetadata(output),
2064
- };
1445
+ });
1446
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2065
1447
  }
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
1448
  };
2071
1449
  const deserializeAws_json1_1ListExclusionsCommand = async (output, context) => {
2072
1450
  if (output.statusCode >= 300) {
@@ -2093,51 +1471,25 @@ const deserializeAws_json1_1ListExclusionsCommandError = async (output, context)
2093
1471
  switch (errorCode) {
2094
1472
  case "AccessDeniedException":
2095
1473
  case "com.amazonaws.inspector#AccessDeniedException":
2096
- response = {
2097
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2098
- name: errorCode,
2099
- $metadata: deserializeMetadata(output),
2100
- };
2101
- break;
1474
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2102
1475
  case "InternalException":
2103
1476
  case "com.amazonaws.inspector#InternalException":
2104
- response = {
2105
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2106
- name: errorCode,
2107
- $metadata: deserializeMetadata(output),
2108
- };
2109
- break;
1477
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2110
1478
  case "InvalidInputException":
2111
1479
  case "com.amazonaws.inspector#InvalidInputException":
2112
- response = {
2113
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2114
- name: errorCode,
2115
- $metadata: deserializeMetadata(output),
2116
- };
2117
- break;
1480
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2118
1481
  case "NoSuchEntityException":
2119
1482
  case "com.amazonaws.inspector#NoSuchEntityException":
2120
- response = {
2121
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2122
- name: errorCode,
2123
- $metadata: deserializeMetadata(output),
2124
- };
2125
- break;
1483
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2126
1484
  default:
2127
1485
  const parsedBody = parsedOutput.body;
2128
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2129
- response = {
2130
- ...parsedBody,
2131
- name: `${errorCode}`,
2132
- message: parsedBody.message || parsedBody.Message || errorCode,
1486
+ response = new InspectorServiceException_1.InspectorServiceException({
1487
+ name: parsedBody.code || parsedBody.Code || errorCode,
2133
1488
  $fault: "client",
2134
1489
  $metadata: deserializeMetadata(output),
2135
- };
1490
+ });
1491
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2136
1492
  }
2137
- const message = response.message || response.Message || errorCode;
2138
- response.message = message;
2139
- delete response.Message;
2140
- return Promise.reject(Object.assign(new Error(message), response));
2141
1493
  };
2142
1494
  const deserializeAws_json1_1ListFindingsCommand = async (output, context) => {
2143
1495
  if (output.statusCode >= 300) {
@@ -2164,51 +1516,25 @@ const deserializeAws_json1_1ListFindingsCommandError = async (output, context) =
2164
1516
  switch (errorCode) {
2165
1517
  case "AccessDeniedException":
2166
1518
  case "com.amazonaws.inspector#AccessDeniedException":
2167
- response = {
2168
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2169
- name: errorCode,
2170
- $metadata: deserializeMetadata(output),
2171
- };
2172
- break;
1519
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2173
1520
  case "InternalException":
2174
1521
  case "com.amazonaws.inspector#InternalException":
2175
- response = {
2176
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2177
- name: errorCode,
2178
- $metadata: deserializeMetadata(output),
2179
- };
2180
- break;
1522
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2181
1523
  case "InvalidInputException":
2182
1524
  case "com.amazonaws.inspector#InvalidInputException":
2183
- response = {
2184
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2185
- name: errorCode,
2186
- $metadata: deserializeMetadata(output),
2187
- };
2188
- break;
1525
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2189
1526
  case "NoSuchEntityException":
2190
1527
  case "com.amazonaws.inspector#NoSuchEntityException":
2191
- response = {
2192
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2193
- name: errorCode,
2194
- $metadata: deserializeMetadata(output),
2195
- };
2196
- break;
1528
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2197
1529
  default:
2198
1530
  const parsedBody = parsedOutput.body;
2199
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2200
- response = {
2201
- ...parsedBody,
2202
- name: `${errorCode}`,
2203
- message: parsedBody.message || parsedBody.Message || errorCode,
1531
+ response = new InspectorServiceException_1.InspectorServiceException({
1532
+ name: parsedBody.code || parsedBody.Code || errorCode,
2204
1533
  $fault: "client",
2205
1534
  $metadata: deserializeMetadata(output),
2206
- };
1535
+ });
1536
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2207
1537
  }
2208
- const message = response.message || response.Message || errorCode;
2209
- response.message = message;
2210
- delete response.Message;
2211
- return Promise.reject(Object.assign(new Error(message), response));
2212
1538
  };
2213
1539
  const deserializeAws_json1_1ListRulesPackagesCommand = async (output, context) => {
2214
1540
  if (output.statusCode >= 300) {
@@ -2235,43 +1561,22 @@ const deserializeAws_json1_1ListRulesPackagesCommandError = async (output, conte
2235
1561
  switch (errorCode) {
2236
1562
  case "AccessDeniedException":
2237
1563
  case "com.amazonaws.inspector#AccessDeniedException":
2238
- response = {
2239
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2240
- name: errorCode,
2241
- $metadata: deserializeMetadata(output),
2242
- };
2243
- break;
1564
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2244
1565
  case "InternalException":
2245
1566
  case "com.amazonaws.inspector#InternalException":
2246
- response = {
2247
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2248
- name: errorCode,
2249
- $metadata: deserializeMetadata(output),
2250
- };
2251
- break;
1567
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2252
1568
  case "InvalidInputException":
2253
1569
  case "com.amazonaws.inspector#InvalidInputException":
2254
- response = {
2255
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2256
- name: errorCode,
2257
- $metadata: deserializeMetadata(output),
2258
- };
2259
- break;
1570
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2260
1571
  default:
2261
1572
  const parsedBody = parsedOutput.body;
2262
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2263
- response = {
2264
- ...parsedBody,
2265
- name: `${errorCode}`,
2266
- message: parsedBody.message || parsedBody.Message || errorCode,
1573
+ response = new InspectorServiceException_1.InspectorServiceException({
1574
+ name: parsedBody.code || parsedBody.Code || errorCode,
2267
1575
  $fault: "client",
2268
1576
  $metadata: deserializeMetadata(output),
2269
- };
1577
+ });
1578
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2270
1579
  }
2271
- const message = response.message || response.Message || errorCode;
2272
- response.message = message;
2273
- delete response.Message;
2274
- return Promise.reject(Object.assign(new Error(message), response));
2275
1580
  };
2276
1581
  const deserializeAws_json1_1ListTagsForResourceCommand = async (output, context) => {
2277
1582
  if (output.statusCode >= 300) {
@@ -2298,51 +1603,25 @@ const deserializeAws_json1_1ListTagsForResourceCommandError = async (output, con
2298
1603
  switch (errorCode) {
2299
1604
  case "AccessDeniedException":
2300
1605
  case "com.amazonaws.inspector#AccessDeniedException":
2301
- response = {
2302
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2303
- name: errorCode,
2304
- $metadata: deserializeMetadata(output),
2305
- };
2306
- break;
1606
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2307
1607
  case "InternalException":
2308
1608
  case "com.amazonaws.inspector#InternalException":
2309
- response = {
2310
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2311
- name: errorCode,
2312
- $metadata: deserializeMetadata(output),
2313
- };
2314
- break;
1609
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2315
1610
  case "InvalidInputException":
2316
1611
  case "com.amazonaws.inspector#InvalidInputException":
2317
- response = {
2318
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2319
- name: errorCode,
2320
- $metadata: deserializeMetadata(output),
2321
- };
2322
- break;
1612
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2323
1613
  case "NoSuchEntityException":
2324
1614
  case "com.amazonaws.inspector#NoSuchEntityException":
2325
- response = {
2326
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2327
- name: errorCode,
2328
- $metadata: deserializeMetadata(output),
2329
- };
2330
- break;
1615
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2331
1616
  default:
2332
1617
  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,
1618
+ response = new InspectorServiceException_1.InspectorServiceException({
1619
+ name: parsedBody.code || parsedBody.Code || errorCode,
2338
1620
  $fault: "client",
2339
1621
  $metadata: deserializeMetadata(output),
2340
- };
1622
+ });
1623
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2341
1624
  }
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
1625
  };
2347
1626
  const deserializeAws_json1_1PreviewAgentsCommand = async (output, context) => {
2348
1627
  if (output.statusCode >= 300) {
@@ -2369,59 +1648,28 @@ const deserializeAws_json1_1PreviewAgentsCommandError = async (output, context)
2369
1648
  switch (errorCode) {
2370
1649
  case "AccessDeniedException":
2371
1650
  case "com.amazonaws.inspector#AccessDeniedException":
2372
- response = {
2373
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2374
- name: errorCode,
2375
- $metadata: deserializeMetadata(output),
2376
- };
2377
- break;
1651
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2378
1652
  case "InternalException":
2379
1653
  case "com.amazonaws.inspector#InternalException":
2380
- response = {
2381
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2382
- name: errorCode,
2383
- $metadata: deserializeMetadata(output),
2384
- };
2385
- break;
1654
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2386
1655
  case "InvalidCrossAccountRoleException":
2387
1656
  case "com.amazonaws.inspector#InvalidCrossAccountRoleException":
2388
- response = {
2389
- ...(await deserializeAws_json1_1InvalidCrossAccountRoleExceptionResponse(parsedOutput, context)),
2390
- name: errorCode,
2391
- $metadata: deserializeMetadata(output),
2392
- };
2393
- break;
1657
+ throw await deserializeAws_json1_1InvalidCrossAccountRoleExceptionResponse(parsedOutput, context);
2394
1658
  case "InvalidInputException":
2395
1659
  case "com.amazonaws.inspector#InvalidInputException":
2396
- response = {
2397
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2398
- name: errorCode,
2399
- $metadata: deserializeMetadata(output),
2400
- };
2401
- break;
1660
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2402
1661
  case "NoSuchEntityException":
2403
1662
  case "com.amazonaws.inspector#NoSuchEntityException":
2404
- response = {
2405
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2406
- name: errorCode,
2407
- $metadata: deserializeMetadata(output),
2408
- };
2409
- break;
1663
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2410
1664
  default:
2411
1665
  const parsedBody = parsedOutput.body;
2412
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2413
- response = {
2414
- ...parsedBody,
2415
- name: `${errorCode}`,
2416
- message: parsedBody.message || parsedBody.Message || errorCode,
1666
+ response = new InspectorServiceException_1.InspectorServiceException({
1667
+ name: parsedBody.code || parsedBody.Code || errorCode,
2417
1668
  $fault: "client",
2418
1669
  $metadata: deserializeMetadata(output),
2419
- };
1670
+ });
1671
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2420
1672
  }
2421
- const message = response.message || response.Message || errorCode;
2422
- response.message = message;
2423
- delete response.Message;
2424
- return Promise.reject(Object.assign(new Error(message), response));
2425
1673
  };
2426
1674
  const deserializeAws_json1_1RegisterCrossAccountAccessRoleCommand = async (output, context) => {
2427
1675
  if (output.statusCode >= 300) {
@@ -2445,59 +1693,28 @@ const deserializeAws_json1_1RegisterCrossAccountAccessRoleCommandError = async (
2445
1693
  switch (errorCode) {
2446
1694
  case "AccessDeniedException":
2447
1695
  case "com.amazonaws.inspector#AccessDeniedException":
2448
- response = {
2449
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2450
- name: errorCode,
2451
- $metadata: deserializeMetadata(output),
2452
- };
2453
- break;
1696
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2454
1697
  case "InternalException":
2455
1698
  case "com.amazonaws.inspector#InternalException":
2456
- response = {
2457
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2458
- name: errorCode,
2459
- $metadata: deserializeMetadata(output),
2460
- };
2461
- break;
1699
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2462
1700
  case "InvalidCrossAccountRoleException":
2463
1701
  case "com.amazonaws.inspector#InvalidCrossAccountRoleException":
2464
- response = {
2465
- ...(await deserializeAws_json1_1InvalidCrossAccountRoleExceptionResponse(parsedOutput, context)),
2466
- name: errorCode,
2467
- $metadata: deserializeMetadata(output),
2468
- };
2469
- break;
1702
+ throw await deserializeAws_json1_1InvalidCrossAccountRoleExceptionResponse(parsedOutput, context);
2470
1703
  case "InvalidInputException":
2471
1704
  case "com.amazonaws.inspector#InvalidInputException":
2472
- response = {
2473
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2474
- name: errorCode,
2475
- $metadata: deserializeMetadata(output),
2476
- };
2477
- break;
1705
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2478
1706
  case "ServiceTemporarilyUnavailableException":
2479
1707
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
2480
- response = {
2481
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
2482
- name: errorCode,
2483
- $metadata: deserializeMetadata(output),
2484
- };
2485
- break;
1708
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
2486
1709
  default:
2487
1710
  const parsedBody = parsedOutput.body;
2488
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2489
- response = {
2490
- ...parsedBody,
2491
- name: `${errorCode}`,
2492
- message: parsedBody.message || parsedBody.Message || errorCode,
1711
+ response = new InspectorServiceException_1.InspectorServiceException({
1712
+ name: parsedBody.code || parsedBody.Code || errorCode,
2493
1713
  $fault: "client",
2494
1714
  $metadata: deserializeMetadata(output),
2495
- };
1715
+ });
1716
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2496
1717
  }
2497
- const message = response.message || response.Message || errorCode;
2498
- response.message = message;
2499
- delete response.Message;
2500
- return Promise.reject(Object.assign(new Error(message), response));
2501
1718
  };
2502
1719
  const deserializeAws_json1_1RemoveAttributesFromFindingsCommand = async (output, context) => {
2503
1720
  if (output.statusCode >= 300) {
@@ -2524,59 +1741,28 @@ const deserializeAws_json1_1RemoveAttributesFromFindingsCommandError = async (ou
2524
1741
  switch (errorCode) {
2525
1742
  case "AccessDeniedException":
2526
1743
  case "com.amazonaws.inspector#AccessDeniedException":
2527
- response = {
2528
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2529
- name: errorCode,
2530
- $metadata: deserializeMetadata(output),
2531
- };
2532
- break;
1744
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2533
1745
  case "InternalException":
2534
1746
  case "com.amazonaws.inspector#InternalException":
2535
- response = {
2536
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2537
- name: errorCode,
2538
- $metadata: deserializeMetadata(output),
2539
- };
2540
- break;
1747
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2541
1748
  case "InvalidInputException":
2542
1749
  case "com.amazonaws.inspector#InvalidInputException":
2543
- response = {
2544
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2545
- name: errorCode,
2546
- $metadata: deserializeMetadata(output),
2547
- };
2548
- break;
1750
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2549
1751
  case "NoSuchEntityException":
2550
1752
  case "com.amazonaws.inspector#NoSuchEntityException":
2551
- response = {
2552
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2553
- name: errorCode,
2554
- $metadata: deserializeMetadata(output),
2555
- };
2556
- break;
1753
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2557
1754
  case "ServiceTemporarilyUnavailableException":
2558
1755
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
2559
- response = {
2560
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
2561
- name: errorCode,
2562
- $metadata: deserializeMetadata(output),
2563
- };
2564
- break;
1756
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
2565
1757
  default:
2566
1758
  const parsedBody = parsedOutput.body;
2567
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2568
- response = {
2569
- ...parsedBody,
2570
- name: `${errorCode}`,
2571
- message: parsedBody.message || parsedBody.Message || errorCode,
1759
+ response = new InspectorServiceException_1.InspectorServiceException({
1760
+ name: parsedBody.code || parsedBody.Code || errorCode,
2572
1761
  $fault: "client",
2573
1762
  $metadata: deserializeMetadata(output),
2574
- };
1763
+ });
1764
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2575
1765
  }
2576
- const message = response.message || response.Message || errorCode;
2577
- response.message = message;
2578
- delete response.Message;
2579
- return Promise.reject(Object.assign(new Error(message), response));
2580
1766
  };
2581
1767
  const deserializeAws_json1_1SetTagsForResourceCommand = async (output, context) => {
2582
1768
  if (output.statusCode >= 300) {
@@ -2600,59 +1786,28 @@ const deserializeAws_json1_1SetTagsForResourceCommandError = async (output, cont
2600
1786
  switch (errorCode) {
2601
1787
  case "AccessDeniedException":
2602
1788
  case "com.amazonaws.inspector#AccessDeniedException":
2603
- response = {
2604
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2605
- name: errorCode,
2606
- $metadata: deserializeMetadata(output),
2607
- };
2608
- break;
1789
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2609
1790
  case "InternalException":
2610
1791
  case "com.amazonaws.inspector#InternalException":
2611
- response = {
2612
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2613
- name: errorCode,
2614
- $metadata: deserializeMetadata(output),
2615
- };
2616
- break;
1792
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2617
1793
  case "InvalidInputException":
2618
1794
  case "com.amazonaws.inspector#InvalidInputException":
2619
- response = {
2620
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2621
- name: errorCode,
2622
- $metadata: deserializeMetadata(output),
2623
- };
2624
- break;
1795
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2625
1796
  case "NoSuchEntityException":
2626
1797
  case "com.amazonaws.inspector#NoSuchEntityException":
2627
- response = {
2628
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2629
- name: errorCode,
2630
- $metadata: deserializeMetadata(output),
2631
- };
2632
- break;
1798
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2633
1799
  case "ServiceTemporarilyUnavailableException":
2634
1800
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
2635
- response = {
2636
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
2637
- name: errorCode,
2638
- $metadata: deserializeMetadata(output),
2639
- };
2640
- break;
1801
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
2641
1802
  default:
2642
1803
  const parsedBody = parsedOutput.body;
2643
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2644
- response = {
2645
- ...parsedBody,
2646
- name: `${errorCode}`,
2647
- message: parsedBody.message || parsedBody.Message || errorCode,
1804
+ response = new InspectorServiceException_1.InspectorServiceException({
1805
+ name: parsedBody.code || parsedBody.Code || errorCode,
2648
1806
  $fault: "client",
2649
1807
  $metadata: deserializeMetadata(output),
2650
- };
1808
+ });
1809
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2651
1810
  }
2652
- const message = response.message || response.Message || errorCode;
2653
- response.message = message;
2654
- delete response.Message;
2655
- return Promise.reject(Object.assign(new Error(message), response));
2656
1811
  };
2657
1812
  const deserializeAws_json1_1StartAssessmentRunCommand = async (output, context) => {
2658
1813
  if (output.statusCode >= 300) {
@@ -2679,83 +1834,37 @@ const deserializeAws_json1_1StartAssessmentRunCommandError = async (output, cont
2679
1834
  switch (errorCode) {
2680
1835
  case "AccessDeniedException":
2681
1836
  case "com.amazonaws.inspector#AccessDeniedException":
2682
- response = {
2683
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2684
- name: errorCode,
2685
- $metadata: deserializeMetadata(output),
2686
- };
2687
- break;
1837
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2688
1838
  case "AgentsAlreadyRunningAssessmentException":
2689
1839
  case "com.amazonaws.inspector#AgentsAlreadyRunningAssessmentException":
2690
- response = {
2691
- ...(await deserializeAws_json1_1AgentsAlreadyRunningAssessmentExceptionResponse(parsedOutput, context)),
2692
- name: errorCode,
2693
- $metadata: deserializeMetadata(output),
2694
- };
2695
- break;
1840
+ throw await deserializeAws_json1_1AgentsAlreadyRunningAssessmentExceptionResponse(parsedOutput, context);
2696
1841
  case "InternalException":
2697
1842
  case "com.amazonaws.inspector#InternalException":
2698
- response = {
2699
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2700
- name: errorCode,
2701
- $metadata: deserializeMetadata(output),
2702
- };
2703
- break;
1843
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2704
1844
  case "InvalidCrossAccountRoleException":
2705
1845
  case "com.amazonaws.inspector#InvalidCrossAccountRoleException":
2706
- response = {
2707
- ...(await deserializeAws_json1_1InvalidCrossAccountRoleExceptionResponse(parsedOutput, context)),
2708
- name: errorCode,
2709
- $metadata: deserializeMetadata(output),
2710
- };
2711
- break;
1846
+ throw await deserializeAws_json1_1InvalidCrossAccountRoleExceptionResponse(parsedOutput, context);
2712
1847
  case "InvalidInputException":
2713
1848
  case "com.amazonaws.inspector#InvalidInputException":
2714
- response = {
2715
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2716
- name: errorCode,
2717
- $metadata: deserializeMetadata(output),
2718
- };
2719
- break;
1849
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2720
1850
  case "LimitExceededException":
2721
1851
  case "com.amazonaws.inspector#LimitExceededException":
2722
- response = {
2723
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2724
- name: errorCode,
2725
- $metadata: deserializeMetadata(output),
2726
- };
2727
- break;
1852
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2728
1853
  case "NoSuchEntityException":
2729
1854
  case "com.amazonaws.inspector#NoSuchEntityException":
2730
- response = {
2731
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2732
- name: errorCode,
2733
- $metadata: deserializeMetadata(output),
2734
- };
2735
- break;
1855
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2736
1856
  case "ServiceTemporarilyUnavailableException":
2737
1857
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
2738
- response = {
2739
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
2740
- name: errorCode,
2741
- $metadata: deserializeMetadata(output),
2742
- };
2743
- break;
1858
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
2744
1859
  default:
2745
1860
  const parsedBody = parsedOutput.body;
2746
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2747
- response = {
2748
- ...parsedBody,
2749
- name: `${errorCode}`,
2750
- message: parsedBody.message || parsedBody.Message || errorCode,
1861
+ response = new InspectorServiceException_1.InspectorServiceException({
1862
+ name: parsedBody.code || parsedBody.Code || errorCode,
2751
1863
  $fault: "client",
2752
1864
  $metadata: deserializeMetadata(output),
2753
- };
1865
+ });
1866
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2754
1867
  }
2755
- const message = response.message || response.Message || errorCode;
2756
- response.message = message;
2757
- delete response.Message;
2758
- return Promise.reject(Object.assign(new Error(message), response));
2759
1868
  };
2760
1869
  const deserializeAws_json1_1StopAssessmentRunCommand = async (output, context) => {
2761
1870
  if (output.statusCode >= 300) {
@@ -2779,59 +1888,28 @@ const deserializeAws_json1_1StopAssessmentRunCommandError = async (output, conte
2779
1888
  switch (errorCode) {
2780
1889
  case "AccessDeniedException":
2781
1890
  case "com.amazonaws.inspector#AccessDeniedException":
2782
- response = {
2783
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2784
- name: errorCode,
2785
- $metadata: deserializeMetadata(output),
2786
- };
2787
- break;
1891
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2788
1892
  case "InternalException":
2789
1893
  case "com.amazonaws.inspector#InternalException":
2790
- response = {
2791
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2792
- name: errorCode,
2793
- $metadata: deserializeMetadata(output),
2794
- };
2795
- break;
1894
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2796
1895
  case "InvalidInputException":
2797
1896
  case "com.amazonaws.inspector#InvalidInputException":
2798
- response = {
2799
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2800
- name: errorCode,
2801
- $metadata: deserializeMetadata(output),
2802
- };
2803
- break;
1897
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2804
1898
  case "NoSuchEntityException":
2805
1899
  case "com.amazonaws.inspector#NoSuchEntityException":
2806
- response = {
2807
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2808
- name: errorCode,
2809
- $metadata: deserializeMetadata(output),
2810
- };
2811
- break;
1900
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2812
1901
  case "ServiceTemporarilyUnavailableException":
2813
1902
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
2814
- response = {
2815
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
2816
- name: errorCode,
2817
- $metadata: deserializeMetadata(output),
2818
- };
2819
- break;
1903
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
2820
1904
  default:
2821
1905
  const parsedBody = parsedOutput.body;
2822
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2823
- response = {
2824
- ...parsedBody,
2825
- name: `${errorCode}`,
2826
- message: parsedBody.message || parsedBody.Message || errorCode,
1906
+ response = new InspectorServiceException_1.InspectorServiceException({
1907
+ name: parsedBody.code || parsedBody.Code || errorCode,
2827
1908
  $fault: "client",
2828
1909
  $metadata: deserializeMetadata(output),
2829
- };
1910
+ });
1911
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2830
1912
  }
2831
- const message = response.message || response.Message || errorCode;
2832
- response.message = message;
2833
- delete response.Message;
2834
- return Promise.reject(Object.assign(new Error(message), response));
2835
1913
  };
2836
1914
  const deserializeAws_json1_1SubscribeToEventCommand = async (output, context) => {
2837
1915
  if (output.statusCode >= 300) {
@@ -2855,67 +1933,31 @@ const deserializeAws_json1_1SubscribeToEventCommandError = async (output, contex
2855
1933
  switch (errorCode) {
2856
1934
  case "AccessDeniedException":
2857
1935
  case "com.amazonaws.inspector#AccessDeniedException":
2858
- response = {
2859
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2860
- name: errorCode,
2861
- $metadata: deserializeMetadata(output),
2862
- };
2863
- break;
1936
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2864
1937
  case "InternalException":
2865
1938
  case "com.amazonaws.inspector#InternalException":
2866
- response = {
2867
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2868
- name: errorCode,
2869
- $metadata: deserializeMetadata(output),
2870
- };
2871
- break;
1939
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2872
1940
  case "InvalidInputException":
2873
1941
  case "com.amazonaws.inspector#InvalidInputException":
2874
- response = {
2875
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2876
- name: errorCode,
2877
- $metadata: deserializeMetadata(output),
2878
- };
2879
- break;
1942
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2880
1943
  case "LimitExceededException":
2881
1944
  case "com.amazonaws.inspector#LimitExceededException":
2882
- response = {
2883
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2884
- name: errorCode,
2885
- $metadata: deserializeMetadata(output),
2886
- };
2887
- break;
1945
+ throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context);
2888
1946
  case "NoSuchEntityException":
2889
1947
  case "com.amazonaws.inspector#NoSuchEntityException":
2890
- response = {
2891
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2892
- name: errorCode,
2893
- $metadata: deserializeMetadata(output),
2894
- };
2895
- break;
1948
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2896
1949
  case "ServiceTemporarilyUnavailableException":
2897
1950
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
2898
- response = {
2899
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
2900
- name: errorCode,
2901
- $metadata: deserializeMetadata(output),
2902
- };
2903
- break;
1951
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
2904
1952
  default:
2905
1953
  const parsedBody = parsedOutput.body;
2906
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2907
- response = {
2908
- ...parsedBody,
2909
- name: `${errorCode}`,
2910
- message: parsedBody.message || parsedBody.Message || errorCode,
1954
+ response = new InspectorServiceException_1.InspectorServiceException({
1955
+ name: parsedBody.code || parsedBody.Code || errorCode,
2911
1956
  $fault: "client",
2912
1957
  $metadata: deserializeMetadata(output),
2913
- };
1958
+ });
1959
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2914
1960
  }
2915
- const message = response.message || response.Message || errorCode;
2916
- response.message = message;
2917
- delete response.Message;
2918
- return Promise.reject(Object.assign(new Error(message), response));
2919
1961
  };
2920
1962
  const deserializeAws_json1_1UnsubscribeFromEventCommand = async (output, context) => {
2921
1963
  if (output.statusCode >= 300) {
@@ -2939,59 +1981,28 @@ const deserializeAws_json1_1UnsubscribeFromEventCommandError = async (output, co
2939
1981
  switch (errorCode) {
2940
1982
  case "AccessDeniedException":
2941
1983
  case "com.amazonaws.inspector#AccessDeniedException":
2942
- response = {
2943
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
2944
- name: errorCode,
2945
- $metadata: deserializeMetadata(output),
2946
- };
2947
- break;
1984
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
2948
1985
  case "InternalException":
2949
1986
  case "com.amazonaws.inspector#InternalException":
2950
- response = {
2951
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
2952
- name: errorCode,
2953
- $metadata: deserializeMetadata(output),
2954
- };
2955
- break;
1987
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
2956
1988
  case "InvalidInputException":
2957
1989
  case "com.amazonaws.inspector#InvalidInputException":
2958
- response = {
2959
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2960
- name: errorCode,
2961
- $metadata: deserializeMetadata(output),
2962
- };
2963
- break;
1990
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
2964
1991
  case "NoSuchEntityException":
2965
1992
  case "com.amazonaws.inspector#NoSuchEntityException":
2966
- response = {
2967
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
2968
- name: errorCode,
2969
- $metadata: deserializeMetadata(output),
2970
- };
2971
- break;
1993
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
2972
1994
  case "ServiceTemporarilyUnavailableException":
2973
1995
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
2974
- response = {
2975
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
2976
- name: errorCode,
2977
- $metadata: deserializeMetadata(output),
2978
- };
2979
- break;
1996
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
2980
1997
  default:
2981
1998
  const parsedBody = parsedOutput.body;
2982
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2983
- response = {
2984
- ...parsedBody,
2985
- name: `${errorCode}`,
2986
- message: parsedBody.message || parsedBody.Message || errorCode,
1999
+ response = new InspectorServiceException_1.InspectorServiceException({
2000
+ name: parsedBody.code || parsedBody.Code || errorCode,
2987
2001
  $fault: "client",
2988
2002
  $metadata: deserializeMetadata(output),
2989
- };
2003
+ });
2004
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2990
2005
  }
2991
- const message = response.message || response.Message || errorCode;
2992
- response.message = message;
2993
- delete response.Message;
2994
- return Promise.reject(Object.assign(new Error(message), response));
2995
2006
  };
2996
2007
  const deserializeAws_json1_1UpdateAssessmentTargetCommand = async (output, context) => {
2997
2008
  if (output.statusCode >= 300) {
@@ -3015,180 +2026,127 @@ const deserializeAws_json1_1UpdateAssessmentTargetCommandError = async (output,
3015
2026
  switch (errorCode) {
3016
2027
  case "AccessDeniedException":
3017
2028
  case "com.amazonaws.inspector#AccessDeniedException":
3018
- response = {
3019
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
3020
- name: errorCode,
3021
- $metadata: deserializeMetadata(output),
3022
- };
3023
- break;
2029
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
3024
2030
  case "InternalException":
3025
2031
  case "com.amazonaws.inspector#InternalException":
3026
- response = {
3027
- ...(await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context)),
3028
- name: errorCode,
3029
- $metadata: deserializeMetadata(output),
3030
- };
3031
- break;
2032
+ throw await deserializeAws_json1_1InternalExceptionResponse(parsedOutput, context);
3032
2033
  case "InvalidInputException":
3033
2034
  case "com.amazonaws.inspector#InvalidInputException":
3034
- response = {
3035
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
3036
- name: errorCode,
3037
- $metadata: deserializeMetadata(output),
3038
- };
3039
- break;
2035
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
3040
2036
  case "NoSuchEntityException":
3041
2037
  case "com.amazonaws.inspector#NoSuchEntityException":
3042
- response = {
3043
- ...(await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context)),
3044
- name: errorCode,
3045
- $metadata: deserializeMetadata(output),
3046
- };
3047
- break;
2038
+ throw await deserializeAws_json1_1NoSuchEntityExceptionResponse(parsedOutput, context);
3048
2039
  case "ServiceTemporarilyUnavailableException":
3049
2040
  case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException":
3050
- response = {
3051
- ...(await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
3052
- name: errorCode,
3053
- $metadata: deserializeMetadata(output),
3054
- };
3055
- break;
2041
+ throw await deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse(parsedOutput, context);
3056
2042
  default:
3057
2043
  const parsedBody = parsedOutput.body;
3058
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3059
- response = {
3060
- ...parsedBody,
3061
- name: `${errorCode}`,
3062
- message: parsedBody.message || parsedBody.Message || errorCode,
2044
+ response = new InspectorServiceException_1.InspectorServiceException({
2045
+ name: parsedBody.code || parsedBody.Code || errorCode,
3063
2046
  $fault: "client",
3064
2047
  $metadata: deserializeMetadata(output),
3065
- };
2048
+ });
2049
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3066
2050
  }
3067
- const message = response.message || response.Message || errorCode;
3068
- response.message = message;
3069
- delete response.Message;
3070
- return Promise.reject(Object.assign(new Error(message), response));
3071
2051
  };
3072
2052
  const deserializeAws_json1_1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
3073
2053
  const body = parsedOutput.body;
3074
2054
  const deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
3075
- const contents = {
3076
- name: "AccessDeniedException",
3077
- $fault: "client",
2055
+ const exception = new models_0_1.AccessDeniedException({
3078
2056
  $metadata: deserializeMetadata(parsedOutput),
3079
2057
  ...deserialized,
3080
- };
3081
- return contents;
2058
+ });
2059
+ return smithy_client_1.decorateServiceException(exception, body);
3082
2060
  };
3083
2061
  const deserializeAws_json1_1AgentsAlreadyRunningAssessmentExceptionResponse = async (parsedOutput, context) => {
3084
2062
  const body = parsedOutput.body;
3085
2063
  const deserialized = deserializeAws_json1_1AgentsAlreadyRunningAssessmentException(body, context);
3086
- const contents = {
3087
- name: "AgentsAlreadyRunningAssessmentException",
3088
- $fault: "client",
2064
+ const exception = new models_0_1.AgentsAlreadyRunningAssessmentException({
3089
2065
  $metadata: deserializeMetadata(parsedOutput),
3090
2066
  ...deserialized,
3091
- };
3092
- return contents;
2067
+ });
2068
+ return smithy_client_1.decorateServiceException(exception, body);
3093
2069
  };
3094
2070
  const deserializeAws_json1_1AssessmentRunInProgressExceptionResponse = async (parsedOutput, context) => {
3095
2071
  const body = parsedOutput.body;
3096
2072
  const deserialized = deserializeAws_json1_1AssessmentRunInProgressException(body, context);
3097
- const contents = {
3098
- name: "AssessmentRunInProgressException",
3099
- $fault: "client",
2073
+ const exception = new models_0_1.AssessmentRunInProgressException({
3100
2074
  $metadata: deserializeMetadata(parsedOutput),
3101
2075
  ...deserialized,
3102
- };
3103
- return contents;
2076
+ });
2077
+ return smithy_client_1.decorateServiceException(exception, body);
3104
2078
  };
3105
2079
  const deserializeAws_json1_1InternalExceptionResponse = async (parsedOutput, context) => {
3106
2080
  const body = parsedOutput.body;
3107
2081
  const deserialized = deserializeAws_json1_1InternalException(body, context);
3108
- const contents = {
3109
- name: "InternalException",
3110
- $fault: "server",
2082
+ const exception = new models_0_1.InternalException({
3111
2083
  $metadata: deserializeMetadata(parsedOutput),
3112
2084
  ...deserialized,
3113
- };
3114
- return contents;
2085
+ });
2086
+ return smithy_client_1.decorateServiceException(exception, body);
3115
2087
  };
3116
2088
  const deserializeAws_json1_1InvalidCrossAccountRoleExceptionResponse = async (parsedOutput, context) => {
3117
2089
  const body = parsedOutput.body;
3118
2090
  const deserialized = deserializeAws_json1_1InvalidCrossAccountRoleException(body, context);
3119
- const contents = {
3120
- name: "InvalidCrossAccountRoleException",
3121
- $fault: "client",
2091
+ const exception = new models_0_1.InvalidCrossAccountRoleException({
3122
2092
  $metadata: deserializeMetadata(parsedOutput),
3123
2093
  ...deserialized,
3124
- };
3125
- return contents;
2094
+ });
2095
+ return smithy_client_1.decorateServiceException(exception, body);
3126
2096
  };
3127
2097
  const deserializeAws_json1_1InvalidInputExceptionResponse = async (parsedOutput, context) => {
3128
2098
  const body = parsedOutput.body;
3129
2099
  const deserialized = deserializeAws_json1_1InvalidInputException(body, context);
3130
- const contents = {
3131
- name: "InvalidInputException",
3132
- $fault: "client",
2100
+ const exception = new models_0_1.InvalidInputException({
3133
2101
  $metadata: deserializeMetadata(parsedOutput),
3134
2102
  ...deserialized,
3135
- };
3136
- return contents;
2103
+ });
2104
+ return smithy_client_1.decorateServiceException(exception, body);
3137
2105
  };
3138
2106
  const deserializeAws_json1_1LimitExceededExceptionResponse = async (parsedOutput, context) => {
3139
2107
  const body = parsedOutput.body;
3140
2108
  const deserialized = deserializeAws_json1_1LimitExceededException(body, context);
3141
- const contents = {
3142
- name: "LimitExceededException",
3143
- $fault: "client",
2109
+ const exception = new models_0_1.LimitExceededException({
3144
2110
  $metadata: deserializeMetadata(parsedOutput),
3145
2111
  ...deserialized,
3146
- };
3147
- return contents;
2112
+ });
2113
+ return smithy_client_1.decorateServiceException(exception, body);
3148
2114
  };
3149
2115
  const deserializeAws_json1_1NoSuchEntityExceptionResponse = async (parsedOutput, context) => {
3150
2116
  const body = parsedOutput.body;
3151
2117
  const deserialized = deserializeAws_json1_1NoSuchEntityException(body, context);
3152
- const contents = {
3153
- name: "NoSuchEntityException",
3154
- $fault: "client",
2118
+ const exception = new models_0_1.NoSuchEntityException({
3155
2119
  $metadata: deserializeMetadata(parsedOutput),
3156
2120
  ...deserialized,
3157
- };
3158
- return contents;
2121
+ });
2122
+ return smithy_client_1.decorateServiceException(exception, body);
3159
2123
  };
3160
2124
  const deserializeAws_json1_1PreviewGenerationInProgressExceptionResponse = async (parsedOutput, context) => {
3161
2125
  const body = parsedOutput.body;
3162
2126
  const deserialized = deserializeAws_json1_1PreviewGenerationInProgressException(body, context);
3163
- const contents = {
3164
- name: "PreviewGenerationInProgressException",
3165
- $fault: "client",
2127
+ const exception = new models_0_1.PreviewGenerationInProgressException({
3166
2128
  $metadata: deserializeMetadata(parsedOutput),
3167
2129
  ...deserialized,
3168
- };
3169
- return contents;
2130
+ });
2131
+ return smithy_client_1.decorateServiceException(exception, body);
3170
2132
  };
3171
2133
  const deserializeAws_json1_1ServiceTemporarilyUnavailableExceptionResponse = async (parsedOutput, context) => {
3172
2134
  const body = parsedOutput.body;
3173
2135
  const deserialized = deserializeAws_json1_1ServiceTemporarilyUnavailableException(body, context);
3174
- const contents = {
3175
- name: "ServiceTemporarilyUnavailableException",
3176
- $fault: "server",
2136
+ const exception = new models_0_1.ServiceTemporarilyUnavailableException({
3177
2137
  $metadata: deserializeMetadata(parsedOutput),
3178
2138
  ...deserialized,
3179
- };
3180
- return contents;
2139
+ });
2140
+ return smithy_client_1.decorateServiceException(exception, body);
3181
2141
  };
3182
2142
  const deserializeAws_json1_1UnsupportedFeatureExceptionResponse = async (parsedOutput, context) => {
3183
2143
  const body = parsedOutput.body;
3184
2144
  const deserialized = deserializeAws_json1_1UnsupportedFeatureException(body, context);
3185
- const contents = {
3186
- name: "UnsupportedFeatureException",
3187
- $fault: "client",
2145
+ const exception = new models_0_1.UnsupportedFeatureException({
3188
2146
  $metadata: deserializeMetadata(parsedOutput),
3189
2147
  ...deserialized,
3190
- };
3191
- return contents;
2148
+ });
2149
+ return smithy_client_1.decorateServiceException(exception, body);
3192
2150
  };
3193
2151
  const serializeAws_json1_1AddAttributesToFindingsRequest = (input, context) => {
3194
2152
  return {
@@ -3811,7 +2769,7 @@ const deserializeAws_json1_1AgentAlreadyRunningAssessment = (output, context) =>
3811
2769
  };
3812
2770
  };
3813
2771
  const deserializeAws_json1_1AgentAlreadyRunningAssessmentList = (output, context) => {
3814
- return (output || [])
2772
+ const retVal = (output || [])
3815
2773
  .filter((e) => e != null)
3816
2774
  .map((entry) => {
3817
2775
  if (entry === null) {
@@ -3819,6 +2777,7 @@ const deserializeAws_json1_1AgentAlreadyRunningAssessmentList = (output, context
3819
2777
  }
3820
2778
  return deserializeAws_json1_1AgentAlreadyRunningAssessment(entry, context);
3821
2779
  });
2780
+ return retVal;
3822
2781
  };
3823
2782
  const deserializeAws_json1_1AgentPreview = (output, context) => {
3824
2783
  return {
@@ -3833,7 +2792,7 @@ const deserializeAws_json1_1AgentPreview = (output, context) => {
3833
2792
  };
3834
2793
  };
3835
2794
  const deserializeAws_json1_1AgentPreviewList = (output, context) => {
3836
- return (output || [])
2795
+ const retVal = (output || [])
3837
2796
  .filter((e) => e != null)
3838
2797
  .map((entry) => {
3839
2798
  if (entry === null) {
@@ -3841,6 +2800,7 @@ const deserializeAws_json1_1AgentPreviewList = (output, context) => {
3841
2800
  }
3842
2801
  return deserializeAws_json1_1AgentPreview(entry, context);
3843
2802
  });
2803
+ return retVal;
3844
2804
  };
3845
2805
  const deserializeAws_json1_1AgentsAlreadyRunningAssessmentException = (output, context) => {
3846
2806
  return {
@@ -3853,7 +2813,7 @@ const deserializeAws_json1_1AgentsAlreadyRunningAssessmentException = (output, c
3853
2813
  };
3854
2814
  };
3855
2815
  const deserializeAws_json1_1AssessmentRulesPackageArnList = (output, context) => {
3856
- return (output || [])
2816
+ const retVal = (output || [])
3857
2817
  .filter((e) => e != null)
3858
2818
  .map((entry) => {
3859
2819
  if (entry === null) {
@@ -3861,6 +2821,7 @@ const deserializeAws_json1_1AssessmentRulesPackageArnList = (output, context) =>
3861
2821
  }
3862
2822
  return smithy_client_1.expectString(entry);
3863
2823
  });
2824
+ return retVal;
3864
2825
  };
3865
2826
  const deserializeAws_json1_1AssessmentRun = (output, context) => {
3866
2827
  return {
@@ -3913,7 +2874,7 @@ const deserializeAws_json1_1AssessmentRunAgent = (output, context) => {
3913
2874
  };
3914
2875
  };
3915
2876
  const deserializeAws_json1_1AssessmentRunAgentList = (output, context) => {
3916
- return (output || [])
2877
+ const retVal = (output || [])
3917
2878
  .filter((e) => e != null)
3918
2879
  .map((entry) => {
3919
2880
  if (entry === null) {
@@ -3921,6 +2882,7 @@ const deserializeAws_json1_1AssessmentRunAgentList = (output, context) => {
3921
2882
  }
3922
2883
  return deserializeAws_json1_1AssessmentRunAgent(entry, context);
3923
2884
  });
2885
+ return retVal;
3924
2886
  };
3925
2887
  const deserializeAws_json1_1AssessmentRunFindingCounts = (output, context) => {
3926
2888
  return Object.entries(output).reduce((acc, [key, value]) => {
@@ -3934,7 +2896,7 @@ const deserializeAws_json1_1AssessmentRunFindingCounts = (output, context) => {
3934
2896
  }, {});
3935
2897
  };
3936
2898
  const deserializeAws_json1_1AssessmentRunInProgressArnList = (output, context) => {
3937
- return (output || [])
2899
+ const retVal = (output || [])
3938
2900
  .filter((e) => e != null)
3939
2901
  .map((entry) => {
3940
2902
  if (entry === null) {
@@ -3942,6 +2904,7 @@ const deserializeAws_json1_1AssessmentRunInProgressArnList = (output, context) =
3942
2904
  }
3943
2905
  return smithy_client_1.expectString(entry);
3944
2906
  });
2907
+ return retVal;
3945
2908
  };
3946
2909
  const deserializeAws_json1_1AssessmentRunInProgressException = (output, context) => {
3947
2910
  return {
@@ -3954,7 +2917,7 @@ const deserializeAws_json1_1AssessmentRunInProgressException = (output, context)
3954
2917
  };
3955
2918
  };
3956
2919
  const deserializeAws_json1_1AssessmentRunList = (output, context) => {
3957
- return (output || [])
2920
+ const retVal = (output || [])
3958
2921
  .filter((e) => e != null)
3959
2922
  .map((entry) => {
3960
2923
  if (entry === null) {
@@ -3962,6 +2925,7 @@ const deserializeAws_json1_1AssessmentRunList = (output, context) => {
3962
2925
  }
3963
2926
  return deserializeAws_json1_1AssessmentRun(entry, context);
3964
2927
  });
2928
+ return retVal;
3965
2929
  };
3966
2930
  const deserializeAws_json1_1AssessmentRunNotification = (output, context) => {
3967
2931
  return {
@@ -3976,7 +2940,7 @@ const deserializeAws_json1_1AssessmentRunNotification = (output, context) => {
3976
2940
  };
3977
2941
  };
3978
2942
  const deserializeAws_json1_1AssessmentRunNotificationList = (output, context) => {
3979
- return (output || [])
2943
+ const retVal = (output || [])
3980
2944
  .filter((e) => e != null)
3981
2945
  .map((entry) => {
3982
2946
  if (entry === null) {
@@ -3984,6 +2948,7 @@ const deserializeAws_json1_1AssessmentRunNotificationList = (output, context) =>
3984
2948
  }
3985
2949
  return deserializeAws_json1_1AssessmentRunNotification(entry, context);
3986
2950
  });
2951
+ return retVal;
3987
2952
  };
3988
2953
  const deserializeAws_json1_1AssessmentRunStateChange = (output, context) => {
3989
2954
  return {
@@ -3994,7 +2959,7 @@ const deserializeAws_json1_1AssessmentRunStateChange = (output, context) => {
3994
2959
  };
3995
2960
  };
3996
2961
  const deserializeAws_json1_1AssessmentRunStateChangeList = (output, context) => {
3997
- return (output || [])
2962
+ const retVal = (output || [])
3998
2963
  .filter((e) => e != null)
3999
2964
  .map((entry) => {
4000
2965
  if (entry === null) {
@@ -4002,6 +2967,7 @@ const deserializeAws_json1_1AssessmentRunStateChangeList = (output, context) =>
4002
2967
  }
4003
2968
  return deserializeAws_json1_1AssessmentRunStateChange(entry, context);
4004
2969
  });
2970
+ return retVal;
4005
2971
  };
4006
2972
  const deserializeAws_json1_1AssessmentTarget = (output, context) => {
4007
2973
  return {
@@ -4017,7 +2983,7 @@ const deserializeAws_json1_1AssessmentTarget = (output, context) => {
4017
2983
  };
4018
2984
  };
4019
2985
  const deserializeAws_json1_1AssessmentTargetList = (output, context) => {
4020
- return (output || [])
2986
+ const retVal = (output || [])
4021
2987
  .filter((e) => e != null)
4022
2988
  .map((entry) => {
4023
2989
  if (entry === null) {
@@ -4025,6 +2991,7 @@ const deserializeAws_json1_1AssessmentTargetList = (output, context) => {
4025
2991
  }
4026
2992
  return deserializeAws_json1_1AssessmentTarget(entry, context);
4027
2993
  });
2994
+ return retVal;
4028
2995
  };
4029
2996
  const deserializeAws_json1_1AssessmentTemplate = (output, context) => {
4030
2997
  return {
@@ -4046,7 +3013,7 @@ const deserializeAws_json1_1AssessmentTemplate = (output, context) => {
4046
3013
  };
4047
3014
  };
4048
3015
  const deserializeAws_json1_1AssessmentTemplateList = (output, context) => {
4049
- return (output || [])
3016
+ const retVal = (output || [])
4050
3017
  .filter((e) => e != null)
4051
3018
  .map((entry) => {
4052
3019
  if (entry === null) {
@@ -4054,9 +3021,10 @@ const deserializeAws_json1_1AssessmentTemplateList = (output, context) => {
4054
3021
  }
4055
3022
  return deserializeAws_json1_1AssessmentTemplate(entry, context);
4056
3023
  });
3024
+ return retVal;
4057
3025
  };
4058
3026
  const deserializeAws_json1_1AssessmentTemplateRulesPackageArnList = (output, context) => {
4059
- return (output || [])
3027
+ const retVal = (output || [])
4060
3028
  .filter((e) => e != null)
4061
3029
  .map((entry) => {
4062
3030
  if (entry === null) {
@@ -4064,6 +3032,7 @@ const deserializeAws_json1_1AssessmentTemplateRulesPackageArnList = (output, con
4064
3032
  }
4065
3033
  return smithy_client_1.expectString(entry);
4066
3034
  });
3035
+ return retVal;
4067
3036
  };
4068
3037
  const deserializeAws_json1_1AssetAttributes = (output, context) => {
4069
3038
  return {
@@ -4088,7 +3057,7 @@ const deserializeAws_json1_1Attribute = (output, context) => {
4088
3057
  };
4089
3058
  };
4090
3059
  const deserializeAws_json1_1AttributeList = (output, context) => {
4091
- return (output || [])
3060
+ const retVal = (output || [])
4092
3061
  .filter((e) => e != null)
4093
3062
  .map((entry) => {
4094
3063
  if (entry === null) {
@@ -4096,6 +3065,7 @@ const deserializeAws_json1_1AttributeList = (output, context) => {
4096
3065
  }
4097
3066
  return deserializeAws_json1_1Attribute(entry, context);
4098
3067
  });
3068
+ return retVal;
4099
3069
  };
4100
3070
  const deserializeAws_json1_1CreateAssessmentTargetResponse = (output, context) => {
4101
3071
  return {
@@ -4205,7 +3175,7 @@ const deserializeAws_json1_1EventSubscription = (output, context) => {
4205
3175
  };
4206
3176
  };
4207
3177
  const deserializeAws_json1_1EventSubscriptionList = (output, context) => {
4208
- return (output || [])
3178
+ const retVal = (output || [])
4209
3179
  .filter((e) => e != null)
4210
3180
  .map((entry) => {
4211
3181
  if (entry === null) {
@@ -4213,6 +3183,7 @@ const deserializeAws_json1_1EventSubscriptionList = (output, context) => {
4213
3183
  }
4214
3184
  return deserializeAws_json1_1EventSubscription(entry, context);
4215
3185
  });
3186
+ return retVal;
4216
3187
  };
4217
3188
  const deserializeAws_json1_1Exclusion = (output, context) => {
4218
3189
  return {
@@ -4253,7 +3224,7 @@ const deserializeAws_json1_1ExclusionPreview = (output, context) => {
4253
3224
  };
4254
3225
  };
4255
3226
  const deserializeAws_json1_1ExclusionPreviewList = (output, context) => {
4256
- return (output || [])
3227
+ const retVal = (output || [])
4257
3228
  .filter((e) => e != null)
4258
3229
  .map((entry) => {
4259
3230
  if (entry === null) {
@@ -4261,6 +3232,7 @@ const deserializeAws_json1_1ExclusionPreviewList = (output, context) => {
4261
3232
  }
4262
3233
  return deserializeAws_json1_1ExclusionPreview(entry, context);
4263
3234
  });
3235
+ return retVal;
4264
3236
  };
4265
3237
  const deserializeAws_json1_1FailedItemDetails = (output, context) => {
4266
3238
  return {
@@ -4314,7 +3286,7 @@ const deserializeAws_json1_1Finding = (output, context) => {
4314
3286
  };
4315
3287
  };
4316
3288
  const deserializeAws_json1_1FindingList = (output, context) => {
4317
- return (output || [])
3289
+ const retVal = (output || [])
4318
3290
  .filter((e) => e != null)
4319
3291
  .map((entry) => {
4320
3292
  if (entry === null) {
@@ -4322,6 +3294,7 @@ const deserializeAws_json1_1FindingList = (output, context) => {
4322
3294
  }
4323
3295
  return deserializeAws_json1_1Finding(entry, context);
4324
3296
  });
3297
+ return retVal;
4325
3298
  };
4326
3299
  const deserializeAws_json1_1GetAssessmentReportResponse = (output, context) => {
4327
3300
  return {
@@ -4373,7 +3346,7 @@ const deserializeAws_json1_1InvalidInputException = (output, context) => {
4373
3346
  };
4374
3347
  };
4375
3348
  const deserializeAws_json1_1Ipv4AddressList = (output, context) => {
4376
- return (output || [])
3349
+ const retVal = (output || [])
4377
3350
  .filter((e) => e != null)
4378
3351
  .map((entry) => {
4379
3352
  if (entry === null) {
@@ -4381,9 +3354,10 @@ const deserializeAws_json1_1Ipv4AddressList = (output, context) => {
4381
3354
  }
4382
3355
  return smithy_client_1.expectString(entry);
4383
3356
  });
3357
+ return retVal;
4384
3358
  };
4385
3359
  const deserializeAws_json1_1Ipv6Addresses = (output, context) => {
4386
- return (output || [])
3360
+ const retVal = (output || [])
4387
3361
  .filter((e) => e != null)
4388
3362
  .map((entry) => {
4389
3363
  if (entry === null) {
@@ -4391,6 +3365,7 @@ const deserializeAws_json1_1Ipv6Addresses = (output, context) => {
4391
3365
  }
4392
3366
  return smithy_client_1.expectString(entry);
4393
3367
  });
3368
+ return retVal;
4394
3369
  };
4395
3370
  const deserializeAws_json1_1LimitExceededException = (output, context) => {
4396
3371
  return {
@@ -4456,7 +3431,7 @@ const deserializeAws_json1_1ListFindingsResponse = (output, context) => {
4456
3431
  };
4457
3432
  };
4458
3433
  const deserializeAws_json1_1ListReturnedArnList = (output, context) => {
4459
- return (output || [])
3434
+ const retVal = (output || [])
4460
3435
  .filter((e) => e != null)
4461
3436
  .map((entry) => {
4462
3437
  if (entry === null) {
@@ -4464,6 +3439,7 @@ const deserializeAws_json1_1ListReturnedArnList = (output, context) => {
4464
3439
  }
4465
3440
  return smithy_client_1.expectString(entry);
4466
3441
  });
3442
+ return retVal;
4467
3443
  };
4468
3444
  const deserializeAws_json1_1ListRulesPackagesResponse = (output, context) => {
4469
3445
  return {
@@ -4501,7 +3477,7 @@ const deserializeAws_json1_1NetworkInterface = (output, context) => {
4501
3477
  };
4502
3478
  };
4503
3479
  const deserializeAws_json1_1NetworkInterfaces = (output, context) => {
4504
- return (output || [])
3480
+ const retVal = (output || [])
4505
3481
  .filter((e) => e != null)
4506
3482
  .map((entry) => {
4507
3483
  if (entry === null) {
@@ -4509,6 +3485,7 @@ const deserializeAws_json1_1NetworkInterfaces = (output, context) => {
4509
3485
  }
4510
3486
  return deserializeAws_json1_1NetworkInterface(entry, context);
4511
3487
  });
3488
+ return retVal;
4512
3489
  };
4513
3490
  const deserializeAws_json1_1NoSuchEntityException = (output, context) => {
4514
3491
  return {
@@ -4537,7 +3514,7 @@ const deserializeAws_json1_1PrivateIp = (output, context) => {
4537
3514
  };
4538
3515
  };
4539
3516
  const deserializeAws_json1_1PrivateIpAddresses = (output, context) => {
4540
- return (output || [])
3517
+ const retVal = (output || [])
4541
3518
  .filter((e) => e != null)
4542
3519
  .map((entry) => {
4543
3520
  if (entry === null) {
@@ -4545,6 +3522,7 @@ const deserializeAws_json1_1PrivateIpAddresses = (output, context) => {
4545
3522
  }
4546
3523
  return deserializeAws_json1_1PrivateIp(entry, context);
4547
3524
  });
3525
+ return retVal;
4548
3526
  };
4549
3527
  const deserializeAws_json1_1RemoveAttributesFromFindingsResponse = (output, context) => {
4550
3528
  return {
@@ -4565,7 +3543,7 @@ const deserializeAws_json1_1ResourceGroup = (output, context) => {
4565
3543
  };
4566
3544
  };
4567
3545
  const deserializeAws_json1_1ResourceGroupList = (output, context) => {
4568
- return (output || [])
3546
+ const retVal = (output || [])
4569
3547
  .filter((e) => e != null)
4570
3548
  .map((entry) => {
4571
3549
  if (entry === null) {
@@ -4573,6 +3551,7 @@ const deserializeAws_json1_1ResourceGroupList = (output, context) => {
4573
3551
  }
4574
3552
  return deserializeAws_json1_1ResourceGroup(entry, context);
4575
3553
  });
3554
+ return retVal;
4576
3555
  };
4577
3556
  const deserializeAws_json1_1ResourceGroupTag = (output, context) => {
4578
3557
  return {
@@ -4581,7 +3560,7 @@ const deserializeAws_json1_1ResourceGroupTag = (output, context) => {
4581
3560
  };
4582
3561
  };
4583
3562
  const deserializeAws_json1_1ResourceGroupTags = (output, context) => {
4584
- return (output || [])
3563
+ const retVal = (output || [])
4585
3564
  .filter((e) => e != null)
4586
3565
  .map((entry) => {
4587
3566
  if (entry === null) {
@@ -4589,6 +3568,7 @@ const deserializeAws_json1_1ResourceGroupTags = (output, context) => {
4589
3568
  }
4590
3569
  return deserializeAws_json1_1ResourceGroupTag(entry, context);
4591
3570
  });
3571
+ return retVal;
4592
3572
  };
4593
3573
  const deserializeAws_json1_1RulesPackage = (output, context) => {
4594
3574
  return {
@@ -4600,7 +3580,7 @@ const deserializeAws_json1_1RulesPackage = (output, context) => {
4600
3580
  };
4601
3581
  };
4602
3582
  const deserializeAws_json1_1RulesPackageList = (output, context) => {
4603
- return (output || [])
3583
+ const retVal = (output || [])
4604
3584
  .filter((e) => e != null)
4605
3585
  .map((entry) => {
4606
3586
  if (entry === null) {
@@ -4608,6 +3588,7 @@ const deserializeAws_json1_1RulesPackageList = (output, context) => {
4608
3588
  }
4609
3589
  return deserializeAws_json1_1RulesPackage(entry, context);
4610
3590
  });
3591
+ return retVal;
4611
3592
  };
4612
3593
  const deserializeAws_json1_1Scope = (output, context) => {
4613
3594
  return {
@@ -4616,7 +3597,7 @@ const deserializeAws_json1_1Scope = (output, context) => {
4616
3597
  };
4617
3598
  };
4618
3599
  const deserializeAws_json1_1ScopeList = (output, context) => {
4619
- return (output || [])
3600
+ const retVal = (output || [])
4620
3601
  .filter((e) => e != null)
4621
3602
  .map((entry) => {
4622
3603
  if (entry === null) {
@@ -4624,6 +3605,7 @@ const deserializeAws_json1_1ScopeList = (output, context) => {
4624
3605
  }
4625
3606
  return deserializeAws_json1_1Scope(entry, context);
4626
3607
  });
3608
+ return retVal;
4627
3609
  };
4628
3610
  const deserializeAws_json1_1SecurityGroup = (output, context) => {
4629
3611
  return {
@@ -4632,7 +3614,7 @@ const deserializeAws_json1_1SecurityGroup = (output, context) => {
4632
3614
  };
4633
3615
  };
4634
3616
  const deserializeAws_json1_1SecurityGroups = (output, context) => {
4635
- return (output || [])
3617
+ const retVal = (output || [])
4636
3618
  .filter((e) => e != null)
4637
3619
  .map((entry) => {
4638
3620
  if (entry === null) {
@@ -4640,6 +3622,7 @@ const deserializeAws_json1_1SecurityGroups = (output, context) => {
4640
3622
  }
4641
3623
  return deserializeAws_json1_1SecurityGroup(entry, context);
4642
3624
  });
3625
+ return retVal;
4643
3626
  };
4644
3627
  const deserializeAws_json1_1ServiceTemporarilyUnavailableException = (output, context) => {
4645
3628
  return {
@@ -4662,7 +3645,7 @@ const deserializeAws_json1_1Subscription = (output, context) => {
4662
3645
  };
4663
3646
  };
4664
3647
  const deserializeAws_json1_1SubscriptionList = (output, context) => {
4665
- return (output || [])
3648
+ const retVal = (output || [])
4666
3649
  .filter((e) => e != null)
4667
3650
  .map((entry) => {
4668
3651
  if (entry === null) {
@@ -4670,6 +3653,7 @@ const deserializeAws_json1_1SubscriptionList = (output, context) => {
4670
3653
  }
4671
3654
  return deserializeAws_json1_1Subscription(entry, context);
4672
3655
  });
3656
+ return retVal;
4673
3657
  };
4674
3658
  const deserializeAws_json1_1Tag = (output, context) => {
4675
3659
  return {
@@ -4678,7 +3662,7 @@ const deserializeAws_json1_1Tag = (output, context) => {
4678
3662
  };
4679
3663
  };
4680
3664
  const deserializeAws_json1_1TagList = (output, context) => {
4681
- return (output || [])
3665
+ const retVal = (output || [])
4682
3666
  .filter((e) => e != null)
4683
3667
  .map((entry) => {
4684
3668
  if (entry === null) {
@@ -4686,9 +3670,10 @@ const deserializeAws_json1_1TagList = (output, context) => {
4686
3670
  }
4687
3671
  return deserializeAws_json1_1Tag(entry, context);
4688
3672
  });
3673
+ return retVal;
4689
3674
  };
4690
3675
  const deserializeAws_json1_1Tags = (output, context) => {
4691
- return (output || [])
3676
+ const retVal = (output || [])
4692
3677
  .filter((e) => e != null)
4693
3678
  .map((entry) => {
4694
3679
  if (entry === null) {
@@ -4696,6 +3681,7 @@ const deserializeAws_json1_1Tags = (output, context) => {
4696
3681
  }
4697
3682
  return deserializeAws_json1_1Tag(entry, context);
4698
3683
  });
3684
+ return retVal;
4699
3685
  };
4700
3686
  const deserializeAws_json1_1TelemetryMetadata = (output, context) => {
4701
3687
  return {
@@ -4705,7 +3691,7 @@ const deserializeAws_json1_1TelemetryMetadata = (output, context) => {
4705
3691
  };
4706
3692
  };
4707
3693
  const deserializeAws_json1_1TelemetryMetadataList = (output, context) => {
4708
- return (output || [])
3694
+ const retVal = (output || [])
4709
3695
  .filter((e) => e != null)
4710
3696
  .map((entry) => {
4711
3697
  if (entry === null) {
@@ -4713,6 +3699,7 @@ const deserializeAws_json1_1TelemetryMetadataList = (output, context) => {
4713
3699
  }
4714
3700
  return deserializeAws_json1_1TelemetryMetadata(entry, context);
4715
3701
  });
3702
+ return retVal;
4716
3703
  };
4717
3704
  const deserializeAws_json1_1UnsupportedFeatureException = (output, context) => {
4718
3705
  return {
@@ -4721,7 +3708,7 @@ const deserializeAws_json1_1UnsupportedFeatureException = (output, context) => {
4721
3708
  };
4722
3709
  };
4723
3710
  const deserializeAws_json1_1UserAttributeList = (output, context) => {
4724
- return (output || [])
3711
+ const retVal = (output || [])
4725
3712
  .filter((e) => e != null)
4726
3713
  .map((entry) => {
4727
3714
  if (entry === null) {
@@ -4729,6 +3716,7 @@ const deserializeAws_json1_1UserAttributeList = (output, context) => {
4729
3716
  }
4730
3717
  return deserializeAws_json1_1Attribute(entry, context);
4731
3718
  });
3719
+ return retVal;
4732
3720
  };
4733
3721
  const deserializeMetadata = (output) => {
4734
3722
  var _a;