use serde_json::json;
use crate::model::*;
use crate::RenderClient;
use httpclient::InMemoryResponseExt;
#[derive(Clone)]
pub struct RetrieveCustomDomainRequest<'a> {
pub(crate) http_client: &'a RenderClient,
pub custom_domain_id_or_name: String,
pub service_id: String,
}
impl<'a> RetrieveCustomDomainRequest<'a> {
pub async fn send(self) -> ::httpclient::InMemoryResult<serde_json::Value> {
let mut r = self
.http_client
.client
.get(
&format!(
"/services/{service_id}/custom-domains/{custom_domain_id_or_name}",
custom_domain_id_or_name = self.custom_domain_id_or_name, service_id
= self.service_id
),
);
r = self.http_client.authenticate(r);
let res = r.await?;
res.json().map_err(Into::into)
}
}
impl<'a> ::std::future::IntoFuture for RetrieveCustomDomainRequest<'a> {
type Output = httpclient::InMemoryResult<serde_json::Value>;
type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
fn into_future(self) -> Self::IntoFuture {
Box::pin(self.send())
}
}