1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use crate::model::*;
use crate::JyveClient;
use serde_json::json;
/**Create this with the associated client method.

That method takes required values as arguments. Set optional values using builder methods on this struct.*/
#[derive(Clone)]
pub struct JobsDetailResetRequest<'a> {
    pub(crate) http_client: &'a JyveClient,
    pub data: Job,
    pub id: i64,
}
impl<'a> JobsDetailResetRequest<'a> {
    pub async fn send(self) -> ::httpclient::InMemoryResult<Job> {
        let mut r = self.http_client.client.post(&format!("/jobs/{id}/reset/", id = self.id));
        r = r.json(json!({ "data" : self.data }));
        r = self.http_client.authenticate(r);
        let res = r.send_awaiting_body().await?;
        res.json()
    }
}
impl<'a> ::std::future::IntoFuture for JobsDetailResetRequest<'a> {
    type Output = httpclient::InMemoryResult<Job>;
    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
    fn into_future(self) -> Self::IntoFuture {
        Box::pin(self.send())
    }
}