@aws-sdk/client-bedrock 3.503.1 → 3.507.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -291,7 +291,7 @@ export const se_UpdateProvisionedModelThroughputCommand = async (input, context)
291
291
  };
292
292
  export const de_CreateModelCustomizationJobCommand = async (output, context) => {
293
293
  if (output.statusCode !== 201 && output.statusCode >= 300) {
294
- return de_CreateModelCustomizationJobCommandError(output, context);
294
+ return de_CommandError(output, context);
295
295
  }
296
296
  const contents = map({
297
297
  $metadata: deserializeMetadata(output),
@@ -303,49 +303,9 @@ export const de_CreateModelCustomizationJobCommand = async (output, context) =>
303
303
  Object.assign(contents, doc);
304
304
  return contents;
305
305
  };
306
- const de_CreateModelCustomizationJobCommandError = async (output, context) => {
307
- const parsedOutput = {
308
- ...output,
309
- body: await parseErrorBody(output.body, context),
310
- };
311
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
312
- switch (errorCode) {
313
- case "AccessDeniedException":
314
- case "com.amazonaws.bedrock#AccessDeniedException":
315
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
316
- case "ConflictException":
317
- case "com.amazonaws.bedrock#ConflictException":
318
- throw await de_ConflictExceptionRes(parsedOutput, context);
319
- case "InternalServerException":
320
- case "com.amazonaws.bedrock#InternalServerException":
321
- throw await de_InternalServerExceptionRes(parsedOutput, context);
322
- case "ResourceNotFoundException":
323
- case "com.amazonaws.bedrock#ResourceNotFoundException":
324
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
325
- case "ServiceQuotaExceededException":
326
- case "com.amazonaws.bedrock#ServiceQuotaExceededException":
327
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
328
- case "ThrottlingException":
329
- case "com.amazonaws.bedrock#ThrottlingException":
330
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
331
- case "TooManyTagsException":
332
- case "com.amazonaws.bedrock#TooManyTagsException":
333
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
334
- case "ValidationException":
335
- case "com.amazonaws.bedrock#ValidationException":
336
- throw await de_ValidationExceptionRes(parsedOutput, context);
337
- default:
338
- const parsedBody = parsedOutput.body;
339
- return throwDefaultError({
340
- output,
341
- parsedBody,
342
- errorCode,
343
- });
344
- }
345
- };
346
306
  export const de_CreateProvisionedModelThroughputCommand = async (output, context) => {
347
307
  if (output.statusCode !== 201 && output.statusCode >= 300) {
348
- return de_CreateProvisionedModelThroughputCommandError(output, context);
308
+ return de_CommandError(output, context);
349
309
  }
350
310
  const contents = map({
351
311
  $metadata: deserializeMetadata(output),
@@ -357,46 +317,9 @@ export const de_CreateProvisionedModelThroughputCommand = async (output, context
357
317
  Object.assign(contents, doc);
358
318
  return contents;
359
319
  };
360
- const de_CreateProvisionedModelThroughputCommandError = async (output, context) => {
361
- const parsedOutput = {
362
- ...output,
363
- body: await parseErrorBody(output.body, context),
364
- };
365
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
366
- switch (errorCode) {
367
- case "AccessDeniedException":
368
- case "com.amazonaws.bedrock#AccessDeniedException":
369
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
370
- case "InternalServerException":
371
- case "com.amazonaws.bedrock#InternalServerException":
372
- throw await de_InternalServerExceptionRes(parsedOutput, context);
373
- case "ResourceNotFoundException":
374
- case "com.amazonaws.bedrock#ResourceNotFoundException":
375
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
376
- case "ServiceQuotaExceededException":
377
- case "com.amazonaws.bedrock#ServiceQuotaExceededException":
378
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
379
- case "ThrottlingException":
380
- case "com.amazonaws.bedrock#ThrottlingException":
381
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
382
- case "TooManyTagsException":
383
- case "com.amazonaws.bedrock#TooManyTagsException":
384
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
385
- case "ValidationException":
386
- case "com.amazonaws.bedrock#ValidationException":
387
- throw await de_ValidationExceptionRes(parsedOutput, context);
388
- default:
389
- const parsedBody = parsedOutput.body;
390
- return throwDefaultError({
391
- output,
392
- parsedBody,
393
- errorCode,
394
- });
395
- }
396
- };
397
320
  export const de_DeleteCustomModelCommand = async (output, context) => {
398
321
  if (output.statusCode !== 200 && output.statusCode >= 300) {
399
- return de_DeleteCustomModelCommandError(output, context);
322
+ return de_CommandError(output, context);
400
323
  }
401
324
  const contents = map({
402
325
  $metadata: deserializeMetadata(output),
@@ -404,43 +327,9 @@ export const de_DeleteCustomModelCommand = async (output, context) => {
404
327
  await collectBody(output.body, context);
405
328
  return contents;
406
329
  };
407
- const de_DeleteCustomModelCommandError = async (output, context) => {
408
- const parsedOutput = {
409
- ...output,
410
- body: await parseErrorBody(output.body, context),
411
- };
412
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
413
- switch (errorCode) {
414
- case "AccessDeniedException":
415
- case "com.amazonaws.bedrock#AccessDeniedException":
416
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
417
- case "ConflictException":
418
- case "com.amazonaws.bedrock#ConflictException":
419
- throw await de_ConflictExceptionRes(parsedOutput, context);
420
- case "InternalServerException":
421
- case "com.amazonaws.bedrock#InternalServerException":
422
- throw await de_InternalServerExceptionRes(parsedOutput, context);
423
- case "ResourceNotFoundException":
424
- case "com.amazonaws.bedrock#ResourceNotFoundException":
425
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
426
- case "ThrottlingException":
427
- case "com.amazonaws.bedrock#ThrottlingException":
428
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
429
- case "ValidationException":
430
- case "com.amazonaws.bedrock#ValidationException":
431
- throw await de_ValidationExceptionRes(parsedOutput, context);
432
- default:
433
- const parsedBody = parsedOutput.body;
434
- return throwDefaultError({
435
- output,
436
- parsedBody,
437
- errorCode,
438
- });
439
- }
440
- };
441
330
  export const de_DeleteModelInvocationLoggingConfigurationCommand = async (output, context) => {
442
331
  if (output.statusCode !== 200 && output.statusCode >= 300) {
443
- return de_DeleteModelInvocationLoggingConfigurationCommandError(output, context);
332
+ return de_CommandError(output, context);
444
333
  }
445
334
  const contents = map({
446
335
  $metadata: deserializeMetadata(output),
@@ -448,34 +337,9 @@ export const de_DeleteModelInvocationLoggingConfigurationCommand = async (output
448
337
  await collectBody(output.body, context);
449
338
  return contents;
450
339
  };
451
- const de_DeleteModelInvocationLoggingConfigurationCommandError = async (output, context) => {
452
- const parsedOutput = {
453
- ...output,
454
- body: await parseErrorBody(output.body, context),
455
- };
456
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
457
- switch (errorCode) {
458
- case "AccessDeniedException":
459
- case "com.amazonaws.bedrock#AccessDeniedException":
460
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
461
- case "InternalServerException":
462
- case "com.amazonaws.bedrock#InternalServerException":
463
- throw await de_InternalServerExceptionRes(parsedOutput, context);
464
- case "ThrottlingException":
465
- case "com.amazonaws.bedrock#ThrottlingException":
466
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
467
- default:
468
- const parsedBody = parsedOutput.body;
469
- return throwDefaultError({
470
- output,
471
- parsedBody,
472
- errorCode,
473
- });
474
- }
475
- };
476
340
  export const de_DeleteProvisionedModelThroughputCommand = async (output, context) => {
477
341
  if (output.statusCode !== 200 && output.statusCode >= 300) {
478
- return de_DeleteProvisionedModelThroughputCommandError(output, context);
342
+ return de_CommandError(output, context);
479
343
  }
480
344
  const contents = map({
481
345
  $metadata: deserializeMetadata(output),
@@ -483,43 +347,9 @@ export const de_DeleteProvisionedModelThroughputCommand = async (output, context
483
347
  await collectBody(output.body, context);
484
348
  return contents;
485
349
  };
486
- const de_DeleteProvisionedModelThroughputCommandError = async (output, context) => {
487
- const parsedOutput = {
488
- ...output,
489
- body: await parseErrorBody(output.body, context),
490
- };
491
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
492
- switch (errorCode) {
493
- case "AccessDeniedException":
494
- case "com.amazonaws.bedrock#AccessDeniedException":
495
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
496
- case "ConflictException":
497
- case "com.amazonaws.bedrock#ConflictException":
498
- throw await de_ConflictExceptionRes(parsedOutput, context);
499
- case "InternalServerException":
500
- case "com.amazonaws.bedrock#InternalServerException":
501
- throw await de_InternalServerExceptionRes(parsedOutput, context);
502
- case "ResourceNotFoundException":
503
- case "com.amazonaws.bedrock#ResourceNotFoundException":
504
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
505
- case "ThrottlingException":
506
- case "com.amazonaws.bedrock#ThrottlingException":
507
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
508
- case "ValidationException":
509
- case "com.amazonaws.bedrock#ValidationException":
510
- throw await de_ValidationExceptionRes(parsedOutput, context);
511
- default:
512
- const parsedBody = parsedOutput.body;
513
- return throwDefaultError({
514
- output,
515
- parsedBody,
516
- errorCode,
517
- });
518
- }
519
- };
520
350
  export const de_GetCustomModelCommand = async (output, context) => {
521
351
  if (output.statusCode !== 200 && output.statusCode >= 300) {
522
- return de_GetCustomModelCommandError(output, context);
352
+ return de_CommandError(output, context);
523
353
  }
524
354
  const contents = map({
525
355
  $metadata: deserializeMetadata(output),
@@ -544,40 +374,9 @@ export const de_GetCustomModelCommand = async (output, context) => {
544
374
  Object.assign(contents, doc);
545
375
  return contents;
546
376
  };
547
- const de_GetCustomModelCommandError = async (output, context) => {
548
- const parsedOutput = {
549
- ...output,
550
- body: await parseErrorBody(output.body, context),
551
- };
552
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
553
- switch (errorCode) {
554
- case "AccessDeniedException":
555
- case "com.amazonaws.bedrock#AccessDeniedException":
556
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
557
- case "InternalServerException":
558
- case "com.amazonaws.bedrock#InternalServerException":
559
- throw await de_InternalServerExceptionRes(parsedOutput, context);
560
- case "ResourceNotFoundException":
561
- case "com.amazonaws.bedrock#ResourceNotFoundException":
562
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
563
- case "ThrottlingException":
564
- case "com.amazonaws.bedrock#ThrottlingException":
565
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
566
- case "ValidationException":
567
- case "com.amazonaws.bedrock#ValidationException":
568
- throw await de_ValidationExceptionRes(parsedOutput, context);
569
- default:
570
- const parsedBody = parsedOutput.body;
571
- return throwDefaultError({
572
- output,
573
- parsedBody,
574
- errorCode,
575
- });
576
- }
577
- };
578
377
  export const de_GetFoundationModelCommand = async (output, context) => {
579
378
  if (output.statusCode !== 200 && output.statusCode >= 300) {
580
- return de_GetFoundationModelCommandError(output, context);
379
+ return de_CommandError(output, context);
581
380
  }
582
381
  const contents = map({
583
382
  $metadata: deserializeMetadata(output),
@@ -589,40 +388,9 @@ export const de_GetFoundationModelCommand = async (output, context) => {
589
388
  Object.assign(contents, doc);
590
389
  return contents;
591
390
  };
592
- const de_GetFoundationModelCommandError = async (output, context) => {
593
- const parsedOutput = {
594
- ...output,
595
- body: await parseErrorBody(output.body, context),
596
- };
597
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
598
- switch (errorCode) {
599
- case "AccessDeniedException":
600
- case "com.amazonaws.bedrock#AccessDeniedException":
601
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
602
- case "InternalServerException":
603
- case "com.amazonaws.bedrock#InternalServerException":
604
- throw await de_InternalServerExceptionRes(parsedOutput, context);
605
- case "ResourceNotFoundException":
606
- case "com.amazonaws.bedrock#ResourceNotFoundException":
607
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
608
- case "ThrottlingException":
609
- case "com.amazonaws.bedrock#ThrottlingException":
610
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
611
- case "ValidationException":
612
- case "com.amazonaws.bedrock#ValidationException":
613
- throw await de_ValidationExceptionRes(parsedOutput, context);
614
- default:
615
- const parsedBody = parsedOutput.body;
616
- return throwDefaultError({
617
- output,
618
- parsedBody,
619
- errorCode,
620
- });
621
- }
622
- };
623
391
  export const de_GetModelCustomizationJobCommand = async (output, context) => {
624
392
  if (output.statusCode !== 200 && output.statusCode >= 300) {
625
- return de_GetModelCustomizationJobCommandError(output, context);
393
+ return de_CommandError(output, context);
626
394
  }
627
395
  const contents = map({
628
396
  $metadata: deserializeMetadata(output),
@@ -654,40 +422,9 @@ export const de_GetModelCustomizationJobCommand = async (output, context) => {
654
422
  Object.assign(contents, doc);
655
423
  return contents;
656
424
  };
657
- const de_GetModelCustomizationJobCommandError = async (output, context) => {
658
- const parsedOutput = {
659
- ...output,
660
- body: await parseErrorBody(output.body, context),
661
- };
662
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
663
- switch (errorCode) {
664
- case "AccessDeniedException":
665
- case "com.amazonaws.bedrock#AccessDeniedException":
666
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
667
- case "InternalServerException":
668
- case "com.amazonaws.bedrock#InternalServerException":
669
- throw await de_InternalServerExceptionRes(parsedOutput, context);
670
- case "ResourceNotFoundException":
671
- case "com.amazonaws.bedrock#ResourceNotFoundException":
672
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
673
- case "ThrottlingException":
674
- case "com.amazonaws.bedrock#ThrottlingException":
675
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
676
- case "ValidationException":
677
- case "com.amazonaws.bedrock#ValidationException":
678
- throw await de_ValidationExceptionRes(parsedOutput, context);
679
- default:
680
- const parsedBody = parsedOutput.body;
681
- return throwDefaultError({
682
- output,
683
- parsedBody,
684
- errorCode,
685
- });
686
- }
687
- };
688
425
  export const de_GetModelInvocationLoggingConfigurationCommand = async (output, context) => {
689
426
  if (output.statusCode !== 200 && output.statusCode >= 300) {
690
- return de_GetModelInvocationLoggingConfigurationCommandError(output, context);
427
+ return de_CommandError(output, context);
691
428
  }
692
429
  const contents = map({
693
430
  $metadata: deserializeMetadata(output),
@@ -699,34 +436,9 @@ export const de_GetModelInvocationLoggingConfigurationCommand = async (output, c
699
436
  Object.assign(contents, doc);
700
437
  return contents;
701
438
  };
702
- const de_GetModelInvocationLoggingConfigurationCommandError = async (output, context) => {
703
- const parsedOutput = {
704
- ...output,
705
- body: await parseErrorBody(output.body, context),
706
- };
707
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
708
- switch (errorCode) {
709
- case "AccessDeniedException":
710
- case "com.amazonaws.bedrock#AccessDeniedException":
711
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
712
- case "InternalServerException":
713
- case "com.amazonaws.bedrock#InternalServerException":
714
- throw await de_InternalServerExceptionRes(parsedOutput, context);
715
- case "ThrottlingException":
716
- case "com.amazonaws.bedrock#ThrottlingException":
717
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
718
- default:
719
- const parsedBody = parsedOutput.body;
720
- return throwDefaultError({
721
- output,
722
- parsedBody,
723
- errorCode,
724
- });
725
- }
726
- };
727
439
  export const de_GetProvisionedModelThroughputCommand = async (output, context) => {
728
440
  if (output.statusCode !== 200 && output.statusCode >= 300) {
729
- return de_GetProvisionedModelThroughputCommandError(output, context);
441
+ return de_CommandError(output, context);
730
442
  }
731
443
  const contents = map({
732
444
  $metadata: deserializeMetadata(output),
@@ -750,40 +462,9 @@ export const de_GetProvisionedModelThroughputCommand = async (output, context) =
750
462
  Object.assign(contents, doc);
751
463
  return contents;
752
464
  };
753
- const de_GetProvisionedModelThroughputCommandError = async (output, context) => {
754
- const parsedOutput = {
755
- ...output,
756
- body: await parseErrorBody(output.body, context),
757
- };
758
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
759
- switch (errorCode) {
760
- case "AccessDeniedException":
761
- case "com.amazonaws.bedrock#AccessDeniedException":
762
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
763
- case "InternalServerException":
764
- case "com.amazonaws.bedrock#InternalServerException":
765
- throw await de_InternalServerExceptionRes(parsedOutput, context);
766
- case "ResourceNotFoundException":
767
- case "com.amazonaws.bedrock#ResourceNotFoundException":
768
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
769
- case "ThrottlingException":
770
- case "com.amazonaws.bedrock#ThrottlingException":
771
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
772
- case "ValidationException":
773
- case "com.amazonaws.bedrock#ValidationException":
774
- throw await de_ValidationExceptionRes(parsedOutput, context);
775
- default:
776
- const parsedBody = parsedOutput.body;
777
- return throwDefaultError({
778
- output,
779
- parsedBody,
780
- errorCode,
781
- });
782
- }
783
- };
784
465
  export const de_ListCustomModelsCommand = async (output, context) => {
785
466
  if (output.statusCode !== 200 && output.statusCode >= 300) {
786
- return de_ListCustomModelsCommandError(output, context);
467
+ return de_CommandError(output, context);
787
468
  }
788
469
  const contents = map({
789
470
  $metadata: deserializeMetadata(output),
@@ -796,37 +477,9 @@ export const de_ListCustomModelsCommand = async (output, context) => {
796
477
  Object.assign(contents, doc);
797
478
  return contents;
798
479
  };
799
- const de_ListCustomModelsCommandError = async (output, context) => {
800
- const parsedOutput = {
801
- ...output,
802
- body: await parseErrorBody(output.body, context),
803
- };
804
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
805
- switch (errorCode) {
806
- case "AccessDeniedException":
807
- case "com.amazonaws.bedrock#AccessDeniedException":
808
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
809
- case "InternalServerException":
810
- case "com.amazonaws.bedrock#InternalServerException":
811
- throw await de_InternalServerExceptionRes(parsedOutput, context);
812
- case "ThrottlingException":
813
- case "com.amazonaws.bedrock#ThrottlingException":
814
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
815
- case "ValidationException":
816
- case "com.amazonaws.bedrock#ValidationException":
817
- throw await de_ValidationExceptionRes(parsedOutput, context);
818
- default:
819
- const parsedBody = parsedOutput.body;
820
- return throwDefaultError({
821
- output,
822
- parsedBody,
823
- errorCode,
824
- });
825
- }
826
- };
827
480
  export const de_ListFoundationModelsCommand = async (output, context) => {
828
481
  if (output.statusCode !== 200 && output.statusCode >= 300) {
829
- return de_ListFoundationModelsCommandError(output, context);
482
+ return de_CommandError(output, context);
830
483
  }
831
484
  const contents = map({
832
485
  $metadata: deserializeMetadata(output),
@@ -838,37 +491,9 @@ export const de_ListFoundationModelsCommand = async (output, context) => {
838
491
  Object.assign(contents, doc);
839
492
  return contents;
840
493
  };
841
- const de_ListFoundationModelsCommandError = async (output, context) => {
842
- const parsedOutput = {
843
- ...output,
844
- body: await parseErrorBody(output.body, context),
845
- };
846
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
847
- switch (errorCode) {
848
- case "AccessDeniedException":
849
- case "com.amazonaws.bedrock#AccessDeniedException":
850
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
851
- case "InternalServerException":
852
- case "com.amazonaws.bedrock#InternalServerException":
853
- throw await de_InternalServerExceptionRes(parsedOutput, context);
854
- case "ThrottlingException":
855
- case "com.amazonaws.bedrock#ThrottlingException":
856
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
857
- case "ValidationException":
858
- case "com.amazonaws.bedrock#ValidationException":
859
- throw await de_ValidationExceptionRes(parsedOutput, context);
860
- default:
861
- const parsedBody = parsedOutput.body;
862
- return throwDefaultError({
863
- output,
864
- parsedBody,
865
- errorCode,
866
- });
867
- }
868
- };
869
494
  export const de_ListModelCustomizationJobsCommand = async (output, context) => {
870
495
  if (output.statusCode !== 200 && output.statusCode >= 300) {
871
- return de_ListModelCustomizationJobsCommandError(output, context);
496
+ return de_CommandError(output, context);
872
497
  }
873
498
  const contents = map({
874
499
  $metadata: deserializeMetadata(output),
@@ -881,37 +506,9 @@ export const de_ListModelCustomizationJobsCommand = async (output, context) => {
881
506
  Object.assign(contents, doc);
882
507
  return contents;
883
508
  };
884
- const de_ListModelCustomizationJobsCommandError = async (output, context) => {
885
- const parsedOutput = {
886
- ...output,
887
- body: await parseErrorBody(output.body, context),
888
- };
889
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
890
- switch (errorCode) {
891
- case "AccessDeniedException":
892
- case "com.amazonaws.bedrock#AccessDeniedException":
893
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
894
- case "InternalServerException":
895
- case "com.amazonaws.bedrock#InternalServerException":
896
- throw await de_InternalServerExceptionRes(parsedOutput, context);
897
- case "ThrottlingException":
898
- case "com.amazonaws.bedrock#ThrottlingException":
899
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
900
- case "ValidationException":
901
- case "com.amazonaws.bedrock#ValidationException":
902
- throw await de_ValidationExceptionRes(parsedOutput, context);
903
- default:
904
- const parsedBody = parsedOutput.body;
905
- return throwDefaultError({
906
- output,
907
- parsedBody,
908
- errorCode,
909
- });
910
- }
911
- };
912
509
  export const de_ListProvisionedModelThroughputsCommand = async (output, context) => {
913
510
  if (output.statusCode !== 200 && output.statusCode >= 300) {
914
- return de_ListProvisionedModelThroughputsCommandError(output, context);
511
+ return de_CommandError(output, context);
915
512
  }
916
513
  const contents = map({
917
514
  $metadata: deserializeMetadata(output),
@@ -924,37 +521,9 @@ export const de_ListProvisionedModelThroughputsCommand = async (output, context)
924
521
  Object.assign(contents, doc);
925
522
  return contents;
926
523
  };
927
- const de_ListProvisionedModelThroughputsCommandError = async (output, context) => {
928
- const parsedOutput = {
929
- ...output,
930
- body: await parseErrorBody(output.body, context),
931
- };
932
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
933
- switch (errorCode) {
934
- case "AccessDeniedException":
935
- case "com.amazonaws.bedrock#AccessDeniedException":
936
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
937
- case "InternalServerException":
938
- case "com.amazonaws.bedrock#InternalServerException":
939
- throw await de_InternalServerExceptionRes(parsedOutput, context);
940
- case "ThrottlingException":
941
- case "com.amazonaws.bedrock#ThrottlingException":
942
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
943
- case "ValidationException":
944
- case "com.amazonaws.bedrock#ValidationException":
945
- throw await de_ValidationExceptionRes(parsedOutput, context);
946
- default:
947
- const parsedBody = parsedOutput.body;
948
- return throwDefaultError({
949
- output,
950
- parsedBody,
951
- errorCode,
952
- });
953
- }
954
- };
955
524
  export const de_ListTagsForResourceCommand = async (output, context) => {
956
525
  if (output.statusCode !== 200 && output.statusCode >= 300) {
957
- return de_ListTagsForResourceCommandError(output, context);
526
+ return de_CommandError(output, context);
958
527
  }
959
528
  const contents = map({
960
529
  $metadata: deserializeMetadata(output),
@@ -966,40 +535,9 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
966
535
  Object.assign(contents, doc);
967
536
  return contents;
968
537
  };
969
- const de_ListTagsForResourceCommandError = async (output, context) => {
970
- const parsedOutput = {
971
- ...output,
972
- body: await parseErrorBody(output.body, context),
973
- };
974
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
975
- switch (errorCode) {
976
- case "AccessDeniedException":
977
- case "com.amazonaws.bedrock#AccessDeniedException":
978
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
979
- case "InternalServerException":
980
- case "com.amazonaws.bedrock#InternalServerException":
981
- throw await de_InternalServerExceptionRes(parsedOutput, context);
982
- case "ResourceNotFoundException":
983
- case "com.amazonaws.bedrock#ResourceNotFoundException":
984
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
985
- case "ThrottlingException":
986
- case "com.amazonaws.bedrock#ThrottlingException":
987
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
988
- case "ValidationException":
989
- case "com.amazonaws.bedrock#ValidationException":
990
- throw await de_ValidationExceptionRes(parsedOutput, context);
991
- default:
992
- const parsedBody = parsedOutput.body;
993
- return throwDefaultError({
994
- output,
995
- parsedBody,
996
- errorCode,
997
- });
998
- }
999
- };
1000
538
  export const de_PutModelInvocationLoggingConfigurationCommand = async (output, context) => {
1001
539
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1002
- return de_PutModelInvocationLoggingConfigurationCommandError(output, context);
540
+ return de_CommandError(output, context);
1003
541
  }
1004
542
  const contents = map({
1005
543
  $metadata: deserializeMetadata(output),
@@ -1007,37 +545,9 @@ export const de_PutModelInvocationLoggingConfigurationCommand = async (output, c
1007
545
  await collectBody(output.body, context);
1008
546
  return contents;
1009
547
  };
1010
- const de_PutModelInvocationLoggingConfigurationCommandError = async (output, context) => {
1011
- const parsedOutput = {
1012
- ...output,
1013
- body: await parseErrorBody(output.body, context),
1014
- };
1015
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1016
- switch (errorCode) {
1017
- case "AccessDeniedException":
1018
- case "com.amazonaws.bedrock#AccessDeniedException":
1019
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1020
- case "InternalServerException":
1021
- case "com.amazonaws.bedrock#InternalServerException":
1022
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1023
- case "ThrottlingException":
1024
- case "com.amazonaws.bedrock#ThrottlingException":
1025
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1026
- case "ValidationException":
1027
- case "com.amazonaws.bedrock#ValidationException":
1028
- throw await de_ValidationExceptionRes(parsedOutput, context);
1029
- default:
1030
- const parsedBody = parsedOutput.body;
1031
- return throwDefaultError({
1032
- output,
1033
- parsedBody,
1034
- errorCode,
1035
- });
1036
- }
1037
- };
1038
548
  export const de_StopModelCustomizationJobCommand = async (output, context) => {
1039
549
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1040
- return de_StopModelCustomizationJobCommandError(output, context);
550
+ return de_CommandError(output, context);
1041
551
  }
1042
552
  const contents = map({
1043
553
  $metadata: deserializeMetadata(output),
@@ -1045,43 +555,9 @@ export const de_StopModelCustomizationJobCommand = async (output, context) => {
1045
555
  await collectBody(output.body, context);
1046
556
  return contents;
1047
557
  };
1048
- const de_StopModelCustomizationJobCommandError = async (output, context) => {
1049
- const parsedOutput = {
1050
- ...output,
1051
- body: await parseErrorBody(output.body, context),
1052
- };
1053
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1054
- switch (errorCode) {
1055
- case "AccessDeniedException":
1056
- case "com.amazonaws.bedrock#AccessDeniedException":
1057
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1058
- case "ConflictException":
1059
- case "com.amazonaws.bedrock#ConflictException":
1060
- throw await de_ConflictExceptionRes(parsedOutput, context);
1061
- case "InternalServerException":
1062
- case "com.amazonaws.bedrock#InternalServerException":
1063
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1064
- case "ResourceNotFoundException":
1065
- case "com.amazonaws.bedrock#ResourceNotFoundException":
1066
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1067
- case "ThrottlingException":
1068
- case "com.amazonaws.bedrock#ThrottlingException":
1069
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1070
- case "ValidationException":
1071
- case "com.amazonaws.bedrock#ValidationException":
1072
- throw await de_ValidationExceptionRes(parsedOutput, context);
1073
- default:
1074
- const parsedBody = parsedOutput.body;
1075
- return throwDefaultError({
1076
- output,
1077
- parsedBody,
1078
- errorCode,
1079
- });
1080
- }
1081
- };
1082
558
  export const de_TagResourceCommand = async (output, context) => {
1083
559
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1084
- return de_TagResourceCommandError(output, context);
560
+ return de_CommandError(output, context);
1085
561
  }
1086
562
  const contents = map({
1087
563
  $metadata: deserializeMetadata(output),
@@ -1089,43 +565,9 @@ export const de_TagResourceCommand = async (output, context) => {
1089
565
  await collectBody(output.body, context);
1090
566
  return contents;
1091
567
  };
1092
- const de_TagResourceCommandError = async (output, context) => {
1093
- const parsedOutput = {
1094
- ...output,
1095
- body: await parseErrorBody(output.body, context),
1096
- };
1097
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1098
- switch (errorCode) {
1099
- case "AccessDeniedException":
1100
- case "com.amazonaws.bedrock#AccessDeniedException":
1101
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1102
- case "InternalServerException":
1103
- case "com.amazonaws.bedrock#InternalServerException":
1104
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1105
- case "ResourceNotFoundException":
1106
- case "com.amazonaws.bedrock#ResourceNotFoundException":
1107
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1108
- case "ThrottlingException":
1109
- case "com.amazonaws.bedrock#ThrottlingException":
1110
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1111
- case "TooManyTagsException":
1112
- case "com.amazonaws.bedrock#TooManyTagsException":
1113
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
1114
- case "ValidationException":
1115
- case "com.amazonaws.bedrock#ValidationException":
1116
- throw await de_ValidationExceptionRes(parsedOutput, context);
1117
- default:
1118
- const parsedBody = parsedOutput.body;
1119
- return throwDefaultError({
1120
- output,
1121
- parsedBody,
1122
- errorCode,
1123
- });
1124
- }
1125
- };
1126
568
  export const de_UntagResourceCommand = async (output, context) => {
1127
569
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1128
- return de_UntagResourceCommandError(output, context);
570
+ return de_CommandError(output, context);
1129
571
  }
1130
572
  const contents = map({
1131
573
  $metadata: deserializeMetadata(output),
@@ -1133,40 +575,9 @@ export const de_UntagResourceCommand = async (output, context) => {
1133
575
  await collectBody(output.body, context);
1134
576
  return contents;
1135
577
  };
1136
- const de_UntagResourceCommandError = async (output, context) => {
1137
- const parsedOutput = {
1138
- ...output,
1139
- body: await parseErrorBody(output.body, context),
1140
- };
1141
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1142
- switch (errorCode) {
1143
- case "AccessDeniedException":
1144
- case "com.amazonaws.bedrock#AccessDeniedException":
1145
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1146
- case "InternalServerException":
1147
- case "com.amazonaws.bedrock#InternalServerException":
1148
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1149
- case "ResourceNotFoundException":
1150
- case "com.amazonaws.bedrock#ResourceNotFoundException":
1151
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1152
- case "ThrottlingException":
1153
- case "com.amazonaws.bedrock#ThrottlingException":
1154
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1155
- case "ValidationException":
1156
- case "com.amazonaws.bedrock#ValidationException":
1157
- throw await de_ValidationExceptionRes(parsedOutput, context);
1158
- default:
1159
- const parsedBody = parsedOutput.body;
1160
- return throwDefaultError({
1161
- output,
1162
- parsedBody,
1163
- errorCode,
1164
- });
1165
- }
1166
- };
1167
578
  export const de_UpdateProvisionedModelThroughputCommand = async (output, context) => {
1168
579
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1169
- return de_UpdateProvisionedModelThroughputCommandError(output, context);
580
+ return de_CommandError(output, context);
1170
581
  }
1171
582
  const contents = map({
1172
583
  $metadata: deserializeMetadata(output),
@@ -1174,7 +585,7 @@ export const de_UpdateProvisionedModelThroughputCommand = async (output, context
1174
585
  await collectBody(output.body, context);
1175
586
  return contents;
1176
587
  };
1177
- const de_UpdateProvisionedModelThroughputCommandError = async (output, context) => {
588
+ const de_CommandError = async (output, context) => {
1178
589
  const parsedOutput = {
1179
590
  ...output,
1180
591
  body: await parseErrorBody(output.body, context),
@@ -1184,15 +595,24 @@ const de_UpdateProvisionedModelThroughputCommandError = async (output, context)
1184
595
  case "AccessDeniedException":
1185
596
  case "com.amazonaws.bedrock#AccessDeniedException":
1186
597
  throw await de_AccessDeniedExceptionRes(parsedOutput, context);
598
+ case "ConflictException":
599
+ case "com.amazonaws.bedrock#ConflictException":
600
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1187
601
  case "InternalServerException":
1188
602
  case "com.amazonaws.bedrock#InternalServerException":
1189
603
  throw await de_InternalServerExceptionRes(parsedOutput, context);
1190
604
  case "ResourceNotFoundException":
1191
605
  case "com.amazonaws.bedrock#ResourceNotFoundException":
1192
606
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
607
+ case "ServiceQuotaExceededException":
608
+ case "com.amazonaws.bedrock#ServiceQuotaExceededException":
609
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1193
610
  case "ThrottlingException":
1194
611
  case "com.amazonaws.bedrock#ThrottlingException":
1195
612
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
613
+ case "TooManyTagsException":
614
+ case "com.amazonaws.bedrock#TooManyTagsException":
615
+ throw await de_TooManyTagsExceptionRes(parsedOutput, context);
1196
616
  case "ValidationException":
1197
617
  case "com.amazonaws.bedrock#ValidationException":
1198
618
  throw await de_ValidationExceptionRes(parsedOutput, context);