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