@aws-sdk/client-eventbridge 3.504.0 → 3.509.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.
@@ -340,7 +340,7 @@ export const se_UpdateEndpointCommand = async (input, context) => {
340
340
  };
341
341
  export const de_ActivateEventSourceCommand = async (output, context) => {
342
342
  if (output.statusCode >= 300) {
343
- return de_ActivateEventSourceCommandError(output, context);
343
+ return de_CommandError(output, context);
344
344
  }
345
345
  await collectBody(output.body, context);
346
346
  const response = {
@@ -348,40 +348,9 @@ export const de_ActivateEventSourceCommand = async (output, context) => {
348
348
  };
349
349
  return response;
350
350
  };
351
- const de_ActivateEventSourceCommandError = async (output, context) => {
352
- const parsedOutput = {
353
- ...output,
354
- body: await parseErrorBody(output.body, context),
355
- };
356
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
357
- switch (errorCode) {
358
- case "ConcurrentModificationException":
359
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
360
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
361
- case "InternalException":
362
- case "com.amazonaws.eventbridge#InternalException":
363
- throw await de_InternalExceptionRes(parsedOutput, context);
364
- case "InvalidStateException":
365
- case "com.amazonaws.eventbridge#InvalidStateException":
366
- throw await de_InvalidStateExceptionRes(parsedOutput, context);
367
- case "OperationDisabledException":
368
- case "com.amazonaws.eventbridge#OperationDisabledException":
369
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
370
- case "ResourceNotFoundException":
371
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
372
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
373
- default:
374
- const parsedBody = parsedOutput.body;
375
- return throwDefaultError({
376
- output,
377
- parsedBody,
378
- errorCode,
379
- });
380
- }
381
- };
382
351
  export const de_CancelReplayCommand = async (output, context) => {
383
352
  if (output.statusCode >= 300) {
384
- return de_CancelReplayCommandError(output, context);
353
+ return de_CommandError(output, context);
385
354
  }
386
355
  const data = await parseBody(output.body, context);
387
356
  let contents = {};
@@ -392,37 +361,9 @@ export const de_CancelReplayCommand = async (output, context) => {
392
361
  };
393
362
  return response;
394
363
  };
395
- const de_CancelReplayCommandError = async (output, context) => {
396
- const parsedOutput = {
397
- ...output,
398
- body: await parseErrorBody(output.body, context),
399
- };
400
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
401
- switch (errorCode) {
402
- case "ConcurrentModificationException":
403
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
404
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
405
- case "IllegalStatusException":
406
- case "com.amazonaws.eventbridge#IllegalStatusException":
407
- throw await de_IllegalStatusExceptionRes(parsedOutput, context);
408
- case "InternalException":
409
- case "com.amazonaws.eventbridge#InternalException":
410
- throw await de_InternalExceptionRes(parsedOutput, context);
411
- case "ResourceNotFoundException":
412
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
413
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
414
- default:
415
- const parsedBody = parsedOutput.body;
416
- return throwDefaultError({
417
- output,
418
- parsedBody,
419
- errorCode,
420
- });
421
- }
422
- };
423
364
  export const de_CreateApiDestinationCommand = async (output, context) => {
424
365
  if (output.statusCode >= 300) {
425
- return de_CreateApiDestinationCommandError(output, context);
366
+ return de_CommandError(output, context);
426
367
  }
427
368
  const data = await parseBody(output.body, context);
428
369
  let contents = {};
@@ -433,37 +374,9 @@ export const de_CreateApiDestinationCommand = async (output, context) => {
433
374
  };
434
375
  return response;
435
376
  };
436
- const de_CreateApiDestinationCommandError = async (output, context) => {
437
- const parsedOutput = {
438
- ...output,
439
- body: await parseErrorBody(output.body, context),
440
- };
441
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
442
- switch (errorCode) {
443
- case "InternalException":
444
- case "com.amazonaws.eventbridge#InternalException":
445
- throw await de_InternalExceptionRes(parsedOutput, context);
446
- case "LimitExceededException":
447
- case "com.amazonaws.eventbridge#LimitExceededException":
448
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
449
- case "ResourceAlreadyExistsException":
450
- case "com.amazonaws.eventbridge#ResourceAlreadyExistsException":
451
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
452
- case "ResourceNotFoundException":
453
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
454
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
455
- default:
456
- const parsedBody = parsedOutput.body;
457
- return throwDefaultError({
458
- output,
459
- parsedBody,
460
- errorCode,
461
- });
462
- }
463
- };
464
377
  export const de_CreateArchiveCommand = async (output, context) => {
465
378
  if (output.statusCode >= 300) {
466
- return de_CreateArchiveCommandError(output, context);
379
+ return de_CommandError(output, context);
467
380
  }
468
381
  const data = await parseBody(output.body, context);
469
382
  let contents = {};
@@ -474,43 +387,9 @@ export const de_CreateArchiveCommand = async (output, context) => {
474
387
  };
475
388
  return response;
476
389
  };
477
- const de_CreateArchiveCommandError = async (output, context) => {
478
- const parsedOutput = {
479
- ...output,
480
- body: await parseErrorBody(output.body, context),
481
- };
482
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
483
- switch (errorCode) {
484
- case "ConcurrentModificationException":
485
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
486
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
487
- case "InternalException":
488
- case "com.amazonaws.eventbridge#InternalException":
489
- throw await de_InternalExceptionRes(parsedOutput, context);
490
- case "InvalidEventPatternException":
491
- case "com.amazonaws.eventbridge#InvalidEventPatternException":
492
- throw await de_InvalidEventPatternExceptionRes(parsedOutput, context);
493
- case "LimitExceededException":
494
- case "com.amazonaws.eventbridge#LimitExceededException":
495
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
496
- case "ResourceAlreadyExistsException":
497
- case "com.amazonaws.eventbridge#ResourceAlreadyExistsException":
498
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
499
- case "ResourceNotFoundException":
500
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
501
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
502
- default:
503
- const parsedBody = parsedOutput.body;
504
- return throwDefaultError({
505
- output,
506
- parsedBody,
507
- errorCode,
508
- });
509
- }
510
- };
511
390
  export const de_CreateConnectionCommand = async (output, context) => {
512
391
  if (output.statusCode >= 300) {
513
- return de_CreateConnectionCommandError(output, context);
392
+ return de_CommandError(output, context);
514
393
  }
515
394
  const data = await parseBody(output.body, context);
516
395
  let contents = {};
@@ -521,34 +400,9 @@ export const de_CreateConnectionCommand = async (output, context) => {
521
400
  };
522
401
  return response;
523
402
  };
524
- const de_CreateConnectionCommandError = async (output, context) => {
525
- const parsedOutput = {
526
- ...output,
527
- body: await parseErrorBody(output.body, context),
528
- };
529
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
530
- switch (errorCode) {
531
- case "InternalException":
532
- case "com.amazonaws.eventbridge#InternalException":
533
- throw await de_InternalExceptionRes(parsedOutput, context);
534
- case "LimitExceededException":
535
- case "com.amazonaws.eventbridge#LimitExceededException":
536
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
537
- case "ResourceAlreadyExistsException":
538
- case "com.amazonaws.eventbridge#ResourceAlreadyExistsException":
539
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
540
- default:
541
- const parsedBody = parsedOutput.body;
542
- return throwDefaultError({
543
- output,
544
- parsedBody,
545
- errorCode,
546
- });
547
- }
548
- };
549
403
  export const de_CreateEndpointCommand = async (output, context) => {
550
404
  if (output.statusCode >= 300) {
551
- return de_CreateEndpointCommandError(output, context);
405
+ return de_CommandError(output, context);
552
406
  }
553
407
  const data = await parseBody(output.body, context);
554
408
  let contents = {};
@@ -559,34 +413,9 @@ export const de_CreateEndpointCommand = async (output, context) => {
559
413
  };
560
414
  return response;
561
415
  };
562
- const de_CreateEndpointCommandError = async (output, context) => {
563
- const parsedOutput = {
564
- ...output,
565
- body: await parseErrorBody(output.body, context),
566
- };
567
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
568
- switch (errorCode) {
569
- case "InternalException":
570
- case "com.amazonaws.eventbridge#InternalException":
571
- throw await de_InternalExceptionRes(parsedOutput, context);
572
- case "LimitExceededException":
573
- case "com.amazonaws.eventbridge#LimitExceededException":
574
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
575
- case "ResourceAlreadyExistsException":
576
- case "com.amazonaws.eventbridge#ResourceAlreadyExistsException":
577
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
578
- default:
579
- const parsedBody = parsedOutput.body;
580
- return throwDefaultError({
581
- output,
582
- parsedBody,
583
- errorCode,
584
- });
585
- }
586
- };
587
416
  export const de_CreateEventBusCommand = async (output, context) => {
588
417
  if (output.statusCode >= 300) {
589
- return de_CreateEventBusCommandError(output, context);
418
+ return de_CommandError(output, context);
590
419
  }
591
420
  const data = await parseBody(output.body, context);
592
421
  let contents = {};
@@ -597,46 +426,9 @@ export const de_CreateEventBusCommand = async (output, context) => {
597
426
  };
598
427
  return response;
599
428
  };
600
- const de_CreateEventBusCommandError = async (output, context) => {
601
- const parsedOutput = {
602
- ...output,
603
- body: await parseErrorBody(output.body, context),
604
- };
605
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
606
- switch (errorCode) {
607
- case "ConcurrentModificationException":
608
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
609
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
610
- case "InternalException":
611
- case "com.amazonaws.eventbridge#InternalException":
612
- throw await de_InternalExceptionRes(parsedOutput, context);
613
- case "InvalidStateException":
614
- case "com.amazonaws.eventbridge#InvalidStateException":
615
- throw await de_InvalidStateExceptionRes(parsedOutput, context);
616
- case "LimitExceededException":
617
- case "com.amazonaws.eventbridge#LimitExceededException":
618
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
619
- case "OperationDisabledException":
620
- case "com.amazonaws.eventbridge#OperationDisabledException":
621
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
622
- case "ResourceAlreadyExistsException":
623
- case "com.amazonaws.eventbridge#ResourceAlreadyExistsException":
624
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
625
- case "ResourceNotFoundException":
626
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
627
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
628
- default:
629
- const parsedBody = parsedOutput.body;
630
- return throwDefaultError({
631
- output,
632
- parsedBody,
633
- errorCode,
634
- });
635
- }
636
- };
637
429
  export const de_CreatePartnerEventSourceCommand = async (output, context) => {
638
430
  if (output.statusCode >= 300) {
639
- return de_CreatePartnerEventSourceCommandError(output, context);
431
+ return de_CommandError(output, context);
640
432
  }
641
433
  const data = await parseBody(output.body, context);
642
434
  let contents = {};
@@ -647,40 +439,9 @@ export const de_CreatePartnerEventSourceCommand = async (output, context) => {
647
439
  };
648
440
  return response;
649
441
  };
650
- const de_CreatePartnerEventSourceCommandError = async (output, context) => {
651
- const parsedOutput = {
652
- ...output,
653
- body: await parseErrorBody(output.body, context),
654
- };
655
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
656
- switch (errorCode) {
657
- case "ConcurrentModificationException":
658
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
659
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
660
- case "InternalException":
661
- case "com.amazonaws.eventbridge#InternalException":
662
- throw await de_InternalExceptionRes(parsedOutput, context);
663
- case "LimitExceededException":
664
- case "com.amazonaws.eventbridge#LimitExceededException":
665
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
666
- case "OperationDisabledException":
667
- case "com.amazonaws.eventbridge#OperationDisabledException":
668
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
669
- case "ResourceAlreadyExistsException":
670
- case "com.amazonaws.eventbridge#ResourceAlreadyExistsException":
671
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
672
- default:
673
- const parsedBody = parsedOutput.body;
674
- return throwDefaultError({
675
- output,
676
- parsedBody,
677
- errorCode,
678
- });
679
- }
680
- };
681
442
  export const de_DeactivateEventSourceCommand = async (output, context) => {
682
443
  if (output.statusCode >= 300) {
683
- return de_DeactivateEventSourceCommandError(output, context);
444
+ return de_CommandError(output, context);
684
445
  }
685
446
  await collectBody(output.body, context);
686
447
  const response = {
@@ -688,78 +449,22 @@ export const de_DeactivateEventSourceCommand = async (output, context) => {
688
449
  };
689
450
  return response;
690
451
  };
691
- const de_DeactivateEventSourceCommandError = async (output, context) => {
692
- const parsedOutput = {
693
- ...output,
694
- body: await parseErrorBody(output.body, context),
695
- };
696
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
697
- switch (errorCode) {
698
- case "ConcurrentModificationException":
699
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
700
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
701
- case "InternalException":
702
- case "com.amazonaws.eventbridge#InternalException":
703
- throw await de_InternalExceptionRes(parsedOutput, context);
704
- case "InvalidStateException":
705
- case "com.amazonaws.eventbridge#InvalidStateException":
706
- throw await de_InvalidStateExceptionRes(parsedOutput, context);
707
- case "OperationDisabledException":
708
- case "com.amazonaws.eventbridge#OperationDisabledException":
709
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
710
- case "ResourceNotFoundException":
711
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
712
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
713
- default:
714
- const parsedBody = parsedOutput.body;
715
- return throwDefaultError({
716
- output,
717
- parsedBody,
718
- errorCode,
719
- });
720
- }
721
- };
722
- export const de_DeauthorizeConnectionCommand = async (output, context) => {
723
- if (output.statusCode >= 300) {
724
- return de_DeauthorizeConnectionCommandError(output, context);
725
- }
726
- const data = await parseBody(output.body, context);
727
- let contents = {};
728
- contents = de_DeauthorizeConnectionResponse(data, context);
729
- const response = {
730
- $metadata: deserializeMetadata(output),
731
- ...contents,
452
+ export const de_DeauthorizeConnectionCommand = async (output, context) => {
453
+ if (output.statusCode >= 300) {
454
+ return de_CommandError(output, context);
455
+ }
456
+ const data = await parseBody(output.body, context);
457
+ let contents = {};
458
+ contents = de_DeauthorizeConnectionResponse(data, context);
459
+ const response = {
460
+ $metadata: deserializeMetadata(output),
461
+ ...contents,
732
462
  };
733
463
  return response;
734
464
  };
735
- const de_DeauthorizeConnectionCommandError = async (output, context) => {
736
- const parsedOutput = {
737
- ...output,
738
- body: await parseErrorBody(output.body, context),
739
- };
740
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
741
- switch (errorCode) {
742
- case "ConcurrentModificationException":
743
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
744
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
745
- case "InternalException":
746
- case "com.amazonaws.eventbridge#InternalException":
747
- throw await de_InternalExceptionRes(parsedOutput, context);
748
- case "ResourceNotFoundException":
749
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
750
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
751
- default:
752
- const parsedBody = parsedOutput.body;
753
- return throwDefaultError({
754
- output,
755
- parsedBody,
756
- errorCode,
757
- });
758
- }
759
- };
760
465
  export const de_DeleteApiDestinationCommand = async (output, context) => {
761
466
  if (output.statusCode >= 300) {
762
- return de_DeleteApiDestinationCommandError(output, context);
467
+ return de_CommandError(output, context);
763
468
  }
764
469
  const data = await parseBody(output.body, context);
765
470
  let contents = {};
@@ -770,34 +475,9 @@ export const de_DeleteApiDestinationCommand = async (output, context) => {
770
475
  };
771
476
  return response;
772
477
  };
773
- const de_DeleteApiDestinationCommandError = async (output, context) => {
774
- const parsedOutput = {
775
- ...output,
776
- body: await parseErrorBody(output.body, context),
777
- };
778
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
779
- switch (errorCode) {
780
- case "ConcurrentModificationException":
781
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
782
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
783
- case "InternalException":
784
- case "com.amazonaws.eventbridge#InternalException":
785
- throw await de_InternalExceptionRes(parsedOutput, context);
786
- case "ResourceNotFoundException":
787
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
788
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
789
- default:
790
- const parsedBody = parsedOutput.body;
791
- return throwDefaultError({
792
- output,
793
- parsedBody,
794
- errorCode,
795
- });
796
- }
797
- };
798
478
  export const de_DeleteArchiveCommand = async (output, context) => {
799
479
  if (output.statusCode >= 300) {
800
- return de_DeleteArchiveCommandError(output, context);
480
+ return de_CommandError(output, context);
801
481
  }
802
482
  const data = await parseBody(output.body, context);
803
483
  let contents = {};
@@ -808,34 +488,9 @@ export const de_DeleteArchiveCommand = async (output, context) => {
808
488
  };
809
489
  return response;
810
490
  };
811
- const de_DeleteArchiveCommandError = async (output, context) => {
812
- const parsedOutput = {
813
- ...output,
814
- body: await parseErrorBody(output.body, context),
815
- };
816
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
817
- switch (errorCode) {
818
- case "ConcurrentModificationException":
819
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
820
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
821
- case "InternalException":
822
- case "com.amazonaws.eventbridge#InternalException":
823
- throw await de_InternalExceptionRes(parsedOutput, context);
824
- case "ResourceNotFoundException":
825
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
826
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
827
- default:
828
- const parsedBody = parsedOutput.body;
829
- return throwDefaultError({
830
- output,
831
- parsedBody,
832
- errorCode,
833
- });
834
- }
835
- };
836
491
  export const de_DeleteConnectionCommand = async (output, context) => {
837
492
  if (output.statusCode >= 300) {
838
- return de_DeleteConnectionCommandError(output, context);
493
+ return de_CommandError(output, context);
839
494
  }
840
495
  const data = await parseBody(output.body, context);
841
496
  let contents = {};
@@ -846,34 +501,9 @@ export const de_DeleteConnectionCommand = async (output, context) => {
846
501
  };
847
502
  return response;
848
503
  };
849
- const de_DeleteConnectionCommandError = async (output, context) => {
850
- const parsedOutput = {
851
- ...output,
852
- body: await parseErrorBody(output.body, context),
853
- };
854
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
855
- switch (errorCode) {
856
- case "ConcurrentModificationException":
857
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
858
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
859
- case "InternalException":
860
- case "com.amazonaws.eventbridge#InternalException":
861
- throw await de_InternalExceptionRes(parsedOutput, context);
862
- case "ResourceNotFoundException":
863
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
864
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
865
- default:
866
- const parsedBody = parsedOutput.body;
867
- return throwDefaultError({
868
- output,
869
- parsedBody,
870
- errorCode,
871
- });
872
- }
873
- };
874
504
  export const de_DeleteEndpointCommand = async (output, context) => {
875
505
  if (output.statusCode >= 300) {
876
- return de_DeleteEndpointCommandError(output, context);
506
+ return de_CommandError(output, context);
877
507
  }
878
508
  const data = await parseBody(output.body, context);
879
509
  let contents = {};
@@ -884,34 +514,9 @@ export const de_DeleteEndpointCommand = async (output, context) => {
884
514
  };
885
515
  return response;
886
516
  };
887
- const de_DeleteEndpointCommandError = async (output, context) => {
888
- const parsedOutput = {
889
- ...output,
890
- body: await parseErrorBody(output.body, context),
891
- };
892
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
893
- switch (errorCode) {
894
- case "ConcurrentModificationException":
895
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
896
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
897
- case "InternalException":
898
- case "com.amazonaws.eventbridge#InternalException":
899
- throw await de_InternalExceptionRes(parsedOutput, context);
900
- case "ResourceNotFoundException":
901
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
902
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
903
- default:
904
- const parsedBody = parsedOutput.body;
905
- return throwDefaultError({
906
- output,
907
- parsedBody,
908
- errorCode,
909
- });
910
- }
911
- };
912
517
  export const de_DeleteEventBusCommand = async (output, context) => {
913
518
  if (output.statusCode >= 300) {
914
- return de_DeleteEventBusCommandError(output, context);
519
+ return de_CommandError(output, context);
915
520
  }
916
521
  await collectBody(output.body, context);
917
522
  const response = {
@@ -919,31 +524,9 @@ export const de_DeleteEventBusCommand = async (output, context) => {
919
524
  };
920
525
  return response;
921
526
  };
922
- const de_DeleteEventBusCommandError = async (output, context) => {
923
- const parsedOutput = {
924
- ...output,
925
- body: await parseErrorBody(output.body, context),
926
- };
927
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
928
- switch (errorCode) {
929
- case "ConcurrentModificationException":
930
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
931
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
932
- case "InternalException":
933
- case "com.amazonaws.eventbridge#InternalException":
934
- throw await de_InternalExceptionRes(parsedOutput, context);
935
- default:
936
- const parsedBody = parsedOutput.body;
937
- return throwDefaultError({
938
- output,
939
- parsedBody,
940
- errorCode,
941
- });
942
- }
943
- };
944
527
  export const de_DeletePartnerEventSourceCommand = async (output, context) => {
945
528
  if (output.statusCode >= 300) {
946
- return de_DeletePartnerEventSourceCommandError(output, context);
529
+ return de_CommandError(output, context);
947
530
  }
948
531
  await collectBody(output.body, context);
949
532
  const response = {
@@ -951,34 +534,9 @@ export const de_DeletePartnerEventSourceCommand = async (output, context) => {
951
534
  };
952
535
  return response;
953
536
  };
954
- const de_DeletePartnerEventSourceCommandError = async (output, context) => {
955
- const parsedOutput = {
956
- ...output,
957
- body: await parseErrorBody(output.body, context),
958
- };
959
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
960
- switch (errorCode) {
961
- case "ConcurrentModificationException":
962
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
963
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
964
- case "InternalException":
965
- case "com.amazonaws.eventbridge#InternalException":
966
- throw await de_InternalExceptionRes(parsedOutput, context);
967
- case "OperationDisabledException":
968
- case "com.amazonaws.eventbridge#OperationDisabledException":
969
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
970
- default:
971
- const parsedBody = parsedOutput.body;
972
- return throwDefaultError({
973
- output,
974
- parsedBody,
975
- errorCode,
976
- });
977
- }
978
- };
979
537
  export const de_DeleteRuleCommand = async (output, context) => {
980
538
  if (output.statusCode >= 300) {
981
- return de_DeleteRuleCommandError(output, context);
539
+ return de_CommandError(output, context);
982
540
  }
983
541
  await collectBody(output.body, context);
984
542
  const response = {
@@ -986,37 +544,9 @@ export const de_DeleteRuleCommand = async (output, context) => {
986
544
  };
987
545
  return response;
988
546
  };
989
- const de_DeleteRuleCommandError = async (output, context) => {
990
- const parsedOutput = {
991
- ...output,
992
- body: await parseErrorBody(output.body, context),
993
- };
994
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
995
- switch (errorCode) {
996
- case "ConcurrentModificationException":
997
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
998
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
999
- case "InternalException":
1000
- case "com.amazonaws.eventbridge#InternalException":
1001
- throw await de_InternalExceptionRes(parsedOutput, context);
1002
- case "ManagedRuleException":
1003
- case "com.amazonaws.eventbridge#ManagedRuleException":
1004
- throw await de_ManagedRuleExceptionRes(parsedOutput, context);
1005
- case "ResourceNotFoundException":
1006
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1007
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1008
- default:
1009
- const parsedBody = parsedOutput.body;
1010
- return throwDefaultError({
1011
- output,
1012
- parsedBody,
1013
- errorCode,
1014
- });
1015
- }
1016
- };
1017
547
  export const de_DescribeApiDestinationCommand = async (output, context) => {
1018
548
  if (output.statusCode >= 300) {
1019
- return de_DescribeApiDestinationCommandError(output, context);
549
+ return de_CommandError(output, context);
1020
550
  }
1021
551
  const data = await parseBody(output.body, context);
1022
552
  let contents = {};
@@ -1027,31 +557,9 @@ export const de_DescribeApiDestinationCommand = async (output, context) => {
1027
557
  };
1028
558
  return response;
1029
559
  };
1030
- const de_DescribeApiDestinationCommandError = async (output, context) => {
1031
- const parsedOutput = {
1032
- ...output,
1033
- body: await parseErrorBody(output.body, context),
1034
- };
1035
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1036
- switch (errorCode) {
1037
- case "InternalException":
1038
- case "com.amazonaws.eventbridge#InternalException":
1039
- throw await de_InternalExceptionRes(parsedOutput, context);
1040
- case "ResourceNotFoundException":
1041
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1042
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1043
- default:
1044
- const parsedBody = parsedOutput.body;
1045
- return throwDefaultError({
1046
- output,
1047
- parsedBody,
1048
- errorCode,
1049
- });
1050
- }
1051
- };
1052
560
  export const de_DescribeArchiveCommand = async (output, context) => {
1053
561
  if (output.statusCode >= 300) {
1054
- return de_DescribeArchiveCommandError(output, context);
562
+ return de_CommandError(output, context);
1055
563
  }
1056
564
  const data = await parseBody(output.body, context);
1057
565
  let contents = {};
@@ -1062,69 +570,22 @@ export const de_DescribeArchiveCommand = async (output, context) => {
1062
570
  };
1063
571
  return response;
1064
572
  };
1065
- const de_DescribeArchiveCommandError = async (output, context) => {
1066
- const parsedOutput = {
1067
- ...output,
1068
- body: await parseErrorBody(output.body, context),
1069
- };
1070
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1071
- switch (errorCode) {
1072
- case "InternalException":
1073
- case "com.amazonaws.eventbridge#InternalException":
1074
- throw await de_InternalExceptionRes(parsedOutput, context);
1075
- case "ResourceAlreadyExistsException":
1076
- case "com.amazonaws.eventbridge#ResourceAlreadyExistsException":
1077
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
1078
- case "ResourceNotFoundException":
1079
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1080
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1081
- default:
1082
- const parsedBody = parsedOutput.body;
1083
- return throwDefaultError({
1084
- output,
1085
- parsedBody,
1086
- errorCode,
1087
- });
1088
- }
1089
- };
1090
- export const de_DescribeConnectionCommand = async (output, context) => {
1091
- if (output.statusCode >= 300) {
1092
- return de_DescribeConnectionCommandError(output, context);
1093
- }
1094
- const data = await parseBody(output.body, context);
1095
- let contents = {};
1096
- contents = de_DescribeConnectionResponse(data, context);
1097
- const response = {
1098
- $metadata: deserializeMetadata(output),
1099
- ...contents,
573
+ export const de_DescribeConnectionCommand = async (output, context) => {
574
+ if (output.statusCode >= 300) {
575
+ return de_CommandError(output, context);
576
+ }
577
+ const data = await parseBody(output.body, context);
578
+ let contents = {};
579
+ contents = de_DescribeConnectionResponse(data, context);
580
+ const response = {
581
+ $metadata: deserializeMetadata(output),
582
+ ...contents,
1100
583
  };
1101
584
  return response;
1102
585
  };
1103
- const de_DescribeConnectionCommandError = async (output, context) => {
1104
- const parsedOutput = {
1105
- ...output,
1106
- body: await parseErrorBody(output.body, context),
1107
- };
1108
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1109
- switch (errorCode) {
1110
- case "InternalException":
1111
- case "com.amazonaws.eventbridge#InternalException":
1112
- throw await de_InternalExceptionRes(parsedOutput, context);
1113
- case "ResourceNotFoundException":
1114
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1115
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1116
- default:
1117
- const parsedBody = parsedOutput.body;
1118
- return throwDefaultError({
1119
- output,
1120
- parsedBody,
1121
- errorCode,
1122
- });
1123
- }
1124
- };
1125
586
  export const de_DescribeEndpointCommand = async (output, context) => {
1126
587
  if (output.statusCode >= 300) {
1127
- return de_DescribeEndpointCommandError(output, context);
588
+ return de_CommandError(output, context);
1128
589
  }
1129
590
  const data = await parseBody(output.body, context);
1130
591
  let contents = {};
@@ -1135,104 +596,9 @@ export const de_DescribeEndpointCommand = async (output, context) => {
1135
596
  };
1136
597
  return response;
1137
598
  };
1138
- const de_DescribeEndpointCommandError = async (output, context) => {
1139
- const parsedOutput = {
1140
- ...output,
1141
- body: await parseErrorBody(output.body, context),
1142
- };
1143
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1144
- switch (errorCode) {
1145
- case "InternalException":
1146
- case "com.amazonaws.eventbridge#InternalException":
1147
- throw await de_InternalExceptionRes(parsedOutput, context);
1148
- case "ResourceNotFoundException":
1149
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1150
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1151
- default:
1152
- const parsedBody = parsedOutput.body;
1153
- return throwDefaultError({
1154
- output,
1155
- parsedBody,
1156
- errorCode,
1157
- });
1158
- }
1159
- };
1160
599
  export const de_DescribeEventBusCommand = async (output, context) => {
1161
600
  if (output.statusCode >= 300) {
1162
- return de_DescribeEventBusCommandError(output, context);
1163
- }
1164
- const data = await parseBody(output.body, context);
1165
- let contents = {};
1166
- contents = _json(data);
1167
- const response = {
1168
- $metadata: deserializeMetadata(output),
1169
- ...contents,
1170
- };
1171
- return response;
1172
- };
1173
- const de_DescribeEventBusCommandError = async (output, context) => {
1174
- const parsedOutput = {
1175
- ...output,
1176
- body: await parseErrorBody(output.body, context),
1177
- };
1178
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1179
- switch (errorCode) {
1180
- case "InternalException":
1181
- case "com.amazonaws.eventbridge#InternalException":
1182
- throw await de_InternalExceptionRes(parsedOutput, context);
1183
- case "ResourceNotFoundException":
1184
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1185
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1186
- default:
1187
- const parsedBody = parsedOutput.body;
1188
- return throwDefaultError({
1189
- output,
1190
- parsedBody,
1191
- errorCode,
1192
- });
1193
- }
1194
- };
1195
- export const de_DescribeEventSourceCommand = async (output, context) => {
1196
- if (output.statusCode >= 300) {
1197
- return de_DescribeEventSourceCommandError(output, context);
1198
- }
1199
- const data = await parseBody(output.body, context);
1200
- let contents = {};
1201
- contents = de_DescribeEventSourceResponse(data, context);
1202
- const response = {
1203
- $metadata: deserializeMetadata(output),
1204
- ...contents,
1205
- };
1206
- return response;
1207
- };
1208
- const de_DescribeEventSourceCommandError = async (output, context) => {
1209
- const parsedOutput = {
1210
- ...output,
1211
- body: await parseErrorBody(output.body, context),
1212
- };
1213
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1214
- switch (errorCode) {
1215
- case "InternalException":
1216
- case "com.amazonaws.eventbridge#InternalException":
1217
- throw await de_InternalExceptionRes(parsedOutput, context);
1218
- case "OperationDisabledException":
1219
- case "com.amazonaws.eventbridge#OperationDisabledException":
1220
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
1221
- case "ResourceNotFoundException":
1222
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1223
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1224
- default:
1225
- const parsedBody = parsedOutput.body;
1226
- return throwDefaultError({
1227
- output,
1228
- parsedBody,
1229
- errorCode,
1230
- });
1231
- }
1232
- };
1233
- export const de_DescribePartnerEventSourceCommand = async (output, context) => {
1234
- if (output.statusCode >= 300) {
1235
- return de_DescribePartnerEventSourceCommandError(output, context);
601
+ return de_CommandError(output, context);
1236
602
  }
1237
603
  const data = await parseBody(output.body, context);
1238
604
  let contents = {};
@@ -1243,416 +609,133 @@ export const de_DescribePartnerEventSourceCommand = async (output, context) => {
1243
609
  };
1244
610
  return response;
1245
611
  };
1246
- const de_DescribePartnerEventSourceCommandError = async (output, context) => {
1247
- const parsedOutput = {
1248
- ...output,
1249
- body: await parseErrorBody(output.body, context),
1250
- };
1251
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1252
- switch (errorCode) {
1253
- case "InternalException":
1254
- case "com.amazonaws.eventbridge#InternalException":
1255
- throw await de_InternalExceptionRes(parsedOutput, context);
1256
- case "OperationDisabledException":
1257
- case "com.amazonaws.eventbridge#OperationDisabledException":
1258
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
1259
- case "ResourceNotFoundException":
1260
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1261
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1262
- default:
1263
- const parsedBody = parsedOutput.body;
1264
- return throwDefaultError({
1265
- output,
1266
- parsedBody,
1267
- errorCode,
1268
- });
1269
- }
1270
- };
1271
- export const de_DescribeReplayCommand = async (output, context) => {
1272
- if (output.statusCode >= 300) {
1273
- return de_DescribeReplayCommandError(output, context);
1274
- }
1275
- const data = await parseBody(output.body, context);
1276
- let contents = {};
1277
- contents = de_DescribeReplayResponse(data, context);
1278
- const response = {
1279
- $metadata: deserializeMetadata(output),
1280
- ...contents,
1281
- };
1282
- return response;
1283
- };
1284
- const de_DescribeReplayCommandError = async (output, context) => {
1285
- const parsedOutput = {
1286
- ...output,
1287
- body: await parseErrorBody(output.body, context),
1288
- };
1289
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1290
- switch (errorCode) {
1291
- case "InternalException":
1292
- case "com.amazonaws.eventbridge#InternalException":
1293
- throw await de_InternalExceptionRes(parsedOutput, context);
1294
- case "ResourceNotFoundException":
1295
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1296
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1297
- default:
1298
- const parsedBody = parsedOutput.body;
1299
- return throwDefaultError({
1300
- output,
1301
- parsedBody,
1302
- errorCode,
1303
- });
1304
- }
1305
- };
1306
- export const de_DescribeRuleCommand = async (output, context) => {
1307
- if (output.statusCode >= 300) {
1308
- return de_DescribeRuleCommandError(output, context);
1309
- }
1310
- const data = await parseBody(output.body, context);
1311
- let contents = {};
1312
- contents = _json(data);
1313
- const response = {
1314
- $metadata: deserializeMetadata(output),
1315
- ...contents,
1316
- };
1317
- return response;
1318
- };
1319
- const de_DescribeRuleCommandError = async (output, context) => {
1320
- const parsedOutput = {
1321
- ...output,
1322
- body: await parseErrorBody(output.body, context),
1323
- };
1324
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1325
- switch (errorCode) {
1326
- case "InternalException":
1327
- case "com.amazonaws.eventbridge#InternalException":
1328
- throw await de_InternalExceptionRes(parsedOutput, context);
1329
- case "ResourceNotFoundException":
1330
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1331
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1332
- default:
1333
- const parsedBody = parsedOutput.body;
1334
- return throwDefaultError({
1335
- output,
1336
- parsedBody,
1337
- errorCode,
1338
- });
1339
- }
1340
- };
1341
- export const de_DisableRuleCommand = async (output, context) => {
1342
- if (output.statusCode >= 300) {
1343
- return de_DisableRuleCommandError(output, context);
1344
- }
1345
- await collectBody(output.body, context);
1346
- const response = {
1347
- $metadata: deserializeMetadata(output),
1348
- };
1349
- return response;
1350
- };
1351
- const de_DisableRuleCommandError = async (output, context) => {
1352
- const parsedOutput = {
1353
- ...output,
1354
- body: await parseErrorBody(output.body, context),
1355
- };
1356
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1357
- switch (errorCode) {
1358
- case "ConcurrentModificationException":
1359
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
1360
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
1361
- case "InternalException":
1362
- case "com.amazonaws.eventbridge#InternalException":
1363
- throw await de_InternalExceptionRes(parsedOutput, context);
1364
- case "ManagedRuleException":
1365
- case "com.amazonaws.eventbridge#ManagedRuleException":
1366
- throw await de_ManagedRuleExceptionRes(parsedOutput, context);
1367
- case "ResourceNotFoundException":
1368
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1369
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1370
- default:
1371
- const parsedBody = parsedOutput.body;
1372
- return throwDefaultError({
1373
- output,
1374
- parsedBody,
1375
- errorCode,
1376
- });
1377
- }
1378
- };
1379
- export const de_EnableRuleCommand = async (output, context) => {
1380
- if (output.statusCode >= 300) {
1381
- return de_EnableRuleCommandError(output, context);
1382
- }
1383
- await collectBody(output.body, context);
1384
- const response = {
1385
- $metadata: deserializeMetadata(output),
1386
- };
1387
- return response;
1388
- };
1389
- const de_EnableRuleCommandError = async (output, context) => {
1390
- const parsedOutput = {
1391
- ...output,
1392
- body: await parseErrorBody(output.body, context),
1393
- };
1394
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1395
- switch (errorCode) {
1396
- case "ConcurrentModificationException":
1397
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
1398
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
1399
- case "InternalException":
1400
- case "com.amazonaws.eventbridge#InternalException":
1401
- throw await de_InternalExceptionRes(parsedOutput, context);
1402
- case "ManagedRuleException":
1403
- case "com.amazonaws.eventbridge#ManagedRuleException":
1404
- throw await de_ManagedRuleExceptionRes(parsedOutput, context);
1405
- case "ResourceNotFoundException":
1406
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1407
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1408
- default:
1409
- const parsedBody = parsedOutput.body;
1410
- return throwDefaultError({
1411
- output,
1412
- parsedBody,
1413
- errorCode,
1414
- });
1415
- }
1416
- };
1417
- export const de_ListApiDestinationsCommand = async (output, context) => {
612
+ export const de_DescribeEventSourceCommand = async (output, context) => {
1418
613
  if (output.statusCode >= 300) {
1419
- return de_ListApiDestinationsCommandError(output, context);
614
+ return de_CommandError(output, context);
1420
615
  }
1421
616
  const data = await parseBody(output.body, context);
1422
617
  let contents = {};
1423
- contents = de_ListApiDestinationsResponse(data, context);
618
+ contents = de_DescribeEventSourceResponse(data, context);
1424
619
  const response = {
1425
620
  $metadata: deserializeMetadata(output),
1426
621
  ...contents,
1427
622
  };
1428
623
  return response;
1429
624
  };
1430
- const de_ListApiDestinationsCommandError = async (output, context) => {
1431
- const parsedOutput = {
1432
- ...output,
1433
- body: await parseErrorBody(output.body, context),
1434
- };
1435
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1436
- switch (errorCode) {
1437
- case "InternalException":
1438
- case "com.amazonaws.eventbridge#InternalException":
1439
- throw await de_InternalExceptionRes(parsedOutput, context);
1440
- default:
1441
- const parsedBody = parsedOutput.body;
1442
- return throwDefaultError({
1443
- output,
1444
- parsedBody,
1445
- errorCode,
1446
- });
1447
- }
1448
- };
1449
- export const de_ListArchivesCommand = async (output, context) => {
625
+ export const de_DescribePartnerEventSourceCommand = async (output, context) => {
1450
626
  if (output.statusCode >= 300) {
1451
- return de_ListArchivesCommandError(output, context);
627
+ return de_CommandError(output, context);
1452
628
  }
1453
629
  const data = await parseBody(output.body, context);
1454
630
  let contents = {};
1455
- contents = de_ListArchivesResponse(data, context);
631
+ contents = _json(data);
1456
632
  const response = {
1457
633
  $metadata: deserializeMetadata(output),
1458
634
  ...contents,
1459
635
  };
1460
636
  return response;
1461
637
  };
1462
- const de_ListArchivesCommandError = async (output, context) => {
1463
- const parsedOutput = {
1464
- ...output,
1465
- body: await parseErrorBody(output.body, context),
1466
- };
1467
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1468
- switch (errorCode) {
1469
- case "InternalException":
1470
- case "com.amazonaws.eventbridge#InternalException":
1471
- throw await de_InternalExceptionRes(parsedOutput, context);
1472
- case "ResourceNotFoundException":
1473
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1474
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1475
- default:
1476
- const parsedBody = parsedOutput.body;
1477
- return throwDefaultError({
1478
- output,
1479
- parsedBody,
1480
- errorCode,
1481
- });
1482
- }
1483
- };
1484
- export const de_ListConnectionsCommand = async (output, context) => {
638
+ export const de_DescribeReplayCommand = async (output, context) => {
1485
639
  if (output.statusCode >= 300) {
1486
- return de_ListConnectionsCommandError(output, context);
640
+ return de_CommandError(output, context);
1487
641
  }
1488
642
  const data = await parseBody(output.body, context);
1489
643
  let contents = {};
1490
- contents = de_ListConnectionsResponse(data, context);
644
+ contents = de_DescribeReplayResponse(data, context);
1491
645
  const response = {
1492
646
  $metadata: deserializeMetadata(output),
1493
647
  ...contents,
1494
648
  };
1495
649
  return response;
1496
650
  };
1497
- const de_ListConnectionsCommandError = async (output, context) => {
1498
- const parsedOutput = {
1499
- ...output,
1500
- body: await parseErrorBody(output.body, context),
1501
- };
1502
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1503
- switch (errorCode) {
1504
- case "InternalException":
1505
- case "com.amazonaws.eventbridge#InternalException":
1506
- throw await de_InternalExceptionRes(parsedOutput, context);
1507
- default:
1508
- const parsedBody = parsedOutput.body;
1509
- return throwDefaultError({
1510
- output,
1511
- parsedBody,
1512
- errorCode,
1513
- });
1514
- }
1515
- };
1516
- export const de_ListEndpointsCommand = async (output, context) => {
651
+ export const de_DescribeRuleCommand = async (output, context) => {
1517
652
  if (output.statusCode >= 300) {
1518
- return de_ListEndpointsCommandError(output, context);
653
+ return de_CommandError(output, context);
1519
654
  }
1520
655
  const data = await parseBody(output.body, context);
1521
656
  let contents = {};
1522
- contents = de_ListEndpointsResponse(data, context);
657
+ contents = _json(data);
1523
658
  const response = {
1524
659
  $metadata: deserializeMetadata(output),
1525
660
  ...contents,
1526
661
  };
1527
662
  return response;
1528
663
  };
1529
- const de_ListEndpointsCommandError = async (output, context) => {
1530
- const parsedOutput = {
1531
- ...output,
1532
- body: await parseErrorBody(output.body, context),
664
+ export const de_DisableRuleCommand = async (output, context) => {
665
+ if (output.statusCode >= 300) {
666
+ return de_CommandError(output, context);
667
+ }
668
+ await collectBody(output.body, context);
669
+ const response = {
670
+ $metadata: deserializeMetadata(output),
1533
671
  };
1534
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1535
- switch (errorCode) {
1536
- case "InternalException":
1537
- case "com.amazonaws.eventbridge#InternalException":
1538
- throw await de_InternalExceptionRes(parsedOutput, context);
1539
- default:
1540
- const parsedBody = parsedOutput.body;
1541
- return throwDefaultError({
1542
- output,
1543
- parsedBody,
1544
- errorCode,
1545
- });
672
+ return response;
673
+ };
674
+ export const de_EnableRuleCommand = async (output, context) => {
675
+ if (output.statusCode >= 300) {
676
+ return de_CommandError(output, context);
1546
677
  }
678
+ await collectBody(output.body, context);
679
+ const response = {
680
+ $metadata: deserializeMetadata(output),
681
+ };
682
+ return response;
1547
683
  };
1548
- export const de_ListEventBusesCommand = async (output, context) => {
684
+ export const de_ListApiDestinationsCommand = async (output, context) => {
1549
685
  if (output.statusCode >= 300) {
1550
- return de_ListEventBusesCommandError(output, context);
686
+ return de_CommandError(output, context);
1551
687
  }
1552
688
  const data = await parseBody(output.body, context);
1553
689
  let contents = {};
1554
- contents = _json(data);
690
+ contents = de_ListApiDestinationsResponse(data, context);
1555
691
  const response = {
1556
692
  $metadata: deserializeMetadata(output),
1557
693
  ...contents,
1558
694
  };
1559
695
  return response;
1560
696
  };
1561
- const de_ListEventBusesCommandError = async (output, context) => {
1562
- const parsedOutput = {
1563
- ...output,
1564
- body: await parseErrorBody(output.body, context),
1565
- };
1566
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1567
- switch (errorCode) {
1568
- case "InternalException":
1569
- case "com.amazonaws.eventbridge#InternalException":
1570
- throw await de_InternalExceptionRes(parsedOutput, context);
1571
- default:
1572
- const parsedBody = parsedOutput.body;
1573
- return throwDefaultError({
1574
- output,
1575
- parsedBody,
1576
- errorCode,
1577
- });
1578
- }
1579
- };
1580
- export const de_ListEventSourcesCommand = async (output, context) => {
697
+ export const de_ListArchivesCommand = async (output, context) => {
1581
698
  if (output.statusCode >= 300) {
1582
- return de_ListEventSourcesCommandError(output, context);
699
+ return de_CommandError(output, context);
1583
700
  }
1584
701
  const data = await parseBody(output.body, context);
1585
702
  let contents = {};
1586
- contents = de_ListEventSourcesResponse(data, context);
703
+ contents = de_ListArchivesResponse(data, context);
1587
704
  const response = {
1588
705
  $metadata: deserializeMetadata(output),
1589
706
  ...contents,
1590
707
  };
1591
708
  return response;
1592
709
  };
1593
- const de_ListEventSourcesCommandError = async (output, context) => {
1594
- const parsedOutput = {
1595
- ...output,
1596
- body: await parseErrorBody(output.body, context),
1597
- };
1598
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1599
- switch (errorCode) {
1600
- case "InternalException":
1601
- case "com.amazonaws.eventbridge#InternalException":
1602
- throw await de_InternalExceptionRes(parsedOutput, context);
1603
- case "OperationDisabledException":
1604
- case "com.amazonaws.eventbridge#OperationDisabledException":
1605
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
1606
- default:
1607
- const parsedBody = parsedOutput.body;
1608
- return throwDefaultError({
1609
- output,
1610
- parsedBody,
1611
- errorCode,
1612
- });
1613
- }
1614
- };
1615
- export const de_ListPartnerEventSourceAccountsCommand = async (output, context) => {
710
+ export const de_ListConnectionsCommand = async (output, context) => {
1616
711
  if (output.statusCode >= 300) {
1617
- return de_ListPartnerEventSourceAccountsCommandError(output, context);
712
+ return de_CommandError(output, context);
1618
713
  }
1619
714
  const data = await parseBody(output.body, context);
1620
715
  let contents = {};
1621
- contents = de_ListPartnerEventSourceAccountsResponse(data, context);
716
+ contents = de_ListConnectionsResponse(data, context);
1622
717
  const response = {
1623
718
  $metadata: deserializeMetadata(output),
1624
719
  ...contents,
1625
720
  };
1626
721
  return response;
1627
722
  };
1628
- const de_ListPartnerEventSourceAccountsCommandError = async (output, context) => {
1629
- const parsedOutput = {
1630
- ...output,
1631
- body: await parseErrorBody(output.body, context),
1632
- };
1633
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1634
- switch (errorCode) {
1635
- case "InternalException":
1636
- case "com.amazonaws.eventbridge#InternalException":
1637
- throw await de_InternalExceptionRes(parsedOutput, context);
1638
- case "OperationDisabledException":
1639
- case "com.amazonaws.eventbridge#OperationDisabledException":
1640
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
1641
- case "ResourceNotFoundException":
1642
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1643
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1644
- default:
1645
- const parsedBody = parsedOutput.body;
1646
- return throwDefaultError({
1647
- output,
1648
- parsedBody,
1649
- errorCode,
1650
- });
723
+ export const de_ListEndpointsCommand = async (output, context) => {
724
+ if (output.statusCode >= 300) {
725
+ return de_CommandError(output, context);
1651
726
  }
727
+ const data = await parseBody(output.body, context);
728
+ let contents = {};
729
+ contents = de_ListEndpointsResponse(data, context);
730
+ const response = {
731
+ $metadata: deserializeMetadata(output),
732
+ ...contents,
733
+ };
734
+ return response;
1652
735
  };
1653
- export const de_ListPartnerEventSourcesCommand = async (output, context) => {
736
+ export const de_ListEventBusesCommand = async (output, context) => {
1654
737
  if (output.statusCode >= 300) {
1655
- return de_ListPartnerEventSourcesCommandError(output, context);
738
+ return de_CommandError(output, context);
1656
739
  }
1657
740
  const data = await parseBody(output.body, context);
1658
741
  let contents = {};
@@ -1663,98 +746,35 @@ export const de_ListPartnerEventSourcesCommand = async (output, context) => {
1663
746
  };
1664
747
  return response;
1665
748
  };
1666
- const de_ListPartnerEventSourcesCommandError = async (output, context) => {
1667
- const parsedOutput = {
1668
- ...output,
1669
- body: await parseErrorBody(output.body, context),
1670
- };
1671
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1672
- switch (errorCode) {
1673
- case "InternalException":
1674
- case "com.amazonaws.eventbridge#InternalException":
1675
- throw await de_InternalExceptionRes(parsedOutput, context);
1676
- case "OperationDisabledException":
1677
- case "com.amazonaws.eventbridge#OperationDisabledException":
1678
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
1679
- default:
1680
- const parsedBody = parsedOutput.body;
1681
- return throwDefaultError({
1682
- output,
1683
- parsedBody,
1684
- errorCode,
1685
- });
1686
- }
1687
- };
1688
- export const de_ListReplaysCommand = async (output, context) => {
749
+ export const de_ListEventSourcesCommand = async (output, context) => {
1689
750
  if (output.statusCode >= 300) {
1690
- return de_ListReplaysCommandError(output, context);
751
+ return de_CommandError(output, context);
1691
752
  }
1692
753
  const data = await parseBody(output.body, context);
1693
754
  let contents = {};
1694
- contents = de_ListReplaysResponse(data, context);
755
+ contents = de_ListEventSourcesResponse(data, context);
1695
756
  const response = {
1696
757
  $metadata: deserializeMetadata(output),
1697
758
  ...contents,
1698
759
  };
1699
760
  return response;
1700
761
  };
1701
- const de_ListReplaysCommandError = async (output, context) => {
1702
- const parsedOutput = {
1703
- ...output,
1704
- body: await parseErrorBody(output.body, context),
1705
- };
1706
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1707
- switch (errorCode) {
1708
- case "InternalException":
1709
- case "com.amazonaws.eventbridge#InternalException":
1710
- throw await de_InternalExceptionRes(parsedOutput, context);
1711
- default:
1712
- const parsedBody = parsedOutput.body;
1713
- return throwDefaultError({
1714
- output,
1715
- parsedBody,
1716
- errorCode,
1717
- });
1718
- }
1719
- };
1720
- export const de_ListRuleNamesByTargetCommand = async (output, context) => {
762
+ export const de_ListPartnerEventSourceAccountsCommand = async (output, context) => {
1721
763
  if (output.statusCode >= 300) {
1722
- return de_ListRuleNamesByTargetCommandError(output, context);
764
+ return de_CommandError(output, context);
1723
765
  }
1724
766
  const data = await parseBody(output.body, context);
1725
767
  let contents = {};
1726
- contents = _json(data);
768
+ contents = de_ListPartnerEventSourceAccountsResponse(data, context);
1727
769
  const response = {
1728
770
  $metadata: deserializeMetadata(output),
1729
771
  ...contents,
1730
772
  };
1731
773
  return response;
1732
774
  };
1733
- const de_ListRuleNamesByTargetCommandError = async (output, context) => {
1734
- const parsedOutput = {
1735
- ...output,
1736
- body: await parseErrorBody(output.body, context),
1737
- };
1738
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1739
- switch (errorCode) {
1740
- case "InternalException":
1741
- case "com.amazonaws.eventbridge#InternalException":
1742
- throw await de_InternalExceptionRes(parsedOutput, context);
1743
- case "ResourceNotFoundException":
1744
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1745
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1746
- default:
1747
- const parsedBody = parsedOutput.body;
1748
- return throwDefaultError({
1749
- output,
1750
- parsedBody,
1751
- errorCode,
1752
- });
1753
- }
1754
- };
1755
- export const de_ListRulesCommand = async (output, context) => {
775
+ export const de_ListPartnerEventSourcesCommand = async (output, context) => {
1756
776
  if (output.statusCode >= 300) {
1757
- return de_ListRulesCommandError(output, context);
777
+ return de_CommandError(output, context);
1758
778
  }
1759
779
  const data = await parseBody(output.body, context);
1760
780
  let contents = {};
@@ -1765,66 +785,22 @@ export const de_ListRulesCommand = async (output, context) => {
1765
785
  };
1766
786
  return response;
1767
787
  };
1768
- const de_ListRulesCommandError = async (output, context) => {
1769
- const parsedOutput = {
1770
- ...output,
1771
- body: await parseErrorBody(output.body, context),
1772
- };
1773
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1774
- switch (errorCode) {
1775
- case "InternalException":
1776
- case "com.amazonaws.eventbridge#InternalException":
1777
- throw await de_InternalExceptionRes(parsedOutput, context);
1778
- case "ResourceNotFoundException":
1779
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1780
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1781
- default:
1782
- const parsedBody = parsedOutput.body;
1783
- return throwDefaultError({
1784
- output,
1785
- parsedBody,
1786
- errorCode,
1787
- });
1788
- }
1789
- };
1790
- export const de_ListTagsForResourceCommand = async (output, context) => {
788
+ export const de_ListReplaysCommand = async (output, context) => {
1791
789
  if (output.statusCode >= 300) {
1792
- return de_ListTagsForResourceCommandError(output, context);
790
+ return de_CommandError(output, context);
1793
791
  }
1794
792
  const data = await parseBody(output.body, context);
1795
793
  let contents = {};
1796
- contents = _json(data);
794
+ contents = de_ListReplaysResponse(data, context);
1797
795
  const response = {
1798
796
  $metadata: deserializeMetadata(output),
1799
797
  ...contents,
1800
798
  };
1801
799
  return response;
1802
800
  };
1803
- const de_ListTagsForResourceCommandError = async (output, context) => {
1804
- const parsedOutput = {
1805
- ...output,
1806
- body: await parseErrorBody(output.body, context),
1807
- };
1808
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1809
- switch (errorCode) {
1810
- case "InternalException":
1811
- case "com.amazonaws.eventbridge#InternalException":
1812
- throw await de_InternalExceptionRes(parsedOutput, context);
1813
- case "ResourceNotFoundException":
1814
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1815
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1816
- default:
1817
- const parsedBody = parsedOutput.body;
1818
- return throwDefaultError({
1819
- output,
1820
- parsedBody,
1821
- errorCode,
1822
- });
1823
- }
1824
- };
1825
- export const de_ListTargetsByRuleCommand = async (output, context) => {
801
+ export const de_ListRuleNamesByTargetCommand = async (output, context) => {
1826
802
  if (output.statusCode >= 300) {
1827
- return de_ListTargetsByRuleCommandError(output, context);
803
+ return de_CommandError(output, context);
1828
804
  }
1829
805
  const data = await parseBody(output.body, context);
1830
806
  let contents = {};
@@ -1835,31 +811,9 @@ export const de_ListTargetsByRuleCommand = async (output, context) => {
1835
811
  };
1836
812
  return response;
1837
813
  };
1838
- const de_ListTargetsByRuleCommandError = async (output, context) => {
1839
- const parsedOutput = {
1840
- ...output,
1841
- body: await parseErrorBody(output.body, context),
1842
- };
1843
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1844
- switch (errorCode) {
1845
- case "InternalException":
1846
- case "com.amazonaws.eventbridge#InternalException":
1847
- throw await de_InternalExceptionRes(parsedOutput, context);
1848
- case "ResourceNotFoundException":
1849
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1850
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1851
- default:
1852
- const parsedBody = parsedOutput.body;
1853
- return throwDefaultError({
1854
- output,
1855
- parsedBody,
1856
- errorCode,
1857
- });
1858
- }
1859
- };
1860
- export const de_PutEventsCommand = async (output, context) => {
814
+ export const de_ListRulesCommand = async (output, context) => {
1861
815
  if (output.statusCode >= 300) {
1862
- return de_PutEventsCommandError(output, context);
816
+ return de_CommandError(output, context);
1863
817
  }
1864
818
  const data = await parseBody(output.body, context);
1865
819
  let contents = {};
@@ -1870,28 +824,9 @@ export const de_PutEventsCommand = async (output, context) => {
1870
824
  };
1871
825
  return response;
1872
826
  };
1873
- const de_PutEventsCommandError = async (output, context) => {
1874
- const parsedOutput = {
1875
- ...output,
1876
- body: await parseErrorBody(output.body, context),
1877
- };
1878
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1879
- switch (errorCode) {
1880
- case "InternalException":
1881
- case "com.amazonaws.eventbridge#InternalException":
1882
- throw await de_InternalExceptionRes(parsedOutput, context);
1883
- default:
1884
- const parsedBody = parsedOutput.body;
1885
- return throwDefaultError({
1886
- output,
1887
- parsedBody,
1888
- errorCode,
1889
- });
1890
- }
1891
- };
1892
- export const de_PutPartnerEventsCommand = async (output, context) => {
827
+ export const de_ListTagsForResourceCommand = async (output, context) => {
1893
828
  if (output.statusCode >= 300) {
1894
- return de_PutPartnerEventsCommandError(output, context);
829
+ return de_CommandError(output, context);
1895
830
  }
1896
831
  const data = await parseBody(output.body, context);
1897
832
  let contents = {};
@@ -1902,72 +837,22 @@ export const de_PutPartnerEventsCommand = async (output, context) => {
1902
837
  };
1903
838
  return response;
1904
839
  };
1905
- const de_PutPartnerEventsCommandError = async (output, context) => {
1906
- const parsedOutput = {
1907
- ...output,
1908
- body: await parseErrorBody(output.body, context),
1909
- };
1910
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1911
- switch (errorCode) {
1912
- case "InternalException":
1913
- case "com.amazonaws.eventbridge#InternalException":
1914
- throw await de_InternalExceptionRes(parsedOutput, context);
1915
- case "OperationDisabledException":
1916
- case "com.amazonaws.eventbridge#OperationDisabledException":
1917
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
1918
- default:
1919
- const parsedBody = parsedOutput.body;
1920
- return throwDefaultError({
1921
- output,
1922
- parsedBody,
1923
- errorCode,
1924
- });
1925
- }
1926
- };
1927
- export const de_PutPermissionCommand = async (output, context) => {
840
+ export const de_ListTargetsByRuleCommand = async (output, context) => {
1928
841
  if (output.statusCode >= 300) {
1929
- return de_PutPermissionCommandError(output, context);
842
+ return de_CommandError(output, context);
1930
843
  }
1931
- await collectBody(output.body, context);
844
+ const data = await parseBody(output.body, context);
845
+ let contents = {};
846
+ contents = _json(data);
1932
847
  const response = {
1933
848
  $metadata: deserializeMetadata(output),
849
+ ...contents,
1934
850
  };
1935
851
  return response;
1936
852
  };
1937
- const de_PutPermissionCommandError = async (output, context) => {
1938
- const parsedOutput = {
1939
- ...output,
1940
- body: await parseErrorBody(output.body, context),
1941
- };
1942
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1943
- switch (errorCode) {
1944
- case "ConcurrentModificationException":
1945
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
1946
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
1947
- case "InternalException":
1948
- case "com.amazonaws.eventbridge#InternalException":
1949
- throw await de_InternalExceptionRes(parsedOutput, context);
1950
- case "OperationDisabledException":
1951
- case "com.amazonaws.eventbridge#OperationDisabledException":
1952
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
1953
- case "PolicyLengthExceededException":
1954
- case "com.amazonaws.eventbridge#PolicyLengthExceededException":
1955
- throw await de_PolicyLengthExceededExceptionRes(parsedOutput, context);
1956
- case "ResourceNotFoundException":
1957
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
1958
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1959
- default:
1960
- const parsedBody = parsedOutput.body;
1961
- return throwDefaultError({
1962
- output,
1963
- parsedBody,
1964
- errorCode,
1965
- });
1966
- }
1967
- };
1968
- export const de_PutRuleCommand = async (output, context) => {
853
+ export const de_PutEventsCommand = async (output, context) => {
1969
854
  if (output.statusCode >= 300) {
1970
- return de_PutRuleCommandError(output, context);
855
+ return de_CommandError(output, context);
1971
856
  }
1972
857
  const data = await parseBody(output.body, context);
1973
858
  let contents = {};
@@ -1978,43 +863,9 @@ export const de_PutRuleCommand = async (output, context) => {
1978
863
  };
1979
864
  return response;
1980
865
  };
1981
- const de_PutRuleCommandError = async (output, context) => {
1982
- const parsedOutput = {
1983
- ...output,
1984
- body: await parseErrorBody(output.body, context),
1985
- };
1986
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1987
- switch (errorCode) {
1988
- case "ConcurrentModificationException":
1989
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
1990
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
1991
- case "InternalException":
1992
- case "com.amazonaws.eventbridge#InternalException":
1993
- throw await de_InternalExceptionRes(parsedOutput, context);
1994
- case "InvalidEventPatternException":
1995
- case "com.amazonaws.eventbridge#InvalidEventPatternException":
1996
- throw await de_InvalidEventPatternExceptionRes(parsedOutput, context);
1997
- case "LimitExceededException":
1998
- case "com.amazonaws.eventbridge#LimitExceededException":
1999
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
2000
- case "ManagedRuleException":
2001
- case "com.amazonaws.eventbridge#ManagedRuleException":
2002
- throw await de_ManagedRuleExceptionRes(parsedOutput, context);
2003
- case "ResourceNotFoundException":
2004
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2005
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2006
- default:
2007
- const parsedBody = parsedOutput.body;
2008
- return throwDefaultError({
2009
- output,
2010
- parsedBody,
2011
- errorCode,
2012
- });
2013
- }
2014
- };
2015
- export const de_PutTargetsCommand = async (output, context) => {
866
+ export const de_PutPartnerEventsCommand = async (output, context) => {
2016
867
  if (output.statusCode >= 300) {
2017
- return de_PutTargetsCommandError(output, context);
868
+ return de_CommandError(output, context);
2018
869
  }
2019
870
  const data = await parseBody(output.body, context);
2020
871
  let contents = {};
@@ -2025,40 +876,9 @@ export const de_PutTargetsCommand = async (output, context) => {
2025
876
  };
2026
877
  return response;
2027
878
  };
2028
- const de_PutTargetsCommandError = async (output, context) => {
2029
- const parsedOutput = {
2030
- ...output,
2031
- body: await parseErrorBody(output.body, context),
2032
- };
2033
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2034
- switch (errorCode) {
2035
- case "ConcurrentModificationException":
2036
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
2037
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
2038
- case "InternalException":
2039
- case "com.amazonaws.eventbridge#InternalException":
2040
- throw await de_InternalExceptionRes(parsedOutput, context);
2041
- case "LimitExceededException":
2042
- case "com.amazonaws.eventbridge#LimitExceededException":
2043
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
2044
- case "ManagedRuleException":
2045
- case "com.amazonaws.eventbridge#ManagedRuleException":
2046
- throw await de_ManagedRuleExceptionRes(parsedOutput, context);
2047
- case "ResourceNotFoundException":
2048
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2049
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2050
- default:
2051
- const parsedBody = parsedOutput.body;
2052
- return throwDefaultError({
2053
- output,
2054
- parsedBody,
2055
- errorCode,
2056
- });
2057
- }
2058
- };
2059
- export const de_RemovePermissionCommand = async (output, context) => {
879
+ export const de_PutPermissionCommand = async (output, context) => {
2060
880
  if (output.statusCode >= 300) {
2061
- return de_RemovePermissionCommandError(output, context);
881
+ return de_CommandError(output, context);
2062
882
  }
2063
883
  await collectBody(output.body, context);
2064
884
  const response = {
@@ -2066,37 +886,22 @@ export const de_RemovePermissionCommand = async (output, context) => {
2066
886
  };
2067
887
  return response;
2068
888
  };
2069
- const de_RemovePermissionCommandError = async (output, context) => {
2070
- const parsedOutput = {
2071
- ...output,
2072
- body: await parseErrorBody(output.body, context),
2073
- };
2074
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2075
- switch (errorCode) {
2076
- case "ConcurrentModificationException":
2077
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
2078
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
2079
- case "InternalException":
2080
- case "com.amazonaws.eventbridge#InternalException":
2081
- throw await de_InternalExceptionRes(parsedOutput, context);
2082
- case "OperationDisabledException":
2083
- case "com.amazonaws.eventbridge#OperationDisabledException":
2084
- throw await de_OperationDisabledExceptionRes(parsedOutput, context);
2085
- case "ResourceNotFoundException":
2086
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2087
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2088
- default:
2089
- const parsedBody = parsedOutput.body;
2090
- return throwDefaultError({
2091
- output,
2092
- parsedBody,
2093
- errorCode,
2094
- });
889
+ export const de_PutRuleCommand = async (output, context) => {
890
+ if (output.statusCode >= 300) {
891
+ return de_CommandError(output, context);
2095
892
  }
893
+ const data = await parseBody(output.body, context);
894
+ let contents = {};
895
+ contents = _json(data);
896
+ const response = {
897
+ $metadata: deserializeMetadata(output),
898
+ ...contents,
899
+ };
900
+ return response;
2096
901
  };
2097
- export const de_RemoveTargetsCommand = async (output, context) => {
902
+ export const de_PutTargetsCommand = async (output, context) => {
2098
903
  if (output.statusCode >= 300) {
2099
- return de_RemoveTargetsCommandError(output, context);
904
+ return de_CommandError(output, context);
2100
905
  }
2101
906
  const data = await parseBody(output.body, context);
2102
907
  let contents = {};
@@ -2107,37 +912,32 @@ export const de_RemoveTargetsCommand = async (output, context) => {
2107
912
  };
2108
913
  return response;
2109
914
  };
2110
- const de_RemoveTargetsCommandError = async (output, context) => {
2111
- const parsedOutput = {
2112
- ...output,
2113
- body: await parseErrorBody(output.body, context),
915
+ export const de_RemovePermissionCommand = async (output, context) => {
916
+ if (output.statusCode >= 300) {
917
+ return de_CommandError(output, context);
918
+ }
919
+ await collectBody(output.body, context);
920
+ const response = {
921
+ $metadata: deserializeMetadata(output),
2114
922
  };
2115
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2116
- switch (errorCode) {
2117
- case "ConcurrentModificationException":
2118
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
2119
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
2120
- case "InternalException":
2121
- case "com.amazonaws.eventbridge#InternalException":
2122
- throw await de_InternalExceptionRes(parsedOutput, context);
2123
- case "ManagedRuleException":
2124
- case "com.amazonaws.eventbridge#ManagedRuleException":
2125
- throw await de_ManagedRuleExceptionRes(parsedOutput, context);
2126
- case "ResourceNotFoundException":
2127
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2128
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2129
- default:
2130
- const parsedBody = parsedOutput.body;
2131
- return throwDefaultError({
2132
- output,
2133
- parsedBody,
2134
- errorCode,
2135
- });
923
+ return response;
924
+ };
925
+ export const de_RemoveTargetsCommand = async (output, context) => {
926
+ if (output.statusCode >= 300) {
927
+ return de_CommandError(output, context);
2136
928
  }
929
+ const data = await parseBody(output.body, context);
930
+ let contents = {};
931
+ contents = _json(data);
932
+ const response = {
933
+ $metadata: deserializeMetadata(output),
934
+ ...contents,
935
+ };
936
+ return response;
2137
937
  };
2138
938
  export const de_StartReplayCommand = async (output, context) => {
2139
939
  if (output.statusCode >= 300) {
2140
- return de_StartReplayCommandError(output, context);
940
+ return de_CommandError(output, context);
2141
941
  }
2142
942
  const data = await parseBody(output.body, context);
2143
943
  let contents = {};
@@ -2148,40 +948,9 @@ export const de_StartReplayCommand = async (output, context) => {
2148
948
  };
2149
949
  return response;
2150
950
  };
2151
- const de_StartReplayCommandError = async (output, context) => {
2152
- const parsedOutput = {
2153
- ...output,
2154
- body: await parseErrorBody(output.body, context),
2155
- };
2156
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2157
- switch (errorCode) {
2158
- case "InternalException":
2159
- case "com.amazonaws.eventbridge#InternalException":
2160
- throw await de_InternalExceptionRes(parsedOutput, context);
2161
- case "InvalidEventPatternException":
2162
- case "com.amazonaws.eventbridge#InvalidEventPatternException":
2163
- throw await de_InvalidEventPatternExceptionRes(parsedOutput, context);
2164
- case "LimitExceededException":
2165
- case "com.amazonaws.eventbridge#LimitExceededException":
2166
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
2167
- case "ResourceAlreadyExistsException":
2168
- case "com.amazonaws.eventbridge#ResourceAlreadyExistsException":
2169
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
2170
- case "ResourceNotFoundException":
2171
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2172
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2173
- default:
2174
- const parsedBody = parsedOutput.body;
2175
- return throwDefaultError({
2176
- output,
2177
- parsedBody,
2178
- errorCode,
2179
- });
2180
- }
2181
- };
2182
951
  export const de_TagResourceCommand = async (output, context) => {
2183
952
  if (output.statusCode >= 300) {
2184
- return de_TagResourceCommandError(output, context);
953
+ return de_CommandError(output, context);
2185
954
  }
2186
955
  const data = await parseBody(output.body, context);
2187
956
  let contents = {};
@@ -2192,37 +961,9 @@ export const de_TagResourceCommand = async (output, context) => {
2192
961
  };
2193
962
  return response;
2194
963
  };
2195
- const de_TagResourceCommandError = async (output, context) => {
2196
- const parsedOutput = {
2197
- ...output,
2198
- body: await parseErrorBody(output.body, context),
2199
- };
2200
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2201
- switch (errorCode) {
2202
- case "ConcurrentModificationException":
2203
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
2204
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
2205
- case "InternalException":
2206
- case "com.amazonaws.eventbridge#InternalException":
2207
- throw await de_InternalExceptionRes(parsedOutput, context);
2208
- case "ManagedRuleException":
2209
- case "com.amazonaws.eventbridge#ManagedRuleException":
2210
- throw await de_ManagedRuleExceptionRes(parsedOutput, context);
2211
- case "ResourceNotFoundException":
2212
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2213
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2214
- default:
2215
- const parsedBody = parsedOutput.body;
2216
- return throwDefaultError({
2217
- output,
2218
- parsedBody,
2219
- errorCode,
2220
- });
2221
- }
2222
- };
2223
964
  export const de_TestEventPatternCommand = async (output, context) => {
2224
965
  if (output.statusCode >= 300) {
2225
- return de_TestEventPatternCommandError(output, context);
966
+ return de_CommandError(output, context);
2226
967
  }
2227
968
  const data = await parseBody(output.body, context);
2228
969
  let contents = {};
@@ -2233,31 +974,9 @@ export const de_TestEventPatternCommand = async (output, context) => {
2233
974
  };
2234
975
  return response;
2235
976
  };
2236
- const de_TestEventPatternCommandError = async (output, context) => {
2237
- const parsedOutput = {
2238
- ...output,
2239
- body: await parseErrorBody(output.body, context),
2240
- };
2241
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2242
- switch (errorCode) {
2243
- case "InternalException":
2244
- case "com.amazonaws.eventbridge#InternalException":
2245
- throw await de_InternalExceptionRes(parsedOutput, context);
2246
- case "InvalidEventPatternException":
2247
- case "com.amazonaws.eventbridge#InvalidEventPatternException":
2248
- throw await de_InvalidEventPatternExceptionRes(parsedOutput, context);
2249
- default:
2250
- const parsedBody = parsedOutput.body;
2251
- return throwDefaultError({
2252
- output,
2253
- parsedBody,
2254
- errorCode,
2255
- });
2256
- }
2257
- };
2258
977
  export const de_UntagResourceCommand = async (output, context) => {
2259
978
  if (output.statusCode >= 300) {
2260
- return de_UntagResourceCommandError(output, context);
979
+ return de_CommandError(output, context);
2261
980
  }
2262
981
  const data = await parseBody(output.body, context);
2263
982
  let contents = {};
@@ -2268,37 +987,9 @@ export const de_UntagResourceCommand = async (output, context) => {
2268
987
  };
2269
988
  return response;
2270
989
  };
2271
- const de_UntagResourceCommandError = async (output, context) => {
2272
- const parsedOutput = {
2273
- ...output,
2274
- body: await parseErrorBody(output.body, context),
2275
- };
2276
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2277
- switch (errorCode) {
2278
- case "ConcurrentModificationException":
2279
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
2280
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
2281
- case "InternalException":
2282
- case "com.amazonaws.eventbridge#InternalException":
2283
- throw await de_InternalExceptionRes(parsedOutput, context);
2284
- case "ManagedRuleException":
2285
- case "com.amazonaws.eventbridge#ManagedRuleException":
2286
- throw await de_ManagedRuleExceptionRes(parsedOutput, context);
2287
- case "ResourceNotFoundException":
2288
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2289
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2290
- default:
2291
- const parsedBody = parsedOutput.body;
2292
- return throwDefaultError({
2293
- output,
2294
- parsedBody,
2295
- errorCode,
2296
- });
2297
- }
2298
- };
2299
990
  export const de_UpdateApiDestinationCommand = async (output, context) => {
2300
991
  if (output.statusCode >= 300) {
2301
- return de_UpdateApiDestinationCommandError(output, context);
992
+ return de_CommandError(output, context);
2302
993
  }
2303
994
  const data = await parseBody(output.body, context);
2304
995
  let contents = {};
@@ -2309,37 +1000,9 @@ export const de_UpdateApiDestinationCommand = async (output, context) => {
2309
1000
  };
2310
1001
  return response;
2311
1002
  };
2312
- const de_UpdateApiDestinationCommandError = async (output, context) => {
2313
- const parsedOutput = {
2314
- ...output,
2315
- body: await parseErrorBody(output.body, context),
2316
- };
2317
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2318
- switch (errorCode) {
2319
- case "ConcurrentModificationException":
2320
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
2321
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
2322
- case "InternalException":
2323
- case "com.amazonaws.eventbridge#InternalException":
2324
- throw await de_InternalExceptionRes(parsedOutput, context);
2325
- case "LimitExceededException":
2326
- case "com.amazonaws.eventbridge#LimitExceededException":
2327
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
2328
- case "ResourceNotFoundException":
2329
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2330
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2331
- default:
2332
- const parsedBody = parsedOutput.body;
2333
- return throwDefaultError({
2334
- output,
2335
- parsedBody,
2336
- errorCode,
2337
- });
2338
- }
2339
- };
2340
1003
  export const de_UpdateArchiveCommand = async (output, context) => {
2341
1004
  if (output.statusCode >= 300) {
2342
- return de_UpdateArchiveCommandError(output, context);
1005
+ return de_CommandError(output, context);
2343
1006
  }
2344
1007
  const data = await parseBody(output.body, context);
2345
1008
  let contents = {};
@@ -2350,40 +1013,9 @@ export const de_UpdateArchiveCommand = async (output, context) => {
2350
1013
  };
2351
1014
  return response;
2352
1015
  };
2353
- const de_UpdateArchiveCommandError = async (output, context) => {
2354
- const parsedOutput = {
2355
- ...output,
2356
- body: await parseErrorBody(output.body, context),
2357
- };
2358
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2359
- switch (errorCode) {
2360
- case "ConcurrentModificationException":
2361
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
2362
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
2363
- case "InternalException":
2364
- case "com.amazonaws.eventbridge#InternalException":
2365
- throw await de_InternalExceptionRes(parsedOutput, context);
2366
- case "InvalidEventPatternException":
2367
- case "com.amazonaws.eventbridge#InvalidEventPatternException":
2368
- throw await de_InvalidEventPatternExceptionRes(parsedOutput, context);
2369
- case "LimitExceededException":
2370
- case "com.amazonaws.eventbridge#LimitExceededException":
2371
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
2372
- case "ResourceNotFoundException":
2373
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2374
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2375
- default:
2376
- const parsedBody = parsedOutput.body;
2377
- return throwDefaultError({
2378
- output,
2379
- parsedBody,
2380
- errorCode,
2381
- });
2382
- }
2383
- };
2384
1016
  export const de_UpdateConnectionCommand = async (output, context) => {
2385
1017
  if (output.statusCode >= 300) {
2386
- return de_UpdateConnectionCommandError(output, context);
1018
+ return de_CommandError(output, context);
2387
1019
  }
2388
1020
  const data = await parseBody(output.body, context);
2389
1021
  let contents = {};
@@ -2394,37 +1026,9 @@ export const de_UpdateConnectionCommand = async (output, context) => {
2394
1026
  };
2395
1027
  return response;
2396
1028
  };
2397
- const de_UpdateConnectionCommandError = async (output, context) => {
2398
- const parsedOutput = {
2399
- ...output,
2400
- body: await parseErrorBody(output.body, context),
2401
- };
2402
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2403
- switch (errorCode) {
2404
- case "ConcurrentModificationException":
2405
- case "com.amazonaws.eventbridge#ConcurrentModificationException":
2406
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
2407
- case "InternalException":
2408
- case "com.amazonaws.eventbridge#InternalException":
2409
- throw await de_InternalExceptionRes(parsedOutput, context);
2410
- case "LimitExceededException":
2411
- case "com.amazonaws.eventbridge#LimitExceededException":
2412
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
2413
- case "ResourceNotFoundException":
2414
- case "com.amazonaws.eventbridge#ResourceNotFoundException":
2415
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2416
- default:
2417
- const parsedBody = parsedOutput.body;
2418
- return throwDefaultError({
2419
- output,
2420
- parsedBody,
2421
- errorCode,
2422
- });
2423
- }
2424
- };
2425
1029
  export const de_UpdateEndpointCommand = async (output, context) => {
2426
1030
  if (output.statusCode >= 300) {
2427
- return de_UpdateEndpointCommandError(output, context);
1031
+ return de_CommandError(output, context);
2428
1032
  }
2429
1033
  const data = await parseBody(output.body, context);
2430
1034
  let contents = {};
@@ -2435,7 +1039,7 @@ export const de_UpdateEndpointCommand = async (output, context) => {
2435
1039
  };
2436
1040
  return response;
2437
1041
  };
2438
- const de_UpdateEndpointCommandError = async (output, context) => {
1042
+ const de_CommandError = async (output, context) => {
2439
1043
  const parsedOutput = {
2440
1044
  ...output,
2441
1045
  body: await parseErrorBody(output.body, context),
@@ -2448,9 +1052,33 @@ const de_UpdateEndpointCommandError = async (output, context) => {
2448
1052
  case "InternalException":
2449
1053
  case "com.amazonaws.eventbridge#InternalException":
2450
1054
  throw await de_InternalExceptionRes(parsedOutput, context);
1055
+ case "InvalidStateException":
1056
+ case "com.amazonaws.eventbridge#InvalidStateException":
1057
+ throw await de_InvalidStateExceptionRes(parsedOutput, context);
1058
+ case "OperationDisabledException":
1059
+ case "com.amazonaws.eventbridge#OperationDisabledException":
1060
+ throw await de_OperationDisabledExceptionRes(parsedOutput, context);
2451
1061
  case "ResourceNotFoundException":
2452
1062
  case "com.amazonaws.eventbridge#ResourceNotFoundException":
2453
1063
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1064
+ case "IllegalStatusException":
1065
+ case "com.amazonaws.eventbridge#IllegalStatusException":
1066
+ throw await de_IllegalStatusExceptionRes(parsedOutput, context);
1067
+ case "LimitExceededException":
1068
+ case "com.amazonaws.eventbridge#LimitExceededException":
1069
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
1070
+ case "ResourceAlreadyExistsException":
1071
+ case "com.amazonaws.eventbridge#ResourceAlreadyExistsException":
1072
+ throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
1073
+ case "InvalidEventPatternException":
1074
+ case "com.amazonaws.eventbridge#InvalidEventPatternException":
1075
+ throw await de_InvalidEventPatternExceptionRes(parsedOutput, context);
1076
+ case "ManagedRuleException":
1077
+ case "com.amazonaws.eventbridge#ManagedRuleException":
1078
+ throw await de_ManagedRuleExceptionRes(parsedOutput, context);
1079
+ case "PolicyLengthExceededException":
1080
+ case "com.amazonaws.eventbridge#PolicyLengthExceededException":
1081
+ throw await de_PolicyLengthExceededExceptionRes(parsedOutput, context);
2454
1082
  default:
2455
1083
  const parsedBody = parsedOutput.body;
2456
1084
  return throwDefaultError({