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
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 BrandsListRequest<'a> {
    pub(crate) http_client: &'a JyveClient,
    pub id: Option<f64>,
    pub ids: Option<String>,
    pub is_active: Option<String>,
    pub name: Option<String>,
    pub page: Option<i64>,
    pub page_size: Option<i64>,
}
impl<'a> BrandsListRequest<'a> {
    pub async fn send(self) -> ::httpclient::InMemoryResult<Vec<Brand>> {
        let mut r = self.http_client.client.get("/brands/");
        if let Some(ref unwrapped) = self.id {
            r = r.query("id", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.ids {
            r = r.query("ids", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.is_active {
            r = r.query("is_active", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.name {
            r = r.query("name", &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());
        }
        r = self.http_client.authenticate(r);
        let res = r.send_awaiting_body().await?;
        res.json()
    }
    pub fn id(mut self, id: f64) -> Self {
        self.id = Some(id);
        self
    }
    pub fn ids(mut self, ids: &str) -> Self {
        self.ids = Some(ids.to_owned());
        self
    }
    pub fn is_active(mut self, is_active: &str) -> Self {
        self.is_active = Some(is_active.to_owned());
        self
    }
    pub fn name(mut self, name: &str) -> Self {
        self.name = Some(name.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
    }
}
impl<'a> ::std::future::IntoFuture for BrandsListRequest<'a> {
    type Output = httpclient::InMemoryResult<Vec<Brand>>;
    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
    fn into_future(self) -> Self::IntoFuture {
        Box::pin(self.send())
    }
}