Storage Object

The StorageObject class provides synchronous methods for managing storage objects.

Storage object resource class for synchronous operations.

class runloop_api_client.sdk.storage_object.StorageObject(client, object_id, upload_url)[source]

Wrapper around storage object operations, including uploads and downloads.

property id: str

Return the storage object identifier.

Returns:

Unique object ID

Return type:

str

property upload_url: str | None

Return the pre-signed upload URL, if available.

Returns:

Upload URL when the object is pending completion

Return type:

str | None

refresh(**options)[source]

Fetch the latest metadata for the object.

Parameters:

options (Unpack[BaseRequestOptions]) – Optional request configuration

Returns:

Updated object metadata

Return type:

ObjectView

complete(**options)[source]

Mark the object as fully uploaded.

Parameters:

options (Unpack[LongRequestOptions]) – Optional long-running request configuration

Returns:

Finalized object metadata

Return type:

ObjectView

get_download_url(**params)[source]

Request a signed download URL for the object.

Parameters:

params (Unpack[SDKObjectDownloadParams]) – See SDKObjectDownloadParams for available parameters

Returns:

URL + metadata describing the download

Return type:

ObjectDownloadURLView

download_as_bytes(**params)[source]

Download the object contents as bytes.

Parameters:

params (Unpack[SDKObjectDownloadParams]) – See SDKObjectDownloadParams for available parameters

Returns:

Entire object payload

Return type:

bytes

download_as_text(**params)[source]

Download the object contents as UTF-8 text.

Parameters:

params (Unpack[SDKObjectDownloadParams]) – See SDKObjectDownloadParams for available parameters

Returns:

Entire object payload decoded as UTF-8

Return type:

str

delete(**options)[source]

Delete the storage object.

Parameters:

options (Unpack[LongRequestOptions]) – Optional long-running request configuration

Returns:

API response for the deleted object

Return type:

ObjectView

upload_content(content)[source]

Upload content to the object’s pre-signed URL.

Parameters:

content (str | bytes) – Bytes or text payload to upload

Raises:
  • RuntimeError – If no upload URL is available

  • httpx.HTTPStatusError – Propagated from the underlying httpx client when the upload fails

Return type:

None