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