Skip to content

Commit 380287d

Browse files
feat(api): api update
1 parent e9857e8 commit 380287d

4 files changed

Lines changed: 174 additions & 4 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: 78
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a329900168cdf7b34262f3d80d8f2b70510bef2f5458e50d95ba1725686e8b8d.yml
3-
openapi_spec_hash: 8c9e134ab7521e052e0cfa6f75a96f6b
4-
config_hash: 84dec0743c13de8bb22f976814deaae9
1+
configured_endpoints: 79
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-59d51521fb27127ec00a91d37d9cbaa484577dbd200d290e61c9d69d33b3c760.yml
3+
openapi_spec_hash: 4ad68555fc0ec3e969817bebff620e88
4+
config_hash: 4cb90c87fb61338e46c50cea9c42abd7

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ from runloop_api_client.types import (
4949
BlueprintListView,
5050
BlueprintPreviewView,
5151
BlueprintView,
52+
BlueprintDeleteResponse,
5253
)
5354
```
5455

@@ -57,6 +58,7 @@ Methods:
5758
- <code title="post /v1/blueprints">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">create</a>(\*\*<a href="src/runloop_api_client/types/blueprint_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_view.py">BlueprintView</a></code>
5859
- <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>
5960
- <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>
61+
- <code title="post /v1/blueprints/{id}/delete">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">delete</a>(id) -> <a href="./src/runloop_api_client/types/blueprint_delete_response.py">object</a></code>
6062
- <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>
6163
- <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>
6264

src/runloop_api_client/resources/blueprints.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,46 @@ def list(
321321
model=BlueprintView,
322322
)
323323

324+
def delete(
325+
self,
326+
id: str,
327+
*,
328+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
329+
# The extra values given here take precedence over values defined on the client or passed to this method.
330+
extra_headers: Headers | None = None,
331+
extra_query: Query | None = None,
332+
extra_body: Body | None = None,
333+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
334+
idempotency_key: str | None = None,
335+
) -> object:
336+
"""
337+
Delete a previously created Blueprint.
338+
339+
Args:
340+
extra_headers: Send extra headers
341+
342+
extra_query: Add additional query parameters to the request
343+
344+
extra_body: Add additional JSON properties to the request
345+
346+
timeout: Override the client-level default timeout for this request, in seconds
347+
348+
idempotency_key: Specify a custom idempotency key for this request
349+
"""
350+
if not id:
351+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
352+
return self._post(
353+
f"/v1/blueprints/{id}/delete",
354+
options=make_request_options(
355+
extra_headers=extra_headers,
356+
extra_query=extra_query,
357+
extra_body=extra_body,
358+
timeout=timeout,
359+
idempotency_key=idempotency_key,
360+
),
361+
cast_to=object,
362+
)
363+
324364
def logs(
325365
self,
326366
id: str,
@@ -710,6 +750,46 @@ def list(
710750
model=BlueprintView,
711751
)
712752

753+
async def delete(
754+
self,
755+
id: str,
756+
*,
757+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
758+
# The extra values given here take precedence over values defined on the client or passed to this method.
759+
extra_headers: Headers | None = None,
760+
extra_query: Query | None = None,
761+
extra_body: Body | None = None,
762+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
763+
idempotency_key: str | None = None,
764+
) -> object:
765+
"""
766+
Delete a previously created Blueprint.
767+
768+
Args:
769+
extra_headers: Send extra headers
770+
771+
extra_query: Add additional query parameters to the request
772+
773+
extra_body: Add additional JSON properties to the request
774+
775+
timeout: Override the client-level default timeout for this request, in seconds
776+
777+
idempotency_key: Specify a custom idempotency key for this request
778+
"""
779+
if not id:
780+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
781+
return await self._post(
782+
f"/v1/blueprints/{id}/delete",
783+
options=make_request_options(
784+
extra_headers=extra_headers,
785+
extra_query=extra_query,
786+
extra_body=extra_body,
787+
timeout=timeout,
788+
idempotency_key=idempotency_key,
789+
),
790+
cast_to=object,
791+
)
792+
713793
async def logs(
714794
self,
715795
id: str,
@@ -825,6 +905,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None:
825905
self.list = to_raw_response_wrapper(
826906
blueprints.list,
827907
)
908+
self.delete = to_raw_response_wrapper(
909+
blueprints.delete,
910+
)
828911
self.logs = to_raw_response_wrapper(
829912
blueprints.logs,
830913
)
@@ -846,6 +929,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None:
846929
self.list = async_to_raw_response_wrapper(
847930
blueprints.list,
848931
)
932+
self.delete = async_to_raw_response_wrapper(
933+
blueprints.delete,
934+
)
849935
self.logs = async_to_raw_response_wrapper(
850936
blueprints.logs,
851937
)
@@ -867,6 +953,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None:
867953
self.list = to_streamed_response_wrapper(
868954
blueprints.list,
869955
)
956+
self.delete = to_streamed_response_wrapper(
957+
blueprints.delete,
958+
)
870959
self.logs = to_streamed_response_wrapper(
871960
blueprints.logs,
872961
)
@@ -888,6 +977,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None:
888977
self.list = async_to_streamed_response_wrapper(
889978
blueprints.list,
890979
)
980+
self.delete = async_to_streamed_response_wrapper(
981+
blueprints.delete,
982+
)
891983
self.logs = async_to_streamed_response_wrapper(
892984
blueprints.logs,
893985
)

tests/api_resources/test_blueprints.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,44 @@ def test_streaming_response_list(self, client: Runloop) -> None:
155155

156156
assert cast(Any, response.is_closed) is True
157157

158+
@parametrize
159+
def test_method_delete(self, client: Runloop) -> None:
160+
blueprint = client.blueprints.delete(
161+
"id",
162+
)
163+
assert_matches_type(object, blueprint, path=["response"])
164+
165+
@parametrize
166+
def test_raw_response_delete(self, client: Runloop) -> None:
167+
response = client.blueprints.with_raw_response.delete(
168+
"id",
169+
)
170+
171+
assert response.is_closed is True
172+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
173+
blueprint = response.parse()
174+
assert_matches_type(object, blueprint, path=["response"])
175+
176+
@parametrize
177+
def test_streaming_response_delete(self, client: Runloop) -> None:
178+
with client.blueprints.with_streaming_response.delete(
179+
"id",
180+
) as response:
181+
assert not response.is_closed
182+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
183+
184+
blueprint = response.parse()
185+
assert_matches_type(object, blueprint, path=["response"])
186+
187+
assert cast(Any, response.is_closed) is True
188+
189+
@parametrize
190+
def test_path_params_delete(self, client: Runloop) -> None:
191+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
192+
client.blueprints.with_raw_response.delete(
193+
"",
194+
)
195+
158196
@parametrize
159197
def test_method_logs(self, client: Runloop) -> None:
160198
blueprint = client.blueprints.logs(
@@ -391,6 +429,44 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None
391429

392430
assert cast(Any, response.is_closed) is True
393431

432+
@parametrize
433+
async def test_method_delete(self, async_client: AsyncRunloop) -> None:
434+
blueprint = await async_client.blueprints.delete(
435+
"id",
436+
)
437+
assert_matches_type(object, blueprint, path=["response"])
438+
439+
@parametrize
440+
async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None:
441+
response = await async_client.blueprints.with_raw_response.delete(
442+
"id",
443+
)
444+
445+
assert response.is_closed is True
446+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
447+
blueprint = await response.parse()
448+
assert_matches_type(object, blueprint, path=["response"])
449+
450+
@parametrize
451+
async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None:
452+
async with async_client.blueprints.with_streaming_response.delete(
453+
"id",
454+
) as response:
455+
assert not response.is_closed
456+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
457+
458+
blueprint = await response.parse()
459+
assert_matches_type(object, blueprint, path=["response"])
460+
461+
assert cast(Any, response.is_closed) is True
462+
463+
@parametrize
464+
async def test_path_params_delete(self, async_client: AsyncRunloop) -> None:
465+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
466+
await async_client.blueprints.with_raw_response.delete(
467+
"",
468+
)
469+
394470
@parametrize
395471
async def test_method_logs(self, async_client: AsyncRunloop) -> None:
396472
blueprint = await async_client.blueprints.logs(

0 commit comments

Comments
 (0)