Skip to content

Commit 7050aee

Browse files
feat(api): api update
1 parent 2502785 commit 7050aee

6 files changed

Lines changed: 145 additions & 9 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 92
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-963f8c488e668763300b08860aef9dd85b72c32069ca20e0c36795e86d2938b1.yml
3-
openapi_spec_hash: 65c50f6ab92fd7bf7d108be411923a7a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bbb5c731b774122662526cc0b24015828012b1f09bb32fe2d54498aa09e52c92.yml
3+
openapi_spec_hash: 3d23e89561895724da8d48967dd26f17
44
config_hash: 60681f589a9e641fdb7f19af2021a033

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,9 @@ def upload_file(
13051305
id: str,
13061306
*,
13071307
path: str,
1308+
chmod: Optional[str] | NotGiven = NOT_GIVEN,
13081309
file: FileTypes | NotGiven = NOT_GIVEN,
1310+
owner: Optional[str] | NotGiven = NOT_GIVEN,
13091311
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
13101312
# The extra values given here take precedence over values defined on the client or passed to this method.
13111313
extra_headers: Headers | None = None,
@@ -1324,6 +1326,12 @@ def upload_file(
13241326
path: The path to write the file to on the Devbox. Path is relative to user home
13251327
directory.
13261328
1329+
chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not
1330+
specified, default system permissions will be used.
1331+
1332+
owner: File owner username. Optional. If not specified, the file will be owned by the
1333+
current user.
1334+
13271335
extra_headers: Send extra headers
13281336
13291337
extra_query: Add additional query parameters to the request
@@ -1341,7 +1349,9 @@ def upload_file(
13411349
body = deepcopy_minimal(
13421350
{
13431351
"path": path,
1352+
"chmod": chmod,
13441353
"file": file,
1354+
"owner": owner,
13451355
}
13461356
)
13471357
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
@@ -1369,6 +1379,8 @@ def write_file_contents(
13691379
*,
13701380
contents: str,
13711381
file_path: str,
1382+
chmod: Optional[str] | NotGiven = NOT_GIVEN,
1383+
owner: Optional[str] | NotGiven = NOT_GIVEN,
13721384
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
13731385
# The extra values given here take precedence over values defined on the client or passed to this method.
13741386
extra_headers: Headers | None = None,
@@ -1388,6 +1400,12 @@ def write_file_contents(
13881400
file_path: The path to write the file to on the Devbox. Path is relative to user home
13891401
directory.
13901402
1403+
chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not
1404+
specified, default system permissions will be used.
1405+
1406+
owner: File owner username. Optional. If not specified, the file will be owned by the
1407+
current user.
1408+
13911409
extra_headers: Send extra headers
13921410
13931411
extra_query: Add additional query parameters to the request
@@ -1408,6 +1426,8 @@ def write_file_contents(
14081426
{
14091427
"contents": contents,
14101428
"file_path": file_path,
1429+
"chmod": chmod,
1430+
"owner": owner,
14111431
},
14121432
devbox_write_file_contents_params.DevboxWriteFileContentsParams,
14131433
),
@@ -2598,7 +2618,9 @@ async def upload_file(
25982618
id: str,
25992619
*,
26002620
path: str,
2621+
chmod: Optional[str] | NotGiven = NOT_GIVEN,
26012622
file: FileTypes | NotGiven = NOT_GIVEN,
2623+
owner: Optional[str] | NotGiven = NOT_GIVEN,
26022624
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
26032625
# The extra values given here take precedence over values defined on the client or passed to this method.
26042626
extra_headers: Headers | None = None,
@@ -2617,6 +2639,12 @@ async def upload_file(
26172639
path: The path to write the file to on the Devbox. Path is relative to user home
26182640
directory.
26192641
2642+
chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not
2643+
specified, default system permissions will be used.
2644+
2645+
owner: File owner username. Optional. If not specified, the file will be owned by the
2646+
current user.
2647+
26202648
extra_headers: Send extra headers
26212649
26222650
extra_query: Add additional query parameters to the request
@@ -2634,7 +2662,9 @@ async def upload_file(
26342662
body = deepcopy_minimal(
26352663
{
26362664
"path": path,
2665+
"chmod": chmod,
26372666
"file": file,
2667+
"owner": owner,
26382668
}
26392669
)
26402670
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
@@ -2662,6 +2692,8 @@ async def write_file_contents(
26622692
*,
26632693
contents: str,
26642694
file_path: str,
2695+
chmod: Optional[str] | NotGiven = NOT_GIVEN,
2696+
owner: Optional[str] | NotGiven = NOT_GIVEN,
26652697
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
26662698
# The extra values given here take precedence over values defined on the client or passed to this method.
26672699
extra_headers: Headers | None = None,
@@ -2681,6 +2713,12 @@ async def write_file_contents(
26812713
file_path: The path to write the file to on the Devbox. Path is relative to user home
26822714
directory.
26832715
2716+
chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not
2717+
specified, default system permissions will be used.
2718+
2719+
owner: File owner username. Optional. If not specified, the file will be owned by the
2720+
current user.
2721+
26842722
extra_headers: Send extra headers
26852723
26862724
extra_query: Add additional query parameters to the request
@@ -2701,6 +2739,8 @@ async def write_file_contents(
27012739
{
27022740
"contents": contents,
27032741
"file_path": file_path,
2742+
"chmod": chmod,
2743+
"owner": owner,
27042744
},
27052745
devbox_write_file_contents_params.DevboxWriteFileContentsParams,
27062746
),

src/runloop_api_client/types/devbox_upload_file_params.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
56
from typing_extensions import Required, TypedDict
67

78
from .._types import FileTypes
@@ -16,4 +17,16 @@ class DevboxUploadFileParams(TypedDict, total=False):
1617
Path is relative to user home directory.
1718
"""
1819

20+
chmod: Optional[str]
21+
"""File permissions in octal format (e.g., "644", "1755").
22+
23+
Optional. If not specified, default system permissions will be used.
24+
"""
25+
1926
file: FileTypes
27+
28+
owner: Optional[str]
29+
"""File owner username.
30+
31+
Optional. If not specified, the file will be owned by the current user.
32+
"""

src/runloop_api_client/types/devbox_write_file_contents_params.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
56
from typing_extensions import Required, TypedDict
67

78
__all__ = ["DevboxWriteFileContentsParams"]
@@ -16,3 +17,15 @@ class DevboxWriteFileContentsParams(TypedDict, total=False):
1617
1718
Path is relative to user home directory.
1819
"""
20+
21+
chmod: Optional[str]
22+
"""File permissions in octal format (e.g., "644", "1755").
23+
24+
Optional. If not specified, default system permissions will be used.
25+
"""
26+
27+
owner: Optional[str]
28+
"""File owner username.
29+
30+
Optional. If not specified, the file will be owned by the current user.
31+
"""

src/runloop_api_client/types/repository_manifest_view.py

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
3+
from typing import Dict, List, Optional
44

55
from .._models import BaseModel
66

7-
__all__ = ["RepositoryManifestView", "ContainerConfig", "Workspace", "WorkspaceDevCommands"]
7+
__all__ = [
8+
"RepositoryManifestView",
9+
"ContainerConfig",
10+
"Workspace",
11+
"WorkspaceDevCommands",
12+
"ContainerizedService",
13+
"ContainerizedServiceCredentials",
14+
]
815

916

1017
class ContainerConfig(BaseModel):
@@ -23,21 +30,21 @@ class ContainerConfig(BaseModel):
2330

2431

2532
class WorkspaceDevCommands(BaseModel):
26-
build: Optional[str] = None
33+
build: Optional[List[str]] = None
2734
"""Build command (e.g. npm run build)."""
2835

29-
install: Optional[str] = None
36+
install: Optional[List[str]] = None
3037
"""Installation command (e.g. pip install -r requirements.txt)."""
3138

32-
lint: Optional[str] = None
39+
lint: Optional[List[str]] = None
3340
"""Lint command (e.g. flake8)."""
3441

35-
test: Optional[str] = None
42+
test: Optional[List[str]] = None
3643
"""Test command (e.g. pytest)."""
3744

3845

3946
class Workspace(BaseModel):
40-
package_manager: str
47+
package_manager: List[str]
4148
"""Name of the package manager used (e.g. pip, npm)."""
4249

4350
dev_commands: Optional[WorkspaceDevCommands] = None
@@ -80,6 +87,37 @@ class Workspace(BaseModel):
8087
"""
8188

8289

90+
class ContainerizedServiceCredentials(BaseModel):
91+
password: str
92+
"""The password of the container service."""
93+
94+
username: str
95+
"""The username of the container service."""
96+
97+
98+
class ContainerizedService(BaseModel):
99+
image: str
100+
"""The image of the container service."""
101+
102+
name: str
103+
"""The name of the container service."""
104+
105+
credentials: Optional[ContainerizedServiceCredentials] = None
106+
"""The credentials of the container service."""
107+
108+
env: Optional[Dict[str, str]] = None
109+
"""The environment variables of the container service."""
110+
111+
options: Optional[str] = None
112+
"""Additional Docker container create options."""
113+
114+
port_mappings: Optional[List[str]] = None
115+
"""The port mappings of the container service.
116+
117+
Port mappings are in the format of <host_port>:<container_port>.
118+
"""
119+
120+
83121
class RepositoryManifestView(BaseModel):
84122
container_config: ContainerConfig
85123
"""Container configuration specifying the base image and setup commands."""
@@ -89,3 +127,9 @@ class RepositoryManifestView(BaseModel):
89127
90128
Each workspace represents a buildable unit of code.
91129
"""
130+
131+
containerized_services: Optional[List[ContainerizedService]] = None
132+
"""List of discovered ContainerizedServices.
133+
134+
Services can be explicitly started when creating a Devbox.
135+
"""

tests/api_resources/test_devboxes.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,9 @@ def test_method_upload_file_with_all_params(self, client: Runloop) -> None:
886886
devbox = client.devboxes.upload_file(
887887
id="id",
888888
path="path",
889+
chmod="chmod",
889890
file=b"raw file contents",
891+
owner="owner",
890892
)
891893
assert_matches_type(object, devbox, path=["response"])
892894

@@ -933,6 +935,17 @@ def test_method_write_file_contents(self, client: Runloop) -> None:
933935
)
934936
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
935937

938+
@parametrize
939+
def test_method_write_file_contents_with_all_params(self, client: Runloop) -> None:
940+
devbox = client.devboxes.write_file_contents(
941+
id="id",
942+
contents="contents",
943+
file_path="file_path",
944+
chmod="chmod",
945+
owner="owner",
946+
)
947+
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
948+
936949
@parametrize
937950
def test_raw_response_write_file_contents(self, client: Runloop) -> None:
938951
response = client.devboxes.with_raw_response.write_file_contents(
@@ -2097,7 +2110,9 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncRunlo
20972110
devbox = await async_client.devboxes.upload_file(
20982111
id="id",
20992112
path="path",
2113+
chmod="chmod",
21002114
file=b"raw file contents",
2115+
owner="owner",
21012116
)
21022117
assert_matches_type(object, devbox, path=["response"])
21032118

@@ -2144,6 +2159,17 @@ async def test_method_write_file_contents(self, async_client: AsyncRunloop) -> N
21442159
)
21452160
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
21462161

2162+
@parametrize
2163+
async def test_method_write_file_contents_with_all_params(self, async_client: AsyncRunloop) -> None:
2164+
devbox = await async_client.devboxes.write_file_contents(
2165+
id="id",
2166+
contents="contents",
2167+
file_path="file_path",
2168+
chmod="chmod",
2169+
owner="owner",
2170+
)
2171+
assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"])
2172+
21472173
@parametrize
21482174
async def test_raw_response_write_file_contents(self, async_client: AsyncRunloop) -> None:
21492175
response = await async_client.devboxes.with_raw_response.write_file_contents(

0 commit comments

Comments
 (0)