use crate::client::ZaiClient;
pub struct FileDeleteRequest {
file_id: String,
}
impl FileDeleteRequest {
pub fn new(file_id: impl Into<String>) -> Self {
Self {
file_id: file_id.into(),
}
}
pub async fn send_via(
&self,
client: &ZaiClient,
) -> crate::ZaiResult<super::response::FileDeleteResponse> {
crate::client::validation::require_non_blank(&self.file_id, "file_id")?;
let route = crate::client::routes::FILES_DELETE;
let url = client.endpoints().resolve_route(route, &[&self.file_id])?;
client
.send_empty::<super::response::FileDeleteResponse>(route.method(), url)
.await
}
}