openai/request/
create_transcription.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 CreateTranscriptionRequest<'a> {
9    pub(crate) http_client: &'a OpenAiClient,
10}
11impl<'a> CreateTranscriptionRequest<'a> {
12    pub async fn send(
13        self,
14    ) -> ::httpclient::InMemoryResult<CreateTranscriptionResponse> {
15        let mut r = self.http_client.client.post("/audio/transcriptions");
16        r = self.http_client.authenticate(r);
17        let res = r.send_awaiting_body().await?;
18        res.json()
19    }
20}
21impl<'a> ::std::future::IntoFuture for CreateTranscriptionRequest<'a> {
22    type Output = httpclient::InMemoryResult<CreateTranscriptionResponse>;
23    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
24    fn into_future(self) -> Self::IntoFuture {
25        Box::pin(self.send())
26    }
27}