44
55import typing_extensions
66from typing import Optional , cast
7+ from typing_extensions import Literal
78
89import httpx
910
2526from ...types .devboxes import (
2627 execution_kill_params ,
2728 execution_retrieve_params ,
29+ execution_send_std_in_params ,
2830 execution_execute_sync_params ,
2931 execution_execute_async_params ,
3032 execution_stream_stderr_updates_params ,
@@ -332,6 +334,62 @@ def kill(
332334 cast_to = DevboxAsyncExecutionDetailView ,
333335 )
334336
337+ def send_std_in (
338+ self ,
339+ execution_id : str ,
340+ * ,
341+ devbox_id : str ,
342+ signal : Optional [Literal ["EOF" , "INTERRUPT" ]] | Omit = omit ,
343+ text : Optional [str ] | Omit = omit ,
344+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
345+ # The extra values given here take precedence over values defined on the client or passed to this method.
346+ extra_headers : Headers | None = None ,
347+ extra_query : Query | None = None ,
348+ extra_body : Body | None = None ,
349+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
350+ idempotency_key : str | None = None ,
351+ ) -> DevboxAsyncExecutionDetailView :
352+ """
353+ Send content to the Std In of a running execution.
354+
355+ Args:
356+ signal: Signal to send to std in of the running execution.
357+
358+ text: Text to send to std in of the running execution.
359+
360+ extra_headers: Send extra headers
361+
362+ extra_query: Add additional query parameters to the request
363+
364+ extra_body: Add additional JSON properties to the request
365+
366+ timeout: Override the client-level default timeout for this request, in seconds
367+
368+ idempotency_key: Specify a custom idempotency key for this request
369+ """
370+ if not devbox_id :
371+ raise ValueError (f"Expected a non-empty value for `devbox_id` but received { devbox_id !r} " )
372+ if not execution_id :
373+ raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
374+ return self ._post (
375+ f"/v1/devboxes/{ devbox_id } /executions/{ execution_id } /send_std_in" ,
376+ body = maybe_transform (
377+ {
378+ "signal" : signal ,
379+ "text" : text ,
380+ },
381+ execution_send_std_in_params .ExecutionSendStdInParams ,
382+ ),
383+ options = make_request_options (
384+ extra_headers = extra_headers ,
385+ extra_query = extra_query ,
386+ extra_body = extra_body ,
387+ timeout = timeout ,
388+ idempotency_key = idempotency_key ,
389+ ),
390+ cast_to = DevboxAsyncExecutionDetailView ,
391+ )
392+
335393 def stream_stderr_updates (
336394 self ,
337395 execution_id : str ,
@@ -785,6 +843,62 @@ async def kill(
785843 cast_to = DevboxAsyncExecutionDetailView ,
786844 )
787845
846+ async def send_std_in (
847+ self ,
848+ execution_id : str ,
849+ * ,
850+ devbox_id : str ,
851+ signal : Optional [Literal ["EOF" , "INTERRUPT" ]] | Omit = omit ,
852+ text : Optional [str ] | Omit = omit ,
853+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
854+ # The extra values given here take precedence over values defined on the client or passed to this method.
855+ extra_headers : Headers | None = None ,
856+ extra_query : Query | None = None ,
857+ extra_body : Body | None = None ,
858+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
859+ idempotency_key : str | None = None ,
860+ ) -> DevboxAsyncExecutionDetailView :
861+ """
862+ Send content to the Std In of a running execution.
863+
864+ Args:
865+ signal: Signal to send to std in of the running execution.
866+
867+ text: Text to send to std in of the running execution.
868+
869+ extra_headers: Send extra headers
870+
871+ extra_query: Add additional query parameters to the request
872+
873+ extra_body: Add additional JSON properties to the request
874+
875+ timeout: Override the client-level default timeout for this request, in seconds
876+
877+ idempotency_key: Specify a custom idempotency key for this request
878+ """
879+ if not devbox_id :
880+ raise ValueError (f"Expected a non-empty value for `devbox_id` but received { devbox_id !r} " )
881+ if not execution_id :
882+ raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
883+ return await self ._post (
884+ f"/v1/devboxes/{ devbox_id } /executions/{ execution_id } /send_std_in" ,
885+ body = await async_maybe_transform (
886+ {
887+ "signal" : signal ,
888+ "text" : text ,
889+ },
890+ execution_send_std_in_params .ExecutionSendStdInParams ,
891+ ),
892+ options = make_request_options (
893+ extra_headers = extra_headers ,
894+ extra_query = extra_query ,
895+ extra_body = extra_body ,
896+ timeout = timeout ,
897+ idempotency_key = idempotency_key ,
898+ ),
899+ cast_to = DevboxAsyncExecutionDetailView ,
900+ )
901+
788902 async def stream_stderr_updates (
789903 self ,
790904 execution_id : str ,
@@ -973,6 +1087,9 @@ def __init__(self, executions: ExecutionsResource) -> None:
9731087 self .kill = to_raw_response_wrapper (
9741088 executions .kill ,
9751089 )
1090+ self .send_std_in = to_raw_response_wrapper (
1091+ executions .send_std_in ,
1092+ )
9761093 self .stream_stdout_updates = to_raw_response_wrapper (
9771094 executions .stream_stdout_updates ,
9781095 )
@@ -999,6 +1116,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None:
9991116 self .kill = async_to_raw_response_wrapper (
10001117 executions .kill ,
10011118 )
1119+ self .send_std_in = async_to_raw_response_wrapper (
1120+ executions .send_std_in ,
1121+ )
10021122 self .stream_stdout_updates = async_to_raw_response_wrapper (
10031123 executions .stream_stdout_updates ,
10041124 )
@@ -1025,6 +1145,9 @@ def __init__(self, executions: ExecutionsResource) -> None:
10251145 self .kill = to_streamed_response_wrapper (
10261146 executions .kill ,
10271147 )
1148+ self .send_std_in = to_streamed_response_wrapper (
1149+ executions .send_std_in ,
1150+ )
10281151 self .stream_stdout_updates = to_streamed_response_wrapper (
10291152 executions .stream_stdout_updates ,
10301153 )
@@ -1051,6 +1174,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None:
10511174 self .kill = async_to_streamed_response_wrapper (
10521175 executions .kill ,
10531176 )
1177+ self .send_std_in = async_to_streamed_response_wrapper (
1178+ executions .send_std_in ,
1179+ )
10541180 self .stream_stdout_updates = async_to_streamed_response_wrapper (
10551181 executions .stream_stdout_updates ,
10561182 )
0 commit comments