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 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:
- 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:
- async get_download_url(**params)[source]¶
Request a signed download URL for the object.
- Parameters:
params (
Unpack[SDKObjectDownloadParams]) – SeeSDKObjectDownloadParamsfor available parameters- Returns:
URL + metadata describing the download
- Return type:
- async download_as_bytes(**params)[source]¶
Download the object contents as bytes.
- Parameters:
params (
Unpack[SDKObjectDownloadParams]) – SeeSDKObjectDownloadParamsfor available parameters- Returns:
Entire object payload
- Return type:
- async download_as_text(**params)[source]¶
Download the object contents as UTF-8 text.
- Parameters:
params (
Unpack[SDKObjectDownloadParams]) – SeeSDKObjectDownloadParamsfor available parameters- Returns:
Entire object payload decoded as UTF-8
- Return type:
- 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:
- 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
Storage object resource class for synchronous operations.
- class runloop_api_client.sdk.storage_object.StorageObject(client, object_id, upload_url, upload_headers=None)[source]¶
Wrapper around storage object operations, including uploads and downloads.
- 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:
- complete(**options)[source]¶
Mark the object as fully uploaded.
- Parameters:
options (
Unpack[LongRequestOptions]) – Optional long-running request configuration- Returns:
Finalized object metadata
- Return type:
- get_download_url(**params)[source]¶
Request a signed download URL for the object.
- Parameters:
params (
Unpack[SDKObjectDownloadParams]) – SeeSDKObjectDownloadParamsfor available parameters- Returns:
URL + metadata describing the download
- Return type:
- download_as_bytes(**params)[source]¶
Download the object contents as bytes.
- Parameters:
params (
Unpack[SDKObjectDownloadParams]) – SeeSDKObjectDownloadParamsfor available parameters- Returns:
Entire object payload
- Return type:
- download_as_text(**params)[source]¶
Download the object contents as UTF-8 text.
- Parameters:
params (
Unpack[SDKObjectDownloadParams]) – SeeSDKObjectDownloadParamsfor available parameters- Returns:
Entire object payload decoded as UTF-8
- Return type:
- 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:
- 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