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