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
use crate::Client;
use crate::ClientResult;
pub struct ChatScheduledMessages {
pub client: Client,
}
impl ChatScheduledMessages {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
ChatScheduledMessages { client }
}
/**
* This function performs a `GET` to the `/chat.scheduledMessages.list` endpoint.
*
* Returns a list of scheduled messages.
*
* FROM: <https://api.slack.com/methods/chat.scheduledMessages.list>
*
* **Parameters:**
*
* * `token: &str` -- Authentication token. Requires scope: `none`.
* * `channel: &str` -- The channel of the scheduled messages.
* * `latest: f64` -- A UNIX timestamp of the latest value in the time range.
* * `oldest: f64` -- A UNIX timestamp of the oldest value in the time range.
* * `limit: i64` -- Maximum number of original entries to return.
* * `cursor: &str` -- For pagination purposes, this is the `cursor` value returned from a previous call to `chat.scheduledmessages.list` indicating where you want to start this call from.
*/
pub async fn list(
&self,
channel: &str,
latest: f64,
oldest: f64,
limit: i64,
cursor: &str,
) -> ClientResult<crate::Response<crate::types::ChatScheduledMessagesListSchema>> {
let mut query_args: Vec<(String, String)> = Default::default();
if !channel.is_empty() {
query_args.push(("channel".to_string(), channel.to_string()));
}
if !cursor.is_empty() {
query_args.push(("cursor".to_string(), cursor.to_string()));
}
if !latest.to_string().is_empty() {
query_args.push(("latest".to_string(), latest.to_string()));
}
if limit > 0 {
query_args.push(("limit".to_string(), limit.to_string()));
}
if !oldest.to_string().is_empty() {
query_args.push(("oldest".to_string(), oldest.to_string()));
}
let query_ = serde_urlencoded::to_string(&query_args).unwrap();
let url = self
.client
.url(&format!("/chat.scheduledMessages.list?{}", query_), None);
self.client
.get(
&url,
crate::Message {
body: None,
content_type: None,
},
)
.await
}
}