Skip to content

Commit e223898

Browse files
feat(api): api update
1 parent 27e1600 commit e223898

6 files changed

Lines changed: 212 additions & 5 deletions

File tree

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 92
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ff6a7188da87d1550f7d3cda78f43990a455e42eb7560ee1a8b8a49d3ed22fcb.yml
3-
openapi_spec_hash: ea324758dd7f60d228d777a50c17b487
4-
config_hash: 60681f589a9e641fdb7f19af2021a033
1+
configured_endpoints: 93
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5bf266bfc4635f690b764f54cbbcd71ff347622e3bfd8540a7d2a4d7d2d78be8.yml
3+
openapi_spec_hash: 3769820d0ac76caf6a1950802c73a382
4+
config_hash: 7d940dc50b19e75e3719c4d41fd0e8dd

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Methods:
6060
- <code title="get /v1/blueprints/{id}">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/blueprint_view.py">BlueprintView</a></code>
6161
- <code title="get /v1/blueprints">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">list</a>(\*\*<a href="src/runloop_api_client/types/blueprint_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_view.py">SyncBlueprintsCursorIDPage[BlueprintView]</a></code>
6262
- <code title="post /v1/blueprints/{id}/delete">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">delete</a>(id) -> object</code>
63+
- <code title="get /v1/blueprints/list_public">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">list_public</a>(\*\*<a href="src/runloop_api_client/types/blueprint_list_public_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_view.py">SyncBlueprintsCursorIDPage[BlueprintView]</a></code>
6364
- <code title="get /v1/blueprints/{id}/logs">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">logs</a>(id) -> <a href="./src/runloop_api_client/types/blueprint_build_logs_list_view.py">BlueprintBuildLogsListView</a></code>
6465
- <code title="post /v1/blueprints/preview">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">preview</a>(\*\*<a href="src/runloop_api_client/types/blueprint_preview_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_preview_view.py">BlueprintPreviewView</a></code>
6566
- <code title="create_and_await_build_complete">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">create_and_await_build_complete</a>(<a href="src/runloop_api_client/types/blueprint_create_params.py">create_args</a>, <a href="src/runloop_api_client/resources/blueprints.py">request_args</a>=None) -> <a href="./src/runloop_api_client/types/blueprint_view.py">BlueprintView</a></code>

src/runloop_api_client/resources/blueprints.py

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66

77
import httpx
88

9-
from ..types import blueprint_list_params, blueprint_create_params, blueprint_preview_params
9+
from ..types import (
10+
blueprint_list_params,
11+
blueprint_create_params,
12+
blueprint_preview_params,
13+
blueprint_list_public_params,
14+
)
1015
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
1116
from .._utils import maybe_transform, async_maybe_transform
1217
from .._compat import cached_property
@@ -349,6 +354,57 @@ def delete(
349354
cast_to=object,
350355
)
351356

