@aws-sdk/client-grafana 3.51.0 → 3.54.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,7 @@ exports.deserializeAws_restJson1UpdateWorkspaceAuthenticationCommand = exports.d
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const uuid_1 = require("uuid");
7
+ const GrafanaServiceException_1 = require("../models/GrafanaServiceException");
7
8
  const models_0_1 = require("../models/models_0");
8
9
  const serializeAws_restJson1AssociateLicenseCommand = async (input, context) => {
9
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -414,59 +415,28 @@ const deserializeAws_restJson1AssociateLicenseCommandError = async (output, cont
414
415
  switch (errorCode) {
415
416
  case "AccessDeniedException":
416
417
  case "com.amazonaws.grafana#AccessDeniedException":
417
- response = {
418
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
419
- name: errorCode,
420
- $metadata: deserializeMetadata(output),
421
- };
422
- break;
418
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
423
419
  case "InternalServerException":
424
420
  case "com.amazonaws.grafana#InternalServerException":
425
- response = {
426
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
427
- name: errorCode,
428
- $metadata: deserializeMetadata(output),
429
- };
430
- break;
421
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
431
422
  case "ResourceNotFoundException":
432
423
  case "com.amazonaws.grafana#ResourceNotFoundException":
433
- response = {
434
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
435
- name: errorCode,
436
- $metadata: deserializeMetadata(output),
437
- };
438
- break;
424
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
439
425
  case "ThrottlingException":
440
426
  case "com.amazonaws.grafana#ThrottlingException":
441
- response = {
442
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
443
- name: errorCode,
444
- $metadata: deserializeMetadata(output),
445
- };
446
- break;
427
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
447
428
  case "ValidationException":
448
429
  case "com.amazonaws.grafana#ValidationException":
449
- response = {
450
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
451
- name: errorCode,
452
- $metadata: deserializeMetadata(output),
453
- };
454
- break;
430
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
455
431
  default:
456
432
  const parsedBody = parsedOutput.body;
457
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
458
- response = {
459
- ...parsedBody,
460
- name: `${errorCode}`,
461
- message: parsedBody.message || parsedBody.Message || errorCode,
433
+ response = new GrafanaServiceException_1.GrafanaServiceException({
434
+ name: parsedBody.code || parsedBody.Code || errorCode,
462
435
  $fault: "client",
463
436
  $metadata: deserializeMetadata(output),
464
- };
437
+ });
438
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
465
439
  }
466
- const message = response.message || response.Message || errorCode;
467
- response.message = message;
468
- delete response.Message;
469
- return Promise.reject(Object.assign(new Error(message), response));
470
440
  };
471
441
  const deserializeAws_restJson1CreateWorkspaceCommand = async (output, context) => {
472
442
  if (output.statusCode !== 202 && output.statusCode >= 300) {
@@ -494,67 +464,31 @@ const deserializeAws_restJson1CreateWorkspaceCommandError = async (output, conte
494
464
  switch (errorCode) {
495
465
  case "AccessDeniedException":
496
466
  case "com.amazonaws.grafana#AccessDeniedException":
497
- response = {
498
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
499
- name: errorCode,
500
- $metadata: deserializeMetadata(output),
501
- };
502
- break;
467
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
503
468
  case "ConflictException":
504
469
  case "com.amazonaws.grafana#ConflictException":
505
- response = {
506
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
507
- name: errorCode,
508
- $metadata: deserializeMetadata(output),
509
- };
510
- break;
470
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
511
471
  case "InternalServerException":
512
472
  case "com.amazonaws.grafana#InternalServerException":
513
- response = {
514
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
515
- name: errorCode,
516
- $metadata: deserializeMetadata(output),
517
- };
518
- break;
473
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
519
474
  case "ServiceQuotaExceededException":
520
475
  case "com.amazonaws.grafana#ServiceQuotaExceededException":
521
- response = {
522
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
523
- name: errorCode,
524
- $metadata: deserializeMetadata(output),
525
- };
526
- break;
476
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
527
477
  case "ThrottlingException":
528
478
  case "com.amazonaws.grafana#ThrottlingException":
529
- response = {
530
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
531
- name: errorCode,
532
- $metadata: deserializeMetadata(output),
533
- };
534
- break;
479
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
535
480
  case "ValidationException":
536
481
  case "com.amazonaws.grafana#ValidationException":
537
- response = {
538
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
539
- name: errorCode,
540
- $metadata: deserializeMetadata(output),
541
- };
542
- break;
482
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
543
483
  default:
544
484
  const parsedBody = parsedOutput.body;
545
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
546
- response = {
547
- ...parsedBody,
548
- name: `${errorCode}`,
549
- message: parsedBody.message || parsedBody.Message || errorCode,
485
+ response = new GrafanaServiceException_1.GrafanaServiceException({
486
+ name: parsedBody.code || parsedBody.Code || errorCode,
550
487
  $fault: "client",
551
488
  $metadata: deserializeMetadata(output),
552
- };
489
+ });
490
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
553
491
  }
554
- const message = response.message || response.Message || errorCode;
555
- response.message = message;
556
- delete response.Message;
557
- return Promise.reject(Object.assign(new Error(message), response));
558
492
  };
559
493
  const deserializeAws_restJson1DeleteWorkspaceCommand = async (output, context) => {
560
494
  if (output.statusCode !== 202 && output.statusCode >= 300) {
@@ -582,67 +516,31 @@ const deserializeAws_restJson1DeleteWorkspaceCommandError = async (output, conte
582
516
  switch (errorCode) {
583
517
  case "AccessDeniedException":
584
518
  case "com.amazonaws.grafana#AccessDeniedException":
585
- response = {
586
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
587
- name: errorCode,
588
- $metadata: deserializeMetadata(output),
589
- };
590
- break;
519
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
591
520
  case "ConflictException":
592
521
  case "com.amazonaws.grafana#ConflictException":
593
- response = {
594
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
595
- name: errorCode,
596
- $metadata: deserializeMetadata(output),
597
- };
598
- break;
522
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
599
523
  case "InternalServerException":
600
524
  case "com.amazonaws.grafana#InternalServerException":
601
- response = {
602
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
603
- name: errorCode,
604
- $metadata: deserializeMetadata(output),
605
- };
606
- break;
525
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
607
526
  case "ResourceNotFoundException":
608
527
  case "com.amazonaws.grafana#ResourceNotFoundException":
609
- response = {
610
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
611
- name: errorCode,
612
- $metadata: deserializeMetadata(output),
613
- };
614
- break;
528
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
615
529
  case "ThrottlingException":
616
530
  case "com.amazonaws.grafana#ThrottlingException":
617
- response = {
618
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
619
- name: errorCode,
620
- $metadata: deserializeMetadata(output),
621
- };
622
- break;
531
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
623
532
  case "ValidationException":
624
533
  case "com.amazonaws.grafana#ValidationException":
625
- response = {
626
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
627
- name: errorCode,
628
- $metadata: deserializeMetadata(output),
629
- };
630
- break;
534
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
631
535
  default:
632
536
  const parsedBody = parsedOutput.body;
633
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
634
- response = {
635
- ...parsedBody,
636
- name: `${errorCode}`,
637
- message: parsedBody.message || parsedBody.Message || errorCode,
537
+ response = new GrafanaServiceException_1.GrafanaServiceException({
538
+ name: parsedBody.code || parsedBody.Code || errorCode,
638
539
  $fault: "client",
639
540
  $metadata: deserializeMetadata(output),
640
- };
541
+ });
542
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
641
543
  }
642
- const message = response.message || response.Message || errorCode;
643
- response.message = message;
644
- delete response.Message;
645
- return Promise.reject(Object.assign(new Error(message), response));
646
544
  };
647
545
  const deserializeAws_restJson1DescribeWorkspaceCommand = async (output, context) => {
648
546
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -670,59 +568,28 @@ const deserializeAws_restJson1DescribeWorkspaceCommandError = async (output, con
670
568
  switch (errorCode) {
671
569
  case "AccessDeniedException":
672
570
  case "com.amazonaws.grafana#AccessDeniedException":
673
- response = {
674
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
675
- name: errorCode,
676
- $metadata: deserializeMetadata(output),
677
- };
678
- break;
571
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
679
572
  case "InternalServerException":
680
573
  case "com.amazonaws.grafana#InternalServerException":
681
- response = {
682
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
683
- name: errorCode,
684
- $metadata: deserializeMetadata(output),
685
- };
686
- break;
574
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
687
575
  case "ResourceNotFoundException":
688
576
  case "com.amazonaws.grafana#ResourceNotFoundException":
689
- response = {
690
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
691
- name: errorCode,
692
- $metadata: deserializeMetadata(output),
693
- };
694
- break;
577
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
695
578
  case "ThrottlingException":
696
579
  case "com.amazonaws.grafana#ThrottlingException":
697
- response = {
698
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
699
- name: errorCode,
700
- $metadata: deserializeMetadata(output),
701
- };
702
- break;
580
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
703
581
  case "ValidationException":
704
582
  case "com.amazonaws.grafana#ValidationException":
705
- response = {
706
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
707
- name: errorCode,
708
- $metadata: deserializeMetadata(output),
709
- };
710
- break;
583
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
711
584
  default:
712
585
  const parsedBody = parsedOutput.body;
713
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
714
- response = {
715
- ...parsedBody,
716
- name: `${errorCode}`,
717
- message: parsedBody.message || parsedBody.Message || errorCode,
586
+ response = new GrafanaServiceException_1.GrafanaServiceException({
587
+ name: parsedBody.code || parsedBody.Code || errorCode,
718
588
  $fault: "client",
719
589
  $metadata: deserializeMetadata(output),
720
- };
590
+ });
591
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
721
592
  }
722
- const message = response.message || response.Message || errorCode;
723
- response.message = message;
724
- delete response.Message;
725
- return Promise.reject(Object.assign(new Error(message), response));
726
593
  };
727
594
  const deserializeAws_restJson1DescribeWorkspaceAuthenticationCommand = async (output, context) => {
728
595
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -750,59 +617,28 @@ const deserializeAws_restJson1DescribeWorkspaceAuthenticationCommandError = asyn
750
617
  switch (errorCode) {
751
618
  case "AccessDeniedException":
752
619
  case "com.amazonaws.grafana#AccessDeniedException":
753
- response = {
754
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
755
- name: errorCode,
756
- $metadata: deserializeMetadata(output),
757
- };
758
- break;
620
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
759
621
  case "InternalServerException":
760
622
  case "com.amazonaws.grafana#InternalServerException":
761
- response = {
762
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
763
- name: errorCode,
764
- $metadata: deserializeMetadata(output),
765
- };
766
- break;
623
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
767
624
  case "ResourceNotFoundException":
768
625
  case "com.amazonaws.grafana#ResourceNotFoundException":
769
- response = {
770
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
771
- name: errorCode,
772
- $metadata: deserializeMetadata(output),
773
- };
774
- break;
626
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
775
627
  case "ThrottlingException":
776
628
  case "com.amazonaws.grafana#ThrottlingException":
777
- response = {
778
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
779
- name: errorCode,
780
- $metadata: deserializeMetadata(output),
781
- };
782
- break;
629
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
783
630
  case "ValidationException":
784
631
  case "com.amazonaws.grafana#ValidationException":
785
- response = {
786
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
787
- name: errorCode,
788
- $metadata: deserializeMetadata(output),
789
- };
790
- break;
632
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
791
633
  default:
792
634
  const parsedBody = parsedOutput.body;
793
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
794
- response = {
795
- ...parsedBody,
796
- name: `${errorCode}`,
797
- message: parsedBody.message || parsedBody.Message || errorCode,
635
+ response = new GrafanaServiceException_1.GrafanaServiceException({
636
+ name: parsedBody.code || parsedBody.Code || errorCode,
798
637
  $fault: "client",
799
638
  $metadata: deserializeMetadata(output),
800
- };
639
+ });
640
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
801
641
  }
802
- const message = response.message || response.Message || errorCode;
803
- response.message = message;
804
- delete response.Message;
805
- return Promise.reject(Object.assign(new Error(message), response));
806
642
  };
807
643
  const deserializeAws_restJson1DisassociateLicenseCommand = async (output, context) => {
808
644
  if (output.statusCode !== 202 && output.statusCode >= 300) {
@@ -830,59 +666,28 @@ const deserializeAws_restJson1DisassociateLicenseCommandError = async (output, c
830
666
  switch (errorCode) {
831
667
  case "AccessDeniedException":
832
668
  case "com.amazonaws.grafana#AccessDeniedException":
833
- response = {
834
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
835
- name: errorCode,
836
- $metadata: deserializeMetadata(output),
837
- };
838
- break;
669
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
839
670
  case "InternalServerException":
840
671
  case "com.amazonaws.grafana#InternalServerException":
841
- response = {
842
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
843
- name: errorCode,
844
- $metadata: deserializeMetadata(output),
845
- };
846
- break;
672
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
847
673
  case "ResourceNotFoundException":
848
674
  case "com.amazonaws.grafana#ResourceNotFoundException":
849
- response = {
850
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
851
- name: errorCode,
852
- $metadata: deserializeMetadata(output),
853
- };
854
- break;
675
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
855
676
  case "ThrottlingException":
856
677
  case "com.amazonaws.grafana#ThrottlingException":
857
- response = {
858
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
859
- name: errorCode,
860
- $metadata: deserializeMetadata(output),
861
- };
862
- break;
678
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
863
679
  case "ValidationException":
864
680
  case "com.amazonaws.grafana#ValidationException":
865
- response = {
866
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
867
- name: errorCode,
868
- $metadata: deserializeMetadata(output),
869
- };
870
- break;
681
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
871
682
  default:
872
683
  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,
684
+ response = new GrafanaServiceException_1.GrafanaServiceException({
685
+ name: parsedBody.code || parsedBody.Code || errorCode,
878
686
  $fault: "client",
879
687
  $metadata: deserializeMetadata(output),
880
- };
688
+ });
689
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
881
690
  }
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
691
  };
887
692
  const deserializeAws_restJson1ListPermissionsCommand = async (output, context) => {
888
693
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -914,59 +719,28 @@ const deserializeAws_restJson1ListPermissionsCommandError = async (output, conte
914
719
  switch (errorCode) {
915
720
  case "AccessDeniedException":
916
721
  case "com.amazonaws.grafana#AccessDeniedException":
917
- response = {
918
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
919
- name: errorCode,
920
- $metadata: deserializeMetadata(output),
921
- };
922
- break;
722
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
923
723
  case "InternalServerException":
924
724
  case "com.amazonaws.grafana#InternalServerException":
925
- response = {
926
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
927
- name: errorCode,
928
- $metadata: deserializeMetadata(output),
929
- };
930
- break;
725
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
931
726
  case "ResourceNotFoundException":
932
727
  case "com.amazonaws.grafana#ResourceNotFoundException":
933
- response = {
934
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
935
- name: errorCode,
936
- $metadata: deserializeMetadata(output),
937
- };
938
- break;
728
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
939
729
  case "ThrottlingException":
940
730
  case "com.amazonaws.grafana#ThrottlingException":
941
- response = {
942
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
943
- name: errorCode,
944
- $metadata: deserializeMetadata(output),
945
- };
946
- break;
731
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
947
732
  case "ValidationException":
948
733
  case "com.amazonaws.grafana#ValidationException":
949
- response = {
950
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
951
- name: errorCode,
952
- $metadata: deserializeMetadata(output),
953
- };
954
- break;
734
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
955
735
  default:
956
736
  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,
737
+ response = new GrafanaServiceException_1.GrafanaServiceException({
738
+ name: parsedBody.code || parsedBody.Code || errorCode,
962
739
  $fault: "client",
963
740
  $metadata: deserializeMetadata(output),
964
- };
741
+ });
742
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
965
743
  }
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
744
  };
971
745
  const deserializeAws_restJson1ListWorkspacesCommand = async (output, context) => {
972
746
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -998,43 +772,22 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async (output, contex
998
772
  switch (errorCode) {
999
773
  case "AccessDeniedException":
1000
774
  case "com.amazonaws.grafana#AccessDeniedException":
1001
- response = {
1002
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1003
- name: errorCode,
1004
- $metadata: deserializeMetadata(output),
1005
- };
1006
- break;
775
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1007
776
  case "InternalServerException":
1008
777
  case "com.amazonaws.grafana#InternalServerException":
1009
- response = {
1010
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1011
- name: errorCode,
1012
- $metadata: deserializeMetadata(output),
1013
- };
1014
- break;
778
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1015
779
  case "ThrottlingException":
1016
780
  case "com.amazonaws.grafana#ThrottlingException":
1017
- response = {
1018
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1019
- name: errorCode,
1020
- $metadata: deserializeMetadata(output),
1021
- };
1022
- break;
781
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1023
782
  default:
1024
783
  const parsedBody = parsedOutput.body;
1025
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1026
- response = {
1027
- ...parsedBody,
1028
- name: `${errorCode}`,
1029
- message: parsedBody.message || parsedBody.Message || errorCode,
784
+ response = new GrafanaServiceException_1.GrafanaServiceException({
785
+ name: parsedBody.code || parsedBody.Code || errorCode,
1030
786
  $fault: "client",
1031
787
  $metadata: deserializeMetadata(output),
1032
- };
788
+ });
789
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1033
790
  }
1034
- const message = response.message || response.Message || errorCode;
1035
- response.message = message;
1036
- delete response.Message;
1037
- return Promise.reject(Object.assign(new Error(message), response));
1038
791
  };
1039
792
  const deserializeAws_restJson1UpdatePermissionsCommand = async (output, context) => {
1040
793
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1062,59 +815,28 @@ const deserializeAws_restJson1UpdatePermissionsCommandError = async (output, con
1062
815
  switch (errorCode) {
1063
816
  case "AccessDeniedException":
1064
817
  case "com.amazonaws.grafana#AccessDeniedException":
1065
- response = {
1066
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1067
- name: errorCode,
1068
- $metadata: deserializeMetadata(output),
1069
- };
1070
- break;
818
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1071
819
  case "InternalServerException":
1072
820
  case "com.amazonaws.grafana#InternalServerException":
1073
- response = {
1074
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1075
- name: errorCode,
1076
- $metadata: deserializeMetadata(output),
1077
- };
1078
- break;
821
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1079
822
  case "ResourceNotFoundException":
1080
823
  case "com.amazonaws.grafana#ResourceNotFoundException":
1081
- response = {
1082
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1083
- name: errorCode,
1084
- $metadata: deserializeMetadata(output),
1085
- };
1086
- break;
824
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1087
825
  case "ThrottlingException":
1088
826
  case "com.amazonaws.grafana#ThrottlingException":
1089
- response = {
1090
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1091
- name: errorCode,
1092
- $metadata: deserializeMetadata(output),
1093
- };
1094
- break;
827
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1095
828
  case "ValidationException":
1096
829
  case "com.amazonaws.grafana#ValidationException":
1097
- response = {
1098
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1099
- name: errorCode,
1100
- $metadata: deserializeMetadata(output),
1101
- };
1102
- break;
830
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1103
831
  default:
1104
832
  const parsedBody = parsedOutput.body;
1105
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1106
- response = {
1107
- ...parsedBody,
1108
- name: `${errorCode}`,
1109
- message: parsedBody.message || parsedBody.Message || errorCode,
833
+ response = new GrafanaServiceException_1.GrafanaServiceException({
834
+ name: parsedBody.code || parsedBody.Code || errorCode,
1110
835
  $fault: "client",
1111
836
  $metadata: deserializeMetadata(output),
1112
- };
837
+ });
838
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1113
839
  }
1114
- const message = response.message || response.Message || errorCode;
1115
- response.message = message;
1116
- delete response.Message;
1117
- return Promise.reject(Object.assign(new Error(message), response));
1118
840
  };
1119
841
  const deserializeAws_restJson1UpdateWorkspaceCommand = async (output, context) => {
1120
842
  if (output.statusCode !== 202 && output.statusCode >= 300) {
@@ -1142,67 +864,31 @@ const deserializeAws_restJson1UpdateWorkspaceCommandError = async (output, conte
1142
864
  switch (errorCode) {
1143
865
  case "AccessDeniedException":
1144
866
  case "com.amazonaws.grafana#AccessDeniedException":
1145
- response = {
1146
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1147
- name: errorCode,
1148
- $metadata: deserializeMetadata(output),
1149
- };
1150
- break;
867
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1151
868
  case "ConflictException":
1152
869
  case "com.amazonaws.grafana#ConflictException":
1153
- response = {
1154
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1155
- name: errorCode,
1156
- $metadata: deserializeMetadata(output),
1157
- };
1158
- break;
870
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1159
871
  case "InternalServerException":
1160
872
  case "com.amazonaws.grafana#InternalServerException":
1161
- response = {
1162
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1163
- name: errorCode,
1164
- $metadata: deserializeMetadata(output),
1165
- };
1166
- break;
873
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1167
874
  case "ResourceNotFoundException":
1168
875
  case "com.amazonaws.grafana#ResourceNotFoundException":
1169
- response = {
1170
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1171
- name: errorCode,
1172
- $metadata: deserializeMetadata(output),
1173
- };
1174
- break;
876
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1175
877
  case "ThrottlingException":
1176
878
  case "com.amazonaws.grafana#ThrottlingException":
1177
- response = {
1178
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1179
- name: errorCode,
1180
- $metadata: deserializeMetadata(output),
1181
- };
1182
- break;
879
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1183
880
  case "ValidationException":
1184
881
  case "com.amazonaws.grafana#ValidationException":
1185
- response = {
1186
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1187
- name: errorCode,
1188
- $metadata: deserializeMetadata(output),
1189
- };
1190
- break;
882
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1191
883
  default:
1192
884
  const parsedBody = parsedOutput.body;
1193
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1194
- response = {
1195
- ...parsedBody,
1196
- name: `${errorCode}`,
1197
- message: parsedBody.message || parsedBody.Message || errorCode,
885
+ response = new GrafanaServiceException_1.GrafanaServiceException({
886
+ name: parsedBody.code || parsedBody.Code || errorCode,
1198
887
  $fault: "client",
1199
888
  $metadata: deserializeMetadata(output),
1200
- };
889
+ });
890
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1201
891
  }
1202
- const message = response.message || response.Message || errorCode;
1203
- response.message = message;
1204
- delete response.Message;
1205
- return Promise.reject(Object.assign(new Error(message), response));
1206
892
  };
1207
893
  const deserializeAws_restJson1UpdateWorkspaceAuthenticationCommand = async (output, context) => {
1208
894
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1230,90 +916,46 @@ const deserializeAws_restJson1UpdateWorkspaceAuthenticationCommandError = async
1230
916
  switch (errorCode) {
1231
917
  case "AccessDeniedException":
1232
918
  case "com.amazonaws.grafana#AccessDeniedException":
1233
- response = {
1234
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1235
- name: errorCode,
1236
- $metadata: deserializeMetadata(output),
1237
- };
1238
- break;
919
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1239
920
  case "ConflictException":
1240
921
  case "com.amazonaws.grafana#ConflictException":
1241
- response = {
1242
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1243
- name: errorCode,
1244
- $metadata: deserializeMetadata(output),
1245
- };
1246
- break;
922
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1247
923
  case "InternalServerException":
1248
924
  case "com.amazonaws.grafana#InternalServerException":
1249
- response = {
1250
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1251
- name: errorCode,
1252
- $metadata: deserializeMetadata(output),
1253
- };
1254
- break;
925
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1255
926
  case "ResourceNotFoundException":
1256
927
  case "com.amazonaws.grafana#ResourceNotFoundException":
1257
- response = {
1258
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1259
- name: errorCode,
1260
- $metadata: deserializeMetadata(output),
1261
- };
1262
- break;
928
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1263
929
  case "ThrottlingException":
1264
930
  case "com.amazonaws.grafana#ThrottlingException":
1265
- response = {
1266
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1267
- name: errorCode,
1268
- $metadata: deserializeMetadata(output),
1269
- };
1270
- break;
931
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1271
932
  case "ValidationException":
1272
933
  case "com.amazonaws.grafana#ValidationException":
1273
- response = {
1274
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1275
- name: errorCode,
1276
- $metadata: deserializeMetadata(output),
1277
- };
1278
- break;
934
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1279
935
  default:
1280
936
  const parsedBody = parsedOutput.body;
1281
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1282
- response = {
1283
- ...parsedBody,
1284
- name: `${errorCode}`,
1285
- message: parsedBody.message || parsedBody.Message || errorCode,
937
+ response = new GrafanaServiceException_1.GrafanaServiceException({
938
+ name: parsedBody.code || parsedBody.Code || errorCode,
1286
939
  $fault: "client",
1287
940
  $metadata: deserializeMetadata(output),
1288
- };
941
+ });
942
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1289
943
  }
1290
- const message = response.message || response.Message || errorCode;
1291
- response.message = message;
1292
- delete response.Message;
1293
- return Promise.reject(Object.assign(new Error(message), response));
1294
944
  };
1295
945
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1296
- const contents = {
1297
- name: "AccessDeniedException",
1298
- $fault: "client",
1299
- $metadata: deserializeMetadata(parsedOutput),
1300
- message: undefined,
1301
- };
946
+ const contents = {};
1302
947
  const data = parsedOutput.body;
1303
948
  if (data.message !== undefined && data.message !== null) {
1304
949
  contents.message = smithy_client_1.expectString(data.message);
1305
950
  }
1306
- return contents;
951
+ const exception = new models_0_1.AccessDeniedException({
952
+ $metadata: deserializeMetadata(parsedOutput),
953
+ ...contents,
954
+ });
955
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1307
956
  };
1308
957
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1309
- const contents = {
1310
- name: "ConflictException",
1311
- $fault: "client",
1312
- $metadata: deserializeMetadata(parsedOutput),
1313
- message: undefined,
1314
- resourceId: undefined,
1315
- resourceType: undefined,
1316
- };
958
+ const contents = {};
1317
959
  const data = parsedOutput.body;
1318
960
  if (data.message !== undefined && data.message !== null) {
1319
961
  contents.message = smithy_client_1.expectString(data.message);
@@ -1324,17 +966,14 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
1324
966
  if (data.resourceType !== undefined && data.resourceType !== null) {
1325
967
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
1326
968
  }
1327
- return contents;
969
+ const exception = new models_0_1.ConflictException({
970
+ $metadata: deserializeMetadata(parsedOutput),
971
+ ...contents,
972
+ });
973
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1328
974
  };
1329
975
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1330
- const contents = {
1331
- name: "InternalServerException",
1332
- $fault: "server",
1333
- $retryable: {},
1334
- $metadata: deserializeMetadata(parsedOutput),
1335
- message: undefined,
1336
- retryAfterSeconds: undefined,
1337
- };
976
+ const contents = {};
1338
977
  if (parsedOutput.headers["retry-after"] !== undefined) {
1339
978
  contents.retryAfterSeconds = smithy_client_1.strictParseInt32(parsedOutput.headers["retry-after"]);
1340
979
  }
@@ -1342,17 +981,14 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
1342
981
  if (data.message !== undefined && data.message !== null) {
1343
982
  contents.message = smithy_client_1.expectString(data.message);
1344
983
  }
1345
- return contents;
984
+ const exception = new models_0_1.InternalServerException({
985
+ $metadata: deserializeMetadata(parsedOutput),
986
+ ...contents,
987
+ });
988
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1346
989
  };
1347
990
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1348
- const contents = {
1349
- name: "ResourceNotFoundException",
1350
- $fault: "client",
1351
- $metadata: deserializeMetadata(parsedOutput),
1352
- message: undefined,
1353
- resourceId: undefined,
1354
- resourceType: undefined,
1355
- };
991
+ const contents = {};
1356
992
  const data = parsedOutput.body;
1357
993
  if (data.message !== undefined && data.message !== null) {
1358
994
  contents.message = smithy_client_1.expectString(data.message);
@@ -1363,19 +999,14 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
1363
999
  if (data.resourceType !== undefined && data.resourceType !== null) {
1364
1000
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
1365
1001
  }
1366
- return contents;
1002
+ const exception = new models_0_1.ResourceNotFoundException({
1003
+ $metadata: deserializeMetadata(parsedOutput),
1004
+ ...contents,
1005
+ });
1006
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1367
1007
  };
1368
1008
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1369
- const contents = {
1370
- name: "ServiceQuotaExceededException",
1371
- $fault: "client",
1372
- $metadata: deserializeMetadata(parsedOutput),
1373
- message: undefined,
1374
- quotaCode: undefined,
1375
- resourceId: undefined,
1376
- resourceType: undefined,
1377
- serviceCode: undefined,
1378
- };
1009
+ const contents = {};
1379
1010
  const data = parsedOutput.body;
1380
1011
  if (data.message !== undefined && data.message !== null) {
1381
1012
  contents.message = smithy_client_1.expectString(data.message);
@@ -1392,19 +1023,14 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
1392
1023
  if (data.serviceCode !== undefined && data.serviceCode !== null) {
1393
1024
  contents.serviceCode = smithy_client_1.expectString(data.serviceCode);
1394
1025
  }
1395
- return contents;
1026
+ const exception = new models_0_1.ServiceQuotaExceededException({
1027
+ $metadata: deserializeMetadata(parsedOutput),
1028
+ ...contents,
1029
+ });
1030
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1396
1031
  };
1397
1032
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1398
- const contents = {
1399
- name: "ThrottlingException",
1400
- $fault: "client",
1401
- $retryable: {},
1402
- $metadata: deserializeMetadata(parsedOutput),
1403
- message: undefined,
1404
- quotaCode: undefined,
1405
- retryAfterSeconds: undefined,
1406
- serviceCode: undefined,
1407
- };
1033
+ const contents = {};
1408
1034
  if (parsedOutput.headers["retry-after"] !== undefined) {
1409
1035
  contents.retryAfterSeconds = smithy_client_1.strictParseInt32(parsedOutput.headers["retry-after"]);
1410
1036
  }
@@ -1418,17 +1044,14 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
1418
1044
  if (data.serviceCode !== undefined && data.serviceCode !== null) {
1419
1045
  contents.serviceCode = smithy_client_1.expectString(data.serviceCode);
1420
1046
  }
1421
- return contents;
1047
+ const exception = new models_0_1.ThrottlingException({
1048
+ $metadata: deserializeMetadata(parsedOutput),
1049
+ ...contents,
1050
+ });
1051
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1422
1052
  };
1423
1053
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1424
- const contents = {
1425
- name: "ValidationException",
1426
- $fault: "client",
1427
- $metadata: deserializeMetadata(parsedOutput),
1428
- fieldList: undefined,
1429
- message: undefined,
1430
- reason: undefined,
1431
- };
1054
+ const contents = {};
1432
1055
  const data = parsedOutput.body;
1433
1056
  if (data.fieldList !== undefined && data.fieldList !== null) {
1434
1057
  contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
@@ -1439,7 +1062,11 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
1439
1062
  if (data.reason !== undefined && data.reason !== null) {
1440
1063
  contents.reason = smithy_client_1.expectString(data.reason);
1441
1064
  }
1442
- return contents;
1065
+ const exception = new models_0_1.ValidationException({
1066
+ $metadata: deserializeMetadata(parsedOutput),
1067
+ ...contents,
1068
+ });
1069
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
1443
1070
  };
1444
1071
  const serializeAws_restJson1AllowedOrganizations = (input, context) => {
1445
1072
  return input
@@ -1579,7 +1206,7 @@ const serializeAws_restJson1UserList = (input, context) => {
1579
1206
  });
1580
1207
  };
1581
1208
  const deserializeAws_restJson1AllowedOrganizations = (output, context) => {
1582
- return (output || [])
1209
+ const retVal = (output || [])
1583
1210
  .filter((e) => e != null)
1584
1211
  .map((entry) => {
1585
1212
  if (entry === null) {
@@ -1587,6 +1214,7 @@ const deserializeAws_restJson1AllowedOrganizations = (output, context) => {
1587
1214
  }
1588
1215
  return smithy_client_1.expectString(entry);
1589
1216
  });
1217
+ return retVal;
1590
1218
  };
1591
1219
  const deserializeAws_restJson1AssertionAttributes = (output, context) => {
1592
1220
  return {
@@ -1612,7 +1240,7 @@ const deserializeAws_restJson1AuthenticationDescription = (output, context) => {
1612
1240
  };
1613
1241
  };
1614
1242
  const deserializeAws_restJson1AuthenticationProviders = (output, context) => {
1615
- return (output || [])
1243
+ const retVal = (output || [])
1616
1244
  .filter((e) => e != null)
1617
1245
  .map((entry) => {
1618
1246
  if (entry === null) {
@@ -1620,6 +1248,7 @@ const deserializeAws_restJson1AuthenticationProviders = (output, context) => {
1620
1248
  }
1621
1249
  return smithy_client_1.expectString(entry);
1622
1250
  });
1251
+ return retVal;
1623
1252
  };
1624
1253
  const deserializeAws_restJson1AuthenticationSummary = (output, context) => {
1625
1254
  return {
@@ -1635,7 +1264,7 @@ const deserializeAws_restJson1AwsSsoAuthentication = (output, context) => {
1635
1264
  };
1636
1265
  };
1637
1266
  const deserializeAws_restJson1DataSourceTypesList = (output, context) => {
1638
- return (output || [])
1267
+ const retVal = (output || [])
1639
1268
  .filter((e) => e != null)
1640
1269
  .map((entry) => {
1641
1270
  if (entry === null) {
@@ -1643,6 +1272,7 @@ const deserializeAws_restJson1DataSourceTypesList = (output, context) => {
1643
1272
  }
1644
1273
  return smithy_client_1.expectString(entry);
1645
1274
  });
1275
+ return retVal;
1646
1276
  };
1647
1277
  const deserializeAws_restJson1IdpMetadata = (output, context) => {
1648
1278
  if (smithy_client_1.expectString(output.url) !== undefined) {
@@ -1654,7 +1284,7 @@ const deserializeAws_restJson1IdpMetadata = (output, context) => {
1654
1284
  return { $unknown: Object.entries(output)[0] };
1655
1285
  };
1656
1286
  const deserializeAws_restJson1NotificationDestinationsList = (output, context) => {
1657
- return (output || [])
1287
+ const retVal = (output || [])
1658
1288
  .filter((e) => e != null)
1659
1289
  .map((entry) => {
1660
1290
  if (entry === null) {
@@ -1662,9 +1292,10 @@ const deserializeAws_restJson1NotificationDestinationsList = (output, context) =
1662
1292
  }
1663
1293
  return smithy_client_1.expectString(entry);
1664
1294
  });
1295
+ return retVal;
1665
1296
  };
1666
1297
  const deserializeAws_restJson1OrganizationalUnitList = (output, context) => {
1667
- return (output || [])
1298
+ const retVal = (output || [])
1668
1299
  .filter((e) => e != null)
1669
1300
  .map((entry) => {
1670
1301
  if (entry === null) {
@@ -1672,6 +1303,7 @@ const deserializeAws_restJson1OrganizationalUnitList = (output, context) => {
1672
1303
  }
1673
1304
  return smithy_client_1.expectString(entry);
1674
1305
  });
1306
+ return retVal;
1675
1307
  };
1676
1308
  const deserializeAws_restJson1PermissionEntry = (output, context) => {
1677
1309
  return {
@@ -1682,7 +1314,7 @@ const deserializeAws_restJson1PermissionEntry = (output, context) => {
1682
1314
  };
1683
1315
  };
1684
1316
  const deserializeAws_restJson1PermissionEntryList = (output, context) => {
1685
- return (output || [])
1317
+ const retVal = (output || [])
1686
1318
  .filter((e) => e != null)
1687
1319
  .map((entry) => {
1688
1320
  if (entry === null) {
@@ -1690,9 +1322,10 @@ const deserializeAws_restJson1PermissionEntryList = (output, context) => {
1690
1322
  }
1691
1323
  return deserializeAws_restJson1PermissionEntry(entry, context);
1692
1324
  });
1325
+ return retVal;
1693
1326
  };
1694
1327
  const deserializeAws_restJson1RoleValueList = (output, context) => {
1695
- return (output || [])
1328
+ const retVal = (output || [])
1696
1329
  .filter((e) => e != null)
1697
1330
  .map((entry) => {
1698
1331
  if (entry === null) {
@@ -1700,6 +1333,7 @@ const deserializeAws_restJson1RoleValueList = (output, context) => {
1700
1333
  }
1701
1334
  return smithy_client_1.expectString(entry);
1702
1335
  });
1336
+ return retVal;
1703
1337
  };
1704
1338
  const deserializeAws_restJson1RoleValues = (output, context) => {
1705
1339
  return {
@@ -1746,7 +1380,7 @@ const deserializeAws_restJson1UpdateError = (output, context) => {
1746
1380
  };
1747
1381
  };
1748
1382
  const deserializeAws_restJson1UpdateErrorList = (output, context) => {
1749
- return (output || [])
1383
+ const retVal = (output || [])
1750
1384
  .filter((e) => e != null)
1751
1385
  .map((entry) => {
1752
1386
  if (entry === null) {
@@ -1754,6 +1388,7 @@ const deserializeAws_restJson1UpdateErrorList = (output, context) => {
1754
1388
  }
1755
1389
  return deserializeAws_restJson1UpdateError(entry, context);
1756
1390
  });
1391
+ return retVal;
1757
1392
  };
1758
1393
  const deserializeAws_restJson1UpdateInstruction = (output, context) => {
1759
1394
  return {
@@ -1771,7 +1406,7 @@ const deserializeAws_restJson1User = (output, context) => {
1771
1406
  };
1772
1407
  };
1773
1408
  const deserializeAws_restJson1UserList = (output, context) => {
1774
- return (output || [])
1409
+ const retVal = (output || [])
1775
1410
  .filter((e) => e != null)
1776
1411
  .map((entry) => {
1777
1412
  if (entry === null) {
@@ -1779,6 +1414,7 @@ const deserializeAws_restJson1UserList = (output, context) => {
1779
1414
  }
1780
1415
  return deserializeAws_restJson1User(entry, context);
1781
1416
  });
1417
+ return retVal;
1782
1418
  };
1783
1419
  const deserializeAws_restJson1ValidationExceptionField = (output, context) => {
1784
1420
  return {
@@ -1787,7 +1423,7 @@ const deserializeAws_restJson1ValidationExceptionField = (output, context) => {
1787
1423
  };
1788
1424
  };
1789
1425
  const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) => {
1790
- return (output || [])
1426
+ const retVal = (output || [])
1791
1427
  .filter((e) => e != null)
1792
1428
  .map((entry) => {
1793
1429
  if (entry === null) {
@@ -1795,6 +1431,7 @@ const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) =
1795
1431
  }
1796
1432
  return deserializeAws_restJson1ValidationExceptionField(entry, context);
1797
1433
  });
1434
+ return retVal;
1798
1435
  };
1799
1436
  const deserializeAws_restJson1WorkspaceDescription = (output, context) => {
1800
1437
  return {
@@ -1838,7 +1475,7 @@ const deserializeAws_restJson1WorkspaceDescription = (output, context) => {
1838
1475
  };
1839
1476
  };
1840
1477
  const deserializeAws_restJson1WorkspaceList = (output, context) => {
1841
- return (output || [])
1478
+ const retVal = (output || [])
1842
1479
  .filter((e) => e != null)
1843
1480
  .map((entry) => {
1844
1481
  if (entry === null) {
@@ -1846,6 +1483,7 @@ const deserializeAws_restJson1WorkspaceList = (output, context) => {
1846
1483
  }
1847
1484
  return deserializeAws_restJson1WorkspaceSummary(entry, context);
1848
1485
  });
1486
+ return retVal;
1849
1487
  };
1850
1488
  const deserializeAws_restJson1WorkspaceSummary = (output, context) => {
1851
1489
  return {