Skip to content

Commit 23d4705

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#79)
1 parent 3befea7 commit 23d4705

9 files changed

Lines changed: 62 additions & 16 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: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8d8e0503acc9538a16d75214afccccbd96e178b8ca1ec56ceb9316a20b6daba6.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6d8fa9e3b0fd4b024c72d3bda8162e15c33295b9e98feabcc0289ecda9cf1db2.yml

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ def create(
6161
*,
6262
blueprint_id: str | NotGiven = NOT_GIVEN,
6363
blueprint_name: str | NotGiven = NOT_GIVEN,
64-
code_handle: str | NotGiven = NOT_GIVEN,
6564
entrypoint: str | NotGiven = NOT_GIVEN,
6665
environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN,
6766
file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN,
67+
launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN,
6868
name: str | NotGiven = NOT_GIVEN,
6969
setup_commands: List[str] | NotGiven = NOT_GIVEN,
7070
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -86,8 +86,6 @@ def create(
8686
blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the
8787
latest successfully built Blueprint with the given name.
8888
89-
code_handle: (Optional) Id of a code handle to mount to devbox.
90-
9189
entrypoint: (Optional) When specified, the Devbox will run this script as its main
9290
executable. The devbox lifecycle will be bound to entrypoint, shutting down when
9391
the process is complete.
@@ -96,6 +94,8 @@ def create(
9694
9795
file_mounts: (Optional) Map of paths and file contents to write before setup..
9896
97+
launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox.
98+
9999
name: (Optional) A user specified name to give the Devbox.
100100
101101
setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include
@@ -116,10 +116,10 @@ def create(
116116
{
117117
"blueprint_id": blueprint_id,
118118
"blueprint_name": blueprint_name,
119-
"code_handle": code_handle,
120119
"entrypoint": entrypoint,
121120
"environment_variables": environment_variables,
122121
"file_mounts": file_mounts,
122+
"launch_parameters": launch_parameters,
123123
"name": name,
124124
"setup_commands": setup_commands,
125125
},
@@ -430,10 +430,10 @@ async def create(
430430
*,
431431
blueprint_id: str | NotGiven = NOT_GIVEN,
432432
blueprint_name: str | NotGiven = NOT_GIVEN,
433-
code_handle: str | NotGiven = NOT_GIVEN,
434433
entrypoint: str | NotGiven = NOT_GIVEN,
435434
environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN,
436435
file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN,
436+
launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN,
437437
name: str | NotGiven = NOT_GIVEN,
438438
setup_commands: List[str] | NotGiven = NOT_GIVEN,
439439
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -455,8 +455,6 @@ async def create(
455455
blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the
456456
latest successfully built Blueprint with the given name.
457457
458-
code_handle: (Optional) Id of a code handle to mount to devbox.
459-
460458
entrypoint: (Optional) When specified, the Devbox will run this script as its main
461459
executable. The devbox lifecycle will be bound to entrypoint, shutting down when
462460
the process is complete.
@@ -465,6 +463,8 @@ async def create(
465463
466464
file_mounts: (Optional) Map of paths and file contents to write before setup..
467465
466+
launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox.
467+
468468
name: (Optional) A user specified name to give the Devbox.
469469
470470
setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include
@@ -485,10 +485,10 @@ async def create(
485485
{
486486
"blueprint_id": blueprint_id,
487487
"blueprint_name": blueprint_name,
488-
"code_handle": code_handle,
489488
"entrypoint": entrypoint,
490489
"environment_variables": environment_variables,
491490
"file_mounts": file_mounts,
491+
"launch_parameters": launch_parameters,
492492
"name": name,
493493
"setup_commands": setup_commands,
494494
},

src/runloop_api_client/types/blueprint_build_parameters.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010

1111

1212
class LaunchParameters(BaseModel):
13+
keep_alive_time_seconds: Optional[int] = None
14+
"""Time in seconds after which Devbox will automatically shutdown.
15+
16+
Default is 1 hour.
17+
"""
18+
1319
launch_commands: Optional[List[str]] = None
1420
"""Set of commands to be run at launch time, before the entrypoint process is run."""
1521

src/runloop_api_client/types/blueprint_create_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class BlueprintCreateParams(TypedDict, total=False):
3232

3333

3434
class LaunchParameters(TypedDict, total=False):
35+
keep_alive_time_seconds: int
36+
"""Time in seconds after which Devbox will automatically shutdown.
37+
38+
Default is 1 hour.
39+
"""
40+
3541
launch_commands: List[str]
3642
"""Set of commands to be run at launch time, before the entrypoint process is run."""
3743

src/runloop_api_client/types/blueprint_preview_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class BlueprintPreviewParams(TypedDict, total=False):
3232

3333

3434
class LaunchParameters(TypedDict, total=False):
35+
keep_alive_time_seconds: int
36+
"""Time in seconds after which Devbox will automatically shutdown.
37+
38+
Default is 1 hour.
39+
"""
40+
3541
launch_commands: List[str]
3642
"""Set of commands to be run at launch time, before the entrypoint process is run."""
3743

src/runloop_api_client/types/devbox_create_params.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
from typing import Dict, List
66
from typing_extensions import TypedDict
77

8-
__all__ = ["DevboxCreateParams"]
8+
from .resource_size import ResourceSize
9+
10+
__all__ = ["DevboxCreateParams", "LaunchParameters"]
911

1012

1113
class DevboxCreateParams(TypedDict, total=False):
@@ -22,9 +24,6 @@ class DevboxCreateParams(TypedDict, total=False):
2224
name.
2325
"""
2426

25-
code_handle: str
26-
"""(Optional) Id of a code handle to mount to devbox."""
27-
2827
entrypoint: str
2928
"""
3029
(Optional) When specified, the Devbox will run this script as its main
@@ -38,6 +37,9 @@ class DevboxCreateParams(TypedDict, total=False):
3837
file_mounts: Dict[str, str]
3938
"""(Optional) Map of paths and file contents to write before setup.."""
4039

40+
launch_parameters: LaunchParameters
41+
"""Parameters to configure the resources and launch time behavior of the Devbox."""
42+
4143
name: str
4244
"""(Optional) A user specified name to give the Devbox."""
4345

@@ -47,3 +49,17 @@ class DevboxCreateParams(TypedDict, total=False):
4749
Examples might include fetching a tool or building your dependencies. Runloop
4850
will look optimize these steps for you.
4951
"""
52+
53+
54+
class LaunchParameters(TypedDict, total=False):
55+
keep_alive_time_seconds: int
56+
"""Time in seconds after which Devbox will automatically shutdown.
57+
58+
Default is 1 hour.
59+
"""
60+
61+
launch_commands: List[str]
62+
"""Set of commands to be run at launch time, before the entrypoint process is run."""
63+
64+
resource_size_request: ResourceSize
65+
"""Manual resource configuration for Devbox. If not set, defaults will be used."""

src/runloop_api_client/types/resource_size.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
__all__ = ["ResourceSize"]
66

7-
ResourceSize: TypeAlias = Literal["MINI", "SMALL", "MEDIUM", "LARGE"]
7+
ResourceSize: TypeAlias = Literal["MINI", "SMALL", "MEDIUM", "LARGE", "X_LARGE"]

tests/api_resources/test_blueprints.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None:
5555
launch_parameters={
5656
"launch_commands": ["string", "string", "string"],
5757
"resource_size_request": "MINI",
58+
"keep_alive_time_seconds": 0,
5859
},
5960
name="name",
6061
system_setup_commands=["string", "string", "string"],
@@ -224,6 +225,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None:
224225
launch_parameters={
225226
"launch_commands": ["string", "string", "string"],
226227
"resource_size_request": "MINI",
228+
"keep_alive_time_seconds": 0,
227229
},
228230
name="name",
229231
system_setup_commands=["string", "string", "string"],
@@ -287,6 +289,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -
287289
launch_parameters={
288290
"launch_commands": ["string", "string", "string"],
289291
"resource_size_request": "MINI",
292+
"keep_alive_time_seconds": 0,
290293
},
291294
name="name",
292295
system_setup_commands=["string", "string", "string"],
@@ -456,6 +459,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop)
456459
launch_parameters={
457460
"launch_commands": ["string", "string", "string"],
458461
"resource_size_request": "MINI",
462+
"keep_alive_time_seconds": 0,
459463
},
460464
name="name",
461465
system_setup_commands=["string", "string", "string"],

tests/api_resources/test_devboxes.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ def test_method_create_with_all_params(self, client: Runloop) -> None:
3131
devbox = client.devboxes.create(
3232
blueprint_id="blueprint_id",
3333
blueprint_name="blueprint_name",
34-
code_handle="code_handle",
3534
entrypoint="entrypoint",
3635
environment_variables={"foo": "string"},
3736
file_mounts={"foo": "string"},
37+
launch_parameters={
38+
"launch_commands": ["string", "string", "string"],
39+
"resource_size_request": "MINI",
40+
"keep_alive_time_seconds": 0,
41+
},
3842
name="name",
3943
setup_commands=["string", "string", "string"],
4044
)
@@ -369,10 +373,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -
369373
devbox = await async_client.devboxes.create(
370374
blueprint_id="blueprint_id",
371375
blueprint_name="blueprint_name",
372-
code_handle="code_handle",
373376
entrypoint="entrypoint",
374377
environment_variables={"foo": "string"},
375378
file_mounts={"foo": "string"},
379+
launch_parameters={
380+
"launch_commands": ["string", "string", "string"],
381+
"resource_size_request": "MINI",
382+
"keep_alive_time_seconds": 0,
383+
},
376384
name="name",
377385
setup_commands=["string", "string", "string"],
378386
)

0 commit comments

Comments
 (0)