Storage Object

Storage object resource class for asynchronous operations.

class runloop_api_client.sdk.async_storage_object.AsyncStorageObject(client, object_id, upload_url, upload_headers=None)[source]

Async 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

async refresh(**options)[source]

Fetch the latest metadata for the object.

Parameters:

options (Unpack[BaseRequestOptions]) – Optional request configuration

Returns:

Updated object metadata

Return type:

ObjectView

async 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

async 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

async 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

async 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

async 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

async upload_content(content)[source]

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

The URL and required headers are sensitive upload credentials. Requests use the configured HTTP transport, but not its default headers, cookies, or auth. Custom transport implementations and event hooks must preserve this isolation. Uploads are not retried and redirects are not followed.

Parameters:

content (str | bytes | Iterable[bytes]) – Bytes payload, text payload, or an iterable streaming bytes

Returns:

None

Return type:

None

Raises:
  • RuntimeError – If no upload URL is available

  • httpx.HTTPStatusError – If storage rejects the upload (message excludes signed credentials)

  • httpx.RequestError – If the upload cannot be sent

as_build_context()[source]

Return this object in the shape expected for a Blueprint build context.

The returned mapping can be passed directly to build_context when creating a blueprint.

Returns:

Mapping suitable for use as a blueprint build context

Return type:

BuildContext