Skip to content

Commit ffc0ce9

Browse files
feat(api): api update
1 parent b25f01f commit ffc0ce9

9 files changed

Lines changed: 87 additions & 23 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 79
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-31e39bc164768e4e73feb3ed3727643705b455e322c91e7fff1dfb2df504d2e8.yml
3-
openapi_spec_hash: 3f2c3d5358dc1732a92e3fed0f5cbcd7
4-
config_hash: e9831eba75eecfc502817af80812f6a7
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-589e342137de29187fec9e332ae5ca29de64e531f8b92b46b2469fdb3449a721.yml
3+
openapi_spec_hash: 5dbf4fe59153afb4d4c8642e05fcecdc
4+
config_hash: 38219157b7a6dd4d0accbd0d57095420

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,15 @@ client.with_options(max_retries=5).devboxes.create()
250250

251251
### Timeouts
252252

253-
By default requests time out after 1 minute. You can configure this with a `timeout` option,
253+
By default requests time out after 10 minutes. You can configure this with a `timeout` option,
254254
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
255255

256256
```python
257257
from runloop_api_client import Runloop
258258

259259
# Configure the default for all requests:
260260
client = Runloop(
261-
# 20 seconds (default is 1 minute)
261+
# 20 seconds (default is 10 minutes)
262262
timeout=20.0,
263263
)
264264

src/runloop_api_client/_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response"
66
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"
77

8-
# default timeout is 1 minute
9-
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0)
8+
# default timeout is 10 minutes
9+
DEFAULT_TIMEOUT = httpx.Timeout(timeout=600, connect=5.0)
1010
DEFAULT_MAX_RETRIES = 0
1111
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)
1212

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -574,11 +574,8 @@ def create_tunnel(
574574
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
575575
idempotency_key: str | None = None,
576576
) -> DevboxTunnelView:
577-
"""Create a live tunnel to an available port on the Devbox.
578-
579-
Note the port must be
580-
made available using Devbox.create.availablePorts. Otherwise, the tunnel will
581-
not connect to any running processes on the Devbox.
577+
"""
578+
Create a live tunnel to an available port on the Devbox.
582579
583580
Args:
584581
port: Devbox port that tunnel will expose.
@@ -859,6 +856,8 @@ def list_disk_snapshots(
859856
*,
860857
devbox_id: str | NotGiven = NOT_GIVEN,
861858
limit: int | NotGiven = NOT_GIVEN,
859+
metadata_key: str | NotGiven = NOT_GIVEN,
860+
metadata_key_in: str | NotGiven = NOT_GIVEN,
862861
starting_after: str | NotGiven = NOT_GIVEN,
863862
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
864863
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -868,13 +867,19 @@ def list_disk_snapshots(
868867
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
869868
) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]:
870869
"""
871-
List all snapshots of a Devbox while optionally filtering by Devbox ID.
870+
List all snapshots of a Devbox while optionally filtering by Devbox ID and
871+
metadata.
872872
873873
Args:
874874
devbox_id: Devbox ID to filter by.
875875
876876
limit: The limit of items to return. Default is 20.
877877
878+
metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for
879+
different keys.
880+
881+
metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition).
882+
878883
starting_after: Load the next page of data starting after the item with the given ID.
879884
880885
extra_headers: Send extra headers
@@ -897,6 +902,8 @@ def list_disk_snapshots(
897902
{
898903
"devbox_id": devbox_id,
899904
"limit": limit,
905+
"metadata_key": metadata_key,
906+
"metadata_key_in": metadata_key_in,
900907
"starting_after": starting_after,
901908
},
902909
devbox_list_disk_snapshots_params.DevboxListDiskSnapshotsParams,
@@ -1760,11 +1767,8 @@ async def create_tunnel(
17601767
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
17611768
idempotency_key: str | None = None,
17621769
) -> DevboxTunnelView:
1763-
"""Create a live tunnel to an available port on the Devbox.
1764-
1765-
Note the port must be
1766-
made available using Devbox.create.availablePorts. Otherwise, the tunnel will
1767-
not connect to any running processes on the Devbox.
1770+
"""
1771+
Create a live tunnel to an available port on the Devbox.
17681772
17691773
Args:
17701774
port: Devbox port that tunnel will expose.
@@ -2045,6 +2049,8 @@ def list_disk_snapshots(
20452049
*,
20462050
devbox_id: str | NotGiven = NOT_GIVEN,
20472051
limit: int | NotGiven = NOT_GIVEN,
2052+
metadata_key: str | NotGiven = NOT_GIVEN,
2053+
metadata_key_in: str | NotGiven = NOT_GIVEN,
20482054
starting_after: str | NotGiven = NOT_GIVEN,
20492055
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
20502056
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2054,13 +2060,19 @@ def list_disk_snapshots(
20542060
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
20552061
) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]:
20562062
"""
2057-
List all snapshots of a Devbox while optionally filtering by Devbox ID.
2063+
List all snapshots of a Devbox while optionally filtering by Devbox ID and
2064+
metadata.
20582065
20592066
Args:
20602067
devbox_id: Devbox ID to filter by.
20612068
20622069
limit: The limit of items to return. Default is 20.
20632070
2071+
metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for
2072+
different keys.
2073+
2074+
metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition).
2075+
20642076
starting_after: Load the next page of data starting after the item with the given ID.
20652077
20662078
extra_headers: Send extra headers
@@ -2083,6 +2095,8 @@ def list_disk_snapshots(
20832095
{
20842096
"devbox_id": devbox_id,
20852097
"limit": limit,
2098+
"metadata_key": metadata_key,
2099+
"metadata_key_in": metadata_key_in,
20862100
"starting_after": starting_after,
20872101
},
20882102
devbox_list_disk_snapshots_params.DevboxListDiskSnapshotsParams,

src/runloop_api_client/resources/devboxes/disk_snapshots.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ def list(
104104
*,
105105
devbox_id: str | NotGiven = NOT_GIVEN,
106106
limit: int | NotGiven = NOT_GIVEN,
107+
metadata_key: str | NotGiven = NOT_GIVEN,
108+
metadata_key_in: str | NotGiven = NOT_GIVEN,
107109
starting_after: str | NotGiven = NOT_GIVEN,
108110
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
109111
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -113,13 +115,19 @@ def list(
113115
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
114116
) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]:
115117
"""
116-
List all snapshots of a Devbox while optionally filtering by Devbox ID.
118+
List all snapshots of a Devbox while optionally filtering by Devbox ID and
119+
metadata.
117120
118121
Args:
119122
devbox_id: Devbox ID to filter by.
120123
121124
limit: The limit of items to return. Default is 20.
122125
126+
metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for
127+
different keys.
128+
129+
metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition).
130+
123131
starting_after: Load the next page of data starting after the item with the given ID.
124132
125133
extra_headers: Send extra headers
@@ -142,6 +150,8 @@ def list(
142150
{
143151
"devbox_id": devbox_id,
144152
"limit": limit,
153+
"metadata_key": metadata_key,
154+
"metadata_key_in": metadata_key_in,
145155
"starting_after": starting_after,
146156
},
147157
disk_snapshot_list_params.DiskSnapshotListParams,
@@ -271,6 +281,8 @@ def list(
271281
*,
272282
devbox_id: str | NotGiven = NOT_GIVEN,
273283
limit: int | NotGiven = NOT_GIVEN,
284+
metadata_key: str | NotGiven = NOT_GIVEN,
285+
metadata_key_in: str | NotGiven = NOT_GIVEN,
274286
starting_after: str | NotGiven = NOT_GIVEN,
275287
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
276288
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -280,13 +292,19 @@ def list(
280292
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
281293
) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]:
282294
"""
283-
List all snapshots of a Devbox while optionally filtering by Devbox ID.
295+
List all snapshots of a Devbox while optionally filtering by Devbox ID and
296+
metadata.
284297
285298
Args:
286299
devbox_id: Devbox ID to filter by.
287300
288301
limit: The limit of items to return. Default is 20.
289302
303+
metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for
304+
different keys.
305+
306+
metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition).
307+
290308
starting_after: Load the next page of data starting after the item with the given ID.
291309
292310
extra_headers: Send extra headers
@@ -309,6 +327,8 @@ def list(
309327
{
310328
"devbox_id": devbox_id,
311329
"limit": limit,
330+
"metadata_key": metadata_key,
331+
"metadata_key_in": metadata_key_in,
312332
"starting_after": starting_after,
313333
},
314334
disk_snapshot_list_params.DiskSnapshotListParams,

src/runloop_api_client/types/devbox_list_disk_snapshots_params.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import TypedDict
5+
from typing_extensions import Annotated, TypedDict
6+
7+
from .._utils import PropertyInfo
68

79
__all__ = ["DevboxListDiskSnapshotsParams"]
810

@@ -14,5 +16,14 @@ class DevboxListDiskSnapshotsParams(TypedDict, total=False):
1416
limit: int
1517
"""The limit of items to return. Default is 20."""
1618

19+
metadata_key: Annotated[str, PropertyInfo(alias="metadata[key]")]
20+
"""Filter snapshots by metadata key-value pair.
21+
22+
Can be used multiple times for different keys.
23+
"""
24+
25+
metadata_key_in: Annotated[str, PropertyInfo(alias="metadata[key][in]")]
26+
"""Filter snapshots by metadata key with multiple possible values (OR condition)."""
27+
1728
starting_after: str
1829
"""Load the next page of data starting after the item with the given ID."""

src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import TypedDict
5+
from typing_extensions import Annotated, TypedDict
6+
7+
from ..._utils import PropertyInfo
68

79
__all__ = ["DiskSnapshotListParams"]
810

@@ -14,5 +16,14 @@ class DiskSnapshotListParams(TypedDict, total=False):
1416
limit: int
1517
"""The limit of items to return. Default is 20."""
1618

19+
metadata_key: Annotated[str, PropertyInfo(alias="metadata[key]")]
20+
"""Filter snapshots by metadata key-value pair.
21+
22+
Can be used multiple times for different keys.
23+
"""
24+
25+
metadata_key_in: Annotated[str, PropertyInfo(alias="metadata[key][in]")]
26+
"""Filter snapshots by metadata key with multiple possible values (OR condition)."""
27+
1728
starting_after: str
1829
"""Load the next page of data starting after the item with the given ID."""

tests/api_resources/devboxes/test_disk_snapshots.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def test_method_list_with_all_params(self, client: Runloop) -> None:
7575
disk_snapshot = client.devboxes.disk_snapshots.list(
7676
devbox_id="devbox_id",
7777
limit=0,
78+
metadata_key="metadata[key]",
79+
metadata_key_in="metadata[key][in]",
7880
starting_after="starting_after",
7981
)
8082
assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"])
@@ -198,6 +200,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) ->
198200
disk_snapshot = await async_client.devboxes.disk_snapshots.list(
199201
devbox_id="devbox_id",
200202
limit=0,
203+
metadata_key="metadata[key]",
204+
metadata_key_in="metadata[key][in]",
201205
starting_after="starting_after",
202206
)
203207
assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"])

tests/api_resources/test_devboxes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,8 @@ def test_method_list_disk_snapshots_with_all_params(self, client: Runloop) -> No
548548
devbox = client.devboxes.list_disk_snapshots(
549549
devbox_id="devbox_id",
550550
limit=0,
551+
metadata_key="metadata[key]",
552+
metadata_key_in="metadata[key][in]",
551553
starting_after="starting_after",
552554
)
553555
assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"])
@@ -1428,6 +1430,8 @@ async def test_method_list_disk_snapshots_with_all_params(self, async_client: As
14281430
devbox = await async_client.devboxes.list_disk_snapshots(
14291431
devbox_id="devbox_id",
14301432
limit=0,
1433+
metadata_key="metadata[key]",
1434+
metadata_key_in="metadata[key][in]",
14311435
starting_after="starting_after",
14321436
)
14331437
assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"])

0 commit comments

Comments
 (0)