twilio/request/
fetch_member.rs

1use serde_json::json;
2use crate::model::*;
3use crate::TwilioClient;
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 FetchMemberRequest<'a> {
9    pub(crate) http_client: &'a TwilioClient,
10    pub account_sid: String,
11    pub call_sid: String,
12    pub queue_sid: String,
13}
14impl<'a> FetchMemberRequest<'a> {
15    pub async fn send(self) -> ::httpclient::InMemoryResult<ApiV2010AccountQueueMember> {
16        let mut r = self
17            .http_client
18            .client
19            .get(
20                &format!(
21                    "/2010-04-01/Accounts/{account_sid}/Queues/{queue_sid}/Members/{call_sid}.json",
22                    account_sid = self.account_sid, call_sid = self.call_sid, queue_sid =
23                    self.queue_sid
24                ),
25            );
26        r = self.http_client.authenticate(r);
27        let res = r.send_awaiting_body().await?;
28        res.json()
29    }
30}
31impl<'a> ::std::future::IntoFuture for FetchMemberRequest<'a> {
32    type Output = httpclient::InMemoryResult<ApiV2010AccountQueueMember>;
33    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
34    fn into_future(self) -> Self::IntoFuture {
35        Box::pin(self.send())
36    }
37}