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