pub struct DocumentUploadFileRequest {
pub key: String,
/* private fields */
}Expand description
File upload request (multipart/form-data)
Fields§
§key: StringBearer API key
Implementations§
Source§impl DocumentUploadFileRequest
impl DocumentUploadFileRequest
Sourcepub fn new(key: String, knowledge_id: impl AsRef<str>) -> Self
pub fn new(key: String, knowledge_id: impl AsRef<str>) -> Self
Create a new request for a specific knowledge base id
Sourcepub fn add_file_path(self, path: impl Into<PathBuf>) -> Self
pub fn add_file_path(self, path: impl Into<PathBuf>) -> Self
Add a local file path to upload
Sourcepub fn with_options(self, opts: UploadFileOptions) -> Self
pub fn with_options(self, opts: UploadFileOptions) -> Self
Set optional parameters
Sourcepub fn options_mut(&mut self) -> &mut UploadFileOptions
pub fn options_mut(&mut self) -> &mut UploadFileOptions
Mutable access to options for incremental configuration
Sourcepub async fn send(&self) -> ZaiResult<UploadFileResponse>
pub async fn send(&self) -> ZaiResult<UploadFileResponse>
Send multipart request and parse typed response
Trait Implementations§
Source§impl HttpClient for DocumentUploadFileRequest
impl HttpClient for DocumentUploadFileRequest
type Body = ()
type ApiUrl = String
type ApiKey = String
fn api_url(&self) -> &Self::ApiUrl
fn api_key(&self) -> &Self::ApiKey
fn body(&self) -> &Self::Body
Source§fn post(&self) -> impl Future<Output = ZaiResult<Response>> + Send
fn post(&self) -> impl Future<Output = ZaiResult<Response>> + Send
Sends a POST request to the API endpoint. Read more
Source§fn http_config(&self) -> Arc<HttpClientConfig>
fn http_config(&self) -> Arc<HttpClientConfig>
Get HTTP client configuration for this request Read more
Auto Trait Implementations§
impl Freeze for DocumentUploadFileRequest
impl RefUnwindSafe for DocumentUploadFileRequest
impl Send for DocumentUploadFileRequest
impl Sync for DocumentUploadFileRequest
impl Unpin for DocumentUploadFileRequest
impl UnsafeUnpin for DocumentUploadFileRequest
impl UnwindSafe for DocumentUploadFileRequest
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