357+
def list_public(
358+
self,
359+
*,
360+
limit: int | NotGiven = NOT_GIVEN,
361+
name: str | NotGiven = NOT_GIVEN,
362+
starting_after: str | NotGiven = NOT_GIVEN,
363+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
364+
# The extra values given here take precedence over values defined on the client or passed to this method.
365+
extra_headers: Headers | None = None,
366+
extra_query: Query | None = None,
367+
extra_body: Body | None = None,
368+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
369+
) -> SyncBlueprintsCursorIDPage[BlueprintView]:
370+
"""
371+
List all public Blueprints that are available to all users.
372+
373+
Args:
374+
limit: The limit of items to return. Default is 20.
375+
376+
name: Filter by name
377+
378+
starting_after: Load the next page of data starting after the item with the given ID.
379+
380+
extra_headers: Send extra headers
381+
382+
extra_query: Add additional query parameters to the request
383+
384+
extra_body: Add additional JSON properties to the request
385+
386+
timeout: Override the client-level default timeout for this request, in seconds
387+
"""
388+
return self._get_api_list(
389+
"/v1/blueprints/list_public",
390+
page=SyncBlueprintsCursorIDPage[BlueprintView],
391+
options=make_request_options(
392+
extra_headers=extra_headers,
393+
extra_query=extra_query,
394+
extra_body=extra_body,
395+
timeout=timeout,
396+
query=maybe_transform(
397+
{
398+
"limit": limit,
399+
"name": name,
400+
"starting_after": starting_after,
401+
},
402+
blueprint_list_public_params.BlueprintListPublicParams,
403+
),
404+
),
405+
model=BlueprintView,
406+
)
407+
352408
def logs(
353409
self,
354410
id: str,
@@ -769,6 +825,57 @@ async def delete(
769825
cast_to=object,
770826
)
771827

828+
def list_public(
829+
self,
830+
*,
831+
limit: int | NotGiven = NOT_GIVEN,
832+
name: str | NotGiven = NOT_GIVEN,
833+
starting_after: str | NotGiven = NOT_GIVEN,
834+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
835+
# The extra values given here take precedence over values defined on the client or passed to this method.
836+
extra_headers: Headers | None = None,
837+
extra_query: Query | None = None,
838+
extra_body: Body | None = None,
839+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
840+
) -> AsyncPaginator[BlueprintView, AsyncBlueprintsCursorIDPage[BlueprintView]]:
841+
"""
842+
List all public Blueprints that are available to all users.
843+
844+
Args:
845+
limit: The limit of items to return. Default is 20.
846+
847+
name: Filter by name
848+
849+
starting_after: Load the next page of data starting after the item with the given ID.
850+
851+
extra_headers: Send extra headers
852+
853+
extra_query: Add additional query parameters to the request
854+
855+
extra_body: Add additional JSON properties to the request
856+
857+
timeout: Override the client-level default timeout for this request, in seconds
858+
"""
859+
return self._get_api_list(
860+
"/v1/blueprints/list_public",
861+
page=AsyncBlueprintsCursorIDPage[BlueprintView],
862+
options=make_request_options(
863+
extra_headers=extra_headers,
864+
extra_query=extra_query,
865+
extra_body=extra_body,
866+
timeout=timeout,
867+
query=maybe_transform(
868+
{
869+
"limit": limit,
870+
"name": name,
871+
"starting_after": starting_after,
872+
},
873+
blueprint_list_public_params.BlueprintListPublicParams,
874+
),
875+
),
876+
model=BlueprintView,
877+
)
878+
772879
async def logs(
773880
self,
774881
id: str,
@@ -898,6 +1005,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None:
8981005
self.delete = to_raw_response_wrapper(
8991006
blueprints.delete,
9001007
)
1008+
self.list_public = to_raw_response_wrapper(
1009+
blueprints.list_public,
1010+
)
9011011
self.logs = to_raw_response_wrapper(
9021012
blueprints.logs,
9031013
)
@@ -922,6 +1032,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None:
9221032
self.delete = async_to_raw_response_wrapper(
9231033
blueprints.delete,
9241034
)
1035+
self.list_public = async_to_raw_response_wrapper(
1036+
blueprints.list_public,
1037+
)
9251038
self.logs = async_to_raw_response_wrapper(
9261039
blueprints.logs,
9271040
)
@@ -946,6 +1059,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None:
9461059
self.delete = to_streamed_response_wrapper(
9471060
blueprints.delete,
9481061
)
1062+
self.list_public = to_streamed_response_wrapper(
1063+
blueprints.list_public,
1064+
)
9491065
self.logs = to_streamed_response_wrapper(
9501066
blueprints.logs,
9511067
)
@@ -970,6 +1086,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None:
9701086
self.delete = async_to_streamed_response_wrapper(
9711087
blueprints.delete,
9721088
)
1089+
self.list_public = async_to_streamed_response_wrapper(
1090+
blueprints.list_public,
1091+
)
9731092
self.logs = async_to_streamed_response_wrapper(
9741093
blueprints.logs,
9751094
)

src/runloop_api_client/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
from .scenario_list_public_params import ScenarioListPublicParams as ScenarioListPublicParams
6969
from .benchmark_definitions_params import BenchmarkDefinitionsParams as BenchmarkDefinitionsParams
7070
from .benchmark_list_public_params import BenchmarkListPublicParams as BenchmarkListPublicParams
71+
from .blueprint_list_public_params import BlueprintListPublicParams as BlueprintListPublicParams
7172
from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView
7273
from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView
7374
from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import TypedDict
6+
7+
__all__ = ["BlueprintListPublicParams"]
8+
9+
10+
class BlueprintListPublicParams(TypedDict, total=False):
11+
limit: int
12+
"""The limit of items to return. Default is 20."""
13+
14+
name: str
15+
"""Filter by name"""
16+
17+
starting_after: str
18+
"""Load the next page of data starting after the item with the given ID."""

tests/api_resources/test_blueprints.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,40 @@ def test_path_params_delete(self, client: Runloop) -> None:
214214
"",
215215
)
216216

217+
@parametrize
218+
def test_method_list_public(self, client: Runloop) -> None:
219+
blueprint = client.blueprints.list_public()
220+
assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"])
221+
222+
@parametrize
223+
def test_method_list_public_with_all_params(self, client: Runloop) -> None:
224+
blueprint = client.blueprints.list_public(
225+
limit=0,
226+
name="name",
227+
starting_after="starting_after",
228+
)
229+
assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"])
230+
231+
@parametrize
232+
def test_raw_response_list_public(self, client: Runloop) -> None:
233+
response = client.blueprints.with_raw_response.list_public()
234+
235+
assert response.is_closed is True
236+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
237+
blueprint = response.parse()
238+
assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"])
239+
240+
@parametrize
241+
def test_streaming_response_list_public(self, client: Runloop) -> None:
242+
with client.blueprints.with_streaming_response.list_public() as response:
243+
assert not response.is_closed
244+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
245+
246+
blueprint = response.parse()
247+
assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"])
248+
249+
assert cast(Any, response.is_closed) is True
250+
217251
@parametrize
218252
def test_method_logs(self, client: Runloop) -> None:
219253
blueprint = client.blueprints.logs(
@@ -532,6 +566,40 @@ async def test_path_params_delete(self, async_client: AsyncRunloop) -> None:
532566
"",
533567
)
534568

569+
@parametrize
570+
async def test_method_list_public(self, async_client: AsyncRunloop) -> None:
571+
blueprint = await async_client.blueprints.list_public()
572+
assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"])
573+
574+
@parametrize
575+
async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None:
576+
blueprint = await async_client.blueprints.list_public(
577+
limit=0,
578+
name="name",
579+
starting_after="starting_after",
580+
)
581+
assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"])
582+
583+
@parametrize
584+
async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> None:
585+
response = await async_client.blueprints.with_raw_response.list_public()
586+
587+
assert response.is_closed is True
588+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
589+
blueprint = await response.parse()
590+
assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"])
591+
592+
@parametrize
593+
async def test_streaming_response_list_public(self, async_client: AsyncRunloop) -> None:
594+
async with async_client.blueprints.with_streaming_response.list_public() as response:
595+
assert not response.is_closed
596+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
597+
598+
blueprint = await response.parse()
599+
assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"])
600+
601+
assert cast(Any, response.is_closed) is True
602+
535603
@parametrize
536604
async def test_method_logs(self, async_client: AsyncRunloop) -> None:
537605
blueprint = await async_client.blueprints.logs(

0 commit comments

Comments
 (0)