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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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 JobTemplatesListRequest<'a> {
    pub(crate) http_client: &'a JyveClient,
    pub brand_public_id: Option<String>,
    pub is_archived: Option<String>,
    pub page: Option<i64>,
    pub page_size: Option<i64>,
    pub q: Option<String>,
    pub with_jobs_completed_on_gte: Option<String>,
    pub with_jobs_completed_on_lte: Option<String>,
    pub with_jobs_starting_on_gte: Option<String>,
    pub with_jobs_starting_on_lte: Option<String>,
}
impl<'a> JobTemplatesListRequest<'a> {
    pub async fn send(self) -> ::httpclient::InMemoryResult<Vec<BasicJobTemplate>> {
        let mut r = self.http_client.client.get("/job_templates/");
        if let Some(ref unwrapped) = self.brand_public_id {
            r = r.query("brand__public_id", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.is_archived {
            r = r.query("is_archived", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.page {
            r = r.query("page", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.page_size {
            r = r.query("page_size", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.q {
            r = r.query("q", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.with_jobs_completed_on_gte {
            r = r.query("with_jobs_completed_on__gte", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.with_jobs_completed_on_lte {
            r = r.query("with_jobs_completed_on__lte", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.with_jobs_starting_on_gte {
            r = r.query("with_jobs_starting_on__gte", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.with_jobs_starting_on_lte {
            r = r.query("with_jobs_starting_on__lte", &unwrapped.to_string());
        }
        r = self.http_client.authenticate(r);
        let res = r.send_awaiting_body().await?;
        res.json()
    }
    pub fn brand_public_id(mut self, brand_public_id: &str) -> Self {
        self.brand_public_id = Some(brand_public_id.to_owned());
        self
    }
    pub fn is_archived(mut self, is_archived: &str) -> Self {
        self.is_archived = Some(is_archived.to_owned());
        self
    }
    pub fn page(mut self, page: i64) -> Self {
        self.page = Some(page);
        self
    }
    pub fn page_size(mut self, page_size: i64) -> Self {
        self.page_size = Some(page_size);
        self
    }
    pub fn q(mut self, q: &str) -> Self {
        self.q = Some(q.to_owned());
        self
    }
    pub fn with_jobs_completed_on_gte(mut self, with_jobs_completed_on_gte: &str) -> Self {
        self.with_jobs_completed_on_gte = Some(with_jobs_completed_on_gte.to_owned());
        self
    }
    pub fn with_jobs_completed_on_lte(mut self, with_jobs_completed_on_lte: &str) -> Self {
        self.with_jobs_completed_on_lte = Some(with_jobs_completed_on_lte.to_owned());
        self
    }
    pub fn with_jobs_starting_on_gte(mut self, with_jobs_starting_on_gte: &str) -> Self {
        self.with_jobs_starting_on_gte = Some(with_jobs_starting_on_gte.to_owned());
        self
    }
    pub fn with_jobs_starting_on_lte(mut self, with_jobs_starting_on_lte: &str) -> Self {
        self.with_jobs_starting_on_lte = Some(with_jobs_starting_on_lte.to_owned());
        self
    }
}
impl<'a> ::std::future::IntoFuture for JobTemplatesListRequest<'a> {
    type Output = httpclient::InMemoryResult<Vec<BasicJobTemplate>>;
    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
    fn into_future(self) -> Self::IntoFuture {
        Box::pin(self.send())
    }
}