render_api/request/
delete_custom_domain.rs

1use serde_json::json;
2use crate::model::*;
3use crate::RenderClient;
4use httpclient::InMemoryResponseExt;
5/**Create this with the associated client method.
6
7That method takes required values as arguments. Set optional values using builder methods on this struct.*/
8#[derive(Clone)]
9pub struct DeleteCustomDomainRequest<'a> {
10    pub(crate) http_client: &'a RenderClient,
11    pub custom_domain_id_or_name: String,
12    pub service_id: String,
13}
14impl<'a> DeleteCustomDomainRequest<'a> {
15    pub async fn send(self) -> ::httpclient::InMemoryResult<()> {
16        let mut r = self
17            .http_client
18            .client
19            .delete(
20                &format!(
21                    "/services/{service_id}/custom-domains/{custom_domain_id_or_name}",
22                    custom_domain_id_or_name = self.custom_domain_id_or_name, service_id
23                    = self.service_id
24                ),
25            );
26        r = self.http_client.authenticate(r);
27        let res = r.await?;
28        res.json().map_err(Into::into)
29    }
30}
31impl<'a> ::std::future::IntoFuture for DeleteCustomDomainRequest<'a> {
32    type Output = httpclient::InMemoryResult<()>;
33    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
34    fn into_future(self) -> Self::IntoFuture {
35        Box::pin(self.send())
36    }
37}