twilio/request/
fetch_authorized_connect_app.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 FetchAuthorizedConnectAppRequest<'a> {
9    pub(crate) http_client: &'a TwilioClient,
10    pub account_sid: String,
11    pub connect_app_sid: String,
12}
13impl<'a> FetchAuthorizedConnectAppRequest<'a> {
14    pub async fn send(
15        self,
16    ) -> ::httpclient::InMemoryResult<ApiV2010AccountAuthorizedConnectApp> {
17        let mut r = self
18            .http_client
19            .client
20            .get(
21                &format!(
22                    "/2010-04-01/Accounts/{account_sid}/AuthorizedConnectApps/{connect_app_sid}.json",
23                    account_sid = self.account_sid, connect_app_sid = self
24                    .connect_app_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 FetchAuthorizedConnectAppRequest<'a> {
33    type Output = httpclient::InMemoryResult<ApiV2010AccountAuthorizedConnectApp>;
34    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
35    fn into_future(self) -> Self::IntoFuture {
36        Box::pin(self.send())
37    }
38}