Skip to content

Commit 291eddb

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#66)
1 parent b82964a commit 291eddb

7 files changed

Lines changed: 20 additions & 123 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: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d46e8a351f9ab9469594e4ac1b185033afe2e530e0dd6df2cae2a666d8fc8336.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ed7237714dcf00d5e186095c38ac8afb3300d4773e0d836042d89f3b53c7ffc.yml

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ Methods:
5757
- <code title="get /v1/devboxes/{id}">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
5858
- <code title="get /v1/devboxes">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">list</a>(\*\*<a href="src/runloop_api_client/types/devbox_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_list_view.py">DevboxListView</a></code>
5959
- <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>
60-
- <code title="post /v1/devboxes/{id}/read_file">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">read_file</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_read_file_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
60+
- <code title="post /v1/devboxes/{id}/read_file">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">read_file</a>(id) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
6161
- <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>
62-
- <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>
62+
- <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_execution_detail_view.py">DevboxExecutionDetailView</a></code>
6363

6464
## Logs
6565

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@
1414
LogsResourceWithStreamingResponse,
1515
AsyncLogsResourceWithStreamingResponse,
1616
)
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-
)
17+
from ...types import devbox_list_params, devbox_create_params, devbox_execute_sync_params
2418
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
2519
from ..._utils import (
2620
maybe_transform,
@@ -257,7 +251,6 @@ def read_file(
257251
self,
258252
id: str,
259253
*,
260-
file_path: str | NotGiven = NOT_GIVEN,
261254
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
262255
# The extra values given here take precedence over values defined on the client or passed to this method.
263256
extra_headers: Headers | None = None,
@@ -269,8 +262,6 @@ def read_file(
269262
Read file contents from a file on given Devbox.
270263
271264
Args:
272-
file_path: The path of the file to read.
273-
274265
extra_headers: Send extra headers
275266
276267
extra_query: Add additional query parameters to the request
@@ -283,7 +274,6 @@ def read_file(
283274
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
284275
return self._post(
285276
f"/v1/devboxes/{id}/read_file",
286-
body=maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams),
287277
options=make_request_options(
288278
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
289279
),
@@ -328,8 +318,6 @@ def write_file(
328318
self,
329319
id: str,
330320
*,
331-
contents: str | NotGiven = NOT_GIVEN,
332-
file_path: str | NotGiven = NOT_GIVEN,
333321
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
334322
# The extra values given here take precedence over values defined on the client or passed to this method.
335323
extra_headers: Headers | None = None,
@@ -341,10 +329,6 @@ def write_file(
341329
Write contents to a file at path on the Devbox.
342330
343331
Args:
344-
contents: The contents to write to file.
345-
346-
file_path: The path of the file to read.
347-
348332
extra_headers: Send extra headers
349333
350334
extra_query: Add additional query parameters to the request
@@ -357,13 +341,6 @@ def write_file(
357341
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
358342
return self._post(
359343
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-
),
367344
options=make_request_options(
368345
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
369346
),
@@ -586,7 +563,6 @@ async def read_file(
586563
self,
587564
id: str,
588565
*,
589-
file_path: str | NotGiven = NOT_GIVEN,
590566
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
591567
# The extra values given here take precedence over values defined on the client or passed to this method.
592568
extra_headers: Headers | None = None,
@@ -598,8 +574,6 @@ async def read_file(
598574
Read file contents from a file on given Devbox.
599575
600576
Args:
601-
file_path: The path of the file to read.
602-
603577
extra_headers: Send extra headers
604578
605579
extra_query: Add additional query parameters to the request
@@ -612,7 +586,6 @@ async def read_file(
612586
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
613587
return await self._post(
614588
f"/v1/devboxes/{id}/read_file",
615-
body=await async_maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams),
616589
options=make_request_options(
617590
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
618591
),
@@ -657,8 +630,6 @@ async def write_file(
657630
self,
658631
id: str,
659632
*,
660-
contents: str | NotGiven = NOT_GIVEN,
661-
file_path: str | NotGiven = NOT_GIVEN,
662633
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
663634
# The extra values given here take precedence over values defined on the client or passed to this method.
664635
extra_headers: Headers | None = None,
@@ -670,10 +641,6 @@ async def write_file(
670641
Write contents to a file at path on the Devbox.
671642
672643
Args:
673-
contents: The contents to write to file.
674-
675-
file_path: The path of the file to read.
676-
677644
extra_headers: Send extra headers
678645
679646
extra_query: Add additional query parameters to the request
@@ -686,13 +653,6 @@ async def write_file(
686653
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
687654
return await self._post(
688655
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-
),
696656
options=make_request_options(
697657
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
698658
),

src/runloop_api_client/types/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
from .code_mount_parameters import CodeMountParameters as CodeMountParameters
2121
from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView
2222
from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams
23-
from .devbox_read_file_params import DevboxReadFileParams as DevboxReadFileParams
2423
from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams
25-
from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams
2624
from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters
2725
from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams
2826
from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam

src/runloop_api_client/types/devbox_read_file_params.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/runloop_api_client/types/devbox_write_file_params.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/api_resources/test_devboxes.py

Lines changed: 16 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -181,22 +181,14 @@ def test_path_params_execute_sync(self, client: Runloop) -> None:
181181
@parametrize
182182
def test_method_read_file(self, client: Runloop) -> None:
183183
devbox = client.devboxes.read_file(
184-
id="id",
185-
)
186-
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
187-
188-
@parametrize
189-
def test_method_read_file_with_all_params(self, client: Runloop) -> None:
190-
devbox = client.devboxes.read_file(
191-
id="id",
192-
file_path="file_path",
184+
"id",
193185
)
194186
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
195187

196188
@parametrize
197189
def test_raw_response_read_file(self, client: Runloop) -> None:
198190
response = client.devboxes.with_raw_response.read_file(
199-
id="id",
191+
"id",
200192
)
201193

202194
assert response.is_closed is True
@@ -207,7 +199,7 @@ def test_raw_response_read_file(self, client: Runloop) -> None:
207199
@parametrize
208200
def test_streaming_response_read_file(self, client: Runloop) -> None:
209201
with client.devboxes.with_streaming_response.read_file(
210-
id="id",
202+
"id",
211203
) as response:
212204
assert not response.is_closed
213205
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -221,7 +213,7 @@ def test_streaming_response_read_file(self, client: Runloop) -> None:
221213
def test_path_params_read_file(self, client: Runloop) -> None:
222214
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
223215
client.devboxes.with_raw_response.read_file(
224-
id="",
216+
"",
225217
)
226218

227219
@parametrize
@@ -265,23 +257,14 @@ def test_path_params_shutdown(self, client: Runloop) -> None:
265257
@parametrize
266258
def test_method_write_file(self, client: Runloop) -> None:
267259
devbox = client.devboxes.write_file(
268-
id="id",
269-
)
270-
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
271-
272-
@parametrize
273-
def test_method_write_file_with_all_params(self, client: Runloop) -> None:
274-
devbox = client.devboxes.write_file(
275-
id="id",
276-
contents="contents",
277-
file_path="file_path",
260+
"id",
278261
)
279262
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
280263

281264
@parametrize
282265
def test_raw_response_write_file(self, client: Runloop) -> None:
283266
response = client.devboxes.with_raw_response.write_file(
284-
id="id",
267+
"id",
285268
)
286269

287270
assert response.is_closed is True
@@ -292,7 +275,7 @@ def test_raw_response_write_file(self, client: Runloop) -> None:
292275
@parametrize
293276
def test_streaming_response_write_file(self, client: Runloop) -> None:
294277
with client.devboxes.with_streaming_response.write_file(
295-
id="id",
278+
"id",
296279
) as response:
297280
assert not response.is_closed
298281
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -306,7 +289,7 @@ def test_streaming_response_write_file(self, client: Runloop) -> None:
306289
def test_path_params_write_file(self, client: Runloop) -> None:
307290
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
308291
client.devboxes.with_raw_response.write_file(
309-
id="",
292+
"",
310293
)
311294

312295

@@ -473,22 +456,14 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non
473456
@parametrize
474457
async def test_method_read_file(self, async_client: AsyncRunloop) -> None:
475458
devbox = await async_client.devboxes.read_file(
476-
id="id",
477-
)
478-
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
479-
480-
@parametrize
481-
async def test_method_read_file_with_all_params(self, async_client: AsyncRunloop) -> None:
482-
devbox = await async_client.devboxes.read_file(
483-
id="id",
484-
file_path="file_path",
459+
"id",
485460
)
486461
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
487462

488463
@parametrize
489464
async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None:
490465
response = await async_client.devboxes.with_raw_response.read_file(
491-
id="id",
466+
"id",
492467
)
493468

494469
assert response.is_closed is True
@@ -499,7 +474,7 @@ async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None:
499474
@parametrize
500475
async def test_streaming_response_read_file(self, async_client: AsyncRunloop) -> None:
501476
async with async_client.devboxes.with_streaming_response.read_file(
502-
id="id",
477+
"id",
503478
) as response:
504479
assert not response.is_closed
505480
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -513,7 +488,7 @@ async def test_streaming_response_read_file(self, async_client: AsyncRunloop) ->
513488
async def test_path_params_read_file(self, async_client: AsyncRunloop) -> None:
514489
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
515490
await async_client.devboxes.with_raw_response.read_file(
516-
id="",
491+
"",
517492
)
518493

519494
@parametrize
@@ -557,23 +532,14 @@ async def test_path_params_shutdown(self, async_client: AsyncRunloop) -> None:
557532
@parametrize
558533
async def test_method_write_file(self, async_client: AsyncRunloop) -> None:
559534
devbox = await async_client.devboxes.write_file(
560-
id="id",
561-
)
562-
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
563-
564-
@parametrize
565-
async def test_method_write_file_with_all_params(self, async_client: AsyncRunloop) -> None:
566-
devbox = await async_client.devboxes.write_file(
567-
id="id",
568-
contents="contents",
569-
file_path="file_path",
535+
"id",
570536
)
571537
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
572538

573539
@parametrize
574540
async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None:
575541
response = await async_client.devboxes.with_raw_response.write_file(
576-
id="id",
542+
"id",
577543
)
578544

579545
assert response.is_closed is True
@@ -584,7 +550,7 @@ async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None
584550
@parametrize
585551
async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -> None:
586552
async with async_client.devboxes.with_streaming_response.write_file(
587-
id="id",
553+
"id",
588554
) as response:
589555
assert not response.is_closed
590556
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -598,5 +564,5 @@ async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -
598564
async def test_path_params_write_file(self, async_client: AsyncRunloop) -> None:
599565
with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"):
600566
await async_client.devboxes.with_raw_response.write_file(
601-
id="",
567+
"",
602568
)

0 commit comments

Comments
 (0)