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