Skip to main content

slack_web_api/api/
chat.rs

1// このファイルは codegen/generate.py が生成する。手で編集しない
2
3#![allow(unused_imports)]
4
5use crate::objects::*;
6use crate::{
7    CursorPaginated, NextCursor, ResponseMetadata, SlackApiMethod, SlackClient, SlackError,
8};
9use serde::{Deserialize, Serialize};
10
11/// Arguments for the Slack Web API method [`chat.appendStream`](https://docs.slack.dev/reference/methods/chat.appendStream): Append text to an existing streaming conversation
12///
13/// Send it with [`SlackClient::chat_append_stream`].
14#[doc(alias = "chat.appendStream")]
15#[derive(Debug, Clone, PartialEq, Serialize)]
16#[non_exhaustive]
17pub struct ChatAppendStreamRequest {
18    /// An encoded ID that represents a channel, private group, or DM
19    pub channel: String,
20    /// The timestamp of the streaming message.
21    pub ts: String,
22    /// Array of streaming chunks.
23    #[serde(
24        skip_serializing_if = "Option::is_none",
25        serialize_with = "crate::form::as_json"
26    )]
27    pub chunks: Option<Vec<serde_json::Value>>,
28    /// Accepts message text formatted in markdown. Limit this field to 12,000 characters. This text is what will be appended to the message received so far.
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub markdown_text: Option<String>,
31}
32
33impl ChatAppendStreamRequest {
34    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
35        Self {
36            channel: channel.into(),
37            ts: ts.into(),
38            chunks: None,
39            markdown_text: None,
40        }
41    }
42
43    pub fn chunks(mut self, chunks: Vec<serde_json::Value>) -> Self {
44        self.chunks = Some(chunks);
45        self
46    }
47
48    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
49        self.markdown_text = Some(markdown_text.into());
50        self
51    }
52}
53
54impl SlackApiMethod for ChatAppendStreamRequest {
55    const METHOD: &'static str = "chat.appendStream";
56    type Response = ChatAppendStreamResponse;
57}
58
59/// Successful response of the Slack Web API method [`chat.appendStream`](https://docs.slack.dev/reference/methods/chat.appendStream).
60#[doc(alias = "chat.appendStream")]
61#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
62pub struct ChatAppendStreamResponse {
63    #[serde(
64        default,
65        deserialize_with = "crate::de::opt_string",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub channel: Option<String>,
69    #[serde(
70        default,
71        deserialize_with = "crate::de::opt_string",
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub ts: Option<String>,
75    #[serde(
76        default,
77        deserialize_with = "crate::de::opt_object",
78        skip_serializing_if = "Option::is_none"
79    )]
80    pub response_metadata: Option<ResponseMetadata>,
81    #[serde(
82        default,
83        deserialize_with = "crate::de::opt_string",
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub warning: Option<String>,
87}
88
89/// Arguments for the Slack Web API method [`chat.delete`](https://docs.slack.dev/reference/methods/chat.delete): Deletes a message.
90///
91/// Send it with [`SlackClient::chat_delete`].
92#[doc(alias = "chat.delete")]
93#[derive(Debug, Clone, PartialEq, Serialize)]
94#[non_exhaustive]
95pub struct ChatDeleteRequest {
96    /// Channel containing the message to be deleted.
97    pub channel: String,
98    /// Timestamp of the message to be deleted.
99    pub ts: String,
100    /// (Legacy) Pass true to delete the message as the authed user with `chat:write:user` scope. Bot users in this context are considered authed users. See [legacy `as_user` parameter](#legacy_as_user) below.
101    #[serde(skip_serializing_if = "Option::is_none")]
102    pub as_user: Option<bool>,
103}
104
105impl ChatDeleteRequest {
106    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
107        Self {
108            channel: channel.into(),
109            ts: ts.into(),
110            as_user: None,
111        }
112    }
113
114    pub fn as_user(mut self, as_user: bool) -> Self {
115        self.as_user = Some(as_user);
116        self
117    }
118}
119
120impl SlackApiMethod for ChatDeleteRequest {
121    const METHOD: &'static str = "chat.delete";
122    type Response = ChatDeleteResponse;
123}
124
125/// Successful response of the Slack Web API method [`chat.delete`](https://docs.slack.dev/reference/methods/chat.delete).
126#[doc(alias = "chat.delete")]
127#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
128pub struct ChatDeleteResponse {
129    #[serde(
130        default,
131        deserialize_with = "crate::de::opt_string",
132        skip_serializing_if = "Option::is_none"
133    )]
134    pub channel: Option<String>,
135    #[serde(
136        default,
137        deserialize_with = "crate::de::opt_string",
138        skip_serializing_if = "Option::is_none"
139    )]
140    pub ts: Option<String>,
141    #[serde(
142        default,
143        deserialize_with = "crate::de::opt_object",
144        skip_serializing_if = "Option::is_none"
145    )]
146    pub response_metadata: Option<ResponseMetadata>,
147    #[serde(
148        default,
149        deserialize_with = "crate::de::opt_string",
150        skip_serializing_if = "Option::is_none"
151    )]
152    pub warning: Option<String>,
153}
154
155/// Arguments for the Slack Web API method [`chat.deleteScheduledMessage`](https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage): Deletes a pending scheduled message from the queue.
156///
157/// Send it with [`SlackClient::chat_delete_scheduled_message`].
158#[doc(alias = "chat.deleteScheduledMessage")]
159#[derive(Debug, Clone, PartialEq, Serialize)]
160#[non_exhaustive]
161pub struct ChatDeleteScheduledMessageRequest {
162    /// The channel the scheduled\_message is posting to
163    pub channel: String,
164    /// `scheduled_message_id` returned from call to chat.scheduleMessage
165    pub scheduled_message_id: String,
166    /// Pass true to delete the message as the authed user with `chat:write:user` scope. Bot users in this context are considered authed users. If unused or false, the message will be deleted with `chat:write:bot` scope.
167    #[serde(skip_serializing_if = "Option::is_none")]
168    pub as_user: Option<bool>,
169}
170
171impl ChatDeleteScheduledMessageRequest {
172    pub fn new(channel: impl Into<String>, scheduled_message_id: impl Into<String>) -> Self {
173        Self {
174            channel: channel.into(),
175            scheduled_message_id: scheduled_message_id.into(),
176            as_user: None,
177        }
178    }
179
180    pub fn as_user(mut self, as_user: bool) -> Self {
181        self.as_user = Some(as_user);
182        self
183    }
184}
185
186impl SlackApiMethod for ChatDeleteScheduledMessageRequest {
187    const METHOD: &'static str = "chat.deleteScheduledMessage";
188    type Response = ChatDeleteScheduledMessageResponse;
189}
190
191/// Successful response of the Slack Web API method [`chat.deleteScheduledMessage`](https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage).
192#[doc(alias = "chat.deleteScheduledMessage")]
193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
194pub struct ChatDeleteScheduledMessageResponse {
195    /// Fields returned by Slack. This method has no documented response example.
196    #[serde(flatten)]
197    pub extra: serde_json::Map<String, serde_json::Value>,
198    #[serde(
199        default,
200        deserialize_with = "crate::de::opt_object",
201        skip_serializing_if = "Option::is_none"
202    )]
203    pub response_metadata: Option<ResponseMetadata>,
204    #[serde(
205        default,
206        deserialize_with = "crate::de::opt_string",
207        skip_serializing_if = "Option::is_none"
208    )]
209    pub warning: Option<String>,
210}
211
212/// Arguments for the Slack Web API method [`chat.getPermalink`](https://docs.slack.dev/reference/methods/chat.getPermalink): Retrieve a permalink URL for a specific extant message
213///
214/// Send it with [`SlackClient::chat_get_permalink`].
215#[doc(alias = "chat.getPermalink")]
216#[derive(Debug, Clone, PartialEq, Serialize)]
217#[non_exhaustive]
218pub struct ChatGetPermalinkRequest {
219    /// The ID of the conversation or channel containing the message
220    pub channel: String,
221    /// A message's `ts` value, uniquely identifying it within a channel
222    pub message_ts: String,
223}
224
225impl ChatGetPermalinkRequest {
226    pub fn new(channel: impl Into<String>, message_ts: impl Into<String>) -> Self {
227        Self {
228            channel: channel.into(),
229            message_ts: message_ts.into(),
230        }
231    }
232}
233
234impl SlackApiMethod for ChatGetPermalinkRequest {
235    const METHOD: &'static str = "chat.getPermalink";
236    type Response = ChatGetPermalinkResponse;
237}
238
239/// Successful response of the Slack Web API method [`chat.getPermalink`](https://docs.slack.dev/reference/methods/chat.getPermalink).
240#[doc(alias = "chat.getPermalink")]
241#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
242pub struct ChatGetPermalinkResponse {
243    #[serde(
244        default,
245        deserialize_with = "crate::de::opt_string",
246        skip_serializing_if = "Option::is_none"
247    )]
248    pub channel: Option<String>,
249    #[serde(
250        default,
251        deserialize_with = "crate::de::opt_string",
252        skip_serializing_if = "Option::is_none"
253    )]
254    pub permalink: Option<String>,
255    #[serde(
256        default,
257        deserialize_with = "crate::de::opt_object",
258        skip_serializing_if = "Option::is_none"
259    )]
260    pub response_metadata: Option<ResponseMetadata>,
261    #[serde(
262        default,
263        deserialize_with = "crate::de::opt_string",
264        skip_serializing_if = "Option::is_none"
265    )]
266    pub warning: Option<String>,
267}
268
269/// Arguments for the Slack Web API method [`chat.meMessage`](https://docs.slack.dev/reference/methods/chat.meMessage): Share a me message into a channel.
270///
271/// Send it with [`SlackClient::chat_me_message`].
272#[doc(alias = "chat.meMessage")]
273#[derive(Debug, Clone, PartialEq, Serialize)]
274#[non_exhaustive]
275pub struct ChatMeMessageRequest {
276    /// Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.
277    pub channel: String,
278    /// Text of the message to send.
279    pub text: String,
280}
281
282impl ChatMeMessageRequest {
283    pub fn new(channel: impl Into<String>, text: impl Into<String>) -> Self {
284        Self {
285            channel: channel.into(),
286            text: text.into(),
287        }
288    }
289}
290
291impl SlackApiMethod for ChatMeMessageRequest {
292    const METHOD: &'static str = "chat.meMessage";
293    type Response = ChatMeMessageResponse;
294}
295
296/// Successful response of the Slack Web API method [`chat.meMessage`](https://docs.slack.dev/reference/methods/chat.meMessage).
297#[doc(alias = "chat.meMessage")]
298#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
299pub struct ChatMeMessageResponse {
300    #[serde(
301        default,
302        deserialize_with = "crate::de::opt_string",
303        skip_serializing_if = "Option::is_none"
304    )]
305    pub channel: Option<String>,
306    #[serde(
307        default,
308        deserialize_with = "crate::de::opt_string",
309        skip_serializing_if = "Option::is_none"
310    )]
311    pub ts: Option<String>,
312    #[serde(
313        default,
314        deserialize_with = "crate::de::opt_object",
315        skip_serializing_if = "Option::is_none"
316    )]
317    pub response_metadata: Option<ResponseMetadata>,
318    #[serde(
319        default,
320        deserialize_with = "crate::de::opt_string",
321        skip_serializing_if = "Option::is_none"
322    )]
323    pub warning: Option<String>,
324}
325
326/// Arguments for the Slack Web API method [`chat.postEphemeral`](https://docs.slack.dev/reference/methods/chat.postEphemeral): Sends an ephemeral message to a user in a channel.
327///
328/// Send it with [`SlackClient::chat_post_ephemeral`].
329#[doc(alias = "chat.postEphemeral")]
330#[derive(Debug, Clone, PartialEq, Serialize)]
331#[non_exhaustive]
332pub struct ChatPostEphemeralRequest {
333    /// Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
334    pub channel: String,
335    /// `id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument.
336    pub user: String,
337    /// (Legacy) Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.
338    #[serde(skip_serializing_if = "Option::is_none")]
339    pub as_user: Option<bool>,
340    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
341    #[serde(
342        skip_serializing_if = "Option::is_none",
343        serialize_with = "crate::form::as_json"
344    )]
345    pub attachments: Option<Vec<crate::blocks::Attachment>>,
346    /// A JSON-based array of structured blocks, presented as a URL-encoded string.
347    #[serde(
348        skip_serializing_if = "Option::is_none",
349        serialize_with = "crate::form::as_json"
350    )]
351    pub blocks: Option<Vec<crate::blocks::Block>>,
352    /// Emoji to use as the icon for this message. Overrides `icon_url`.
353    #[serde(skip_serializing_if = "Option::is_none")]
354    pub icon_emoji: Option<String>,
355    /// URL to an image to use as the icon for this message.
356    #[serde(skip_serializing_if = "Option::is_none")]
357    pub icon_url: Option<String>,
358    /// Find and link channel names and usernames.
359    #[serde(skip_serializing_if = "Option::is_none")]
360    pub link_names: Option<bool>,
361    /// Accepts message text formatted in markdown. This argument should not be used in conjunction with `blocks` or `text`. Limit this field to 12,000 characters.
362    #[serde(skip_serializing_if = "Option::is_none")]
363    pub markdown_text: Option<String>,
364    /// JSON object with an `entities` array of work object entity metadata, presented as a URL-encoded string. Only entity metadata is supported: ephemeral messages are not persisted and never dispatch `message_metadata_*` events, so `event_type`/`event_payload` message metadata is ignored here. Each entity requires `entity_type`, `entity_payload`, `external_ref`, and `url`.
365    #[serde(skip_serializing_if = "Option::is_none")]
366    pub metadata: Option<crate::blocks::MessageMetadata>,
367    /// Change how messages are treated. Defaults to `none`. See [below](#formatting).
368    #[serde(skip_serializing_if = "Option::is_none")]
369    pub parse: Option<String>,
370    /// How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
371    #[serde(skip_serializing_if = "Option::is_none")]
372    pub text: Option<String>,
373    /// Provide another message's `ts` value to post this message in a thread. Avoid using a reply's `ts` value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread.
374    #[serde(skip_serializing_if = "Option::is_none")]
375    pub thread_ts: Option<String>,
376    /// Set your bot's user name.
377    #[serde(skip_serializing_if = "Option::is_none")]
378    pub username: Option<String>,
379}
380
381impl ChatPostEphemeralRequest {
382    pub fn new(channel: impl Into<String>, user: impl Into<String>) -> Self {
383        Self {
384            channel: channel.into(),
385            user: user.into(),
386            as_user: None,
387            attachments: None,
388            blocks: None,
389            icon_emoji: None,
390            icon_url: None,
391            link_names: None,
392            markdown_text: None,
393            metadata: None,
394            parse: None,
395            text: None,
396            thread_ts: None,
397            username: None,
398        }
399    }
400
401    pub fn as_user(mut self, as_user: bool) -> Self {
402        self.as_user = Some(as_user);
403        self
404    }
405
406    pub fn attachments(mut self, attachments: Vec<crate::blocks::Attachment>) -> Self {
407        self.attachments = Some(attachments);
408        self
409    }
410
411    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
412        self.blocks = Some(blocks);
413        self
414    }
415
416    pub fn icon_emoji(mut self, icon_emoji: impl Into<String>) -> Self {
417        self.icon_emoji = Some(icon_emoji.into());
418        self
419    }
420
421    pub fn icon_url(mut self, icon_url: impl Into<String>) -> Self {
422        self.icon_url = Some(icon_url.into());
423        self
424    }
425
426    pub fn link_names(mut self, link_names: bool) -> Self {
427        self.link_names = Some(link_names);
428        self
429    }
430
431    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
432        self.markdown_text = Some(markdown_text.into());
433        self
434    }
435
436    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
437        self.metadata = Some(metadata);
438        self
439    }
440
441    pub fn parse(mut self, parse: impl Into<String>) -> Self {
442        self.parse = Some(parse.into());
443        self
444    }
445
446    pub fn text(mut self, text: impl Into<String>) -> Self {
447        self.text = Some(text.into());
448        self
449    }
450
451    pub fn thread_ts(mut self, thread_ts: impl Into<String>) -> Self {
452        self.thread_ts = Some(thread_ts.into());
453        self
454    }
455
456    pub fn username(mut self, username: impl Into<String>) -> Self {
457        self.username = Some(username.into());
458        self
459    }
460}
461
462impl SlackApiMethod for ChatPostEphemeralRequest {
463    const METHOD: &'static str = "chat.postEphemeral";
464    type Response = ChatPostEphemeralResponse;
465}
466
467/// Successful response of the Slack Web API method [`chat.postEphemeral`](https://docs.slack.dev/reference/methods/chat.postEphemeral).
468#[doc(alias = "chat.postEphemeral")]
469#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
470pub struct ChatPostEphemeralResponse {
471    #[serde(
472        default,
473        deserialize_with = "crate::de::opt_string",
474        skip_serializing_if = "Option::is_none"
475    )]
476    pub message_ts: Option<String>,
477    #[serde(
478        default,
479        deserialize_with = "crate::de::opt_object",
480        skip_serializing_if = "Option::is_none"
481    )]
482    pub response_metadata: Option<ResponseMetadata>,
483    #[serde(
484        default,
485        deserialize_with = "crate::de::opt_string",
486        skip_serializing_if = "Option::is_none"
487    )]
488    pub warning: Option<String>,
489}
490
491/// Arguments for the Slack Web API method [`chat.postMessage`](https://docs.slack.dev/reference/methods/chat.postMessage): Sends a message to a channel.
492///
493/// Send it with [`SlackClient::chat_post_message`].
494#[doc(alias = "chat.postMessage")]
495#[derive(Debug, Clone, PartialEq, Serialize)]
496#[non_exhaustive]
497pub struct ChatPostMessageRequest {
498    /// An encoded ID or channel name that represents a channel, private group, or IM channel to send the message to. See [below](#channels) for more details.
499    pub channel: String,
500    /// (Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic apps. See [legacy `as_user` parameter](#legacy_as_user) below.
501    #[serde(skip_serializing_if = "Option::is_none")]
502    pub as_user: Option<bool>,
503    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
504    #[serde(
505        skip_serializing_if = "Option::is_none",
506        serialize_with = "crate::form::as_json"
507    )]
508    pub attachments: Option<Vec<crate::blocks::Attachment>>,
509    /// A JSON-based array of structured blocks, presented as a URL-encoded string.
510    #[serde(
511        skip_serializing_if = "Option::is_none",
512        serialize_with = "crate::form::as_json"
513    )]
514    pub blocks: Option<Vec<crate::blocks::Block>>,
515    /// This field represents the timestamp of the draft's last update at the time this API is called. If the current message is a draft, this field can be provided to ensure synchronization with the server.
516    #[serde(skip_serializing_if = "Option::is_none")]
517    pub current_draft_last_updated_ts: Option<String>,
518    /// Emoji to use as the icon for this message. Overrides `icon_url`.
519    #[serde(skip_serializing_if = "Option::is_none")]
520    pub icon_emoji: Option<String>,
521    /// URL to an image to use as the icon for this message.
522    #[serde(skip_serializing_if = "Option::is_none")]
523    pub icon_url: Option<String>,
524    /// Find and link user groups. No longer supports linking individual users; use syntax shown in [Mentioning Users](https://docs.slack.dev/messaging/formatting-message-text.md#mentioning-users) instead.
525    #[serde(skip_serializing_if = "Option::is_none")]
526    pub link_names: Option<bool>,
527    /// Accepts message text formatted in markdown. This argument should not be used in conjunction with `blocks` or `text`. Limit this field to 12,000 characters.
528    #[serde(skip_serializing_if = "Option::is_none")]
529    pub markdown_text: Option<String>,
530    /// JSON object with event\_type and event\_payload fields, presented as a URL-encoded string. You can also provide Work Object entity metadata using this parameter. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
531    #[serde(skip_serializing_if = "Option::is_none")]
532    pub metadata: Option<crate::blocks::MessageMetadata>,
533    /// Disable Slack markup parsing by setting to `false`. Enabled by default.
534    #[serde(skip_serializing_if = "Option::is_none")]
535    pub mrkdwn: Option<bool>,
536    /// Change how messages are treated. See [below](#formatting).
537    #[serde(skip_serializing_if = "Option::is_none")]
538    pub parse: Option<String>,
539    /// Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`.
540    #[serde(skip_serializing_if = "Option::is_none")]
541    pub reply_broadcast: Option<bool>,
542    /// How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
543    #[serde(skip_serializing_if = "Option::is_none")]
544    pub text: Option<String>,
545    /// Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead.
546    #[serde(skip_serializing_if = "Option::is_none")]
547    pub thread_ts: Option<String>,
548    /// Pass true to enable unfurling of primarily text-based content.
549    #[serde(skip_serializing_if = "Option::is_none")]
550    pub unfurl_links: Option<bool>,
551    /// Pass false to disable unfurling of media content.
552    #[serde(skip_serializing_if = "Option::is_none")]
553    pub unfurl_media: Option<bool>,
554    /// Set your bot's user name.
555    #[serde(skip_serializing_if = "Option::is_none")]
556    pub username: Option<String>,
557    /// Pass true to unfurl links from installed apps, or false to prevent app links from unfurling. When omitted, app links follow the `unfurl_links` setting.
558    #[serde(skip_serializing_if = "Option::is_none")]
559    pub unfurl_app_links: Option<bool>,
560}
561
562impl ChatPostMessageRequest {
563    pub fn new(channel: impl Into<String>) -> Self {
564        Self {
565            channel: channel.into(),
566            as_user: None,
567            attachments: None,
568            blocks: None,
569            current_draft_last_updated_ts: None,
570            icon_emoji: None,
571            icon_url: None,
572            link_names: None,
573            markdown_text: None,
574            metadata: None,
575            mrkdwn: None,
576            parse: None,
577            reply_broadcast: None,
578            text: None,
579            thread_ts: None,
580            unfurl_links: None,
581            unfurl_media: None,
582            username: None,
583            unfurl_app_links: None,
584        }
585    }
586
587    pub fn as_user(mut self, as_user: bool) -> Self {
588        self.as_user = Some(as_user);
589        self
590    }
591
592    pub fn attachments(mut self, attachments: Vec<crate::blocks::Attachment>) -> Self {
593        self.attachments = Some(attachments);
594        self
595    }
596
597    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
598        self.blocks = Some(blocks);
599        self
600    }
601
602    pub fn current_draft_last_updated_ts(
603        mut self,
604        current_draft_last_updated_ts: impl Into<String>,
605    ) -> Self {
606        self.current_draft_last_updated_ts = Some(current_draft_last_updated_ts.into());
607        self
608    }
609
610    pub fn icon_emoji(mut self, icon_emoji: impl Into<String>) -> Self {
611        self.icon_emoji = Some(icon_emoji.into());
612        self
613    }
614
615    pub fn icon_url(mut self, icon_url: impl Into<String>) -> Self {
616        self.icon_url = Some(icon_url.into());
617        self
618    }
619
620    pub fn link_names(mut self, link_names: bool) -> Self {
621        self.link_names = Some(link_names);
622        self
623    }
624
625    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
626        self.markdown_text = Some(markdown_text.into());
627        self
628    }
629
630    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
631        self.metadata = Some(metadata);
632        self
633    }
634
635    pub fn mrkdwn(mut self, mrkdwn: bool) -> Self {
636        self.mrkdwn = Some(mrkdwn);
637        self
638    }
639
640    pub fn parse(mut self, parse: impl Into<String>) -> Self {
641        self.parse = Some(parse.into());
642        self
643    }
644
645    pub fn reply_broadcast(mut self, reply_broadcast: bool) -> Self {
646        self.reply_broadcast = Some(reply_broadcast);
647        self
648    }
649
650    pub fn text(mut self, text: impl Into<String>) -> Self {
651        self.text = Some(text.into());
652        self
653    }
654
655    pub fn thread_ts(mut self, thread_ts: impl Into<String>) -> Self {
656        self.thread_ts = Some(thread_ts.into());
657        self
658    }
659
660    pub fn unfurl_links(mut self, unfurl_links: bool) -> Self {
661        self.unfurl_links = Some(unfurl_links);
662        self
663    }
664
665    pub fn unfurl_media(mut self, unfurl_media: bool) -> Self {
666        self.unfurl_media = Some(unfurl_media);
667        self
668    }
669
670    pub fn username(mut self, username: impl Into<String>) -> Self {
671        self.username = Some(username.into());
672        self
673    }
674
675    pub fn unfurl_app_links(mut self, unfurl_app_links: bool) -> Self {
676        self.unfurl_app_links = Some(unfurl_app_links);
677        self
678    }
679}
680
681impl SlackApiMethod for ChatPostMessageRequest {
682    const METHOD: &'static str = "chat.postMessage";
683    type Response = ChatPostMessageResponse;
684}
685
686/// Successful response of the Slack Web API method [`chat.postMessage`](https://docs.slack.dev/reference/methods/chat.postMessage).
687#[doc(alias = "chat.postMessage")]
688#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
689pub struct ChatPostMessageResponse {
690    #[serde(
691        default,
692        deserialize_with = "crate::de::opt_string",
693        skip_serializing_if = "Option::is_none"
694    )]
695    pub channel: Option<String>,
696    #[serde(
697        default,
698        deserialize_with = "crate::de::opt_string",
699        skip_serializing_if = "Option::is_none"
700    )]
701    pub ts: Option<String>,
702    #[serde(
703        default,
704        deserialize_with = "crate::de::opt_object",
705        skip_serializing_if = "Option::is_none"
706    )]
707    pub message: Option<Message>,
708    #[serde(
709        default,
710        deserialize_with = "crate::de::opt_object",
711        skip_serializing_if = "Option::is_none"
712    )]
713    pub response_metadata: Option<ResponseMetadata>,
714    #[serde(
715        default,
716        deserialize_with = "crate::de::opt_string",
717        skip_serializing_if = "Option::is_none"
718    )]
719    pub warning: Option<String>,
720}
721
722/// Arguments for the Slack Web API method [`chat.scheduleMessage`](https://docs.slack.dev/reference/methods/chat.scheduleMessage): Schedules a message to be sent to a channel.
723///
724/// Send it with [`SlackClient::chat_schedule_message`].
725#[doc(alias = "chat.scheduleMessage")]
726#[derive(Debug, Clone, PartialEq, Serialize)]
727#[non_exhaustive]
728pub struct ChatScheduleMessageRequest {
729    /// Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details.
730    pub channel: String,
731    /// Unix timestamp representing the future time the message should post to Slack.
732    pub post_at: i64,
733    /// Set to `true` to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by [new Slack apps](https://docs.slack.dev/quickstart.md). See [chat.postMessage](chat.postMessage#authorship).
734    #[serde(skip_serializing_if = "Option::is_none")]
735    pub as_user: Option<bool>,
736    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
737    #[serde(
738        skip_serializing_if = "Option::is_none",
739        serialize_with = "crate::form::as_json"
740    )]
741    pub attachments: Option<Vec<crate::blocks::Attachment>>,
742    /// A JSON-based array of structured blocks, presented as a URL-encoded string.
743    #[serde(
744        skip_serializing_if = "Option::is_none",
745        serialize_with = "crate::form::as_json"
746    )]
747    pub blocks: Option<Vec<crate::blocks::Block>>,
748    /// Find and link user groups. No longer supports linking individual users; use syntax shown in [Mentioning Users](https://docs.slack.dev/messaging/formatting-message-text.md#mentioning-users) instead.
749    #[serde(skip_serializing_if = "Option::is_none")]
750    pub link_names: Option<bool>,
751    /// Accepts message text formatted in markdown. This argument should not be used in conjunction with `blocks` or `text`. Limit this field to 12,000 characters.
752    #[serde(skip_serializing_if = "Option::is_none")]
753    pub markdown_text: Option<String>,
754    /// Change how messages are treated. See [chat.postMessage](chat.postMessage#formatting).
755    #[serde(skip_serializing_if = "Option::is_none")]
756    pub parse: Option<String>,
757    /// Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`.
758    #[serde(skip_serializing_if = "Option::is_none")]
759    pub reply_broadcast: Option<bool>,
760    /// How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
761    #[serde(skip_serializing_if = "Option::is_none")]
762    pub text: Option<String>,
763    /// Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead.
764    #[serde(skip_serializing_if = "Option::is_none")]
765    pub thread_ts: Option<String>,
766    /// Pass true to enable unfurling of primarily text-based content.
767    #[serde(skip_serializing_if = "Option::is_none")]
768    pub unfurl_links: Option<bool>,
769    /// Pass false to disable unfurling of media content.
770    #[serde(skip_serializing_if = "Option::is_none")]
771    pub unfurl_media: Option<bool>,
772    /// JSON object with event\_type and event\_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
773    #[serde(skip_serializing_if = "Option::is_none")]
774    pub metadata: Option<crate::blocks::MessageMetadata>,
775}
776
777impl ChatScheduleMessageRequest {
778    pub fn new(channel: impl Into<String>, post_at: i64) -> Self {
779        Self {
780            channel: channel.into(),
781            post_at,
782            as_user: None,
783            attachments: None,
784            blocks: None,
785            link_names: None,
786            markdown_text: None,
787            parse: None,
788            reply_broadcast: None,
789            text: None,
790            thread_ts: None,
791            unfurl_links: None,
792            unfurl_media: None,
793            metadata: None,
794        }
795    }
796
797    pub fn as_user(mut self, as_user: bool) -> Self {
798        self.as_user = Some(as_user);
799        self
800    }
801
802    pub fn attachments(mut self, attachments: Vec<crate::blocks::Attachment>) -> Self {
803        self.attachments = Some(attachments);
804        self
805    }
806
807    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
808        self.blocks = Some(blocks);
809        self
810    }
811
812    pub fn link_names(mut self, link_names: bool) -> Self {
813        self.link_names = Some(link_names);
814        self
815    }
816
817    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
818        self.markdown_text = Some(markdown_text.into());
819        self
820    }
821
822    pub fn parse(mut self, parse: impl Into<String>) -> Self {
823        self.parse = Some(parse.into());
824        self
825    }
826
827    pub fn reply_broadcast(mut self, reply_broadcast: bool) -> Self {
828        self.reply_broadcast = Some(reply_broadcast);
829        self
830    }
831
832    pub fn text(mut self, text: impl Into<String>) -> Self {
833        self.text = Some(text.into());
834        self
835    }
836
837    pub fn thread_ts(mut self, thread_ts: impl Into<String>) -> Self {
838        self.thread_ts = Some(thread_ts.into());
839        self
840    }
841
842    pub fn unfurl_links(mut self, unfurl_links: bool) -> Self {
843        self.unfurl_links = Some(unfurl_links);
844        self
845    }
846
847    pub fn unfurl_media(mut self, unfurl_media: bool) -> Self {
848        self.unfurl_media = Some(unfurl_media);
849        self
850    }
851
852    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
853        self.metadata = Some(metadata);
854        self
855    }
856}
857
858impl SlackApiMethod for ChatScheduleMessageRequest {
859    const METHOD: &'static str = "chat.scheduleMessage";
860    type Response = ChatScheduleMessageResponse;
861}
862
863/// Successful response of the Slack Web API method [`chat.scheduleMessage`](https://docs.slack.dev/reference/methods/chat.scheduleMessage).
864#[doc(alias = "chat.scheduleMessage")]
865#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
866pub struct ChatScheduleMessageResponse {
867    #[serde(
868        default,
869        deserialize_with = "crate::de::opt_string",
870        skip_serializing_if = "Option::is_none"
871    )]
872    pub channel: Option<String>,
873    #[serde(
874        default,
875        deserialize_with = "crate::de::opt_string",
876        skip_serializing_if = "Option::is_none"
877    )]
878    pub scheduled_message_id: Option<String>,
879    #[serde(
880        default,
881        deserialize_with = "crate::de::opt_string",
882        skip_serializing_if = "Option::is_none"
883    )]
884    pub post_at: Option<String>,
885    #[serde(
886        default,
887        deserialize_with = "crate::de::opt_object",
888        skip_serializing_if = "Option::is_none"
889    )]
890    pub message: Option<ChatScheduleMessageResponseMessage>,
891    #[serde(
892        default,
893        deserialize_with = "crate::de::opt_object",
894        skip_serializing_if = "Option::is_none"
895    )]
896    pub response_metadata: Option<ResponseMetadata>,
897    #[serde(
898        default,
899        deserialize_with = "crate::de::opt_string",
900        skip_serializing_if = "Option::is_none"
901    )]
902    pub warning: Option<String>,
903}
904
905#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
906pub struct ChatScheduleMessageResponseMessage {
907    #[serde(
908        default,
909        deserialize_with = "crate::de::opt_string",
910        skip_serializing_if = "Option::is_none"
911    )]
912    pub text: Option<String>,
913    #[serde(
914        default,
915        deserialize_with = "crate::de::opt_string",
916        skip_serializing_if = "Option::is_none"
917    )]
918    pub username: Option<String>,
919    #[serde(
920        default,
921        deserialize_with = "crate::de::opt_string",
922        skip_serializing_if = "Option::is_none"
923    )]
924    pub bot_id: Option<String>,
925    #[serde(
926        default,
927        deserialize_with = "crate::de::vec",
928        skip_serializing_if = "Vec::is_empty"
929    )]
930    pub attachments: Vec<MessageAttachment>,
931    #[serde(
932        default,
933        deserialize_with = "crate::de::opt_string",
934        skip_serializing_if = "Option::is_none"
935    )]
936    pub r#type: Option<String>,
937    #[serde(
938        default,
939        deserialize_with = "crate::de::opt_string",
940        skip_serializing_if = "Option::is_none"
941    )]
942    pub subtype: Option<String>,
943}
944
945/// Arguments for the Slack Web API method [`chat.scheduledMessages.list`](https://docs.slack.dev/reference/methods/chat.scheduledMessages.list): Returns a list of scheduled messages.
946///
947/// Send it with [`SlackClient::chat_scheduled_messages_list`].
948#[doc(alias = "chat.scheduledMessages.list")]
949#[derive(Debug, Clone, PartialEq, Serialize, Default)]
950#[non_exhaustive]
951pub struct ChatScheduledMessagesListRequest {
952    /// The channel of the scheduled messages
953    #[serde(skip_serializing_if = "Option::is_none")]
954    pub channel: Option<String>,
955    /// 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.
956    #[serde(skip_serializing_if = "Option::is_none")]
957    pub cursor: Option<String>,
958    /// A Unix timestamp of the latest value in the time range
959    #[serde(skip_serializing_if = "Option::is_none")]
960    pub latest: Option<String>,
961    /// Maximum number of original entries to return.
962    #[serde(skip_serializing_if = "Option::is_none")]
963    pub limit: Option<i64>,
964    /// A Unix timestamp of the oldest value in the time range
965    #[serde(skip_serializing_if = "Option::is_none")]
966    pub oldest: Option<String>,
967    /// encoded team id to list channels in, required if org token is used
968    #[serde(skip_serializing_if = "Option::is_none")]
969    pub team_id: Option<String>,
970}
971
972impl ChatScheduledMessagesListRequest {
973    pub fn new() -> Self {
974        Self {
975            channel: None,
976            cursor: None,
977            latest: None,
978            limit: None,
979            oldest: None,
980            team_id: None,
981        }
982    }
983
984    pub fn channel(mut self, channel: impl Into<String>) -> Self {
985        self.channel = Some(channel.into());
986        self
987    }
988
989    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
990        self.cursor = Some(cursor.into());
991        self
992    }
993
994    pub fn latest(mut self, latest: impl Into<String>) -> Self {
995        self.latest = Some(latest.into());
996        self
997    }
998
999    pub fn limit(mut self, limit: i64) -> Self {
1000        self.limit = Some(limit);
1001        self
1002    }
1003
1004    pub fn oldest(mut self, oldest: impl Into<String>) -> Self {
1005        self.oldest = Some(oldest.into());
1006        self
1007    }
1008
1009    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1010        self.team_id = Some(team_id.into());
1011        self
1012    }
1013}
1014
1015impl SlackApiMethod for ChatScheduledMessagesListRequest {
1016    const METHOD: &'static str = "chat.scheduledMessages.list";
1017    type Response = ChatScheduledMessagesListResponse;
1018}
1019
1020impl CursorPaginated for ChatScheduledMessagesListRequest {
1021    fn set_cursor(&mut self, cursor: String) {
1022        self.cursor = Some(cursor);
1023    }
1024}
1025
1026impl NextCursor for ChatScheduledMessagesListResponse {
1027    fn next_cursor(&self) -> Option<&str> {
1028        self.response_metadata.as_ref()?.next_cursor.as_deref()
1029    }
1030}
1031
1032/// Successful response of the Slack Web API method [`chat.scheduledMessages.list`](https://docs.slack.dev/reference/methods/chat.scheduledMessages.list).
1033#[doc(alias = "chat.scheduledMessages.list")]
1034#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1035pub struct ChatScheduledMessagesListResponse {
1036    #[serde(
1037        default,
1038        deserialize_with = "crate::de::vec",
1039        skip_serializing_if = "Vec::is_empty"
1040    )]
1041    pub scheduled_messages: Vec<ChatScheduledMessagesListResponseScheduledMessages>,
1042    #[serde(
1043        default,
1044        deserialize_with = "crate::de::opt_object",
1045        skip_serializing_if = "Option::is_none"
1046    )]
1047    pub response_metadata: Option<ResponseMetadata>,
1048    #[serde(
1049        default,
1050        deserialize_with = "crate::de::opt_string",
1051        skip_serializing_if = "Option::is_none"
1052    )]
1053    pub warning: Option<String>,
1054}
1055
1056#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1057pub struct ChatScheduledMessagesListResponseScheduledMessages {
1058    #[serde(
1059        default,
1060        deserialize_with = "crate::de::opt_i64",
1061        skip_serializing_if = "Option::is_none"
1062    )]
1063    pub id: Option<i64>,
1064    #[serde(
1065        default,
1066        deserialize_with = "crate::de::opt_string",
1067        skip_serializing_if = "Option::is_none"
1068    )]
1069    pub channel_id: Option<String>,
1070    #[serde(
1071        default,
1072        deserialize_with = "crate::de::opt_i64",
1073        skip_serializing_if = "Option::is_none"
1074    )]
1075    pub post_at: Option<i64>,
1076    #[serde(
1077        default,
1078        deserialize_with = "crate::de::opt_i64",
1079        skip_serializing_if = "Option::is_none"
1080    )]
1081    pub date_created: Option<i64>,
1082    #[serde(
1083        default,
1084        deserialize_with = "crate::de::opt_string",
1085        skip_serializing_if = "Option::is_none"
1086    )]
1087    pub text: Option<String>,
1088}
1089
1090/// Arguments for the Slack Web API method [`chat.startStream`](https://docs.slack.dev/reference/methods/chat.startStream): Start a new streaming conversation
1091///
1092/// Send it with [`SlackClient::chat_start_stream`].
1093#[doc(alias = "chat.startStream")]
1094#[derive(Debug, Clone, PartialEq, Serialize)]
1095#[non_exhaustive]
1096pub struct ChatStartStreamRequest {
1097    /// An encoded ID that represents a channel, thread, or DM.
1098    pub channel: String,
1099    /// Array of streaming chunks. Can include [markdown text chunk](#markdown_text-chunks) objects, [task update chunk](#task_update-chunks) objects, [plan update chunks](#plan_update-chunks), or [blocks chunks](#blocks-chunks).
1100    #[serde(
1101        skip_serializing_if = "Option::is_none",
1102        serialize_with = "crate::form::as_json"
1103    )]
1104    pub chunks: Option<Vec<serde_json::Value>>,
1105    /// Accepts message text formatted in markdown. Limit this field to 12,000 characters.
1106    #[serde(skip_serializing_if = "Option::is_none")]
1107    pub markdown_text: Option<String>,
1108    /// Provide another message's `ts` value to reply to. Omit it to stream a top-level message instead of a thread reply; this is only supported in channels where the whole channel is one session, such as Slack Code, and returns `invalid_thread_ts` elsewhere. Passing `"0"` is equivalent to omitting it.
1109    #[serde(skip_serializing_if = "Option::is_none")]
1110    pub thread_ts: Option<String>,
1111    /// The encoded ID of the user to receive the streaming text. Required when streaming to channels.
1112    #[serde(skip_serializing_if = "Option::is_none")]
1113    pub recipient_user_id: Option<String>,
1114    /// The encoded ID of the team the user receiving the streaming text belongs to. Required when streaming to channels.
1115    #[serde(skip_serializing_if = "Option::is_none")]
1116    pub recipient_team_id: Option<String>,
1117    /// Specifies how tasks are displayed in the message. `timeline` task updates render as individual task cards interleaved with streamed text. `plan` task updates render together in a plan block.
1118    #[serde(skip_serializing_if = "Option::is_none")]
1119    pub task_display_mode: Option<String>,
1120    /// Emoji to use as the icon for this message. Overrides `icon_url`.
1121    #[serde(skip_serializing_if = "Option::is_none")]
1122    pub icon_emoji: Option<String>,
1123    /// Image URL to use as the icon for this message.
1124    #[serde(skip_serializing_if = "Option::is_none")]
1125    pub icon_url: Option<String>,
1126    /// The bot's username to display.
1127    #[serde(skip_serializing_if = "Option::is_none")]
1128    pub username: Option<String>,
1129}
1130
1131impl ChatStartStreamRequest {
1132    pub fn new(channel: impl Into<String>) -> Self {
1133        Self {
1134            channel: channel.into(),
1135            chunks: None,
1136            markdown_text: None,
1137            thread_ts: None,
1138            recipient_user_id: None,
1139            recipient_team_id: None,
1140            task_display_mode: None,
1141            icon_emoji: None,
1142            icon_url: None,
1143            username: None,
1144        }
1145    }
1146
1147    pub fn chunks(mut self, chunks: Vec<serde_json::Value>) -> Self {
1148        self.chunks = Some(chunks);
1149        self
1150    }
1151
1152    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
1153        self.markdown_text = Some(markdown_text.into());
1154        self
1155    }
1156
1157    pub fn thread_ts(mut self, thread_ts: impl Into<String>) -> Self {
1158        self.thread_ts = Some(thread_ts.into());
1159        self
1160    }
1161
1162    pub fn recipient_user_id(mut self, recipient_user_id: impl Into<String>) -> Self {
1163        self.recipient_user_id = Some(recipient_user_id.into());
1164        self
1165    }
1166
1167    pub fn recipient_team_id(mut self, recipient_team_id: impl Into<String>) -> Self {
1168        self.recipient_team_id = Some(recipient_team_id.into());
1169        self
1170    }
1171
1172    pub fn task_display_mode(mut self, task_display_mode: impl Into<String>) -> Self {
1173        self.task_display_mode = Some(task_display_mode.into());
1174        self
1175    }
1176
1177    pub fn icon_emoji(mut self, icon_emoji: impl Into<String>) -> Self {
1178        self.icon_emoji = Some(icon_emoji.into());
1179        self
1180    }
1181
1182    pub fn icon_url(mut self, icon_url: impl Into<String>) -> Self {
1183        self.icon_url = Some(icon_url.into());
1184        self
1185    }
1186
1187    pub fn username(mut self, username: impl Into<String>) -> Self {
1188        self.username = Some(username.into());
1189        self
1190    }
1191}
1192
1193impl SlackApiMethod for ChatStartStreamRequest {
1194    const METHOD: &'static str = "chat.startStream";
1195    type Response = ChatStartStreamResponse;
1196}
1197
1198/// Successful response of the Slack Web API method [`chat.startStream`](https://docs.slack.dev/reference/methods/chat.startStream).
1199#[doc(alias = "chat.startStream")]
1200#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1201pub struct ChatStartStreamResponse {
1202    #[serde(
1203        default,
1204        deserialize_with = "crate::de::opt_string",
1205        skip_serializing_if = "Option::is_none"
1206    )]
1207    pub channel: Option<String>,
1208    #[serde(
1209        default,
1210        deserialize_with = "crate::de::opt_string",
1211        skip_serializing_if = "Option::is_none"
1212    )]
1213    pub ts: Option<String>,
1214    #[serde(
1215        default,
1216        deserialize_with = "crate::de::opt_object",
1217        skip_serializing_if = "Option::is_none"
1218    )]
1219    pub response_metadata: Option<ResponseMetadata>,
1220    #[serde(
1221        default,
1222        deserialize_with = "crate::de::opt_string",
1223        skip_serializing_if = "Option::is_none"
1224    )]
1225    pub warning: Option<String>,
1226}
1227
1228/// Arguments for the Slack Web API method [`chat.stopStream`](https://docs.slack.dev/reference/methods/chat.stopStream): Stop a streaming conversation
1229///
1230/// Send it with [`SlackClient::chat_stop_stream`].
1231#[doc(alias = "chat.stopStream")]
1232#[derive(Debug, Clone, PartialEq, Serialize)]
1233#[non_exhaustive]
1234pub struct ChatStopStreamRequest {
1235    /// An encoded ID that represents a channel, private group, or DM
1236    pub channel: String,
1237    /// The timestamp of the streaming message.
1238    pub ts: String,
1239    /// Array of streaming chunks. Can include [markdown text chunk](#markdown_text-chunks) objects, [task update chunk](#task_update-chunks) objects, [plan update chunks](#plan_update-chunks), or [blocks chunks](#blocks-chunks).
1240    #[serde(
1241        skip_serializing_if = "Option::is_none",
1242        serialize_with = "crate::form::as_json"
1243    )]
1244    pub chunks: Option<Vec<serde_json::Value>>,
1245    /// Accepts message text formatted in markdown. Limit this field to 12,000 characters.
1246    #[serde(skip_serializing_if = "Option::is_none")]
1247    pub markdown_text: Option<String>,
1248    /// A list of blocks that will be rendered at the bottom of the finalized message.
1249    #[serde(
1250        skip_serializing_if = "Option::is_none",
1251        serialize_with = "crate::form::as_json"
1252    )]
1253    pub blocks: Option<Vec<crate::blocks::Block>>,
1254    /// JSON object with event\_type and event\_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
1255    #[serde(skip_serializing_if = "Option::is_none")]
1256    pub metadata: Option<crate::blocks::MessageMetadata>,
1257    /// The session status to set after stopping the stream.
1258    #[serde(skip_serializing_if = "Option::is_none")]
1259    pub session_status: Option<String>,
1260}
1261
1262impl ChatStopStreamRequest {
1263    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
1264        Self {
1265            channel: channel.into(),
1266            ts: ts.into(),
1267            chunks: None,
1268            markdown_text: None,
1269            blocks: None,
1270            metadata: None,
1271            session_status: None,
1272        }
1273    }
1274
1275    pub fn chunks(mut self, chunks: Vec<serde_json::Value>) -> Self {
1276        self.chunks = Some(chunks);
1277        self
1278    }
1279
1280    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
1281        self.markdown_text = Some(markdown_text.into());
1282        self
1283    }
1284
1285    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
1286        self.blocks = Some(blocks);
1287        self
1288    }
1289
1290    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
1291        self.metadata = Some(metadata);
1292        self
1293    }
1294
1295    pub fn session_status(mut self, session_status: impl Into<String>) -> Self {
1296        self.session_status = Some(session_status.into());
1297        self
1298    }
1299}
1300
1301impl SlackApiMethod for ChatStopStreamRequest {
1302    const METHOD: &'static str = "chat.stopStream";
1303    type Response = ChatStopStreamResponse;
1304}
1305
1306/// Successful response of the Slack Web API method [`chat.stopStream`](https://docs.slack.dev/reference/methods/chat.stopStream).
1307#[doc(alias = "chat.stopStream")]
1308#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1309pub struct ChatStopStreamResponse {
1310    #[serde(
1311        default,
1312        deserialize_with = "crate::de::opt_string",
1313        skip_serializing_if = "Option::is_none"
1314    )]
1315    pub channel: Option<String>,
1316    #[serde(
1317        default,
1318        deserialize_with = "crate::de::opt_string",
1319        skip_serializing_if = "Option::is_none"
1320    )]
1321    pub ts: Option<String>,
1322    #[serde(
1323        default,
1324        deserialize_with = "crate::de::opt_object",
1325        skip_serializing_if = "Option::is_none"
1326    )]
1327    pub message: Option<Message>,
1328    #[serde(
1329        default,
1330        deserialize_with = "crate::de::opt_object",
1331        skip_serializing_if = "Option::is_none"
1332    )]
1333    pub response_metadata: Option<ResponseMetadata>,
1334    #[serde(
1335        default,
1336        deserialize_with = "crate::de::opt_string",
1337        skip_serializing_if = "Option::is_none"
1338    )]
1339    pub warning: Option<String>,
1340}
1341
1342/// Arguments for the Slack Web API method [`chat.unfurl`](https://docs.slack.dev/reference/methods/chat.unfurl): Provide custom unfurl behavior for user-posted URLs
1343///
1344/// Send it with [`SlackClient::chat_unfurl`].
1345#[doc(alias = "chat.unfurl")]
1346#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1347#[non_exhaustive]
1348pub struct ChatUnfurlRequest {
1349    /// Channel ID of the message. Both `channel` and `ts` must be provided together, _or_ `unfurl_id` and `source` must be provided together. Required for public channels.
1350    #[serde(skip_serializing_if = "Option::is_none")]
1351    pub channel: Option<String>,
1352    /// Timestamp of the message to add unfurl behavior to. Required for public channels.
1353    #[serde(skip_serializing_if = "Option::is_none")]
1354    pub ts: Option<String>,
1355    /// URL-encoded JSON map with keys set to URLs featured in the message, pointing to their unfurl blocks or message attachments. Required for public channels.
1356    #[serde(skip_serializing_if = "Option::is_none")]
1357    pub unfurls: Option<String>,
1358    /// Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons, `Not now` or `Never ask me again`.
1359    #[serde(skip_serializing_if = "Option::is_none")]
1360    pub user_auth_message: Option<String>,
1361    /// Set to `true` or `1` to indicate the user must install your Slack app to trigger unfurls for this domain
1362    #[serde(skip_serializing_if = "Option::is_none")]
1363    pub user_auth_required: Option<bool>,
1364    /// Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.
1365    #[serde(skip_serializing_if = "Option::is_none")]
1366    pub user_auth_url: Option<String>,
1367    /// Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior
1368    #[serde(
1369        skip_serializing_if = "Option::is_none",
1370        serialize_with = "crate::form::as_json"
1371    )]
1372    pub user_auth_blocks: Option<Vec<crate::blocks::Block>>,
1373    /// The ID of the link to unfurl. Both `unfurl_id` and `source` must be provided together, _or_ `channel` and `ts` must be provided together.
1374    #[serde(skip_serializing_if = "Option::is_none")]
1375    pub unfurl_id: Option<String>,
1376    /// The source of the link to unfurl. The source may either be `composer`, when the link is inside the message composer, or `conversations_history`, when the link has been posted to a conversation.
1377    #[serde(skip_serializing_if = "Option::is_none")]
1378    pub source: Option<String>,
1379}
1380
1381impl ChatUnfurlRequest {
1382    pub fn new() -> Self {
1383        Self {
1384            channel: None,
1385            ts: None,
1386            unfurls: None,
1387            user_auth_message: None,
1388            user_auth_required: None,
1389            user_auth_url: None,
1390            user_auth_blocks: None,
1391            unfurl_id: None,
1392            source: None,
1393        }
1394    }
1395
1396    pub fn channel(mut self, channel: impl Into<String>) -> Self {
1397        self.channel = Some(channel.into());
1398        self
1399    }
1400
1401    pub fn ts(mut self, ts: impl Into<String>) -> Self {
1402        self.ts = Some(ts.into());
1403        self
1404    }
1405
1406    pub fn unfurls(mut self, unfurls: impl Into<String>) -> Self {
1407        self.unfurls = Some(unfurls.into());
1408        self
1409    }
1410
1411    pub fn user_auth_message(mut self, user_auth_message: impl Into<String>) -> Self {
1412        self.user_auth_message = Some(user_auth_message.into());
1413        self
1414    }
1415
1416    pub fn user_auth_required(mut self, user_auth_required: bool) -> Self {
1417        self.user_auth_required = Some(user_auth_required);
1418        self
1419    }
1420
1421    pub fn user_auth_url(mut self, user_auth_url: impl Into<String>) -> Self {
1422        self.user_auth_url = Some(user_auth_url.into());
1423        self
1424    }
1425
1426    pub fn user_auth_blocks(mut self, user_auth_blocks: Vec<crate::blocks::Block>) -> Self {
1427        self.user_auth_blocks = Some(user_auth_blocks);
1428        self
1429    }
1430
1431    pub fn unfurl_id(mut self, unfurl_id: impl Into<String>) -> Self {
1432        self.unfurl_id = Some(unfurl_id.into());
1433        self
1434    }
1435
1436    pub fn source(mut self, source: impl Into<String>) -> Self {
1437        self.source = Some(source.into());
1438        self
1439    }
1440}
1441
1442impl SlackApiMethod for ChatUnfurlRequest {
1443    const METHOD: &'static str = "chat.unfurl";
1444    type Response = ChatUnfurlResponse;
1445}
1446
1447/// Successful response of the Slack Web API method [`chat.unfurl`](https://docs.slack.dev/reference/methods/chat.unfurl).
1448#[doc(alias = "chat.unfurl")]
1449#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1450pub struct ChatUnfurlResponse {
1451    /// Fields returned by Slack. This method has no documented response example.
1452    #[serde(flatten)]
1453    pub extra: serde_json::Map<String, serde_json::Value>,
1454    #[serde(
1455        default,
1456        deserialize_with = "crate::de::opt_object",
1457        skip_serializing_if = "Option::is_none"
1458    )]
1459    pub response_metadata: Option<ResponseMetadata>,
1460    #[serde(
1461        default,
1462        deserialize_with = "crate::de::opt_string",
1463        skip_serializing_if = "Option::is_none"
1464    )]
1465    pub warning: Option<String>,
1466}
1467
1468/// Arguments for the Slack Web API method [`chat.update`](https://docs.slack.dev/reference/methods/chat.update): Updates a message.
1469///
1470/// Send it with [`SlackClient::chat_update`].
1471#[doc(alias = "chat.update")]
1472#[derive(Debug, Clone, PartialEq, Serialize)]
1473#[non_exhaustive]
1474pub struct ChatUpdateRequest {
1475    /// Channel containing the message to be updated. For direct messages, ensure that this value is a DM ID (starts with `D`) instead of a User ID (starts with either `U` or `W`).
1476    pub channel: String,
1477    /// Timestamp of the message to be updated.
1478    pub ts: String,
1479    /// Pass true to update the message as the authed user. Bot users in this context are considered authed users.
1480    #[serde(skip_serializing_if = "Option::is_none")]
1481    pub as_user: Option<bool>,
1482    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
1483    #[serde(
1484        skip_serializing_if = "Option::is_none",
1485        serialize_with = "crate::form::as_json"
1486    )]
1487    pub attachments: Option<Vec<crate::blocks::Attachment>>,
1488    /// A JSON-based array of structured attachments, presented as a URL-encoded string.
1489    #[serde(skip_serializing_if = "Option::is_none")]
1490    pub unfurled_attachments: Option<String>,
1491    /// A JSON-based array of structured blocks, presented as a URL-encoded string.
1492    #[serde(
1493        skip_serializing_if = "Option::is_none",
1494        serialize_with = "crate::form::as_json"
1495    )]
1496    pub blocks: Option<Vec<crate::blocks::Block>>,
1497    /// Accepts message text formatted in markdown. This argument should not be used in conjunction with `blocks` or `text`. Limit this field to 12,000 characters.
1498    #[serde(skip_serializing_if = "Option::is_none")]
1499    pub markdown_text: Option<String>,
1500    /// JSON object with event\_type and event\_payload fields, presented as a URL-encoded string. If you don't include this field, the message's previous `metadata` will be retained. To remove previous `metadata`, include an empty object for this field. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
1501    #[serde(skip_serializing_if = "Option::is_none")]
1502    pub metadata: Option<crate::blocks::MessageMetadata>,
1503    /// Find and link channel names and usernames. Defaults to `none`. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, `none`.
1504    #[serde(skip_serializing_if = "Option::is_none")]
1505    pub link_names: Option<bool>,
1506    /// Change how messages are treated. Defaults to `client`, unlike `chat.postMessage`. Accepts either `none` or `full`. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, `client`.
1507    #[serde(skip_serializing_if = "Option::is_none")]
1508    pub parse: Option<String>,
1509    /// How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
1510    #[serde(skip_serializing_if = "Option::is_none")]
1511    pub text: Option<String>,
1512    /// Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.
1513    #[serde(skip_serializing_if = "Option::is_none")]
1514    pub reply_broadcast: Option<bool>,
1515    /// Array of new file ids that will be sent with this message.
1516    #[serde(skip_serializing_if = "Option::is_none")]
1517    pub file_ids: Option<Vec<String>>,
1518}
1519
1520impl ChatUpdateRequest {
1521    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
1522        Self {
1523            channel: channel.into(),
1524            ts: ts.into(),
1525            as_user: None,
1526            attachments: None,
1527            unfurled_attachments: None,
1528            blocks: None,
1529            markdown_text: None,
1530            metadata: None,
1531            link_names: None,
1532            parse: None,
1533            text: None,
1534            reply_broadcast: None,
1535            file_ids: None,
1536        }
1537    }
1538
1539    pub fn as_user(mut self, as_user: bool) -> Self {
1540        self.as_user = Some(as_user);
1541        self
1542    }
1543
1544    pub fn attachments(mut self, attachments: Vec<crate::blocks::Attachment>) -> Self {
1545        self.attachments = Some(attachments);
1546        self
1547    }
1548
1549    pub fn unfurled_attachments(mut self, unfurled_attachments: impl Into<String>) -> Self {
1550        self.unfurled_attachments = Some(unfurled_attachments.into());
1551        self
1552    }
1553
1554    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
1555        self.blocks = Some(blocks);
1556        self
1557    }
1558
1559    pub fn markdown_text(mut self, markdown_text: impl Into<String>) -> Self {
1560        self.markdown_text = Some(markdown_text.into());
1561        self
1562    }
1563
1564    pub fn metadata(mut self, metadata: crate::blocks::MessageMetadata) -> Self {
1565        self.metadata = Some(metadata);
1566        self
1567    }
1568
1569    pub fn link_names(mut self, link_names: bool) -> Self {
1570        self.link_names = Some(link_names);
1571        self
1572    }
1573
1574    pub fn parse(mut self, parse: impl Into<String>) -> Self {
1575        self.parse = Some(parse.into());
1576        self
1577    }
1578
1579    pub fn text(mut self, text: impl Into<String>) -> Self {
1580        self.text = Some(text.into());
1581        self
1582    }
1583
1584    pub fn reply_broadcast(mut self, reply_broadcast: bool) -> Self {
1585        self.reply_broadcast = Some(reply_broadcast);
1586        self
1587    }
1588
1589    pub fn file_ids(mut self, file_ids: Vec<String>) -> Self {
1590        self.file_ids = Some(file_ids);
1591        self
1592    }
1593}
1594
1595impl SlackApiMethod for ChatUpdateRequest {
1596    const METHOD: &'static str = "chat.update";
1597    type Response = ChatUpdateResponse;
1598}
1599
1600/// Successful response of the Slack Web API method [`chat.update`](https://docs.slack.dev/reference/methods/chat.update).
1601#[doc(alias = "chat.update")]
1602#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1603pub struct ChatUpdateResponse {
1604    #[serde(
1605        default,
1606        deserialize_with = "crate::de::opt_string",
1607        skip_serializing_if = "Option::is_none"
1608    )]
1609    pub channel: Option<String>,
1610    #[serde(
1611        default,
1612        deserialize_with = "crate::de::opt_string",
1613        skip_serializing_if = "Option::is_none"
1614    )]
1615    pub ts: Option<String>,
1616    #[serde(
1617        default,
1618        deserialize_with = "crate::de::opt_string",
1619        skip_serializing_if = "Option::is_none"
1620    )]
1621    pub text: Option<String>,
1622    #[serde(
1623        default,
1624        deserialize_with = "crate::de::opt_object",
1625        skip_serializing_if = "Option::is_none"
1626    )]
1627    pub message: Option<ChatUpdateResponseMessage>,
1628    #[serde(
1629        default,
1630        deserialize_with = "crate::de::opt_object",
1631        skip_serializing_if = "Option::is_none"
1632    )]
1633    pub response_metadata: Option<ResponseMetadata>,
1634    #[serde(
1635        default,
1636        deserialize_with = "crate::de::opt_string",
1637        skip_serializing_if = "Option::is_none"
1638    )]
1639    pub warning: Option<String>,
1640}
1641
1642#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1643pub struct ChatUpdateResponseMessage {
1644    #[serde(
1645        default,
1646        deserialize_with = "crate::de::opt_string",
1647        skip_serializing_if = "Option::is_none"
1648    )]
1649    pub text: Option<String>,
1650    #[serde(
1651        default,
1652        deserialize_with = "crate::de::opt_string",
1653        skip_serializing_if = "Option::is_none"
1654    )]
1655    pub user: Option<String>,
1656}
1657
1658impl SlackClient {
1659    /// Calls the Slack Web API method [`chat.appendStream`](https://docs.slack.dev/reference/methods/chat.appendStream): Append text to an existing streaming conversation
1660    ///
1661    /// Required scopes:
1662    ///
1663    /// - bot token: `chat:write`
1664    ///
1665    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1666    ///
1667    /// # Errors
1668    ///
1669    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1670    #[doc(alias = "chat.appendStream")]
1671    pub async fn chat_append_stream(
1672        &self,
1673        request: &ChatAppendStreamRequest,
1674    ) -> Result<ChatAppendStreamResponse, SlackError> {
1675        self.call(request).await
1676    }
1677
1678    /// Calls the Slack Web API method [`chat.delete`](https://docs.slack.dev/reference/methods/chat.delete): Deletes a message.
1679    ///
1680    /// Required scopes:
1681    ///
1682    /// - bot token: `chat:write`
1683    /// - user token: `chat:write`
1684    ///
1685    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1686    ///
1687    /// # Errors
1688    ///
1689    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1690    #[doc(alias = "chat.delete")]
1691    pub async fn chat_delete(
1692        &self,
1693        request: &ChatDeleteRequest,
1694    ) -> Result<ChatDeleteResponse, SlackError> {
1695        self.call(request).await
1696    }
1697
1698    /// Calls the Slack Web API method [`chat.deleteScheduledMessage`](https://docs.slack.dev/reference/methods/chat.deleteScheduledMessage): Deletes a pending scheduled message from the queue.
1699    ///
1700    /// Required scopes:
1701    ///
1702    /// - bot token: `chat:write`
1703    /// - user token: `chat:write`
1704    ///
1705    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1706    ///
1707    /// # Errors
1708    ///
1709    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1710    #[doc(alias = "chat.deleteScheduledMessage")]
1711    pub async fn chat_delete_scheduled_message(
1712        &self,
1713        request: &ChatDeleteScheduledMessageRequest,
1714    ) -> Result<ChatDeleteScheduledMessageResponse, SlackError> {
1715        self.call(request).await
1716    }
1717
1718    /// Calls the Slack Web API method [`chat.getPermalink`](https://docs.slack.dev/reference/methods/chat.getPermalink): Retrieve a permalink URL for a specific extant message
1719    ///
1720    /// Rate limit: Tier 5 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1721    ///
1722    /// # Errors
1723    ///
1724    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1725    #[doc(alias = "chat.getPermalink")]
1726    pub async fn chat_get_permalink(
1727        &self,
1728        request: &ChatGetPermalinkRequest,
1729    ) -> Result<ChatGetPermalinkResponse, SlackError> {
1730        self.call(request).await
1731    }
1732
1733    /// Calls the Slack Web API method [`chat.meMessage`](https://docs.slack.dev/reference/methods/chat.meMessage): Share a me message into a channel.
1734    ///
1735    /// Required scopes:
1736    ///
1737    /// - bot token: `chat:write`
1738    /// - user token: `chat:write`
1739    ///
1740    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1741    ///
1742    /// # Errors
1743    ///
1744    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1745    #[doc(alias = "chat.meMessage")]
1746    pub async fn chat_me_message(
1747        &self,
1748        request: &ChatMeMessageRequest,
1749    ) -> Result<ChatMeMessageResponse, SlackError> {
1750        self.call(request).await
1751    }
1752
1753    /// Calls the Slack Web API method [`chat.postEphemeral`](https://docs.slack.dev/reference/methods/chat.postEphemeral): Sends an ephemeral message to a user in a channel.
1754    ///
1755    /// Required scopes:
1756    ///
1757    /// - bot token: `chat:write`
1758    /// - user token: `chat:write`
1759    ///
1760    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1761    ///
1762    /// # Errors
1763    ///
1764    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1765    #[doc(alias = "chat.postEphemeral")]
1766    pub async fn chat_post_ephemeral(
1767        &self,
1768        request: &ChatPostEphemeralRequest,
1769    ) -> Result<ChatPostEphemeralResponse, SlackError> {
1770        self.call(request).await
1771    }
1772
1773    /// Calls the Slack Web API method [`chat.postMessage`](https://docs.slack.dev/reference/methods/chat.postMessage): Sends a message to a channel.
1774    ///
1775    /// Required scopes:
1776    ///
1777    /// - bot token: `chat:write`
1778    /// - user token: `chat:write`
1779    ///
1780    /// Rate limit: Tier 5 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1781    ///
1782    /// # Errors
1783    ///
1784    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1785    #[doc(alias = "chat.postMessage")]
1786    pub async fn chat_post_message(
1787        &self,
1788        request: &ChatPostMessageRequest,
1789    ) -> Result<ChatPostMessageResponse, SlackError> {
1790        self.call(request).await
1791    }
1792
1793    /// Calls the Slack Web API method [`chat.scheduleMessage`](https://docs.slack.dev/reference/methods/chat.scheduleMessage): Schedules a message to be sent to a channel.
1794    ///
1795    /// Required scopes:
1796    ///
1797    /// - bot token: `chat:write`
1798    /// - user token: `chat:write`
1799    ///
1800    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1801    ///
1802    /// # Errors
1803    ///
1804    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1805    #[doc(alias = "chat.scheduleMessage")]
1806    pub async fn chat_schedule_message(
1807        &self,
1808        request: &ChatScheduleMessageRequest,
1809    ) -> Result<ChatScheduleMessageResponse, SlackError> {
1810        self.call(request).await
1811    }
1812
1813    /// Calls the Slack Web API method [`chat.scheduledMessages.list`](https://docs.slack.dev/reference/methods/chat.scheduledMessages.list): Returns a list of scheduled messages.
1814    ///
1815    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1816    ///
1817    /// # Errors
1818    ///
1819    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1820    #[doc(alias = "chat.scheduledMessages.list")]
1821    pub async fn chat_scheduled_messages_list(
1822        &self,
1823        request: &ChatScheduledMessagesListRequest,
1824    ) -> Result<ChatScheduledMessagesListResponse, SlackError> {
1825        self.call(request).await
1826    }
1827
1828    /// Calls the Slack Web API method [`chat.startStream`](https://docs.slack.dev/reference/methods/chat.startStream): Start a new streaming conversation
1829    ///
1830    /// Required scopes:
1831    ///
1832    /// - bot token: `chat:write`
1833    ///
1834    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1835    ///
1836    /// # Errors
1837    ///
1838    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1839    #[doc(alias = "chat.startStream")]
1840    pub async fn chat_start_stream(
1841        &self,
1842        request: &ChatStartStreamRequest,
1843    ) -> Result<ChatStartStreamResponse, SlackError> {
1844        self.call(request).await
1845    }
1846
1847    /// Calls the Slack Web API method [`chat.stopStream`](https://docs.slack.dev/reference/methods/chat.stopStream): Stop a streaming conversation
1848    ///
1849    /// Required scopes:
1850    ///
1851    /// - bot token: `chat:write`
1852    ///
1853    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1854    ///
1855    /// # Errors
1856    ///
1857    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1858    #[doc(alias = "chat.stopStream")]
1859    pub async fn chat_stop_stream(
1860        &self,
1861        request: &ChatStopStreamRequest,
1862    ) -> Result<ChatStopStreamResponse, SlackError> {
1863        self.call(request).await
1864    }
1865
1866    /// Calls the Slack Web API method [`chat.unfurl`](https://docs.slack.dev/reference/methods/chat.unfurl): Provide custom unfurl behavior for user-posted URLs
1867    ///
1868    /// Required scopes:
1869    ///
1870    /// - bot token: `links:write`
1871    /// - user token: `links:write`
1872    ///
1873    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1874    ///
1875    /// # Errors
1876    ///
1877    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1878    #[doc(alias = "chat.unfurl")]
1879    pub async fn chat_unfurl(
1880        &self,
1881        request: &ChatUnfurlRequest,
1882    ) -> Result<ChatUnfurlResponse, SlackError> {
1883        self.call(request).await
1884    }
1885
1886    /// Calls the Slack Web API method [`chat.update`](https://docs.slack.dev/reference/methods/chat.update): Updates a message.
1887    ///
1888    /// Required scopes:
1889    ///
1890    /// - bot token: `chat:write`
1891    /// - user token: `chat:write`
1892    ///
1893    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1894    ///
1895    /// # Errors
1896    ///
1897    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1898    #[doc(alias = "chat.update")]
1899    pub async fn chat_update(
1900        &self,
1901        request: &ChatUpdateRequest,
1902    ) -> Result<ChatUpdateResponse, SlackError> {
1903        self.call(request).await
1904    }
1905}