Skip to content

Commit eeeefa8

Browse files
fix(snapshot): added "deleted" status to DevboxSnapshotStatus enum \n fix(storage-object): added ObjectState enum, fixed createObject() to appropriately type content_type and state as the respective enums
1 parent 3e869c5 commit eeeefa8

8 files changed

Lines changed: 65 additions & 44 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-4a14147d9603516ef2245584e4e44af8324cb1cbf130c3718bea39ad15b8084d.yml
3-
openapi_spec_hash: bfeae3e75e496683934b941a19396c4b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9f8a6310d4d9c36d386f5afe17cfc891d05d5911204574645f9f90d9b6864a00.yml
3+
openapi_spec_hash: 3fc0a807bb8d728abe3b7eaff0b9f7ec
44
config_hash: 2363f563f42501d2b1587a4f64bdccaf

src/runloop_api_client/resources/objects.py

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def create(
5252
content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"],
5353
name: str,
5454
metadata: Optional[Dict[str, str]] | Omit = omit,
55+
ttl_ms: Optional[int] | Omit = omit,
5556
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5657
# The extra values given here take precedence over values defined on the client or passed to this method.
5758
extra_headers: Headers | None = None,
@@ -72,6 +73,9 @@ def create(
7273
7374
metadata: User defined metadata to attach to the object for organization.
7475
76+
ttl_ms: Optional lifetime of the object in milliseconds, after which the object is
77+
automatically deleted. Time starts ticking after the object is created.
78+
7579
extra_headers: Send extra headers
7680
7781
extra_query: Add additional query parameters to the request
@@ -89,6 +93,7 @@ def create(
8993
"content_type": content_type,
9094
"name": name,
9195
"metadata": metadata,
96+
"ttl_ms": ttl_ms,
9297
},
9398
object_create_params.ObjectCreateParams,
9499
),
@@ -138,12 +143,12 @@ def retrieve(
138143
def list(
139144
self,
140145
*,
141-
content_type: str | Omit = omit,
146+
content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] | Omit = omit,
142147
limit: int | Omit = omit,
143148
name: str | Omit = omit,
144149
search: str | Omit = omit,
145150
starting_after: str | Omit = omit,
146-
state: str | Omit = omit,
151+
state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] | Omit = omit,
147152
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
148153
# The extra values given here take precedence over values defined on the client or passed to this method.
149154
extra_headers: Headers | None = None,
@@ -155,17 +160,17 @@ def list(
155160
List all Objects for the authenticated account with pagination support.
156161
157162
Args:
158-
content_type: Filter objects by content type.
163+
content_type: Filter storage objects by content type.
159164
160165
limit: The limit of items to return. Default is 20.
161166
162-
name: Filter objects by name (partial match supported).
167+
name: Filter storage objects by name (partial match supported).
163168
164169
search: Search by object ID or name.
165170
166171
starting_after: Load the next page of data starting after the item with the given ID.
167172
168-
state: Filter objects by state (UPLOADING, READ_ONLY, DELETED).
173+
state: Filter storage objects by state.
169174
170175
extra_headers: Send extra headers
171176
@@ -328,12 +333,12 @@ def download(
328333
def list_public(
329334
self,
330335
*,
331-
content_type: str | Omit = omit,
336+
content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] | Omit = omit,
332337
limit: int | Omit = omit,
333338
name: str | Omit = omit,
334339
search: str | Omit = omit,
335340
starting_after: str | Omit = omit,
336-
state: str | Omit = omit,
341+
state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] | Omit = omit,
337342
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
338343
# The extra values given here take precedence over values defined on the client or passed to this method.
339344
extra_headers: Headers | None = None,
@@ -345,17 +350,17 @@ def list_public(
345350
List all public Objects with pagination support.
346351
347352
Args:
348-
content_type: Filter objects by content type.
353+
content_type: Filter storage objects by content type.
349354
350355
limit: The limit of items to return. Default is 20.
351356
352-
name: Filter objects by name (partial match supported).
357+
name: Filter storage objects by name (partial match supported).
353358
354359
search: Search by object ID or name.
355360
356361
starting_after: Load the next page of data starting after the item with the given ID.
357362
358-
state: Filter objects by state (UPLOADING, READ_ONLY, DELETED).
363+
state: Filter storage objects by state.
359364
360365
extra_headers: Send extra headers
361366
@@ -415,6 +420,7 @@ async def create(
415420
content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"],
416421
name: str,
417422
metadata: Optional[Dict[str, str]] | Omit = omit,
423+
ttl_ms: Optional[int] | Omit = omit,
418424
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
419425
# The extra values given here take precedence over values defined on the client or passed to this method.
420426
extra_headers: Headers | None = None,
@@ -435,6 +441,9 @@ async def create(
435441
436442
metadata: User defined metadata to attach to the object for organization.
437443
444+
ttl_ms: Optional lifetime of the object in milliseconds, after which the object is
445+
automatically deleted. Time starts ticking after the object is created.
446+
438447
extra_headers: Send extra headers
439448
440449
extra_query: Add additional query parameters to the request
@@ -452,6 +461,7 @@ async def create(
452461
"content_type": content_type,
453462
"name": name,
454463
"metadata": metadata,
464+
"ttl_ms": ttl_ms,
455465
},
456466
object_create_params.ObjectCreateParams,
457467
),
@@ -501,12 +511,12 @@ async def retrieve(
501511
def list(
502512
self,
503513
*,
504-
content_type: str | Omit = omit,
514+
content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] | Omit = omit,
505515
limit: int | Omit = omit,
506516
name: str | Omit = omit,
507517
search: str | Omit = omit,
508518
starting_after: str | Omit = omit,
509-
state: str | Omit = omit,
519+
state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] | Omit = omit,
510520
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
511521
# The extra values given here take precedence over values defined on the client or passed to this method.
512522
extra_headers: Headers | None = None,
@@ -518,17 +528,17 @@ def list(
518528
List all Objects for the authenticated account with pagination support.
519529
520530
Args:
521-
content_type: Filter objects by content type.
531+
content_type: Filter storage objects by content type.
522532
523533
limit: The limit of items to return. Default is 20.
524534
525-
name: Filter objects by name (partial match supported).
535+
name: Filter storage objects by name (partial match supported).
526536
527537
search: Search by object ID or name.
528538
529539
starting_after: Load the next page of data starting after the item with the given ID.
530540
531-
state: Filter objects by state (UPLOADING, READ_ONLY, DELETED).
541+
state: Filter storage objects by state.
532542
533543
extra_headers: Send extra headers
534544
@@ -691,12 +701,12 @@ async def download(
691701
def list_public(
692702
self,
693703
*,
694-
content_type: str | Omit = omit,
704+
content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] | Omit = omit,
695705
limit: int | Omit = omit,
696706
name: str | Omit = omit,
697707
search: str | Omit = omit,
698708
starting_after: str | Omit = omit,
699-
state: str | Omit = omit,
709+
state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] | Omit = omit,
700710
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
701711
# The extra values given here take precedence over values defined on the client or passed to this method.
702712
extra_headers: Headers | None = None,
@@ -708,17 +718,17 @@ def list_public(
708718
List all public Objects with pagination support.
709719
710720
Args:
711-
content_type: Filter objects by content type.
721+
content_type: Filter storage objects by content type.
712722
713723
limit: The limit of items to return. Default is 20.
714724
715-
name: Filter objects by name (partial match supported).
725+
name: Filter storage objects by name (partial match supported).
716726
717727
search: Search by object ID or name.
718728
719729
starting_after: Load the next page of data starting after the item with the given ID.
720730
721-
state: Filter objects by state (UPLOADING, READ_ONLY, DELETED).
731+
state: Filter storage objects by state.
722732
723733
extra_headers: Send extra headers
724734

src/runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class DevboxSnapshotAsyncStatusView(BaseModel):
13-
status: Literal["in_progress", "error", "complete"]
13+
status: Literal["in_progress", "error", "complete", "deleted"]
1414
"""The current status of the snapshot operation."""
1515

1616
error_message: Optional[str] = None

src/runloop_api_client/types/object_create_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ class ObjectCreateParams(TypedDict, total=False):
1717

1818
metadata: Optional[Dict[str, str]]
1919
"""User defined metadata to attach to the object for organization."""
20+
21+
ttl_ms: Optional[int]
22+
"""
23+
Optional lifetime of the object in milliseconds, after which the object is
24+
automatically deleted. Time starts ticking after the object is created.
25+
"""

src/runloop_api_client/types/object_list_params.py

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

33
from __future__ import annotations
44

5-
from typing_extensions import TypedDict
5+
from typing_extensions import Literal, TypedDict
66

77
__all__ = ["ObjectListParams"]
88

99

1010
class ObjectListParams(TypedDict, total=False):
11-
content_type: str
12-
"""Filter objects by content type."""
11+
content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"]
12+
"""Filter storage objects by content type."""
1313

1414
limit: int
1515
"""The limit of items to return. Default is 20."""
1616

1717
name: str
18-
"""Filter objects by name (partial match supported)."""
18+
"""Filter storage objects by name (partial match supported)."""
1919

2020
search: str
2121
"""Search by object ID or name."""
2222

2323
starting_after: str
2424
"""Load the next page of data starting after the item with the given ID."""
2525

26-
state: str
27-
"""Filter objects by state (UPLOADING, READ_ONLY, DELETED)."""
26+
state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"]
27+
"""Filter storage objects by state."""

src/runloop_api_client/types/object_list_public_params.py

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

33
from __future__ import annotations
44

5-
from typing_extensions import TypedDict
5+
from typing_extensions import Literal, TypedDict
66

77
__all__ = ["ObjectListPublicParams"]
88

99

1010
class ObjectListPublicParams(TypedDict, total=False):
11-
content_type: str
12-
"""Filter objects by content type."""
11+
content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"]
12+
"""Filter storage objects by content type."""
1313

1414
limit: int
1515
"""The limit of items to return. Default is 20."""
1616

1717
name: str
18-
"""Filter objects by name (partial match supported)."""
18+
"""Filter storage objects by name (partial match supported)."""
1919

2020
search: str
2121
"""Search by object ID or name."""
2222

2323
starting_after: str
2424
"""Load the next page of data starting after the item with the given ID."""
2525

26-
state: str
27-
"""Filter objects by state (UPLOADING, READ_ONLY, DELETED)."""
26+
state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"]
27+
"""Filter storage objects by state."""

src/runloop_api_client/types/object_view.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ class ObjectView(BaseModel):
2121
name: str
2222
"""The name of the Object."""
2323

24-
state: str
24+
state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"]
2525
"""The current state of the Object."""
2626

27+
delete_after_time_ms: Optional[int] = None
28+
"""The time after which the Object will be deleted in milliseconds since epoch."""
29+
2730
size_bytes: Optional[int] = None
2831
"""The size of the Object content in bytes (null until uploaded)."""
2932

tests/api_resources/test_objects.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None:
3535
content_type="unspecified",
3636
name="name",
3737
metadata={"foo": "string"},
38+
ttl_ms=0,
3839
)
3940
assert_matches_type(ObjectView, object_, path=["response"])
4041

@@ -110,12 +111,12 @@ def test_method_list(self, client: Runloop) -> None:
110111
@parametrize
111112
def test_method_list_with_all_params(self, client: Runloop) -> None:
112113
object_ = client.objects.list(
113-
content_type="content_type",
114+
content_type="unspecified",
114115
limit=0,
115116
name="name",
116117
search="search",
117118
starting_after="starting_after",
118-
state="state",
119+
state="UPLOADING",
119120
)
120121
assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"])
121122

@@ -269,12 +270,12 @@ def test_method_list_public(self, client: Runloop) -> None:
269270
@parametrize
270271
def test_method_list_public_with_all_params(self, client: Runloop) -> None:
271272
object_ = client.objects.list_public(
272-
content_type="content_type",
273+
content_type="unspecified",
273274
limit=0,
274275
name="name",
275276
search="search",
276277
starting_after="starting_after",
277-
state="state",
278+
state="UPLOADING",
278279
)
279280
assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"])
280281

@@ -318,6 +319,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -
318319
content_type="unspecified",
319320
name="name",
320321
metadata={"foo": "string"},
322+
ttl_ms=0,
321323
)
322324
assert_matches_type(ObjectView, object_, path=["response"])
323325

@@ -393,12 +395,12 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None:
393395
@parametrize
394396
async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None:
395397
object_ = await async_client.objects.list(
396-
content_type="content_type",
398+
content_type="unspecified",
397399
limit=0,
398400
name="name",
399401
search="search",
400402
starting_after="starting_after",
401-
state="state",
403+
state="UPLOADING",
402404
)
403405
assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"])
404406

@@ -552,12 +554,12 @@ async def test_method_list_public(self, async_client: AsyncRunloop) -> None:
552554
@parametrize
553555
async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None:
554556
object_ = await async_client.objects.list_public(
555-
content_type="content_type",
557+
content_type="unspecified",
556558
limit=0,
557559
name="name",
558560
search="search",
559561
starting_after="starting_after",
560-
state="state",
562+
state="UPLOADING",
561563
)
562564
assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"])
563565

0 commit comments

Comments
 (0)