1use crate::client::ZaiClient;
2
3pub struct FileDeleteRequest {
5 file_id: String,
6}
7
8impl FileDeleteRequest {
9 pub fn new(file_id: impl Into<String>) -> Self {
11 Self {
12 file_id: file_id.into(),
13 }
14 }
15
16 pub async fn send_via(
18 &self,
19 client: &ZaiClient,
20 ) -> crate::ZaiResult<super::response::FileDeleteResponse> {
21 crate::client::validation::require_non_blank(&self.file_id, "file_id")?;
22 let route = crate::client::routes::FILES_DELETE;
23 let url = client.endpoints().resolve_route(route, &[&self.file_id])?;
24 client
25 .send_empty::<super::response::FileDeleteResponse>(route.method(), url)
26 .await
27 }
28}