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