2121 benchmark_start_run_params ,
2222 benchmark_definitions_params ,
2323 benchmark_list_public_params ,
24+ benchmark_update_scenarios_params ,
2425)
2526from ..._types import Body , Omit , Query , Headers , NotGiven , SequenceNotStr , omit , not_given
2627from ..._utils import maybe_transform , async_maybe_transform
@@ -453,6 +454,59 @@ def start_run(
453454 cast_to = BenchmarkRunView ,
454455 )
455456
457+ def update_scenarios (
458+ self ,
459+ id : str ,
460+ * ,
461+ scenarios_to_add : Optional [SequenceNotStr [str ]] | Omit = omit ,
462+ scenarios_to_remove : Optional [SequenceNotStr [str ]] | Omit = omit ,
463+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
464+ # The extra values given here take precedence over values defined on the client or passed to this method.
465+ extra_headers : Headers | None = None ,
466+ extra_query : Query | None = None ,
467+ extra_body : Body | None = None ,
468+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
469+ idempotency_key : str | None = None ,
470+ ) -> BenchmarkView :
471+ """
472+ Add and/or remove Scenario IDs from an existing Benchmark.
473+
474+ Args:
475+ scenarios_to_add: Scenario IDs to add to the Benchmark.
476+
477+ scenarios_to_remove: Scenario IDs to remove from the Benchmark.
478+
479+ extra_headers: Send extra headers
480+
481+ extra_query: Add additional query parameters to the request
482+
483+ extra_body: Add additional JSON properties to the request
484+
485+ timeout: Override the client-level default timeout for this request, in seconds
486+
487+ idempotency_key: Specify a custom idempotency key for this request
488+ """
489+ if not id :
490+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
491+ return self ._post (
492+ f"/v1/benchmarks/{ id } /scenarios" ,
493+ body = maybe_transform (
494+ {
495+ "scenarios_to_add" : scenarios_to_add ,
496+ "scenarios_to_remove" : scenarios_to_remove ,
497+ },
498+ benchmark_update_scenarios_params .BenchmarkUpdateScenariosParams ,
499+ ),
500+ options = make_request_options (
501+ extra_headers = extra_headers ,
502+ extra_query = extra_query ,
503+ extra_body = extra_body ,
504+ timeout = timeout ,
505+ idempotency_key = idempotency_key ,
506+ ),
507+ cast_to = BenchmarkView ,
508+ )
509+
456510
457511class AsyncBenchmarksResource (AsyncAPIResource ):
458512 @cached_property
@@ -865,6 +919,59 @@ async def start_run(
865919 cast_to = BenchmarkRunView ,
866920 )
867921
922+ async def update_scenarios (
923+ self ,
924+ id : str ,
925+ * ,
926+ scenarios_to_add : Optional [SequenceNotStr [str ]] | Omit = omit ,
927+ scenarios_to_remove : Optional [SequenceNotStr [str ]] | Omit = omit ,
928+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
929+ # The extra values given here take precedence over values defined on the client or passed to this method.
930+ extra_headers : Headers | None = None ,
931+ extra_query : Query | None = None ,
932+ extra_body : Body | None = None ,
933+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
934+ idempotency_key : str | None = None ,
935+ ) -> BenchmarkView :
936+ """
937+ Add and/or remove Scenario IDs from an existing Benchmark.
938+
939+ Args:
940+ scenarios_to_add: Scenario IDs to add to the Benchmark.
941+
942+ scenarios_to_remove: Scenario IDs to remove from the Benchmark.
943+
944+ extra_headers: Send extra headers
945+
946+ extra_query: Add additional query parameters to the request
947+
948+ extra_body: Add additional JSON properties to the request
949+
950+ timeout: Override the client-level default timeout for this request, in seconds
951+
952+ idempotency_key: Specify a custom idempotency key for this request
953+ """
954+ if not id :
955+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
956+ return await self ._post (
957+ f"/v1/benchmarks/{ id } /scenarios" ,
958+ body = await async_maybe_transform (
959+ {
960+ "scenarios_to_add" : scenarios_to_add ,
961+ "scenarios_to_remove" : scenarios_to_remove ,
962+ },
963+ benchmark_update_scenarios_params .BenchmarkUpdateScenariosParams ,
964+ ),
965+ options = make_request_options (
966+ extra_headers = extra_headers ,
967+ extra_query = extra_query ,
968+ extra_body = extra_body ,
969+ timeout = timeout ,
970+ idempotency_key = idempotency_key ,
971+ ),
972+ cast_to = BenchmarkView ,
973+ )
974+
868975
869976class BenchmarksResourceWithRawResponse :
870977 def __init__ (self , benchmarks : BenchmarksResource ) -> None :
@@ -891,6 +998,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
891998 self .start_run = to_raw_response_wrapper (
892999 benchmarks .start_run ,
8931000 )
1001+ self .update_scenarios = to_raw_response_wrapper (
1002+ benchmarks .update_scenarios ,
1003+ )
8941004
8951005 @cached_property
8961006 def runs (self ) -> RunsResourceWithRawResponse :
@@ -922,6 +1032,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
9221032 self .start_run = async_to_raw_response_wrapper (
9231033 benchmarks .start_run ,
9241034 )
1035+ self .update_scenarios = async_to_raw_response_wrapper (
1036+ benchmarks .update_scenarios ,
1037+ )
9251038
9261039 @cached_property
9271040 def runs (self ) -> AsyncRunsResourceWithRawResponse :
@@ -953,6 +1066,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
9531066 self .start_run = to_streamed_response_wrapper (
9541067 benchmarks .start_run ,
9551068 )
1069+ self .update_scenarios = to_streamed_response_wrapper (
1070+ benchmarks .update_scenarios ,
1071+ )
9561072
9571073 @cached_property
9581074 def runs (self ) -> RunsResourceWithStreamingResponse :
@@ -984,6 +1100,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
9841100 self .start_run = async_to_streamed_response_wrapper (
9851101 benchmarks .start_run ,
9861102 )
1103+ self .update_scenarios = async_to_streamed_response_wrapper (
1104+ benchmarks .update_scenarios ,
1105+ )
9871106
9881107 @cached_property
9891108 def runs (self ) -> AsyncRunsResourceWithStreamingResponse :
0 commit comments