Storage Object¶
The AsyncStorageObject class provides asynchronous methods for managing storage objects.
Storage object resource class for asynchronous operations.
- class runloop_api_client.sdk.async_storage_object.AsyncStorageObject(client, object_id, upload_url)[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.
- Parameters:
- Raises:
RuntimeError – If no upload URL is available
httpx.HTTPStatusError – Propagated from the underlying
httpxclient when the upload fails
- Return type:
None