Skip to content

Commit a61b9a0

Browse files
feat(api): api update (#203)
1 parent 60df00c commit a61b9a0

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1f5b6bcd6819f627874dddd0d1101d4865944a1321f30fccacbb14355298bbfa.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-27190c4495c3af7a4071f72c910c78ec818cf96fcd3558b0c1af1b9e578f2e58.yml

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Methods:
6969
- <code title="post /v1/devboxes/{id}/execute_sync">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">execute_sync</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_execute_sync_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
7070
- <code title="post /v1/devboxes/{id}/read_file_contents">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">read_file_contents</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_read_file_contents_params.py">params</a>) -> str</code>
7171
- <code title="post /v1/devboxes/{id}/shutdown">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">shutdown</a>(id) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
72-
- <code title="post /v1/devboxes/{id}/snapshot_disk">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">snapshot_disk</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_snapshot_disk_params.py">params</a>) -> None</code>
72+
- <code title="post /v1/devboxes/{id}/snapshot_disk">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">snapshot_disk</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_snapshot_disk_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_snapshot_view.py">DevboxSnapshotView</a></code>
7373
- <code title="post /v1/devboxes/{id}/upload_file">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">upload_file</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_upload_file_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_upload_file_response.py">object</a></code>
7474
- <code title="post /v1/devboxes/{id}/write_file">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">write_file</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_write_file_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
7575

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
devbox_disk_snapshots_params,
2727
devbox_read_file_contents_params,
2828
)
29-
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes
29+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
3030
from ..._utils import (
3131
extract_files,
3232
maybe_transform,
@@ -60,6 +60,7 @@
6060
from ..._base_client import make_request_options
6161
from ...types.devbox_view import DevboxView
6262
from ...types.devbox_list_view import DevboxListView
63+
from ...types.devbox_snapshot_view import DevboxSnapshotView
6364
from ...types.devbox_snapshot_list_view import DevboxSnapshotListView
6465
from ...types.code_mount_parameters_param import CodeMountParametersParam
6566
from ...types.devbox_execution_detail_view import DevboxExecutionDetailView
@@ -570,7 +571,7 @@ def snapshot_disk(
570571
extra_query: Query | None = None,
571572
extra_body: Body | None = None,
572573
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
573-
) -> None:
574+
) -> DevboxSnapshotView:
574575
"""
575576
Create a filesystem snapshot of a devbox with the specified name and metadata.
576577
@@ -589,7 +590,6 @@ def snapshot_disk(
589590
"""
590591
if not id:
591592
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
592-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
593593
return self._post(
594594
f"/v1/devboxes/{id}/snapshot_disk",
595595
body=maybe_transform(
@@ -602,7 +602,7 @@ def snapshot_disk(
602602
options=make_request_options(
603603
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
604604
),
605-
cast_to=NoneType,
605+
cast_to=DevboxSnapshotView,
606606
)
607607

608608
def upload_file(
@@ -1200,7 +1200,7 @@ async def snapshot_disk(
12001200
extra_query: Query | None = None,
12011201
extra_body: Body | None = None,
12021202
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1203-
) -> None:
1203+
) -> DevboxSnapshotView:
12041204
"""
12051205
Create a filesystem snapshot of a devbox with the specified name and metadata.
12061206
@@ -1219,7 +1219,6 @@ async def snapshot_disk(
12191219
"""
12201220
if not id:
12211221
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1222-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
12231222
return await self._post(
12241223
f"/v1/devboxes/{id}/snapshot_disk",
12251224
body=await async_maybe_transform(
@@ -1232,7 +1231,7 @@ async def snapshot_disk(
12321231
options=make_request_options(
12331232
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
12341233
),
1235-
cast_to=NoneType,
1234+
cast_to=DevboxSnapshotView,
12361235
)
12371236

12381237
async def upload_file(

tests/api_resources/test_devboxes.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from runloop_api_client.types import (
1515
DevboxView,
1616
DevboxListView,
17+
DevboxSnapshotView,
1718
DevboxSnapshotListView,
1819
DevboxExecutionDetailView,
1920
DevboxCreateSSHKeyResponse,
@@ -486,7 +487,7 @@ def test_method_snapshot_disk(self, client: Runloop) -> None:
486487
devbox = client.devboxes.snapshot_disk(
487488
id="id",
488489
)
489-
assert devbox is None
490+
assert_matches_type(DevboxSnapshotView, devbox, path=["response"])
490491

491492
@parametrize
492493
def test_method_snapshot_disk_with_all_params(self, client: Runloop) -> None:
@@ -495,7 +496,7 @@ def test_method_snapshot_disk_with_all_params(self, client: Runloop) -> None:
495496
metadata={"foo": "string"},
496497
name="name",
497498
)
498-
assert devbox is None
499+
assert_matches_type(DevboxSnapshotView, devbox, path=["response"])
499500

500501
@parametrize
501502
def test_raw_response_snapshot_disk(self, client: Runloop) -> None:
@@ -506,7 +507,7 @@ def test_raw_response_snapshot_disk(self, client: Runloop) -> None:
506507
assert response.is_closed is True
507508
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
508509
devbox = response.parse()
509-
assert devbox is None
510+
assert_matches_type(DevboxSnapshotView, devbox, path=["response"])
510511

511512
@parametrize
512513
def test_streaming_response_snapshot_disk(self, client: Runloop) -> None:
@@ -517,7 +518,7 @@ def test_streaming_response_snapshot_disk(self, client: Runloop) -> None:
517518
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
518519

519520
devbox = response.parse()
520-
assert devbox is None
521+
assert_matches_type(DevboxSnapshotView, devbox, path=["response"])
521522

522523
assert cast(Any, response.is_closed) is True
523524

@@ -1079,7 +1080,7 @@ async def test_method_snapshot_disk(self, async_client: AsyncRunloop) -> None:
10791080
devbox = await async_client.devboxes.snapshot_disk(
10801081
id="id",
10811082
)
1082-
assert devbox is None
1083+
assert_matches_type(DevboxSnapshotView, devbox, path=["response"])
10831084

10841085
@parametrize
10851086
async def test_method_snapshot_disk_with_all_params(self, async_client: AsyncRunloop) -> None:
@@ -1088,7 +1089,7 @@ async def test_method_snapshot_disk_with_all_params(self, async_client: AsyncRun
10881089
metadata={"foo": "string"},
10891090
name="name",
10901091
)
1091-
assert devbox is None
1092+
assert_matches_type(DevboxSnapshotView, devbox, path=["response"])
10921093

10931094
@parametrize
10941095
async def test_raw_response_snapshot_disk(self, async_client: AsyncRunloop) -> None:
@@ -1099,7 +1100,7 @@ async def test_raw_response_snapshot_disk(self, async_client: AsyncRunloop) -> N
10991100
assert response.is_closed is True
11001101
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
11011102
devbox = await response.parse()
1102-
assert devbox is None
1103+
assert_matches_type(DevboxSnapshotView, devbox, path=["response"])
11031104

11041105
@parametrize
11051106
async def test_streaming_response_snapshot_disk(self, async_client: AsyncRunloop) -> None:
@@ -1110,7 +1111,7 @@ async def test_streaming_response_snapshot_disk(self, async_client: AsyncRunloop
11101111
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
11111112

11121113
devbox = await response.parse()
1113-
assert devbox is None
1114+
assert_matches_type(DevboxSnapshotView, devbox, path=["response"])
11141115

11151116
assert cast(Any, response.is_closed) is True
11161117

0 commit comments

Comments
 (0)