1717from ...types import (
1818 benchmark_list_params ,
1919 benchmark_create_params ,
20+ benchmark_update_params ,
2021 benchmark_start_run_params ,
2122 benchmark_list_public_params ,
2223)
@@ -153,6 +154,67 @@ def retrieve(
153154 cast_to = BenchmarkView ,
154155 )
155156
157+ def update (
158+ self ,
159+ id : str ,
160+ * ,
161+ is_public : bool ,
162+ name : str ,
163+ metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
164+ scenario_ids : Optional [List [str ]] | NotGiven = NOT_GIVEN ,
165+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
166+ # The extra values given here take precedence over values defined on the client or passed to this method.
167+ extra_headers : Headers | None = None ,
168+ extra_query : Query | None = None ,
169+ extra_body : Body | None = None ,
170+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
171+ idempotency_key : str | None = None ,
172+ ) -> BenchmarkView :
173+ """
174+ Update a Benchmark with a set of Scenarios.
175+
176+ Args:
177+ is_public: Whether this benchmark is public.
178+
179+ name: The name of the Benchmark. This must be unique.
180+
181+ metadata: User defined metadata to attach to the benchmark for organization.
182+
183+ scenario_ids: The Scenario IDs that make up the Benchmark.
184+
185+ extra_headers: Send extra headers
186+
187+ extra_query: Add additional query parameters to the request
188+
189+ extra_body: Add additional JSON properties to the request
190+
191+ timeout: Override the client-level default timeout for this request, in seconds
192+
193+ idempotency_key: Specify a custom idempotency key for this request
194+ """
195+ if not id :
196+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
197+ return self ._post (
198+ f"/v1/benchmarks/{ id } " ,
199+ body = maybe_transform (
200+ {
201+ "is_public" : is_public ,
202+ "name" : name ,
203+ "metadata" : metadata ,
204+ "scenario_ids" : scenario_ids ,
205+ },
206+ benchmark_update_params .BenchmarkUpdateParams ,
207+ ),
208+ options = make_request_options (
209+ extra_headers = extra_headers ,
210+ extra_query = extra_query ,
211+ extra_body = extra_body ,
212+ timeout = timeout ,
213+ idempotency_key = idempotency_key ,
214+ ),
215+ cast_to = BenchmarkView ,
216+ )
217+
156218 def list (
157219 self ,
158220 * ,
@@ -417,6 +479,67 @@ async def retrieve(
417479 cast_to = BenchmarkView ,
418480 )
419481
482+ async def update (
483+ self ,
484+ id : str ,
485+ * ,
486+ is_public : bool ,
487+ name : str ,
488+ metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
489+ scenario_ids : Optional [List [str ]] | NotGiven = NOT_GIVEN ,
490+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
491+ # The extra values given here take precedence over values defined on the client or passed to this method.
492+ extra_headers : Headers | None = None ,
493+ extra_query : Query | None = None ,
494+ extra_body : Body | None = None ,
495+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
496+ idempotency_key : str | None = None ,
497+ ) -> BenchmarkView :
498+ """
499+ Update a Benchmark with a set of Scenarios.
500+
501+ Args:
502+ is_public: Whether this benchmark is public.
503+
504+ name: The name of the Benchmark. This must be unique.
505+
506+ metadata: User defined metadata to attach to the benchmark for organization.
507+
508+ scenario_ids: The Scenario IDs that make up the Benchmark.
509+
510+ extra_headers: Send extra headers
511+
512+ extra_query: Add additional query parameters to the request
513+
514+ extra_body: Add additional JSON properties to the request
515+
516+ timeout: Override the client-level default timeout for this request, in seconds
517+
518+ idempotency_key: Specify a custom idempotency key for this request
519+ """
520+ if not id :
521+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
522+ return await self ._post (
523+ f"/v1/benchmarks/{ id } " ,
524+ body = await async_maybe_transform (
525+ {
526+ "is_public" : is_public ,
527+ "name" : name ,
528+ "metadata" : metadata ,
529+ "scenario_ids" : scenario_ids ,
530+ },
531+ benchmark_update_params .BenchmarkUpdateParams ,
532+ ),
533+ options = make_request_options (
534+ extra_headers = extra_headers ,
535+ extra_query = extra_query ,
536+ extra_body = extra_body ,
537+ timeout = timeout ,
538+ idempotency_key = idempotency_key ,
539+ ),
540+ cast_to = BenchmarkView ,
541+ )
542+
420543 def list (
421544 self ,
422545 * ,
@@ -576,6 +699,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
576699 self .retrieve = to_raw_response_wrapper (
577700 benchmarks .retrieve ,
578701 )
702+ self .update = to_raw_response_wrapper (
703+ benchmarks .update ,
704+ )
579705 self .list = to_raw_response_wrapper (
580706 benchmarks .list ,
581707 )
@@ -601,6 +727,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
601727 self .retrieve = async_to_raw_response_wrapper (
602728 benchmarks .retrieve ,
603729 )
730+ self .update = async_to_raw_response_wrapper (
731+ benchmarks .update ,
732+ )
604733 self .list = async_to_raw_response_wrapper (
605734 benchmarks .list ,
606735 )
@@ -626,6 +755,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
626755 self .retrieve = to_streamed_response_wrapper (
627756 benchmarks .retrieve ,
628757 )
758+ self .update = to_streamed_response_wrapper (
759+ benchmarks .update ,
760+ )
629761 self .list = to_streamed_response_wrapper (
630762 benchmarks .list ,
631763 )
@@ -651,6 +783,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
651783 self .retrieve = async_to_streamed_response_wrapper (
652784 benchmarks .retrieve ,
653785 )
786+ self .update = async_to_streamed_response_wrapper (
787+ benchmarks .update ,
788+ )
654789 self .list = async_to_streamed_response_wrapper (
655790 benchmarks .list ,
656791 )
0 commit comments