pub struct FilesResource { /* private fields */ }Expand description
Stored files — /api/v2/files (recordings, prompts and backups).
Implementations§
Source§impl FilesResource
impl FilesResource
Sourcepub async fn list_all(&self) -> Result<Vec<StoredFile>, ManagerError>
pub async fn list_all(&self) -> Result<Vec<StoredFile>, ManagerError>
List all files (auto-paginated).
Sourcepub async fn list_page(
&self,
page: i32,
per_page: Option<i32>,
file_type: Option<StorageType>,
) -> Result<Page<StoredFile>, ManagerError>
pub async fn list_page( &self, page: i32, per_page: Option<i32>, file_type: Option<StorageType>, ) -> Result<Page<StoredFile>, ManagerError>
List one page of files, optionally narrowed to one storage type.
Sourcepub async fn list_by_type(
&self,
file_type: StorageType,
) -> Result<Vec<StoredFile>, ManagerError>
pub async fn list_by_type( &self, file_type: StorageType, ) -> Result<Vec<StoredFile>, ManagerError>
List files of a given storage type (single, non-paginated response).
Sourcepub async fn backups(&self) -> Result<Vec<StoredFile>, ManagerError>
pub async fn backups(&self) -> Result<Vec<StoredFile>, ManagerError>
List all backup files.
Sourcepub async fn recordings(&self) -> Result<Vec<StoredFile>, ManagerError>
pub async fn recordings(&self) -> Result<Vec<StoredFile>, ManagerError>
List all recording files.
Sourcepub async fn prompts(&self) -> Result<Vec<StoredFile>, ManagerError>
pub async fn prompts(&self) -> Result<Vec<StoredFile>, ManagerError>
List all prompt files.
Sourcepub async fn get(
&self,
id: &str,
) -> Result<StoredFileItemResponse, ManagerError>
pub async fn get( &self, id: &str, ) -> Result<StoredFileItemResponse, ManagerError>
Get a file by id.
Sourcepub async fn delete(
&self,
id: &str,
) -> Result<DefaultV2MessageResponse, ManagerError>
pub async fn delete( &self, id: &str, ) -> Result<DefaultV2MessageResponse, ManagerError>
Delete a file by id.
Sourcepub async fn download(&self, id: &str) -> Result<(), ManagerError>
pub async fn download(&self, id: &str) -> Result<(), ManagerError>
Trigger a download for a file by id.
The underlying endpoint redirects to a download link; the generated client discards the
response body, so this returns () once the server-side download has been triggered.
Use bulk_download / bulk_download_post
when you need the actual bytes.
Sourcepub async fn bulk_delete(
&self,
ids: Vec<String>,
) -> Result<DefaultV2MessageResponse, ManagerError>
pub async fn bulk_delete( &self, ids: Vec<String>, ) -> Result<DefaultV2MessageResponse, ManagerError>
Bulk-delete files by id. Each id must be a valid UUID.
Sourcepub async fn bulk_download(
&self,
ids: Vec<String>,
) -> Result<Vec<u8>, ManagerError>
pub async fn bulk_download( &self, ids: Vec<String>, ) -> Result<Vec<u8>, ManagerError>
Download multiple files as a ZIP archive (GET), returning the raw bytes.
Sourcepub async fn bulk_download_post(
&self,
ids: Vec<String>,
) -> Result<Vec<u8>, ManagerError>
pub async fn bulk_download_post( &self, ids: Vec<String>, ) -> Result<Vec<u8>, ManagerError>
Download multiple files as a ZIP archive (POST), returning the raw bytes.
Each id must be a valid UUID.