twilio/request/
create_incoming_phone_number_assigned_add_on.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 CreateIncomingPhoneNumberAssignedAddOnRequest<'a> {
9    pub(crate) http_client: &'a TwilioClient,
10    pub account_sid: String,
11    pub resource_sid: String,
12}
13impl<'a> CreateIncomingPhoneNumberAssignedAddOnRequest<'a> {
14    pub async fn send(
15        self,
16    ) -> ::httpclient::InMemoryResult<
17        ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOn,
18    > {
19        let mut r = self
20            .http_client
21            .client
22            .post(
23                &format!(
24                    "/2010-04-01/Accounts/{account_sid}/IncomingPhoneNumbers/{resource_sid}/AssignedAddOns.json",
25                    account_sid = self.account_sid, resource_sid = self.resource_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
34for CreateIncomingPhoneNumberAssignedAddOnRequest<'a> {
35    type Output = httpclient::InMemoryResult<
36        ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOn,
37    >;
38    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
39    fn into_future(self) -> Self::IntoFuture {
40        Box::pin(self.send())
41    }
42}