1919)
2020from ..._base_client import make_request_options
2121from ...types .devboxes import execution_execute_sync_params , execution_execute_async_params
22+ from ...types .devboxes .devbox_logs_list_view import DevboxLogsListView
2223from ...types .devboxes .devbox_execution_detail_view import DevboxExecutionDetailView
2324from ...types .devboxes .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView
2425
@@ -108,6 +109,42 @@ def execute_sync(
108109 cast_to = DevboxExecutionDetailView ,
109110 )
110111
112+ def logs (
113+ self ,
114+ execution_id : str ,
115+ * ,
116+ id : str ,
117+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
118+ # The extra values given here take precedence over values defined on the client or passed to this method.
119+ extra_headers : Headers | None = None ,
120+ extra_query : Query | None = None ,
121+ extra_body : Body | None = None ,
122+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
123+ ) -> DevboxLogsListView :
124+ """
125+ Get all logs from a Devbox execution by id.
126+
127+ Args:
128+ extra_headers: Send extra headers
129+
130+ extra_query: Add additional query parameters to the request
131+
132+ extra_body: Add additional JSON properties to the request
133+
134+ timeout: Override the client-level default timeout for this request, in seconds
135+ """
136+ if not id :
137+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
138+ if not execution_id :
139+ raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
140+ return self ._get (
141+ f"/v1/devboxes/{ id } /executions/{ execution_id } /logs" ,
142+ options = make_request_options (
143+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
144+ ),
145+ cast_to = DevboxLogsListView ,
146+ )
147+
111148
112149class AsyncExecutionsResource (AsyncAPIResource ):
113150 @cached_property
@@ -196,6 +233,42 @@ async def execute_sync(
196233 cast_to = DevboxExecutionDetailView ,
197234 )
198235
236+ async def logs (
237+ self ,
238+ execution_id : str ,
239+ * ,
240+ id : str ,
241+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
242+ # The extra values given here take precedence over values defined on the client or passed to this method.
243+ extra_headers : Headers | None = None ,
244+ extra_query : Query | None = None ,
245+ extra_body : Body | None = None ,
246+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
247+ ) -> DevboxLogsListView :
248+ """
249+ Get all logs from a Devbox execution by id.
250+
251+ Args:
252+ extra_headers: Send extra headers
253+
254+ extra_query: Add additional query parameters to the request
255+
256+ extra_body: Add additional JSON properties to the request
257+
258+ timeout: Override the client-level default timeout for this request, in seconds
259+ """
260+ if not id :
261+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
262+ if not execution_id :
263+ raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
264+ return await self ._get (
265+ f"/v1/devboxes/{ id } /executions/{ execution_id } /logs" ,
266+ options = make_request_options (
267+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
268+ ),
269+ cast_to = DevboxLogsListView ,
270+ )
271+
199272
200273class ExecutionsResourceWithRawResponse :
201274 def __init__ (self , executions : ExecutionsResource ) -> None :
@@ -207,6 +280,9 @@ def __init__(self, executions: ExecutionsResource) -> None:
207280 self .execute_sync = to_raw_response_wrapper (
208281 executions .execute_sync ,
209282 )
283+ self .logs = to_raw_response_wrapper (
284+ executions .logs ,
285+ )
210286
211287
212288class AsyncExecutionsResourceWithRawResponse :
@@ -219,6 +295,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None:
219295 self .execute_sync = async_to_raw_response_wrapper (
220296 executions .execute_sync ,
221297 )
298+ self .logs = async_to_raw_response_wrapper (
299+ executions .logs ,
300+ )
222301
223302
224303class ExecutionsResourceWithStreamingResponse :
@@ -231,6 +310,9 @@ def __init__(self, executions: ExecutionsResource) -> None:
231310 self .execute_sync = to_streamed_response_wrapper (
232311 executions .execute_sync ,
233312 )
313+ self .logs = to_streamed_response_wrapper (
314+ executions .logs ,
315+ )
234316
235317
236318class AsyncExecutionsResourceWithStreamingResponse :
@@ -243,3 +325,6 @@ def __init__(self, executions: AsyncExecutionsResource) -> None:
243325 self .execute_sync = async_to_streamed_response_wrapper (
244326 executions .execute_sync ,
245327 )
328+ self .logs = async_to_streamed_response_wrapper (
329+ executions .logs ,
330+ )
0 commit comments