1#![allow(unused_imports)]
4
5use crate::objects::*;
6use crate::{
7 CursorPaginated, NextCursor, ResponseMetadata, SlackApiMethod, SlackClient, SlackError,
8};
9use serde::{Deserialize, Serialize};
10
11#[doc(alias = "chat.appendStream")]
15#[derive(Debug, Clone, PartialEq, Serialize)]
16#[non_exhaustive]
17pub struct ChatAppendStreamRequest {
18 pub channel: String,
20 pub ts: String,
22 #[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 #[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#[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#[doc(alias = "chat.delete")]
93#[derive(Debug, Clone, PartialEq, Serialize)]
94#[non_exhaustive]
95pub struct ChatDeleteRequest {
96 pub channel: String,
98 pub ts: String,
100 #[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#[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#[doc(alias = "chat.deleteScheduledMessage")]
159#[derive(Debug, Clone, PartialEq, Serialize)]
160#[non_exhaustive]
161pub struct ChatDeleteScheduledMessageRequest {
162 pub channel: String,
164 pub scheduled_message_id: String,
166 #[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#[doc(alias = "chat.deleteScheduledMessage")]
193#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
194pub struct ChatDeleteScheduledMessageResponse {
195 #[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#[doc(alias = "chat.getPermalink")]
216#[derive(Debug, Clone, PartialEq, Serialize)]
217#[non_exhaustive]
218pub struct ChatGetPermalinkRequest {
219 pub channel: String,
221 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#[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#[doc(alias = "chat.meMessage")]
273#[derive(Debug, Clone, PartialEq, Serialize)]
274#[non_exhaustive]
275pub struct ChatMeMessageRequest {
276 pub channel: String,
278 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#[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#[doc(alias = "chat.postEphemeral")]
330#[derive(Debug, Clone, PartialEq, Serialize)]
331#[non_exhaustive]
332pub struct ChatPostEphemeralRequest {
333 pub channel: String,
335 pub user: String,
337 #[serde(skip_serializing_if = "Option::is_none")]
339 pub as_user: Option<bool>,
340 #[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 #[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 #[serde(skip_serializing_if = "Option::is_none")]
354 pub icon_emoji: Option<String>,
355 #[serde(skip_serializing_if = "Option::is_none")]
357 pub icon_url: Option<String>,
358 #[serde(skip_serializing_if = "Option::is_none")]
360 pub link_names: Option<bool>,
361 #[serde(skip_serializing_if = "Option::is_none")]
363 pub markdown_text: Option<String>,
364 #[serde(skip_serializing_if = "Option::is_none")]
366 pub metadata: Option<crate::blocks::MessageMetadata>,
367 #[serde(skip_serializing_if = "Option::is_none")]
369 pub parse: Option<String>,
370 #[serde(skip_serializing_if = "Option::is_none")]
372 pub text: Option<String>,
373 #[serde(skip_serializing_if = "Option::is_none")]
375 pub thread_ts: Option<String>,
376 #[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#[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#[doc(alias = "chat.postMessage")]
495#[derive(Debug, Clone, PartialEq, Serialize)]
496#[non_exhaustive]
497pub struct ChatPostMessageRequest {
498 pub channel: String,
500 #[serde(skip_serializing_if = "Option::is_none")]
502 pub as_user: Option<bool>,
503 #[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 #[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 #[serde(skip_serializing_if = "Option::is_none")]
517 pub current_draft_last_updated_ts: Option<String>,
518 #[serde(skip_serializing_if = "Option::is_none")]
520 pub icon_emoji: Option<String>,
521 #[serde(skip_serializing_if = "Option::is_none")]
523 pub icon_url: Option<String>,
524 #[serde(skip_serializing_if = "Option::is_none")]
526 pub link_names: Option<bool>,
527 #[serde(skip_serializing_if = "Option::is_none")]
529 pub markdown_text: Option<String>,
530 #[serde(skip_serializing_if = "Option::is_none")]
532 pub metadata: Option<crate::blocks::MessageMetadata>,
533 #[serde(skip_serializing_if = "Option::is_none")]
535 pub mrkdwn: Option<bool>,
536 #[serde(skip_serializing_if = "Option::is_none")]
538 pub parse: Option<String>,
539 #[serde(skip_serializing_if = "Option::is_none")]
541 pub reply_broadcast: Option<bool>,
542 #[serde(skip_serializing_if = "Option::is_none")]
544 pub text: Option<String>,
545 #[serde(skip_serializing_if = "Option::is_none")]
547 pub thread_ts: Option<String>,
548 #[serde(skip_serializing_if = "Option::is_none")]
550 pub unfurl_links: Option<bool>,
551 #[serde(skip_serializing_if = "Option::is_none")]
553 pub unfurl_media: Option<bool>,
554 #[serde(skip_serializing_if = "Option::is_none")]
556 pub username: Option<String>,
557 #[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#[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#[doc(alias = "chat.scheduleMessage")]
726#[derive(Debug, Clone, PartialEq, Serialize)]
727#[non_exhaustive]
728pub struct ChatScheduleMessageRequest {
729 pub channel: String,
731 pub post_at: i64,
733 #[serde(skip_serializing_if = "Option::is_none")]
735 pub as_user: Option<bool>,
736 #[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 #[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 #[serde(skip_serializing_if = "Option::is_none")]
750 pub link_names: Option<bool>,
751 #[serde(skip_serializing_if = "Option::is_none")]
753 pub markdown_text: Option<String>,
754 #[serde(skip_serializing_if = "Option::is_none")]
756 pub parse: Option<String>,
757 #[serde(skip_serializing_if = "Option::is_none")]
759 pub reply_broadcast: Option<bool>,
760 #[serde(skip_serializing_if = "Option::is_none")]
762 pub text: Option<String>,
763 #[serde(skip_serializing_if = "Option::is_none")]
765 pub thread_ts: Option<String>,
766 #[serde(skip_serializing_if = "Option::is_none")]
768 pub unfurl_links: Option<bool>,
769 #[serde(skip_serializing_if = "Option::is_none")]
771 pub unfurl_media: Option<bool>,
772 #[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#[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#[doc(alias = "chat.scheduledMessages.list")]
949#[derive(Debug, Clone, PartialEq, Serialize, Default)]
950#[non_exhaustive]
951pub struct ChatScheduledMessagesListRequest {
952 #[serde(skip_serializing_if = "Option::is_none")]
954 pub channel: Option<String>,
955 #[serde(skip_serializing_if = "Option::is_none")]
957 pub cursor: Option<String>,
958 #[serde(skip_serializing_if = "Option::is_none")]
960 pub latest: Option<String>,
961 #[serde(skip_serializing_if = "Option::is_none")]
963 pub limit: Option<i64>,
964 #[serde(skip_serializing_if = "Option::is_none")]
966 pub oldest: Option<String>,
967 #[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#[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#[doc(alias = "chat.startStream")]
1094#[derive(Debug, Clone, PartialEq, Serialize)]
1095#[non_exhaustive]
1096pub struct ChatStartStreamRequest {
1097 pub channel: String,
1099 #[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 #[serde(skip_serializing_if = "Option::is_none")]
1107 pub markdown_text: Option<String>,
1108 #[serde(skip_serializing_if = "Option::is_none")]
1110 pub thread_ts: Option<String>,
1111 #[serde(skip_serializing_if = "Option::is_none")]
1113 pub recipient_user_id: Option<String>,
1114 #[serde(skip_serializing_if = "Option::is_none")]
1116 pub recipient_team_id: Option<String>,
1117 #[serde(skip_serializing_if = "Option::is_none")]
1119 pub task_display_mode: Option<String>,
1120 #[serde(skip_serializing_if = "Option::is_none")]
1122 pub icon_emoji: Option<String>,
1123 #[serde(skip_serializing_if = "Option::is_none")]
1125 pub icon_url: Option<String>,
1126 #[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#[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#[doc(alias = "chat.stopStream")]
1232#[derive(Debug, Clone, PartialEq, Serialize)]
1233#[non_exhaustive]
1234pub struct ChatStopStreamRequest {
1235 pub channel: String,
1237 pub ts: String,
1239 #[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 #[serde(skip_serializing_if = "Option::is_none")]
1247 pub markdown_text: Option<String>,
1248 #[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 #[serde(skip_serializing_if = "Option::is_none")]
1256 pub metadata: Option<crate::blocks::MessageMetadata>,
1257 #[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#[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#[doc(alias = "chat.unfurl")]
1346#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1347#[non_exhaustive]
1348pub struct ChatUnfurlRequest {
1349 #[serde(skip_serializing_if = "Option::is_none")]
1351 pub channel: Option<String>,
1352 #[serde(skip_serializing_if = "Option::is_none")]
1354 pub ts: Option<String>,
1355 #[serde(skip_serializing_if = "Option::is_none")]
1357 pub unfurls: Option<String>,
1358 #[serde(skip_serializing_if = "Option::is_none")]
1360 pub user_auth_message: Option<String>,
1361 #[serde(skip_serializing_if = "Option::is_none")]
1363 pub user_auth_required: Option<bool>,
1364 #[serde(skip_serializing_if = "Option::is_none")]
1366 pub user_auth_url: Option<String>,
1367 #[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 #[serde(skip_serializing_if = "Option::is_none")]
1375 pub unfurl_id: Option<String>,
1376 #[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#[doc(alias = "chat.unfurl")]
1449#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1450pub struct ChatUnfurlResponse {
1451 #[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#[doc(alias = "chat.update")]
1472#[derive(Debug, Clone, PartialEq, Serialize)]
1473#[non_exhaustive]
1474pub struct ChatUpdateRequest {
1475 pub channel: String,
1477 pub ts: String,
1479 #[serde(skip_serializing_if = "Option::is_none")]
1481 pub as_user: Option<bool>,
1482 #[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 #[serde(skip_serializing_if = "Option::is_none")]
1490 pub unfurled_attachments: Option<String>,
1491 #[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 #[serde(skip_serializing_if = "Option::is_none")]
1499 pub markdown_text: Option<String>,
1500 #[serde(skip_serializing_if = "Option::is_none")]
1502 pub metadata: Option<crate::blocks::MessageMetadata>,
1503 #[serde(skip_serializing_if = "Option::is_none")]
1505 pub link_names: Option<bool>,
1506 #[serde(skip_serializing_if = "Option::is_none")]
1508 pub parse: Option<String>,
1509 #[serde(skip_serializing_if = "Option::is_none")]
1511 pub text: Option<String>,
1512 #[serde(skip_serializing_if = "Option::is_none")]
1514 pub reply_broadcast: Option<bool>,
1515 #[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#[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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}