pub struct FilesClient<'a> { /* private fields */ }Expand description
Domain client for file endpoints.
Implementations§
Source§impl<'a> FilesClient<'a>
impl<'a> FilesClient<'a>
Sourcepub async fn list(
&self,
limit: Option<u32>,
cursor: Option<&str>,
workspace_id: Option<&str>,
) -> Result<FileListResponse, OpenRouterError>
pub async fn list( &self, limit: Option<u32>, cursor: Option<&str>, workspace_id: Option<&str>, ) -> Result<FileListResponse, OpenRouterError>
List files (GET /files).
Sourcepub async fn upload(
&self,
request: &UploadFileRequest,
workspace_id: Option<&str>,
) -> Result<FileMetadata, OpenRouterError>
pub async fn upload( &self, request: &UploadFileRequest, workspace_id: Option<&str>, ) -> Result<FileMetadata, OpenRouterError>
Upload a file (POST /files).
Sourcepub async fn get_metadata(
&self,
file_id: &str,
workspace_id: Option<&str>,
) -> Result<FileMetadata, OpenRouterError>
pub async fn get_metadata( &self, file_id: &str, workspace_id: Option<&str>, ) -> Result<FileMetadata, OpenRouterError>
Get file metadata (GET /files/{file_id}).
Sourcepub async fn download_content(
&self,
file_id: &str,
workspace_id: Option<&str>,
) -> Result<Vec<u8>, OpenRouterError>
pub async fn download_content( &self, file_id: &str, workspace_id: Option<&str>, ) -> Result<Vec<u8>, OpenRouterError>
Download file content (GET /files/{file_id}/content).
Sourcepub async fn delete(
&self,
file_id: &str,
workspace_id: Option<&str>,
) -> Result<FileDeleteResponse, OpenRouterError>
pub async fn delete( &self, file_id: &str, workspace_id: Option<&str>, ) -> Result<FileDeleteResponse, OpenRouterError>
Delete a file (DELETE /files/{file_id}).
Trait Implementations§
Source§impl<'a> Clone for FilesClient<'a>
impl<'a> Clone for FilesClient<'a>
Source§fn clone(&self) -> FilesClient<'a>
fn clone(&self) -> FilesClient<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for FilesClient<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for FilesClient<'a>
impl<'a> !UnwindSafe for FilesClient<'a>
impl<'a> Freeze for FilesClient<'a>
impl<'a> Send for FilesClient<'a>
impl<'a> Sync for FilesClient<'a>
impl<'a> Unpin for FilesClient<'a>
impl<'a> UnsafeUnpin for FilesClient<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more