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