Skip to content

Commit 01c7d14

Browse files
feat(devbox): unify api for devbox mounts
1 parent be5d99e commit 01c7d14

9 files changed

Lines changed: 55 additions & 14 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: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5f33221208c1febba343daf570f73a5086f150a9b128df045ebddc3fe2c86607.yml
3-
openapi_spec_hash: 0aea07130ddbe43a665a13a68231e2ca
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0dd27c6877ed117c50fe0af95cee4d54c646d2484368e131b8e3315eba3fffcc.yml
3+
openapi_spec_hash: 68f663172747aef8e66f2b23289efc7b
44
config_hash: 2363f563f42501d2b1587a4f64bdccaf

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def create(
231231
232232
metadata: User defined metadata to attach to the devbox for organization.
233233
234-
mounts: A list of file system mounts to be included in the Devbox.
234+
mounts: A list of mounts to be included in the Devbox.
235235
236236
name: (Optional) A user specified name to give the Devbox.
237237
@@ -1769,7 +1769,7 @@ async def create(
17691769
17701770
metadata: User defined metadata to attach to the devbox for organization.
17711771
1772-
mounts: A list of file system mounts to be included in the Devbox.
1772+
mounts: A list of mounts to be included in the Devbox.
17731773
17741774
name: (Optional) A user specified name to give the Devbox.
17751775

src/runloop_api_client/types/devbox_create_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class DevboxBaseCreateParams(TypedDict, total=False):
4444
"""User defined metadata to attach to the devbox for organization."""
4545

4646
mounts: Optional[Iterable[Mount]]
47-
"""A list of file system mounts to be included in the Devbox."""
47+
"""A list of mounts to be included in the Devbox."""
4848

4949
name: Optional[str]
5050
"""(Optional) A user specified name to give the Devbox."""

src/runloop_api_client/types/shared/code_mount_parameters.py

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

33
from typing import Optional
4+
from typing_extensions import Literal
45

56
from ..._models import BaseModel
67

@@ -17,6 +18,8 @@ class CodeMountParameters(BaseModel):
1718
repo_owner: str
1819
"""The owner of the repo."""
1920

21+
type: Literal["code_mount"]
22+
2023
token: Optional[str] = None
2124
"""The authentication token necessary to pull repo."""
2225

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

3-
from typing import Union
4-
from typing_extensions import Annotated, TypeAlias
3+
from typing import Dict, Union
4+
from typing_extensions import Literal, Annotated, TypeAlias
55

66
from ..._utils import PropertyInfo
7+
from ..._models import BaseModel
8+
from .code_mount_parameters import CodeMountParameters
79
from .agent_mount_parameters import AgentMountParameters
810
from .object_mount_parameters import ObjectMountParameters
911

10-
__all__ = ["Mount"]
12+
__all__ = ["Mount", "FileMountParameters"]
1113

12-
Mount: TypeAlias = Annotated[Union[ObjectMountParameters, AgentMountParameters], PropertyInfo(discriminator="type")]
14+
15+
class FileMountParameters(BaseModel):
16+
files: Dict[str, str]
17+
"""Map of file paths to file contents to be written before setup.
18+
19+
Keys are absolute paths where files should be created, values are the file
20+
contents.
21+
"""
22+
23+
type: Literal["file_mount"]
24+
25+
26+
Mount: TypeAlias = Annotated[
27+
Union[ObjectMountParameters, AgentMountParameters, CodeMountParameters, FileMountParameters],
28+
PropertyInfo(discriminator="type"),
29+
]

src/runloop_api_client/types/shared_params/code_mount_parameters.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = ["CodeMountParameters"]
99

@@ -18,6 +18,8 @@ class CodeMountParameters(TypedDict, total=False):
1818
repo_owner: Required[str]
1919
"""The owner of the repo."""
2020

21+
type: Required[Literal["code_mount"]]
22+
2123
token: Optional[str]
2224
"""The authentication token necessary to pull repo."""
2325

src/runloop_api_client/types/shared_params/mount.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,25 @@
22

33
from __future__ import annotations
44

5-
from typing import Union
6-
from typing_extensions import TypeAlias
5+
from typing import Dict, Union
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8+
from .code_mount_parameters import CodeMountParameters
89
from .agent_mount_parameters import AgentMountParameters
910
from .object_mount_parameters import ObjectMountParameters
1011

11-
__all__ = ["Mount"]
12+
__all__ = ["Mount", "FileMountParameters"]
1213

13-
Mount: TypeAlias = Union[ObjectMountParameters, AgentMountParameters]
14+
15+
class FileMountParameters(TypedDict, total=False):
16+
files: Required[Dict[str, str]]
17+
"""Map of file paths to file contents to be written before setup.
18+
19+
Keys are absolute paths where files should be created, values are the file
20+
contents.
21+
"""
22+
23+
type: Required[Literal["file_mount"]]
24+
25+
26+
Mount: TypeAlias = Union[ObjectMountParameters, AgentMountParameters, CodeMountParameters, FileMountParameters]

tests/api_resources/test_blueprints.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None:
4444
{
4545
"repo_name": "repo_name",
4646
"repo_owner": "repo_owner",
47+
"type": "code_mount",
4748
"token": "token",
4849
"install_command": "install_command",
4950
}
@@ -412,6 +413,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None:
412413
{
413414
"repo_name": "repo_name",
414415
"repo_owner": "repo_owner",
416+
"type": "code_mount",
415417
"token": "token",
416418
"install_command": "install_command",
417419
}
@@ -514,6 +516,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -
514516
{
515517
"repo_name": "repo_name",
516518
"repo_owner": "repo_owner",
519+
"type": "code_mount",
517520
"token": "token",
518521
"install_command": "install_command",
519522
}
@@ -882,6 +885,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop)
882885
{
883886
"repo_name": "repo_name",
884887
"repo_owner": "repo_owner",
888+
"type": "code_mount",
885889
"token": "token",
886890
"install_command": "install_command",
887891
}

tests/api_resources/test_devboxes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None:
5858
{
5959
"repo_name": "repo_name",
6060
"repo_owner": "repo_owner",
61+
"type": "code_mount",
6162
"token": "token",
6263
"install_command": "install_command",
6364
}
@@ -1606,6 +1607,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -
16061607
{
16071608
"repo_name": "repo_name",
16081609
"repo_owner": "repo_owner",
1610+
"type": "code_mount",
16091611
"token": "token",
16101612
"install_command": "install_command",
16111613
}

0 commit comments

Comments
 (0)