twilio/request/
fetch_sip_ip_address.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 FetchSipIpAddressRequest<'a> {
9    pub(crate) http_client: &'a TwilioClient,
10    pub account_sid: String,
11    pub ip_access_control_list_sid: String,
12    pub sid: String,
13}
14impl<'a> FetchSipIpAddressRequest<'a> {
15    pub async fn send(
16        self,
17    ) -> ::httpclient::InMemoryResult<
18        ApiV2010AccountSipSipIpAccessControlListSipIpAddress,
19    > {
20        let mut r = self
21            .http_client
22            .client
23            .get(
24                &format!(
25                    "/2010-04-01/Accounts/{account_sid}/SIP/IpAccessControlLists/{ip_access_control_list_sid}/IpAddresses/{sid}.json",
26                    account_sid = self.account_sid, ip_access_control_list_sid = self
27                    .ip_access_control_list_sid, sid = self.sid
28                ),
29            );
30        r = self.http_client.authenticate(r);
31        let res = r.send_awaiting_body().await?;
32        res.json()
33    }
34}
35impl<'a> ::std::future::IntoFuture for FetchSipIpAddressRequest<'a> {
36    type Output = httpclient::InMemoryResult<
37        ApiV2010AccountSipSipIpAccessControlListSipIpAddress,
38    >;
39    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
40    fn into_future(self) -> Self::IntoFuture {
41        Box::pin(self.send())
42    }
43}