twilio/request/
delete_key.rs1use serde_json::json;
2use crate::model::*;
3use crate::TwilioClient;
4#[derive(Clone)]
8pub struct DeleteKeyRequest<'a> {
9 pub(crate) http_client: &'a TwilioClient,
10 pub account_sid: String,
11 pub sid: String,
12}
13impl<'a> DeleteKeyRequest<'a> {
14 pub async fn send(self) -> ::httpclient::InMemoryResult<()> {
15 let mut r = self
16 .http_client
17 .client
18 .delete(
19 &format!(
20 "/2010-04-01/Accounts/{account_sid}/Keys/{sid}.json", account_sid =
21 self.account_sid, sid = self.sid
22 ),
23 );
24 r = self.http_client.authenticate(r);
25 let res = r.send_awaiting_body().await?;
26 res.json()
27 }
28}
29impl<'a> ::std::future::IntoFuture for DeleteKeyRequest<'a> {
30 type Output = httpclient::InMemoryResult<()>;
31 type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
32 fn into_future(self) -> Self::IntoFuture {
33 Box::pin(self.send())
34 }
35}