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