openai/request/
delete_model.rs

1use serde_json::json;
2use crate::model::*;
3use crate::OpenAiClient;
4/**Create this with the associated client method.
5
6That method takes required values as arguments. Set optional values using builder methods on this struct.*/
7#[derive(Clone)]
8pub struct DeleteModelRequest<'a> {
9    pub(crate) http_client: &'a OpenAiClient,
10    pub model: String,
11}
12impl<'a> DeleteModelRequest<'a> {
13    pub async fn send(self) -> ::httpclient::InMemoryResult<DeleteModelResponse> {
14        let mut r = self
15            .http_client
16            .client
17            .delete(&format!("/models/{model}", model = self.model));
18        r = self.http_client.authenticate(r);
19        let res = r.send_awaiting_body().await?;
20        res.json()
21    }
22}
23impl<'a> ::std::future::IntoFuture for DeleteModelRequest<'a> {
24    type Output = httpclient::InMemoryResult<DeleteModelResponse>;
25    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
26    fn into_future(self) -> Self::IntoFuture {
27        Box::pin(self.send())
28    }
29}