render_api/request/
delete_service.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 DeleteServiceRequest<'a> {
10    pub(crate) http_client: &'a RenderClient,
11    pub service_id: String,
12}
13impl<'a> DeleteServiceRequest<'a> {
14    pub async fn send(self) -> ::httpclient::InMemoryResult<()> {
15        let mut r = self
16            .http_client
17            .client
18            .delete(&format!("/services/{service_id}", service_id = self.service_id));
19        r = self.http_client.authenticate(r);
20        let res = r.await?;
21        res.json().map_err(Into::into)
22    }
23}
24impl<'a> ::std::future::IntoFuture for DeleteServiceRequest<'a> {
25    type Output = httpclient::InMemoryResult<()>;
26    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
27    fn into_future(self) -> Self::IntoFuture {
28        Box::pin(self.send())
29    }
30}