twilio/request/
fetch_incoming_phone_number_assigned_add_on_extension.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 FetchIncomingPhoneNumberAssignedAddOnExtensionRequest<'a> {
9    pub(crate) http_client: &'a TwilioClient,
10    pub account_sid: String,
11    pub assigned_add_on_sid: String,
12    pub resource_sid: String,
13    pub sid: String,
14}
15impl<'a> FetchIncomingPhoneNumberAssignedAddOnExtensionRequest<'a> {
16    pub async fn send(
17        self,
18    ) -> ::httpclient::InMemoryResult<
19        ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOnIncomingPhoneNumberAssignedAddOnExtension,
20    > {
21        let mut r = self
22            .http_client
23            .client
24            .get(
25                &format!(
26                    "/2010-04-01/Accounts/{account_sid}/IncomingPhoneNumbers/{resource_sid}/AssignedAddOns/{assigned_add_on_sid}/Extensions/{sid}.json",
27                    account_sid = self.account_sid, assigned_add_on_sid = self
28                    .assigned_add_on_sid, resource_sid = self.resource_sid, sid = self
29                    .sid
30                ),
31            );
32        r = self.http_client.authenticate(r);
33        let res = r.send_awaiting_body().await?;
34        res.json()
35    }
36}
37pub struct FetchIncomingPhoneNumberAssignedAddOnExtensionRequired<'a> {
38    pub account_sid: &'a str,
39    pub assigned_add_on_sid: &'a str,
40    pub resource_sid: &'a str,
41    pub sid: &'a str,
42}
43impl<'a> FetchIncomingPhoneNumberAssignedAddOnExtensionRequired<'a> {}
44impl<'a> ::std::future::IntoFuture
45for FetchIncomingPhoneNumberAssignedAddOnExtensionRequest<'a> {
46    type Output = httpclient::InMemoryResult<
47        ApiV2010AccountIncomingPhoneNumberIncomingPhoneNumberAssignedAddOnIncomingPhoneNumberAssignedAddOnExtension,
48    >;
49    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
50    fn into_future(self) -> Self::IntoFuture {
51        Box::pin(self.send())
52    }
53}