use serde_json::json;
use crate::model::*;
use crate::SendgridClient;
pub struct DeleteV3ScopesRequestsRequestIdRequest<'a> {
pub(crate) client: &'a SendgridClient,
pub request_id: String,
}
impl<'a> DeleteV3ScopesRequestsRequestIdRequest<'a> {
pub async fn send(self) -> anyhow::Result<()> {
let mut r = self
.client
.client
.delete(
&format!(
"/v3/scopes/requests/{request_id}", request_id = self.request_id
),
);
r = self.client.authenticate(r);
let res = r.send().await.unwrap().error_for_status();
match res {
Ok(res) => Ok(()),
Err(res) => {
let text = res.text().await.map_err(|e| anyhow::anyhow!("{:?}", e))?;
Err(anyhow::anyhow!("{:?}", text))
}
}
}
}