render_api/request/
retrieve_user_or_team.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 RetrieveUserOrTeamRequest<'a> {
10    pub(crate) http_client: &'a RenderClient,
11    pub owner_id: String,
12}
13impl<'a> RetrieveUserOrTeamRequest<'a> {
14    pub async fn send(self) -> ::httpclient::InMemoryResult<serde_json::Value> {
15        let mut r = self
16            .http_client
17            .client
18            .get(&format!("/owners/{owner_id}", owner_id = self.owner_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 RetrieveUserOrTeamRequest<'a> {
25    type Output = httpclient::InMemoryResult<serde_json::Value>;
26    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
27    fn into_future(self) -> Self::IntoFuture {
28        Box::pin(self.send())
29    }
30}