1414 LogsResourceWithStreamingResponse ,
1515 AsyncLogsResourceWithStreamingResponse ,
1616)
17- from ...types import devbox_list_params , devbox_create_params , devbox_execute_sync_params
17+ from ...types import (
18+ devbox_list_params ,
19+ devbox_create_params ,
20+ devbox_read_file_params ,
21+ devbox_write_file_params ,
22+ devbox_execute_sync_params ,
23+ )
1824from ..._types import NOT_GIVEN , Body , Query , Headers , NotGiven
1925from ..._utils import (
2026 maybe_transform ,
@@ -251,6 +257,7 @@ def read_file(
251257 self ,
252258 id : str ,
253259 * ,
260+ file_path : str | NotGiven = NOT_GIVEN ,
254261 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
255262 # The extra values given here take precedence over values defined on the client or passed to this method.
256263 extra_headers : Headers | None = None ,
@@ -262,6 +269,8 @@ def read_file(
262269 Read file contents from a file on given Devbox.
263270
264271 Args:
272+ file_path: The path of the file to read.
273+
265274 extra_headers: Send extra headers
266275
267276 extra_query: Add additional query parameters to the request
@@ -274,6 +283,7 @@ def read_file(
274283 raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
275284 return self ._post (
276285 f"/v1/devboxes/{ id } /read_file" ,
286+ body = maybe_transform ({"file_path" : file_path }, devbox_read_file_params .DevboxReadFileParams ),
277287 options = make_request_options (
278288 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
279289 ),
@@ -318,6 +328,8 @@ def write_file(
318328 self ,
319329 id : str ,
320330 * ,
331+ contents : str | NotGiven = NOT_GIVEN ,
332+ file_path : str | NotGiven = NOT_GIVEN ,
321333 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
322334 # The extra values given here take precedence over values defined on the client or passed to this method.
323335 extra_headers : Headers | None = None ,
@@ -329,6 +341,10 @@ def write_file(
329341 Write contents to a file at path on the Devbox.
330342
331343 Args:
344+ contents: The contents to write to file.
345+
346+ file_path: The path of the file to read.
347+
332348 extra_headers: Send extra headers
333349
334350 extra_query: Add additional query parameters to the request
@@ -341,6 +357,13 @@ def write_file(
341357 raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
342358 return self ._post (
343359 f"/v1/devboxes/{ id } /write_file" ,
360+ body = maybe_transform (
361+ {
362+ "contents" : contents ,
363+ "file_path" : file_path ,
364+ },
365+ devbox_write_file_params .DevboxWriteFileParams ,
366+ ),
344367 options = make_request_options (
345368 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
346369 ),
@@ -563,6 +586,7 @@ async def read_file(
563586 self ,
564587 id : str ,
565588 * ,
589+ file_path : str | NotGiven = NOT_GIVEN ,
566590 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
567591 # The extra values given here take precedence over values defined on the client or passed to this method.
568592 extra_headers : Headers | None = None ,
@@ -574,6 +598,8 @@ async def read_file(
574598 Read file contents from a file on given Devbox.
575599
576600 Args:
601+ file_path: The path of the file to read.
602+
577603 extra_headers: Send extra headers
578604
579605 extra_query: Add additional query parameters to the request
@@ -586,6 +612,7 @@ async def read_file(
586612 raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
587613 return await self ._post (
588614 f"/v1/devboxes/{ id } /read_file" ,
615+ body = await async_maybe_transform ({"file_path" : file_path }, devbox_read_file_params .DevboxReadFileParams ),
589616 options = make_request_options (
590617 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
591618 ),
@@ -630,6 +657,8 @@ async def write_file(
630657 self ,
631658 id : str ,
632659 * ,
660+ contents : str | NotGiven = NOT_GIVEN ,
661+ file_path : str | NotGiven = NOT_GIVEN ,
633662 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
634663 # The extra values given here take precedence over values defined on the client or passed to this method.
635664 extra_headers : Headers | None = None ,
@@ -641,6 +670,10 @@ async def write_file(
641670 Write contents to a file at path on the Devbox.
642671
643672 Args:
673+ contents: The contents to write to file.
674+
675+ file_path: The path of the file to read.
676+
644677 extra_headers: Send extra headers
645678
646679 extra_query: Add additional query parameters to the request
@@ -653,6 +686,13 @@ async def write_file(
653686 raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
654687 return await self ._post (
655688 f"/v1/devboxes/{ id } /write_file" ,
689+ body = await async_maybe_transform (
690+ {
691+ "contents" : contents ,
692+ "file_path" : file_path ,
693+ },
694+ devbox_write_file_params .DevboxWriteFileParams ,
695+ ),
656696 options = make_request_options (
657697 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
658698 ),
0 commit comments