twilio/request/
fetch_recording.rs1use serde_json::json;
2use crate::model::*;
3use crate::TwilioClient;
4#[derive(Clone)]
8pub struct FetchRecordingRequest<'a> {
9 pub(crate) http_client: &'a TwilioClient,
10 pub account_sid: String,
11 pub include_soft_deleted: Option<bool>,
12 pub sid: String,
13}
14impl<'a> FetchRecordingRequest<'a> {
15 pub async fn send(self) -> ::httpclient::InMemoryResult<ApiV2010AccountRecording> {
16 let mut r = self
17 .http_client
18 .client
19 .get(
20 &format!(
21 "/2010-04-01/Accounts/{account_sid}/Recordings/{sid}.json",
22 account_sid = self.account_sid, sid = self.sid
23 ),
24 );
25 if let Some(ref unwrapped) = self.include_soft_deleted {
26 r = r.query("IncludeSoftDeleted", &unwrapped.to_string());
27 }
28 r = self.http_client.authenticate(r);
29 let res = r.send_awaiting_body().await?;
30 res.json()
31 }
32 pub fn include_soft_deleted(mut self, include_soft_deleted: bool) -> Self {
33 self.include_soft_deleted = Some(include_soft_deleted);
34 self
35 }
36}
37impl<'a> ::std::future::IntoFuture for FetchRecordingRequest<'a> {
38 type Output = httpclient::InMemoryResult<ApiV2010AccountRecording>;
39 type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
40 fn into_future(self) -> Self::IntoFuture {
41 Box::pin(self.send())
42 }
43}