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
use serde_json::json;
use crate::model::*;
use crate::TwilioClient;
/**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 ListNotificationRequest<'a> {
    pub(crate) http_client: &'a TwilioClient,
    pub account_sid: String,
    pub log: Option<i64>,
    pub message_date: Option<chrono::NaiveDate>,
    pub message_date_gt: Option<chrono::NaiveDate>,
    pub message_date_lt: Option<chrono::NaiveDate>,
    pub page: Option<i64>,
    pub page_size: Option<i64>,
    pub page_token: Option<String>,
}
impl<'a> ListNotificationRequest<'a> {
    pub async fn send(self) -> ::httpclient::InMemoryResult<serde_json::Value> {
        let mut r = self
            .http_client
            .client
            .get(
                &format!(
                    "/2010-04-01/Accounts/{account_sid}/Notifications.json", account_sid
                    = self.account_sid
                ),
            );
        if let Some(ref unwrapped) = self.log {
            r = r.query("Log", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.message_date {
            r = r.query("MessageDate", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.message_date_gt {
            r = r.query("MessageDate_gt", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.message_date_lt {
            r = r.query("MessageDate_lt", &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("PageSize", &unwrapped.to_string());
        }
        if let Some(ref unwrapped) = self.page_token {
            r = r.query("PageToken", &unwrapped.to_string());
        }
        r = self.http_client.authenticate(r);
        let res = r.send_awaiting_body().await?;
        res.json()
    }
    pub fn log(mut self, log: i64) -> Self {
        self.log = Some(log);
        self
    }
    pub fn message_date(mut self, message_date: chrono::NaiveDate) -> Self {
        self.message_date = Some(message_date);
        self
    }
    pub fn message_date_gt(mut self, message_date_gt: chrono::NaiveDate) -> Self {
        self.message_date_gt = Some(message_date_gt);
        self
    }
    pub fn message_date_lt(mut self, message_date_lt: chrono::NaiveDate) -> Self {
        self.message_date_lt = Some(message_date_lt);
        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 page_token(mut self, page_token: &str) -> Self {
        self.page_token = Some(page_token.to_owned());
        self
    }
}
impl<'a> ::std::future::IntoFuture for ListNotificationRequest<'a> {
    type Output = httpclient::InMemoryResult<serde_json::Value>;
    type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>;
    fn into_future(self) -> Self::IntoFuture {
        Box::pin(self.send())
    }
}