Skip to content

Commit 763abce

Browse files
feat(api): api update
1 parent a9a0d2b commit 763abce

5 files changed

Lines changed: 132 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 92
1+
configured_endpoints: 93
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6b65a42b74406a77acb03ddb582288396d7af64df16eebf887c77246d3a54470.yml
33
openapi_spec_hash: aeb9f595d53412926ef507174f33a1a1
4-
config_hash: f008c82c6ae5099c9a4b8e1fce1e15f1
4+
config_hash: 97c56b44c382faf3f8cbb0999532054f

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ Methods:
198198
- <code title="post /v1/devboxes/{id}/execute_async">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">execute_async</a>(id, \*\*<a href="src/runloop_api_client/types/devboxes/execution_execute_async_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_async_execution_detail_view.py">DevboxAsyncExecutionDetailView</a></code>
199199
- <code title="post /v1/devboxes/{id}/execute_sync">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">execute_sync</a>(id, \*\*<a href="src/runloop_api_client/types/devboxes/execution_execute_sync_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
200200
- <code title="post /v1/devboxes/{devbox_id}/executions/{execution_id}/kill">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">kill</a>(execution_id, \*, devbox_id, \*\*<a href="src/runloop_api_client/types/devboxes/execution_kill_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_async_execution_detail_view.py">DevboxAsyncExecutionDetailView</a></code>
201+
- <code title="post /v1/devboxes/{devbox_id}/executions/{execution_id}/send_std_in">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">send_std_in</a>(execution_id, \*, devbox_id, \*\*<a href="src/runloop_api_client/types/devboxes/execution_send_std_in_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_async_execution_detail_view.py">DevboxAsyncExecutionDetailView</a></code>
201202
- <code title="get /v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stderr_updates">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">stream_stderr_updates</a>(execution_id, \*, devbox_id, \*\*<a href="src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/execution_update_chunk.py">ExecutionUpdateChunk</a></code>
202203
- <code title="get /v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stdout_updates">client.devboxes.executions.<a href="./src/runloop_api_client/resources/devboxes/executions.py">stream_stdout_updates</a>(execution_id, \*, devbox_id, \*\*<a href="src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/execution_update_chunk.py">ExecutionUpdateChunk</a></code>
203204

src/runloop_api_client/types/devboxes/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from .disk_snapshot_list_params import DiskSnapshotListParams as DiskSnapshotListParams
1414
from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams
1515
from .disk_snapshot_update_params import DiskSnapshotUpdateParams as DiskSnapshotUpdateParams
16+
from .execution_send_std_in_params import ExecutionSendStdInParams as ExecutionSendStdInParams
1617
from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams
1718
from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams
1819
from .computer_mouse_interaction_params import ComputerMouseInteractionParams as ComputerMouseInteractionParams
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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 Required, TypedDict
6+
7+
__all__ = ["ExecutionSendStdInParams"]
8+
9+
10+
class ExecutionSendStdInParams(TypedDict, total=False):
11+
devbox_id: Required[str]
12+
13+
text: str
14+
"""Text to send to std in of the running execution."""

tests/api_resources/devboxes/test_executions.py

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,63 @@ def test_path_params_kill(self, client: Runloop) -> None:
247247
devbox_id="devbox_id",
248248
)
249249

250+
@parametrize
251+
def test_method_send_std_in(self, client: Runloop) -> None:
252+
execution = client.devboxes.executions.send_std_in(
253+
execution_id="execution_id",
254+
devbox_id="devbox_id",
255+
)
256+
assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"])
257+
258+
@parametrize
259+
def test_method_send_std_in_with_all_params(self, client: Runloop) -> None:
260+
execution = client.devboxes.executions.send_std_in(
261+
execution_id="execution_id",
262+
devbox_id="devbox_id",
263+
text="text",
264+
)
265+
assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"])
266+
267+
@parametrize
268+
def test_raw_response_send_std_in(self, client: Runloop) -> None:
269+
response = client.devboxes.executions.with_raw_response.send_std_in(
270+
execution_id="execution_id",
271+
devbox_id="devbox_id",
272+
)
273+
274+
assert response.is_closed is True
275+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
276+
execution = response.parse()
277+
assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"])
278+
279+
@parametrize
280+
def test_streaming_response_send_std_in(self, client: Runloop) -> None:
281+
with client.devboxes.executions.with_streaming_response.send_std_in(
282+
execution_id="execution_id",
283+
devbox_id="devbox_id",
284+
) as response:
285+
assert not response.is_closed
286+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
287+
288+
execution = response.parse()
289+
assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"])
290+
291+
assert cast(Any, response.is_closed) is True
292+
293+
@parametrize
294+
def test_path_params_send_std_in(self, client: Runloop) -> None:
295+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"):
296+
client.devboxes.executions.with_raw_response.send_std_in(
297+
execution_id="execution_id",
298+
devbox_id="",
299+
)
300+
301+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"):
302+
client.devboxes.executions.with_raw_response.send_std_in(
303+
execution_id="",
304+
devbox_id="devbox_id",
305+
)
306+
250307
@parametrize
251308
def test_method_stream_stdout_updates(self, client: Runloop, respx_mock: MockRouter) -> None:
252309
respx_mock.get("/v1/devboxes/devbox_id/executions/execution_id/stream_stdout_updates").mock(
@@ -770,6 +827,63 @@ async def test_path_params_kill(self, async_client: AsyncRunloop) -> None:
770827
devbox_id="devbox_id",
771828
)
772829

830+
@parametrize
831+
async def test_method_send_std_in(self, async_client: AsyncRunloop) -> None:
832+
execution = await async_client.devboxes.executions.send_std_in(
833+
execution_id="execution_id",
834+
devbox_id="devbox_id",
835+
)
836+
assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"])
837+
838+
@parametrize
839+
async def test_method_send_std_in_with_all_params(self, async_client: AsyncRunloop) -> None:
840+
execution = await async_client.devboxes.executions.send_std_in(
841+
execution_id="execution_id",
842+
devbox_id="devbox_id",
843+
text="text",
844+
)
845+
assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"])
846+
847+
@parametrize
848+
async def test_raw_response_send_std_in(self, async_client: AsyncRunloop) -> None:
849+
response = await async_client.devboxes.executions.with_raw_response.send_std_in(
850+
execution_id="execution_id",
851+
devbox_id="devbox_id",
852+
)
853+
854+
assert response.is_closed is True
855+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
856+
execution = await response.parse()
857+
assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"])
858+
859+
@parametrize
860+
async def test_streaming_response_send_std_in(self, async_client: AsyncRunloop) -> None:
861+
async with async_client.devboxes.executions.with_streaming_response.send_std_in(
862+
execution_id="execution_id",
863+
devbox_id="devbox_id",
864+
) as response:
865+
assert not response.is_closed
866+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
867+
868+
execution = await response.parse()
869+
assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"])
870+
871+
assert cast(Any, response.is_closed) is True
872+
873+
@parametrize
874+
async def test_path_params_send_std_in(self, async_client: AsyncRunloop) -> None:
875+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"):
876+
await async_client.devboxes.executions.with_raw_response.send_std_in(
877+
execution_id="execution_id",
878+
devbox_id="",
879+
)
880+
881+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"):
882+
await async_client.devboxes.executions.with_raw_response.send_std_in(
883+
execution_id="",
884+
devbox_id="devbox_id",
885+
)
886+
773887
@parametrize
774888
async def test_method_stream_stdout_updates(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None:
775889
respx_mock.get("/v1/devboxes/devbox_id/executions/execution_id/stream_stdout_updates").mock(

0 commit comments

Comments
 (0)