|
19 | 19 | benchmark_create_params,
|
20 | 20 | benchmark_update_params,
|
21 | 21 | benchmark_start_run_params,
|
| 22 | + benchmark_definitions_params, |
22 | 23 | benchmark_list_public_params,
|
23 | 24 | )
|
24 | 25 | from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
35 | 36 | from ..._base_client import AsyncPaginator, make_request_options
|
36 | 37 | from ...types.benchmark_view import BenchmarkView
|
37 | 38 | from ...types.benchmark_run_view import BenchmarkRunView
|
| 39 | +from ...types.scenario_definition_list_view import ScenarioDefinitionListView |
38 | 40 |
|
39 | 41 | __all__ = ["BenchmarksResource", "AsyncBenchmarksResource"]
|
40 | 42 |
|
@@ -262,6 +264,55 @@ def list(
|
262 | 264 | model=BenchmarkView,
|
263 | 265 | )
|
264 | 266 |
|
| 267 | + def definitions( |
| 268 | + self, |
| 269 | + id: str, |
| 270 | + *, |
| 271 | + limit: int | NotGiven = NOT_GIVEN, |
| 272 | + starting_after: str | NotGiven = NOT_GIVEN, |
| 273 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 274 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 275 | + extra_headers: Headers | None = None, |
| 276 | + extra_query: Query | None = None, |
| 277 | + extra_body: Body | None = None, |
| 278 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 279 | + ) -> ScenarioDefinitionListView: |
| 280 | + """ |
| 281 | + Get scenario definitions for a previously created Benchmark. |
| 282 | +
|
| 283 | + Args: |
| 284 | + limit: The limit of items to return. Default is 20. |
| 285 | +
|
| 286 | + starting_after: Load the next page of data starting after the item with the given ID. |
| 287 | +
|
| 288 | + extra_headers: Send extra headers |
| 289 | +
|
| 290 | + extra_query: Add additional query parameters to the request |
| 291 | +
|
| 292 | + extra_body: Add additional JSON properties to the request |
| 293 | +
|
| 294 | + timeout: Override the client-level default timeout for this request, in seconds |
| 295 | + """ |
| 296 | + if not id: |
| 297 | + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
| 298 | + return self._get( |
| 299 | + f"/v1/benchmarks/{id}/definitions", |
| 300 | + options=make_request_options( |
| 301 | + extra_headers=extra_headers, |
| 302 | + extra_query=extra_query, |
| 303 | + extra_body=extra_body, |
| 304 | + timeout=timeout, |
| 305 | + query=maybe_transform( |
| 306 | + { |
| 307 | + "limit": limit, |
| 308 | + "starting_after": starting_after, |
| 309 | + }, |
| 310 | + benchmark_definitions_params.BenchmarkDefinitionsParams, |
| 311 | + ), |
| 312 | + ), |
| 313 | + cast_to=ScenarioDefinitionListView, |
| 314 | + ) |
| 315 | + |
265 | 316 | def list_public(
|
266 | 317 | self,
|
267 | 318 | *,
|
@@ -587,6 +638,55 @@ def list(
|
587 | 638 | model=BenchmarkView,
|
588 | 639 | )
|
589 | 640 |
|
| 641 | + async def definitions( |
| 642 | + self, |
| 643 | + id: str, |
| 644 | + *, |
| 645 | + limit: int | NotGiven = NOT_GIVEN, |
| 646 | + starting_after: str | NotGiven = NOT_GIVEN, |
| 647 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 648 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 649 | + extra_headers: Headers | None = None, |
| 650 | + extra_query: Query | None = None, |
| 651 | + extra_body: Body | None = None, |
| 652 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 653 | + ) -> ScenarioDefinitionListView: |
| 654 | + """ |
| 655 | + Get scenario definitions for a previously created Benchmark. |
| 656 | +
|
| 657 | + Args: |
| 658 | + limit: The limit of items to return. Default is 20. |
| 659 | +
|
| 660 | + starting_after: Load the next page of data starting after the item with the given ID. |
| 661 | +
|
| 662 | + extra_headers: Send extra headers |
| 663 | +
|
| 664 | + extra_query: Add additional query parameters to the request |
| 665 | +
|
| 666 | + extra_body: Add additional JSON properties to the request |
| 667 | +
|
| 668 | + timeout: Override the client-level default timeout for this request, in seconds |
| 669 | + """ |
| 670 | + if not id: |
| 671 | + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") |
| 672 | + return await self._get( |
| 673 | + f"/v1/benchmarks/{id}/definitions", |
| 674 | + options=make_request_options( |
| 675 | + extra_headers=extra_headers, |
| 676 | + extra_query=extra_query, |
| 677 | + extra_body=extra_body, |
| 678 | + timeout=timeout, |
| 679 | + query=await async_maybe_transform( |
| 680 | + { |
| 681 | + "limit": limit, |
| 682 | + "starting_after": starting_after, |
| 683 | + }, |
| 684 | + benchmark_definitions_params.BenchmarkDefinitionsParams, |
| 685 | + ), |
| 686 | + ), |
| 687 | + cast_to=ScenarioDefinitionListView, |
| 688 | + ) |
| 689 | + |
590 | 690 | def list_public(
|
591 | 691 | self,
|
592 | 692 | *,
|
@@ -705,6 +805,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
|
705 | 805 | self.list = to_raw_response_wrapper(
|
706 | 806 | benchmarks.list,
|
707 | 807 | )
|
| 808 | + self.definitions = to_raw_response_wrapper( |
| 809 | + benchmarks.definitions, |
| 810 | + ) |
708 | 811 | self.list_public = to_raw_response_wrapper(
|
709 | 812 | benchmarks.list_public,
|
710 | 813 | )
|
@@ -733,6 +836,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
|
733 | 836 | self.list = async_to_raw_response_wrapper(
|
734 | 837 | benchmarks.list,
|
735 | 838 | )
|
| 839 | + self.definitions = async_to_raw_response_wrapper( |
| 840 | + benchmarks.definitions, |
| 841 | + ) |
736 | 842 | self.list_public = async_to_raw_response_wrapper(
|
737 | 843 | benchmarks.list_public,
|
738 | 844 | )
|
@@ -761,6 +867,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None:
|
761 | 867 | self.list = to_streamed_response_wrapper(
|
762 | 868 | benchmarks.list,
|
763 | 869 | )
|
| 870 | + self.definitions = to_streamed_response_wrapper( |
| 871 | + benchmarks.definitions, |
| 872 | + ) |
764 | 873 | self.list_public = to_streamed_response_wrapper(
|
765 | 874 | benchmarks.list_public,
|
766 | 875 | )
|
@@ -789,6 +898,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None:
|
789 | 898 | self.list = async_to_streamed_response_wrapper(
|
790 | 899 | benchmarks.list,
|
791 | 900 | )
|
| 901 | + self.definitions = async_to_streamed_response_wrapper( |
| 902 | + benchmarks.definitions, |
| 903 | + ) |
792 | 904 | self.list_public = async_to_streamed_response_wrapper(
|
793 | 905 | benchmarks.list_public,
|
794 | 906 | )
|
|
0 commit comments