@aws-sdk/client-amp 3.504.0 → 3.507.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.
@@ -344,7 +344,7 @@ export const se_UpdateWorkspaceAliasCommand = async (input, context) => {
344
344
  };
345
345
  export const de_CreateAlertManagerDefinitionCommand = async (output, context) => {
346
346
  if (output.statusCode !== 202 && output.statusCode >= 300) {
347
- return de_CreateAlertManagerDefinitionCommandError(output, context);
347
+ return de_CommandError(output, context);
348
348
  }
349
349
  const contents = map({
350
350
  $metadata: deserializeMetadata(output),
@@ -356,46 +356,9 @@ export const de_CreateAlertManagerDefinitionCommand = async (output, context) =>
356
356
  Object.assign(contents, doc);
357
357
  return contents;
358
358
  };
359
- const de_CreateAlertManagerDefinitionCommandError = async (output, context) => {
360
- const parsedOutput = {
361
- ...output,
362
- body: await parseErrorBody(output.body, context),
363
- };
364
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
365
- switch (errorCode) {
366
- case "AccessDeniedException":
367
- case "com.amazonaws.amp#AccessDeniedException":
368
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
369
- case "ConflictException":
370
- case "com.amazonaws.amp#ConflictException":
371
- throw await de_ConflictExceptionRes(parsedOutput, context);
372
- case "InternalServerException":
373
- case "com.amazonaws.amp#InternalServerException":
374
- throw await de_InternalServerExceptionRes(parsedOutput, context);
375
- case "ResourceNotFoundException":
376
- case "com.amazonaws.amp#ResourceNotFoundException":
377
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
378
- case "ServiceQuotaExceededException":
379
- case "com.amazonaws.amp#ServiceQuotaExceededException":
380
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
381
- case "ThrottlingException":
382
- case "com.amazonaws.amp#ThrottlingException":
383
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
384
- case "ValidationException":
385
- case "com.amazonaws.amp#ValidationException":
386
- throw await de_ValidationExceptionRes(parsedOutput, context);
387
- default:
388
- const parsedBody = parsedOutput.body;
389
- return throwDefaultError({
390
- output,
391
- parsedBody,
392
- errorCode,
393
- });
394
- }
395
- };
396
359
  export const de_CreateLoggingConfigurationCommand = async (output, context) => {
397
360
  if (output.statusCode !== 202 && output.statusCode >= 300) {
398
- return de_CreateLoggingConfigurationCommandError(output, context);
361
+ return de_CommandError(output, context);
399
362
  }
400
363
  const contents = map({
401
364
  $metadata: deserializeMetadata(output),
@@ -407,37 +370,9 @@ export const de_CreateLoggingConfigurationCommand = async (output, context) => {
407
370
  Object.assign(contents, doc);
408
371
  return contents;
409
372
  };
410
- const de_CreateLoggingConfigurationCommandError = async (output, context) => {
411
- const parsedOutput = {
412
- ...output,
413
- body: await parseErrorBody(output.body, context),
414
- };
415
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
416
- switch (errorCode) {
417
- case "AccessDeniedException":
418
- case "com.amazonaws.amp#AccessDeniedException":
419
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
420
- case "InternalServerException":
421
- case "com.amazonaws.amp#InternalServerException":
422
- throw await de_InternalServerExceptionRes(parsedOutput, context);
423
- case "ResourceNotFoundException":
424
- case "com.amazonaws.amp#ResourceNotFoundException":
425
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
426
- case "ValidationException":
427
- case "com.amazonaws.amp#ValidationException":
428
- throw await de_ValidationExceptionRes(parsedOutput, context);
429
- default:
430
- const parsedBody = parsedOutput.body;
431
- return throwDefaultError({
432
- output,
433
- parsedBody,
434
- errorCode,
435
- });
436
- }
437
- };
438
373
  export const de_CreateRuleGroupsNamespaceCommand = async (output, context) => {
439
374
  if (output.statusCode !== 202 && output.statusCode >= 300) {
440
- return de_CreateRuleGroupsNamespaceCommandError(output, context);
375
+ return de_CommandError(output, context);
441
376
  }
442
377
  const contents = map({
443
378
  $metadata: deserializeMetadata(output),
@@ -452,46 +387,9 @@ export const de_CreateRuleGroupsNamespaceCommand = async (output, context) => {
452
387
  Object.assign(contents, doc);
453
388
  return contents;
454
389
  };
455
- const de_CreateRuleGroupsNamespaceCommandError = async (output, context) => {
456
- const parsedOutput = {
457
- ...output,
458
- body: await parseErrorBody(output.body, context),
459
- };
460
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
461
- switch (errorCode) {
462
- case "AccessDeniedException":
463
- case "com.amazonaws.amp#AccessDeniedException":
464
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
465
- case "ConflictException":
466
- case "com.amazonaws.amp#ConflictException":
467
- throw await de_ConflictExceptionRes(parsedOutput, context);
468
- case "InternalServerException":
469
- case "com.amazonaws.amp#InternalServerException":
470
- throw await de_InternalServerExceptionRes(parsedOutput, context);
471
- case "ResourceNotFoundException":
472
- case "com.amazonaws.amp#ResourceNotFoundException":
473
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
474
- case "ServiceQuotaExceededException":
475
- case "com.amazonaws.amp#ServiceQuotaExceededException":
476
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
477
- case "ThrottlingException":
478
- case "com.amazonaws.amp#ThrottlingException":
479
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
480
- case "ValidationException":
481
- case "com.amazonaws.amp#ValidationException":
482
- throw await de_ValidationExceptionRes(parsedOutput, context);
483
- default:
484
- const parsedBody = parsedOutput.body;
485
- return throwDefaultError({
486
- output,
487
- parsedBody,
488
- errorCode,
489
- });
490
- }
491
- };
492
390
  export const de_CreateScraperCommand = async (output, context) => {
493
391
  if (output.statusCode !== 202 && output.statusCode >= 300) {
494
- return de_CreateScraperCommandError(output, context);
392
+ return de_CommandError(output, context);
495
393
  }
496
394
  const contents = map({
497
395
  $metadata: deserializeMetadata(output),
@@ -506,46 +404,9 @@ export const de_CreateScraperCommand = async (output, context) => {
506
404
  Object.assign(contents, doc);
507
405
  return contents;
508
406
  };
509
- const de_CreateScraperCommandError = async (output, context) => {
510
- const parsedOutput = {
511
- ...output,
512
- body: await parseErrorBody(output.body, context),
513
- };
514
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
515
- switch (errorCode) {
516
- case "AccessDeniedException":
517
- case "com.amazonaws.amp#AccessDeniedException":
518
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
519
- case "ConflictException":
520
- case "com.amazonaws.amp#ConflictException":
521
- throw await de_ConflictExceptionRes(parsedOutput, context);
522
- case "InternalServerException":
523
- case "com.amazonaws.amp#InternalServerException":
524
- throw await de_InternalServerExceptionRes(parsedOutput, context);
525
- case "ResourceNotFoundException":
526
- case "com.amazonaws.amp#ResourceNotFoundException":
527
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
528
- case "ServiceQuotaExceededException":
529
- case "com.amazonaws.amp#ServiceQuotaExceededException":
530
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
531
- case "ThrottlingException":
532
- case "com.amazonaws.amp#ThrottlingException":
533
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
534
- case "ValidationException":
535
- case "com.amazonaws.amp#ValidationException":
536
- throw await de_ValidationExceptionRes(parsedOutput, context);
537
- default:
538
- const parsedBody = parsedOutput.body;
539
- return throwDefaultError({
540
- output,
541
- parsedBody,
542
- errorCode,
543
- });
544
- }
545
- };
546
407
  export const de_CreateWorkspaceCommand = async (output, context) => {
547
408
  if (output.statusCode !== 202 && output.statusCode >= 300) {
548
- return de_CreateWorkspaceCommandError(output, context);
409
+ return de_CommandError(output, context);
549
410
  }
550
411
  const contents = map({
551
412
  $metadata: deserializeMetadata(output),
@@ -561,43 +422,9 @@ export const de_CreateWorkspaceCommand = async (output, context) => {
561
422
  Object.assign(contents, doc);
562
423
  return contents;
563
424
  };
564
- const de_CreateWorkspaceCommandError = async (output, context) => {
565
- const parsedOutput = {
566
- ...output,
567
- body: await parseErrorBody(output.body, context),
568
- };
569
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
570
- switch (errorCode) {
571
- case "AccessDeniedException":
572
- case "com.amazonaws.amp#AccessDeniedException":
573
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
574
- case "ConflictException":
575
- case "com.amazonaws.amp#ConflictException":
576
- throw await de_ConflictExceptionRes(parsedOutput, context);
577
- case "InternalServerException":
578
- case "com.amazonaws.amp#InternalServerException":
579
- throw await de_InternalServerExceptionRes(parsedOutput, context);
580
- case "ServiceQuotaExceededException":
581
- case "com.amazonaws.amp#ServiceQuotaExceededException":
582
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
583
- case "ThrottlingException":
584
- case "com.amazonaws.amp#ThrottlingException":
585
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
586
- case "ValidationException":
587
- case "com.amazonaws.amp#ValidationException":
588
- throw await de_ValidationExceptionRes(parsedOutput, context);
589
- default:
590
- const parsedBody = parsedOutput.body;
591
- return throwDefaultError({
592
- output,
593
- parsedBody,
594
- errorCode,
595
- });
596
- }
597
- };
598
425
  export const de_DeleteAlertManagerDefinitionCommand = async (output, context) => {
599
426
  if (output.statusCode !== 202 && output.statusCode >= 300) {
600
- return de_DeleteAlertManagerDefinitionCommandError(output, context);
427
+ return de_CommandError(output, context);
601
428
  }
602
429
  const contents = map({
603
430
  $metadata: deserializeMetadata(output),
@@ -605,43 +432,9 @@ export const de_DeleteAlertManagerDefinitionCommand = async (output, context) =>
605
432
  await collectBody(output.body, context);
606
433
  return contents;
607
434
  };
608
- const de_DeleteAlertManagerDefinitionCommandError = async (output, context) => {
609
- const parsedOutput = {
610
- ...output,
611
- body: await parseErrorBody(output.body, context),
612
- };
613
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
614
- switch (errorCode) {
615
- case "AccessDeniedException":
616
- case "com.amazonaws.amp#AccessDeniedException":
617
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
618
- case "ConflictException":
619
- case "com.amazonaws.amp#ConflictException":
620
- throw await de_ConflictExceptionRes(parsedOutput, context);
621
- case "InternalServerException":
622
- case "com.amazonaws.amp#InternalServerException":
623
- throw await de_InternalServerExceptionRes(parsedOutput, context);
624
- case "ResourceNotFoundException":
625
- case "com.amazonaws.amp#ResourceNotFoundException":
626
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
627
- case "ThrottlingException":
628
- case "com.amazonaws.amp#ThrottlingException":
629
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
630
- case "ValidationException":
631
- case "com.amazonaws.amp#ValidationException":
632
- throw await de_ValidationExceptionRes(parsedOutput, context);
633
- default:
634
- const parsedBody = parsedOutput.body;
635
- return throwDefaultError({
636
- output,
637
- parsedBody,
638
- errorCode,
639
- });
640
- }
641
- };
642
435
  export const de_DeleteLoggingConfigurationCommand = async (output, context) => {
643
436
  if (output.statusCode !== 202 && output.statusCode >= 300) {
644
- return de_DeleteLoggingConfigurationCommandError(output, context);
437
+ return de_CommandError(output, context);
645
438
  }
646
439
  const contents = map({
647
440
  $metadata: deserializeMetadata(output),
@@ -649,40 +442,9 @@ export const de_DeleteLoggingConfigurationCommand = async (output, context) => {
649
442
  await collectBody(output.body, context);
650
443
  return contents;
651
444
  };
652
- const de_DeleteLoggingConfigurationCommandError = async (output, context) => {
653
- const parsedOutput = {
654
- ...output,
655
- body: await parseErrorBody(output.body, context),
656
- };
657
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
658
- switch (errorCode) {
659
- case "AccessDeniedException":
660
- case "com.amazonaws.amp#AccessDeniedException":
661
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
662
- case "ConflictException":
663
- case "com.amazonaws.amp#ConflictException":
664
- throw await de_ConflictExceptionRes(parsedOutput, context);
665
- case "InternalServerException":
666
- case "com.amazonaws.amp#InternalServerException":
667
- throw await de_InternalServerExceptionRes(parsedOutput, context);
668
- case "ResourceNotFoundException":
669
- case "com.amazonaws.amp#ResourceNotFoundException":
670
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
671
- case "ValidationException":
672
- case "com.amazonaws.amp#ValidationException":
673
- throw await de_ValidationExceptionRes(parsedOutput, context);
674
- default:
675
- const parsedBody = parsedOutput.body;
676
- return throwDefaultError({
677
- output,
678
- parsedBody,
679
- errorCode,
680
- });
681
- }
682
- };
683
445
  export const de_DeleteRuleGroupsNamespaceCommand = async (output, context) => {
684
446
  if (output.statusCode !== 202 && output.statusCode >= 300) {
685
- return de_DeleteRuleGroupsNamespaceCommandError(output, context);
447
+ return de_CommandError(output, context);
686
448
  }
687
449
  const contents = map({
688
450
  $metadata: deserializeMetadata(output),
@@ -690,92 +452,24 @@ export const de_DeleteRuleGroupsNamespaceCommand = async (output, context) => {
690
452
  await collectBody(output.body, context);
691
453
  return contents;
692
454
  };
693
- const de_DeleteRuleGroupsNamespaceCommandError = async (output, context) => {
694
- const parsedOutput = {
695
- ...output,
696
- body: await parseErrorBody(output.body, context),
697
- };
698
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
699
- switch (errorCode) {
700
- case "AccessDeniedException":
701
- case "com.amazonaws.amp#AccessDeniedException":
702
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
703
- case "ConflictException":
704
- case "com.amazonaws.amp#ConflictException":
705
- throw await de_ConflictExceptionRes(parsedOutput, context);
706
- case "InternalServerException":
707
- case "com.amazonaws.amp#InternalServerException":
708
- throw await de_InternalServerExceptionRes(parsedOutput, context);
709
- case "ResourceNotFoundException":
710
- case "com.amazonaws.amp#ResourceNotFoundException":
711
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
712
- case "ThrottlingException":
713
- case "com.amazonaws.amp#ThrottlingException":
714
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
715
- case "ValidationException":
716
- case "com.amazonaws.amp#ValidationException":
717
- throw await de_ValidationExceptionRes(parsedOutput, context);
718
- default:
719
- const parsedBody = parsedOutput.body;
720
- return throwDefaultError({
721
- output,
722
- parsedBody,
723
- errorCode,
724
- });
725
- }
726
- };
727
- export const de_DeleteScraperCommand = async (output, context) => {
728
- if (output.statusCode !== 202 && output.statusCode >= 300) {
729
- return de_DeleteScraperCommandError(output, context);
730
- }
731
- const contents = map({
732
- $metadata: deserializeMetadata(output),
733
- });
734
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
735
- const doc = take(data, {
736
- scraperId: __expectString,
737
- status: _json,
738
- });
739
- Object.assign(contents, doc);
740
- return contents;
741
- };
742
- const de_DeleteScraperCommandError = async (output, context) => {
743
- const parsedOutput = {
744
- ...output,
745
- body: await parseErrorBody(output.body, context),
746
- };
747
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
748
- switch (errorCode) {
749
- case "AccessDeniedException":
750
- case "com.amazonaws.amp#AccessDeniedException":
751
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
752
- case "ConflictException":
753
- case "com.amazonaws.amp#ConflictException":
754
- throw await de_ConflictExceptionRes(parsedOutput, context);
755
- case "InternalServerException":
756
- case "com.amazonaws.amp#InternalServerException":
757
- throw await de_InternalServerExceptionRes(parsedOutput, context);
758
- case "ResourceNotFoundException":
759
- case "com.amazonaws.amp#ResourceNotFoundException":
760
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
761
- case "ThrottlingException":
762
- case "com.amazonaws.amp#ThrottlingException":
763
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
764
- case "ValidationException":
765
- case "com.amazonaws.amp#ValidationException":
766
- throw await de_ValidationExceptionRes(parsedOutput, context);
767
- default:
768
- const parsedBody = parsedOutput.body;
769
- return throwDefaultError({
770
- output,
771
- parsedBody,
772
- errorCode,
773
- });
455
+ export const de_DeleteScraperCommand = async (output, context) => {
456
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
457
+ return de_CommandError(output, context);
774
458
  }
459
+ const contents = map({
460
+ $metadata: deserializeMetadata(output),
461
+ });
462
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
463
+ const doc = take(data, {
464
+ scraperId: __expectString,
465
+ status: _json,
466
+ });
467
+ Object.assign(contents, doc);
468
+ return contents;
775
469
  };
776
470
  export const de_DeleteWorkspaceCommand = async (output, context) => {
777
471
  if (output.statusCode !== 202 && output.statusCode >= 300) {
778
- return de_DeleteWorkspaceCommandError(output, context);
472
+ return de_CommandError(output, context);
779
473
  }
780
474
  const contents = map({
781
475
  $metadata: deserializeMetadata(output),
@@ -783,43 +477,9 @@ export const de_DeleteWorkspaceCommand = async (output, context) => {
783
477
  await collectBody(output.body, context);
784
478
  return contents;
785
479
  };
786
- const de_DeleteWorkspaceCommandError = async (output, context) => {
787
- const parsedOutput = {
788
- ...output,
789
- body: await parseErrorBody(output.body, context),
790
- };
791
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
792
- switch (errorCode) {
793
- case "AccessDeniedException":
794
- case "com.amazonaws.amp#AccessDeniedException":
795
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
796
- case "ConflictException":
797
- case "com.amazonaws.amp#ConflictException":
798
- throw await de_ConflictExceptionRes(parsedOutput, context);
799
- case "InternalServerException":
800
- case "com.amazonaws.amp#InternalServerException":
801
- throw await de_InternalServerExceptionRes(parsedOutput, context);
802
- case "ResourceNotFoundException":
803
- case "com.amazonaws.amp#ResourceNotFoundException":
804
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
805
- case "ThrottlingException":
806
- case "com.amazonaws.amp#ThrottlingException":
807
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
808
- case "ValidationException":
809
- case "com.amazonaws.amp#ValidationException":
810
- throw await de_ValidationExceptionRes(parsedOutput, context);
811
- default:
812
- const parsedBody = parsedOutput.body;
813
- return throwDefaultError({
814
- output,
815
- parsedBody,
816
- errorCode,
817
- });
818
- }
819
- };
820
480
  export const de_DescribeAlertManagerDefinitionCommand = async (output, context) => {
821
481
  if (output.statusCode !== 200 && output.statusCode >= 300) {
822
- return de_DescribeAlertManagerDefinitionCommandError(output, context);
482
+ return de_CommandError(output, context);
823
483
  }
824
484
  const contents = map({
825
485
  $metadata: deserializeMetadata(output),
@@ -831,40 +491,9 @@ export const de_DescribeAlertManagerDefinitionCommand = async (output, context)
831
491
  Object.assign(contents, doc);
832
492
  return contents;
833
493
  };
834
- const de_DescribeAlertManagerDefinitionCommandError = async (output, context) => {
835
- const parsedOutput = {
836
- ...output,
837
- body: await parseErrorBody(output.body, context),
838
- };
839
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
840
- switch (errorCode) {
841
- case "AccessDeniedException":
842
- case "com.amazonaws.amp#AccessDeniedException":
843
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
844
- case "InternalServerException":
845
- case "com.amazonaws.amp#InternalServerException":
846
- throw await de_InternalServerExceptionRes(parsedOutput, context);
847
- case "ResourceNotFoundException":
848
- case "com.amazonaws.amp#ResourceNotFoundException":
849
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
850
- case "ThrottlingException":
851
- case "com.amazonaws.amp#ThrottlingException":
852
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
853
- case "ValidationException":
854
- case "com.amazonaws.amp#ValidationException":
855
- throw await de_ValidationExceptionRes(parsedOutput, context);
856
- default:
857
- const parsedBody = parsedOutput.body;
858
- return throwDefaultError({
859
- output,
860
- parsedBody,
861
- errorCode,
862
- });
863
- }
864
- };
865
494
  export const de_DescribeLoggingConfigurationCommand = async (output, context) => {
866
495
  if (output.statusCode !== 200 && output.statusCode >= 300) {
867
- return de_DescribeLoggingConfigurationCommandError(output, context);
496
+ return de_CommandError(output, context);
868
497
  }
869
498
  const contents = map({
870
499
  $metadata: deserializeMetadata(output),
@@ -876,37 +505,9 @@ export const de_DescribeLoggingConfigurationCommand = async (output, context) =>
876
505
  Object.assign(contents, doc);
877
506
  return contents;
878
507
  };
879
- const de_DescribeLoggingConfigurationCommandError = async (output, context) => {
880
- const parsedOutput = {
881
- ...output,
882
- body: await parseErrorBody(output.body, context),
883
- };
884
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
885
- switch (errorCode) {
886
- case "AccessDeniedException":
887
- case "com.amazonaws.amp#AccessDeniedException":
888
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
889
- case "InternalServerException":
890
- case "com.amazonaws.amp#InternalServerException":
891
- throw await de_InternalServerExceptionRes(parsedOutput, context);
892
- case "ResourceNotFoundException":
893
- case "com.amazonaws.amp#ResourceNotFoundException":
894
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
895
- case "ValidationException":
896
- case "com.amazonaws.amp#ValidationException":
897
- throw await de_ValidationExceptionRes(parsedOutput, context);
898
- default:
899
- const parsedBody = parsedOutput.body;
900
- return throwDefaultError({
901
- output,
902
- parsedBody,
903
- errorCode,
904
- });
905
- }
906
- };
907
508
  export const de_DescribeRuleGroupsNamespaceCommand = async (output, context) => {
908
509
  if (output.statusCode !== 200 && output.statusCode >= 300) {
909
- return de_DescribeRuleGroupsNamespaceCommandError(output, context);
510
+ return de_CommandError(output, context);
910
511
  }
911
512
  const contents = map({
912
513
  $metadata: deserializeMetadata(output),
@@ -918,40 +519,9 @@ export const de_DescribeRuleGroupsNamespaceCommand = async (output, context) =>
918
519
  Object.assign(contents, doc);
919
520
  return contents;
920
521
  };
921
- const de_DescribeRuleGroupsNamespaceCommandError = async (output, context) => {
922
- const parsedOutput = {
923
- ...output,
924
- body: await parseErrorBody(output.body, context),
925
- };
926
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
927
- switch (errorCode) {
928
- case "AccessDeniedException":
929
- case "com.amazonaws.amp#AccessDeniedException":
930
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
931
- case "InternalServerException":
932
- case "com.amazonaws.amp#InternalServerException":
933
- throw await de_InternalServerExceptionRes(parsedOutput, context);
934
- case "ResourceNotFoundException":
935
- case "com.amazonaws.amp#ResourceNotFoundException":
936
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
937
- case "ThrottlingException":
938
- case "com.amazonaws.amp#ThrottlingException":
939
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
940
- case "ValidationException":
941
- case "com.amazonaws.amp#ValidationException":
942
- throw await de_ValidationExceptionRes(parsedOutput, context);
943
- default:
944
- const parsedBody = parsedOutput.body;
945
- return throwDefaultError({
946
- output,
947
- parsedBody,
948
- errorCode,
949
- });
950
- }
951
- };
952
522
  export const de_DescribeScraperCommand = async (output, context) => {
953
523
  if (output.statusCode !== 200 && output.statusCode >= 300) {
954
- return de_DescribeScraperCommandError(output, context);
524
+ return de_CommandError(output, context);
955
525
  }
956
526
  const contents = map({
957
527
  $metadata: deserializeMetadata(output),
@@ -963,40 +533,9 @@ export const de_DescribeScraperCommand = async (output, context) => {
963
533
  Object.assign(contents, doc);
964
534
  return contents;
965
535
  };
966
- const de_DescribeScraperCommandError = async (output, context) => {
967
- const parsedOutput = {
968
- ...output,
969
- body: await parseErrorBody(output.body, context),
970
- };
971
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
972
- switch (errorCode) {
973
- case "AccessDeniedException":
974
- case "com.amazonaws.amp#AccessDeniedException":
975
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
976
- case "InternalServerException":
977
- case "com.amazonaws.amp#InternalServerException":
978
- throw await de_InternalServerExceptionRes(parsedOutput, context);
979
- case "ResourceNotFoundException":
980
- case "com.amazonaws.amp#ResourceNotFoundException":
981
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
982
- case "ThrottlingException":
983
- case "com.amazonaws.amp#ThrottlingException":
984
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
985
- case "ValidationException":
986
- case "com.amazonaws.amp#ValidationException":
987
- throw await de_ValidationExceptionRes(parsedOutput, context);
988
- default:
989
- const parsedBody = parsedOutput.body;
990
- return throwDefaultError({
991
- output,
992
- parsedBody,
993
- errorCode,
994
- });
995
- }
996
- };
997
536
  export const de_DescribeWorkspaceCommand = async (output, context) => {
998
537
  if (output.statusCode !== 200 && output.statusCode >= 300) {
999
- return de_DescribeWorkspaceCommandError(output, context);
538
+ return de_CommandError(output, context);
1000
539
  }
1001
540
  const contents = map({
1002
541
  $metadata: deserializeMetadata(output),
@@ -1008,40 +547,9 @@ export const de_DescribeWorkspaceCommand = async (output, context) => {
1008
547
  Object.assign(contents, doc);
1009
548
  return contents;
1010
549
  };
1011
- const de_DescribeWorkspaceCommandError = async (output, context) => {
1012
- const parsedOutput = {
1013
- ...output,
1014
- body: await parseErrorBody(output.body, context),
1015
- };
1016
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1017
- switch (errorCode) {
1018
- case "AccessDeniedException":
1019
- case "com.amazonaws.amp#AccessDeniedException":
1020
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1021
- case "InternalServerException":
1022
- case "com.amazonaws.amp#InternalServerException":
1023
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1024
- case "ResourceNotFoundException":
1025
- case "com.amazonaws.amp#ResourceNotFoundException":
1026
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1027
- case "ThrottlingException":
1028
- case "com.amazonaws.amp#ThrottlingException":
1029
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1030
- case "ValidationException":
1031
- case "com.amazonaws.amp#ValidationException":
1032
- throw await de_ValidationExceptionRes(parsedOutput, context);
1033
- default:
1034
- const parsedBody = parsedOutput.body;
1035
- return throwDefaultError({
1036
- output,
1037
- parsedBody,
1038
- errorCode,
1039
- });
1040
- }
1041
- };
1042
550
  export const de_GetDefaultScraperConfigurationCommand = async (output, context) => {
1043
551
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1044
- return de_GetDefaultScraperConfigurationCommandError(output, context);
552
+ return de_CommandError(output, context);
1045
553
  }
1046
554
  const contents = map({
1047
555
  $metadata: deserializeMetadata(output),
@@ -1053,80 +561,24 @@ export const de_GetDefaultScraperConfigurationCommand = async (output, context)
1053
561
  Object.assign(contents, doc);
1054
562
  return contents;
1055
563
  };
1056
- const de_GetDefaultScraperConfigurationCommandError = async (output, context) => {
1057
- const parsedOutput = {
1058
- ...output,
1059
- body: await parseErrorBody(output.body, context),
1060
- };
1061
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1062
- switch (errorCode) {
1063
- case "AccessDeniedException":
1064
- case "com.amazonaws.amp#AccessDeniedException":
1065
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1066
- case "InternalServerException":
1067
- case "com.amazonaws.amp#InternalServerException":
1068
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1069
- case "ThrottlingException":
1070
- case "com.amazonaws.amp#ThrottlingException":
1071
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1072
- default:
1073
- const parsedBody = parsedOutput.body;
1074
- return throwDefaultError({
1075
- output,
1076
- parsedBody,
1077
- errorCode,
1078
- });
1079
- }
1080
- };
1081
564
  export const de_ListRuleGroupsNamespacesCommand = async (output, context) => {
1082
565
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1083
- return de_ListRuleGroupsNamespacesCommandError(output, context);
1084
- }
1085
- const contents = map({
1086
- $metadata: deserializeMetadata(output),
1087
- });
1088
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1089
- const doc = take(data, {
1090
- nextToken: __expectString,
1091
- ruleGroupsNamespaces: (_) => de_RuleGroupsNamespaceSummaryList(_, context),
1092
- });
1093
- Object.assign(contents, doc);
1094
- return contents;
1095
- };
1096
- const de_ListRuleGroupsNamespacesCommandError = async (output, context) => {
1097
- const parsedOutput = {
1098
- ...output,
1099
- body: await parseErrorBody(output.body, context),
1100
- };
1101
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1102
- switch (errorCode) {
1103
- case "AccessDeniedException":
1104
- case "com.amazonaws.amp#AccessDeniedException":
1105
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1106
- case "InternalServerException":
1107
- case "com.amazonaws.amp#InternalServerException":
1108
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1109
- case "ResourceNotFoundException":
1110
- case "com.amazonaws.amp#ResourceNotFoundException":
1111
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1112
- case "ThrottlingException":
1113
- case "com.amazonaws.amp#ThrottlingException":
1114
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1115
- case "ValidationException":
1116
- case "com.amazonaws.amp#ValidationException":
1117
- throw await de_ValidationExceptionRes(parsedOutput, context);
1118
- default:
1119
- const parsedBody = parsedOutput.body;
1120
- return throwDefaultError({
1121
- output,
1122
- parsedBody,
1123
- errorCode,
1124
- });
566
+ return de_CommandError(output, context);
1125
567
  }
568
+ const contents = map({
569
+ $metadata: deserializeMetadata(output),
570
+ });
571
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
572
+ const doc = take(data, {
573
+ nextToken: __expectString,
574
+ ruleGroupsNamespaces: (_) => de_RuleGroupsNamespaceSummaryList(_, context),
575
+ });
576
+ Object.assign(contents, doc);
577
+ return contents;
1126
578
  };
1127
579
  export const de_ListScrapersCommand = async (output, context) => {
1128
580
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1129
- return de_ListScrapersCommandError(output, context);
581
+ return de_CommandError(output, context);
1130
582
  }
1131
583
  const contents = map({
1132
584
  $metadata: deserializeMetadata(output),
@@ -1139,37 +591,9 @@ export const de_ListScrapersCommand = async (output, context) => {
1139
591
  Object.assign(contents, doc);
1140
592
  return contents;
1141
593
  };
1142
- const de_ListScrapersCommandError = async (output, context) => {
1143
- const parsedOutput = {
1144
- ...output,
1145
- body: await parseErrorBody(output.body, context),
1146
- };
1147
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1148
- switch (errorCode) {
1149
- case "AccessDeniedException":
1150
- case "com.amazonaws.amp#AccessDeniedException":
1151
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1152
- case "InternalServerException":
1153
- case "com.amazonaws.amp#InternalServerException":
1154
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1155
- case "ThrottlingException":
1156
- case "com.amazonaws.amp#ThrottlingException":
1157
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1158
- case "ValidationException":
1159
- case "com.amazonaws.amp#ValidationException":
1160
- throw await de_ValidationExceptionRes(parsedOutput, context);
1161
- default:
1162
- const parsedBody = parsedOutput.body;
1163
- return throwDefaultError({
1164
- output,
1165
- parsedBody,
1166
- errorCode,
1167
- });
1168
- }
1169
- };
1170
594
  export const de_ListTagsForResourceCommand = async (output, context) => {
1171
595
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1172
- return de_ListTagsForResourceCommandError(output, context);
596
+ return de_CommandError(output, context);
1173
597
  }
1174
598
  const contents = map({
1175
599
  $metadata: deserializeMetadata(output),
@@ -1181,40 +605,9 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
1181
605
  Object.assign(contents, doc);
1182
606
  return contents;
1183
607
  };
1184
- const de_ListTagsForResourceCommandError = async (output, context) => {
1185
- const parsedOutput = {
1186
- ...output,
1187
- body: await parseErrorBody(output.body, context),
1188
- };
1189
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1190
- switch (errorCode) {
1191
- case "AccessDeniedException":
1192
- case "com.amazonaws.amp#AccessDeniedException":
1193
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1194
- case "InternalServerException":
1195
- case "com.amazonaws.amp#InternalServerException":
1196
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1197
- case "ResourceNotFoundException":
1198
- case "com.amazonaws.amp#ResourceNotFoundException":
1199
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1200
- case "ThrottlingException":
1201
- case "com.amazonaws.amp#ThrottlingException":
1202
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1203
- case "ValidationException":
1204
- case "com.amazonaws.amp#ValidationException":
1205
- throw await de_ValidationExceptionRes(parsedOutput, context);
1206
- default:
1207
- const parsedBody = parsedOutput.body;
1208
- return throwDefaultError({
1209
- output,
1210
- parsedBody,
1211
- errorCode,
1212
- });
1213
- }
1214
- };
1215
608
  export const de_ListWorkspacesCommand = async (output, context) => {
1216
609
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1217
- return de_ListWorkspacesCommandError(output, context);
610
+ return de_CommandError(output, context);
1218
611
  }
1219
612
  const contents = map({
1220
613
  $metadata: deserializeMetadata(output),
@@ -1227,37 +620,9 @@ export const de_ListWorkspacesCommand = async (output, context) => {
1227
620
  Object.assign(contents, doc);
1228
621
  return contents;
1229
622
  };
1230
- const de_ListWorkspacesCommandError = async (output, context) => {
1231
- const parsedOutput = {
1232
- ...output,
1233
- body: await parseErrorBody(output.body, context),
1234
- };
1235
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1236
- switch (errorCode) {
1237
- case "AccessDeniedException":
1238
- case "com.amazonaws.amp#AccessDeniedException":
1239
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1240
- case "InternalServerException":
1241
- case "com.amazonaws.amp#InternalServerException":
1242
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1243
- case "ThrottlingException":
1244
- case "com.amazonaws.amp#ThrottlingException":
1245
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1246
- case "ValidationException":
1247
- case "com.amazonaws.amp#ValidationException":
1248
- throw await de_ValidationExceptionRes(parsedOutput, context);
1249
- default:
1250
- const parsedBody = parsedOutput.body;
1251
- return throwDefaultError({
1252
- output,
1253
- parsedBody,
1254
- errorCode,
1255
- });
1256
- }
1257
- };
1258
623
  export const de_PutAlertManagerDefinitionCommand = async (output, context) => {
1259
624
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1260
- return de_PutAlertManagerDefinitionCommandError(output, context);
625
+ return de_CommandError(output, context);
1261
626
  }
1262
627
  const contents = map({
1263
628
  $metadata: deserializeMetadata(output),
@@ -1269,46 +634,9 @@ export const de_PutAlertManagerDefinitionCommand = async (output, context) => {
1269
634
  Object.assign(contents, doc);
1270
635
  return contents;
1271
636
  };
1272
- const de_PutAlertManagerDefinitionCommandError = async (output, context) => {
1273
- const parsedOutput = {
1274
- ...output,
1275
- body: await parseErrorBody(output.body, context),
1276
- };
1277
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1278
- switch (errorCode) {
1279
- case "AccessDeniedException":
1280
- case "com.amazonaws.amp#AccessDeniedException":
1281
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1282
- case "ConflictException":
1283
- case "com.amazonaws.amp#ConflictException":
1284
- throw await de_ConflictExceptionRes(parsedOutput, context);
1285
- case "InternalServerException":
1286
- case "com.amazonaws.amp#InternalServerException":
1287
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1288
- case "ResourceNotFoundException":
1289
- case "com.amazonaws.amp#ResourceNotFoundException":
1290
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1291
- case "ServiceQuotaExceededException":
1292
- case "com.amazonaws.amp#ServiceQuotaExceededException":
1293
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1294
- case "ThrottlingException":
1295
- case "com.amazonaws.amp#ThrottlingException":
1296
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1297
- case "ValidationException":
1298
- case "com.amazonaws.amp#ValidationException":
1299
- throw await de_ValidationExceptionRes(parsedOutput, context);
1300
- default:
1301
- const parsedBody = parsedOutput.body;
1302
- return throwDefaultError({
1303
- output,
1304
- parsedBody,
1305
- errorCode,
1306
- });
1307
- }
1308
- };
1309
637
  export const de_PutRuleGroupsNamespaceCommand = async (output, context) => {
1310
638
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1311
- return de_PutRuleGroupsNamespaceCommandError(output, context);
639
+ return de_CommandError(output, context);
1312
640
  }
1313
641
  const contents = map({
1314
642
  $metadata: deserializeMetadata(output),
@@ -1323,46 +651,9 @@ export const de_PutRuleGroupsNamespaceCommand = async (output, context) => {
1323
651
  Object.assign(contents, doc);
1324
652
  return contents;
1325
653
  };
1326
- const de_PutRuleGroupsNamespaceCommandError = async (output, context) => {
1327
- const parsedOutput = {
1328
- ...output,
1329
- body: await parseErrorBody(output.body, context),
1330
- };
1331
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1332
- switch (errorCode) {
1333
- case "AccessDeniedException":
1334
- case "com.amazonaws.amp#AccessDeniedException":
1335
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1336
- case "ConflictException":
1337
- case "com.amazonaws.amp#ConflictException":
1338
- throw await de_ConflictExceptionRes(parsedOutput, context);
1339
- case "InternalServerException":
1340
- case "com.amazonaws.amp#InternalServerException":
1341
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1342
- case "ResourceNotFoundException":
1343
- case "com.amazonaws.amp#ResourceNotFoundException":
1344
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1345
- case "ServiceQuotaExceededException":
1346
- case "com.amazonaws.amp#ServiceQuotaExceededException":
1347
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1348
- case "ThrottlingException":
1349
- case "com.amazonaws.amp#ThrottlingException":
1350
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1351
- case "ValidationException":
1352
- case "com.amazonaws.amp#ValidationException":
1353
- throw await de_ValidationExceptionRes(parsedOutput, context);
1354
- default:
1355
- const parsedBody = parsedOutput.body;
1356
- return throwDefaultError({
1357
- output,
1358
- parsedBody,
1359
- errorCode,
1360
- });
1361
- }
1362
- };
1363
654
  export const de_TagResourceCommand = async (output, context) => {
1364
655
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1365
- return de_TagResourceCommandError(output, context);
656
+ return de_CommandError(output, context);
1366
657
  }
1367
658
  const contents = map({
1368
659
  $metadata: deserializeMetadata(output),
@@ -1370,40 +661,9 @@ export const de_TagResourceCommand = async (output, context) => {
1370
661
  await collectBody(output.body, context);
1371
662
  return contents;
1372
663
  };
1373
- const de_TagResourceCommandError = async (output, context) => {
1374
- const parsedOutput = {
1375
- ...output,
1376
- body: await parseErrorBody(output.body, context),
1377
- };
1378
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1379
- switch (errorCode) {
1380
- case "AccessDeniedException":
1381
- case "com.amazonaws.amp#AccessDeniedException":
1382
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1383
- case "InternalServerException":
1384
- case "com.amazonaws.amp#InternalServerException":
1385
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1386
- case "ResourceNotFoundException":
1387
- case "com.amazonaws.amp#ResourceNotFoundException":
1388
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1389
- case "ThrottlingException":
1390
- case "com.amazonaws.amp#ThrottlingException":
1391
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1392
- case "ValidationException":
1393
- case "com.amazonaws.amp#ValidationException":
1394
- throw await de_ValidationExceptionRes(parsedOutput, context);
1395
- default:
1396
- const parsedBody = parsedOutput.body;
1397
- return throwDefaultError({
1398
- output,
1399
- parsedBody,
1400
- errorCode,
1401
- });
1402
- }
1403
- };
1404
664
  export const de_UntagResourceCommand = async (output, context) => {
1405
665
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1406
- return de_UntagResourceCommandError(output, context);
666
+ return de_CommandError(output, context);
1407
667
  }
1408
668
  const contents = map({
1409
669
  $metadata: deserializeMetadata(output),
@@ -1411,40 +671,9 @@ export const de_UntagResourceCommand = async (output, context) => {
1411
671
  await collectBody(output.body, context);
1412
672
  return contents;
1413
673
  };
1414
- const de_UntagResourceCommandError = async (output, context) => {
1415
- const parsedOutput = {
1416
- ...output,
1417
- body: await parseErrorBody(output.body, context),
1418
- };
1419
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1420
- switch (errorCode) {
1421
- case "AccessDeniedException":
1422
- case "com.amazonaws.amp#AccessDeniedException":
1423
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1424
- case "InternalServerException":
1425
- case "com.amazonaws.amp#InternalServerException":
1426
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1427
- case "ResourceNotFoundException":
1428
- case "com.amazonaws.amp#ResourceNotFoundException":
1429
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1430
- case "ThrottlingException":
1431
- case "com.amazonaws.amp#ThrottlingException":
1432
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1433
- case "ValidationException":
1434
- case "com.amazonaws.amp#ValidationException":
1435
- throw await de_ValidationExceptionRes(parsedOutput, context);
1436
- default:
1437
- const parsedBody = parsedOutput.body;
1438
- return throwDefaultError({
1439
- output,
1440
- parsedBody,
1441
- errorCode,
1442
- });
1443
- }
1444
- };
1445
674
  export const de_UpdateLoggingConfigurationCommand = async (output, context) => {
1446
675
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1447
- return de_UpdateLoggingConfigurationCommandError(output, context);
676
+ return de_CommandError(output, context);
1448
677
  }
1449
678
  const contents = map({
1450
679
  $metadata: deserializeMetadata(output),
@@ -1456,40 +685,9 @@ export const de_UpdateLoggingConfigurationCommand = async (output, context) => {
1456
685
  Object.assign(contents, doc);
1457
686
  return contents;
1458
687
  };
1459
- const de_UpdateLoggingConfigurationCommandError = async (output, context) => {
1460
- const parsedOutput = {
1461
- ...output,
1462
- body: await parseErrorBody(output.body, context),
1463
- };
1464
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1465
- switch (errorCode) {
1466
- case "AccessDeniedException":
1467
- case "com.amazonaws.amp#AccessDeniedException":
1468
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1469
- case "ConflictException":
1470
- case "com.amazonaws.amp#ConflictException":
1471
- throw await de_ConflictExceptionRes(parsedOutput, context);
1472
- case "InternalServerException":
1473
- case "com.amazonaws.amp#InternalServerException":
1474
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1475
- case "ResourceNotFoundException":
1476
- case "com.amazonaws.amp#ResourceNotFoundException":
1477
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1478
- case "ValidationException":
1479
- case "com.amazonaws.amp#ValidationException":
1480
- throw await de_ValidationExceptionRes(parsedOutput, context);
1481
- default:
1482
- const parsedBody = parsedOutput.body;
1483
- return throwDefaultError({
1484
- output,
1485
- parsedBody,
1486
- errorCode,
1487
- });
1488
- }
1489
- };
1490
688
  export const de_UpdateWorkspaceAliasCommand = async (output, context) => {
1491
689
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1492
- return de_UpdateWorkspaceAliasCommandError(output, context);
690
+ return de_CommandError(output, context);
1493
691
  }
1494
692
  const contents = map({
1495
693
  $metadata: deserializeMetadata(output),
@@ -1497,7 +695,7 @@ export const de_UpdateWorkspaceAliasCommand = async (output, context) => {
1497
695
  await collectBody(output.body, context);
1498
696
  return contents;
1499
697
  };
1500
- const de_UpdateWorkspaceAliasCommandError = async (output, context) => {
698
+ const de_CommandError = async (output, context) => {
1501
699
  const parsedOutput = {
1502
700
  ...output,
1503
701
  body: await parseErrorBody(output.body, context),