Skip to main content

slack_web_api/api/
conversations.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 [`conversations.acceptSharedInvite`](https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite): Accepts an invitation to a Slack Connect channel.
12///
13/// Send it with [`SlackClient::conversations_accept_shared_invite`].
14#[doc(alias = "conversations.acceptSharedInvite")]
15#[derive(Debug, Clone, PartialEq, Serialize)]
16#[non_exhaustive]
17pub struct ConversationsAcceptSharedInviteRequest {
18    /// Name of the channel. If the channel does not exist already in your workspace, this name is the one that the channel will take.
19    pub channel_name: String,
20    /// Whether the channel should be private.
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub is_private: Option<bool>,
23    /// Whether you'd like to use your workspace's free trial to begin using Slack Connect.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    pub free_trial_accepted: Option<bool>,
26    /// ID of the invite that you’d like to accept. Must provide either `invite_id` or `channel_id`. See the [`shared_channel_invite_received`](https://docs.slack.dev/reference/events/shared_channel_invite_received.md) event payload for more details on how to retrieve the ID of the invitation.
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub invite_id: Option<String>,
29    /// ID of the channel that you'd like to accept. Must provide either `invite_id` or `channel_id`.
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub channel_id: Option<String>,
32    /// The ID of the workspace to accept the channel in. If an org-level token is used to call this method, the `team_id` argument is required.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub team_id: Option<String>,
35}
36
37impl ConversationsAcceptSharedInviteRequest {
38    pub fn new(channel_name: impl Into<String>) -> Self {
39        Self {
40            channel_name: channel_name.into(),
41            is_private: None,
42            free_trial_accepted: None,
43            invite_id: None,
44            channel_id: None,
45            team_id: None,
46        }
47    }
48
49    pub fn is_private(mut self, is_private: bool) -> Self {
50        self.is_private = Some(is_private);
51        self
52    }
53
54    pub fn free_trial_accepted(mut self, free_trial_accepted: bool) -> Self {
55        self.free_trial_accepted = Some(free_trial_accepted);
56        self
57    }
58
59    pub fn invite_id(mut self, invite_id: impl Into<String>) -> Self {
60        self.invite_id = Some(invite_id.into());
61        self
62    }
63
64    pub fn channel_id(mut self, channel_id: impl Into<String>) -> Self {
65        self.channel_id = Some(channel_id.into());
66        self
67    }
68
69    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
70        self.team_id = Some(team_id.into());
71        self
72    }
73}
74
75impl SlackApiMethod for ConversationsAcceptSharedInviteRequest {
76    const METHOD: &'static str = "conversations.acceptSharedInvite";
77    type Response = ConversationsAcceptSharedInviteResponse;
78}
79
80/// Successful response of the Slack Web API method [`conversations.acceptSharedInvite`](https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite).
81#[doc(alias = "conversations.acceptSharedInvite")]
82#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
83pub struct ConversationsAcceptSharedInviteResponse {
84    #[serde(
85        default,
86        deserialize_with = "crate::de::opt_bool",
87        skip_serializing_if = "Option::is_none"
88    )]
89    pub implicit_approval: Option<bool>,
90    #[serde(
91        default,
92        deserialize_with = "crate::de::opt_string",
93        skip_serializing_if = "Option::is_none"
94    )]
95    pub channel_id: Option<String>,
96    #[serde(
97        default,
98        deserialize_with = "crate::de::opt_string",
99        skip_serializing_if = "Option::is_none"
100    )]
101    pub invite_id: Option<String>,
102    #[serde(
103        default,
104        deserialize_with = "crate::de::opt_object",
105        skip_serializing_if = "Option::is_none"
106    )]
107    pub response_metadata: Option<ResponseMetadata>,
108    #[serde(
109        default,
110        deserialize_with = "crate::de::opt_string",
111        skip_serializing_if = "Option::is_none"
112    )]
113    pub warning: Option<String>,
114}
115
116/// Arguments for the Slack Web API method [`conversations.approveSharedInvite`](https://docs.slack.dev/reference/methods/conversations.approveSharedInvite): Approves an invitation to a Slack Connect channel
117///
118/// Send it with [`SlackClient::conversations_approve_shared_invite`].
119#[doc(alias = "conversations.approveSharedInvite")]
120#[derive(Debug, Clone, PartialEq, Serialize)]
121#[non_exhaustive]
122pub struct ConversationsApproveSharedInviteRequest {
123    /// ID of the shared channel invite to approve
124    pub invite_id: String,
125    /// The team or enterprise ID of the receiving party involved in the invitation you are approving
126    #[serde(skip_serializing_if = "Option::is_none")]
127    pub target_team: Option<String>,
128}
129
130impl ConversationsApproveSharedInviteRequest {
131    pub fn new(invite_id: impl Into<String>) -> Self {
132        Self {
133            invite_id: invite_id.into(),
134            target_team: None,
135        }
136    }
137
138    pub fn target_team(mut self, target_team: impl Into<String>) -> Self {
139        self.target_team = Some(target_team.into());
140        self
141    }
142}
143
144impl SlackApiMethod for ConversationsApproveSharedInviteRequest {
145    const METHOD: &'static str = "conversations.approveSharedInvite";
146    type Response = ConversationsApproveSharedInviteResponse;
147}
148
149/// Successful response of the Slack Web API method [`conversations.approveSharedInvite`](https://docs.slack.dev/reference/methods/conversations.approveSharedInvite).
150#[doc(alias = "conversations.approveSharedInvite")]
151#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
152pub struct ConversationsApproveSharedInviteResponse {
153    /// Fields returned by Slack. This method has no documented response example.
154    #[serde(flatten)]
155    pub extra: serde_json::Map<String, serde_json::Value>,
156    #[serde(
157        default,
158        deserialize_with = "crate::de::opt_object",
159        skip_serializing_if = "Option::is_none"
160    )]
161    pub response_metadata: Option<ResponseMetadata>,
162    #[serde(
163        default,
164        deserialize_with = "crate::de::opt_string",
165        skip_serializing_if = "Option::is_none"
166    )]
167    pub warning: Option<String>,
168}
169
170/// Arguments for the Slack Web API method [`conversations.archive`](https://docs.slack.dev/reference/methods/conversations.archive): Archives a conversation.
171///
172/// Send it with [`SlackClient::conversations_archive`].
173#[doc(alias = "conversations.archive")]
174#[derive(Debug, Clone, PartialEq, Serialize)]
175#[non_exhaustive]
176pub struct ConversationsArchiveRequest {
177    /// ID of conversation to archive
178    pub channel: String,
179}
180
181impl ConversationsArchiveRequest {
182    pub fn new(channel: impl Into<String>) -> Self {
183        Self {
184            channel: channel.into(),
185        }
186    }
187}
188
189impl SlackApiMethod for ConversationsArchiveRequest {
190    const METHOD: &'static str = "conversations.archive";
191    type Response = ConversationsArchiveResponse;
192}
193
194/// Successful response of the Slack Web API method [`conversations.archive`](https://docs.slack.dev/reference/methods/conversations.archive).
195#[doc(alias = "conversations.archive")]
196#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
197pub struct ConversationsArchiveResponse {
198    /// Fields returned by Slack. This method has no documented response example.
199    #[serde(flatten)]
200    pub extra: serde_json::Map<String, serde_json::Value>,
201    #[serde(
202        default,
203        deserialize_with = "crate::de::opt_object",
204        skip_serializing_if = "Option::is_none"
205    )]
206    pub response_metadata: Option<ResponseMetadata>,
207    #[serde(
208        default,
209        deserialize_with = "crate::de::opt_string",
210        skip_serializing_if = "Option::is_none"
211    )]
212    pub warning: Option<String>,
213}
214
215/// Arguments for the Slack Web API method [`conversations.canvases.create`](https://docs.slack.dev/reference/methods/conversations.canvases.create): Create a channel canvas for a channel
216///
217/// Send it with [`SlackClient::conversations_canvases_create`].
218#[doc(alias = "conversations.canvases.create")]
219#[derive(Debug, Clone, PartialEq, Serialize)]
220#[non_exhaustive]
221pub struct ConversationsCanvasesCreateRequest {
222    /// Channel ID of the channel the canvas will be tabbed in.
223    pub channel_id: String,
224    /// Structure describing the type and value of the content to create. The markdown content is limited to 1 MiB (1,048,576 characters).
225    #[serde(skip_serializing_if = "Option::is_none")]
226    pub document_content: Option<String>,
227    /// Title of the newly created canvas
228    #[serde(skip_serializing_if = "Option::is_none")]
229    pub title: Option<String>,
230}
231
232impl ConversationsCanvasesCreateRequest {
233    pub fn new(channel_id: impl Into<String>) -> Self {
234        Self {
235            channel_id: channel_id.into(),
236            document_content: None,
237            title: None,
238        }
239    }
240
241    pub fn document_content(mut self, document_content: impl Into<String>) -> Self {
242        self.document_content = Some(document_content.into());
243        self
244    }
245
246    pub fn title(mut self, title: impl Into<String>) -> Self {
247        self.title = Some(title.into());
248        self
249    }
250}
251
252impl SlackApiMethod for ConversationsCanvasesCreateRequest {
253    const METHOD: &'static str = "conversations.canvases.create";
254    type Response = ConversationsCanvasesCreateResponse;
255}
256
257/// Successful response of the Slack Web API method [`conversations.canvases.create`](https://docs.slack.dev/reference/methods/conversations.canvases.create).
258#[doc(alias = "conversations.canvases.create")]
259#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
260pub struct ConversationsCanvasesCreateResponse {
261    #[serde(
262        default,
263        deserialize_with = "crate::de::opt_string",
264        skip_serializing_if = "Option::is_none"
265    )]
266    pub canvas_id: Option<String>,
267    #[serde(
268        default,
269        deserialize_with = "crate::de::opt_object",
270        skip_serializing_if = "Option::is_none"
271    )]
272    pub response_metadata: Option<ResponseMetadata>,
273    #[serde(
274        default,
275        deserialize_with = "crate::de::opt_string",
276        skip_serializing_if = "Option::is_none"
277    )]
278    pub warning: Option<String>,
279}
280
281/// Arguments for the Slack Web API method [`conversations.close`](https://docs.slack.dev/reference/methods/conversations.close): Closes a direct message or multi-person direct message.
282///
283/// Send it with [`SlackClient::conversations_close`].
284#[doc(alias = "conversations.close")]
285#[derive(Debug, Clone, PartialEq, Serialize)]
286#[non_exhaustive]
287pub struct ConversationsCloseRequest {
288    /// Conversation to close.
289    pub channel: String,
290}
291
292impl ConversationsCloseRequest {
293    pub fn new(channel: impl Into<String>) -> Self {
294        Self {
295            channel: channel.into(),
296        }
297    }
298}
299
300impl SlackApiMethod for ConversationsCloseRequest {
301    const METHOD: &'static str = "conversations.close";
302    type Response = ConversationsCloseResponse;
303}
304
305/// Successful response of the Slack Web API method [`conversations.close`](https://docs.slack.dev/reference/methods/conversations.close).
306#[doc(alias = "conversations.close")]
307#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
308pub struct ConversationsCloseResponse {
309    #[serde(
310        default,
311        deserialize_with = "crate::de::opt_bool",
312        skip_serializing_if = "Option::is_none"
313    )]
314    pub no_op: Option<bool>,
315    #[serde(
316        default,
317        deserialize_with = "crate::de::opt_bool",
318        skip_serializing_if = "Option::is_none"
319    )]
320    pub already_closed: Option<bool>,
321    #[serde(
322        default,
323        deserialize_with = "crate::de::opt_object",
324        skip_serializing_if = "Option::is_none"
325    )]
326    pub response_metadata: Option<ResponseMetadata>,
327    #[serde(
328        default,
329        deserialize_with = "crate::de::opt_string",
330        skip_serializing_if = "Option::is_none"
331    )]
332    pub warning: Option<String>,
333}
334
335/// Arguments for the Slack Web API method [`conversations.create`](https://docs.slack.dev/reference/methods/conversations.create): Initiates a public or private channel-based conversation
336///
337/// Send it with [`SlackClient::conversations_create`].
338#[doc(alias = "conversations.create")]
339#[derive(Debug, Clone, PartialEq, Serialize)]
340#[non_exhaustive]
341pub struct ConversationsCreateRequest {
342    /// Name of the public or private channel to create
343    pub name: String,
344    /// Create a private channel instead of a public one
345    #[serde(skip_serializing_if = "Option::is_none")]
346    pub is_private: Option<bool>,
347    /// encoded team id to create the channel in, required if org token is used
348    #[serde(skip_serializing_if = "Option::is_none")]
349    pub team_id: Option<String>,
350}
351
352impl ConversationsCreateRequest {
353    pub fn new(name: impl Into<String>) -> Self {
354        Self {
355            name: name.into(),
356            is_private: None,
357            team_id: None,
358        }
359    }
360
361    pub fn is_private(mut self, is_private: bool) -> Self {
362        self.is_private = Some(is_private);
363        self
364    }
365
366    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
367        self.team_id = Some(team_id.into());
368        self
369    }
370}
371
372impl SlackApiMethod for ConversationsCreateRequest {
373    const METHOD: &'static str = "conversations.create";
374    type Response = ConversationsCreateResponse;
375}
376
377/// Successful response of the Slack Web API method [`conversations.create`](https://docs.slack.dev/reference/methods/conversations.create).
378#[doc(alias = "conversations.create")]
379#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
380pub struct ConversationsCreateResponse {
381    #[serde(
382        default,
383        deserialize_with = "crate::de::opt_object",
384        skip_serializing_if = "Option::is_none"
385    )]
386    pub channel: Option<Conversation>,
387    #[serde(
388        default,
389        deserialize_with = "crate::de::opt_object",
390        skip_serializing_if = "Option::is_none"
391    )]
392    pub response_metadata: Option<ResponseMetadata>,
393    #[serde(
394        default,
395        deserialize_with = "crate::de::opt_string",
396        skip_serializing_if = "Option::is_none"
397    )]
398    pub warning: Option<String>,
399}
400
401/// Arguments for the Slack Web API method [`conversations.declineSharedInvite`](https://docs.slack.dev/reference/methods/conversations.declineSharedInvite): Declines a Slack Connect channel invite.
402///
403/// Send it with [`SlackClient::conversations_decline_shared_invite`].
404#[doc(alias = "conversations.declineSharedInvite")]
405#[derive(Debug, Clone, PartialEq, Serialize)]
406#[non_exhaustive]
407pub struct ConversationsDeclineSharedInviteRequest {
408    /// ID of the Slack Connect invite to decline. Subscribe to the [`shared_channel_invite_accepted`](https://docs.slack.dev/reference/events/shared_channel_invite_accepted.md) event to receive IDs of Slack Connect channel invites that have been accepted and are awaiting approval.
409    pub invite_id: String,
410    /// The team or enterprise id of the other party involved in the invitation you are declining
411    #[serde(skip_serializing_if = "Option::is_none")]
412    pub target_team: Option<String>,
413}
414
415impl ConversationsDeclineSharedInviteRequest {
416    pub fn new(invite_id: impl Into<String>) -> Self {
417        Self {
418            invite_id: invite_id.into(),
419            target_team: None,
420        }
421    }
422
423    pub fn target_team(mut self, target_team: impl Into<String>) -> Self {
424        self.target_team = Some(target_team.into());
425        self
426    }
427}
428
429impl SlackApiMethod for ConversationsDeclineSharedInviteRequest {
430    const METHOD: &'static str = "conversations.declineSharedInvite";
431    type Response = ConversationsDeclineSharedInviteResponse;
432}
433
434/// Successful response of the Slack Web API method [`conversations.declineSharedInvite`](https://docs.slack.dev/reference/methods/conversations.declineSharedInvite).
435#[doc(alias = "conversations.declineSharedInvite")]
436#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
437pub struct ConversationsDeclineSharedInviteResponse {
438    /// Fields returned by Slack. This method has no documented response example.
439    #[serde(flatten)]
440    pub extra: serde_json::Map<String, serde_json::Value>,
441    #[serde(
442        default,
443        deserialize_with = "crate::de::opt_object",
444        skip_serializing_if = "Option::is_none"
445    )]
446    pub response_metadata: Option<ResponseMetadata>,
447    #[serde(
448        default,
449        deserialize_with = "crate::de::opt_string",
450        skip_serializing_if = "Option::is_none"
451    )]
452    pub warning: Option<String>,
453}
454
455/// Arguments for the Slack Web API method [`conversations.externalInvitePermissions.set`](https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set): Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'.
456///
457/// Send it with [`SlackClient::conversations_external_invite_permissions_set`].
458#[doc(alias = "conversations.externalInvitePermissions.set")]
459#[derive(Debug, Clone, PartialEq, Serialize)]
460#[non_exhaustive]
461pub struct ConversationsExternalInvitePermissionsSetRequest {
462    /// The channel ID to change external invite permissions for
463    pub channel: String,
464    /// The encoded team ID of the target team. Must be in the specified channel.
465    pub target_team: String,
466    /// Type of action to be taken: upgrade or downgrade
467    pub action: String,
468}
469
470impl ConversationsExternalInvitePermissionsSetRequest {
471    pub fn new(
472        channel: impl Into<String>,
473        target_team: impl Into<String>,
474        action: impl Into<String>,
475    ) -> Self {
476        Self {
477            channel: channel.into(),
478            target_team: target_team.into(),
479            action: action.into(),
480        }
481    }
482}
483
484impl SlackApiMethod for ConversationsExternalInvitePermissionsSetRequest {
485    const METHOD: &'static str = "conversations.externalInvitePermissions.set";
486    type Response = ConversationsExternalInvitePermissionsSetResponse;
487}
488
489/// Successful response of the Slack Web API method [`conversations.externalInvitePermissions.set`](https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set).
490#[doc(alias = "conversations.externalInvitePermissions.set")]
491#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
492pub struct ConversationsExternalInvitePermissionsSetResponse {
493    /// Fields returned by Slack. This method has no documented response example.
494    #[serde(flatten)]
495    pub extra: serde_json::Map<String, serde_json::Value>,
496    #[serde(
497        default,
498        deserialize_with = "crate::de::opt_object",
499        skip_serializing_if = "Option::is_none"
500    )]
501    pub response_metadata: Option<ResponseMetadata>,
502    #[serde(
503        default,
504        deserialize_with = "crate::de::opt_string",
505        skip_serializing_if = "Option::is_none"
506    )]
507    pub warning: Option<String>,
508}
509
510/// Arguments for the Slack Web API method [`conversations.history`](https://docs.slack.dev/reference/methods/conversations.history): Fetches a conversation's history of messages and events.
511///
512/// Send it with [`SlackClient::conversations_history`].
513#[doc(alias = "conversations.history")]
514#[derive(Debug, Clone, PartialEq, Serialize)]
515#[non_exhaustive]
516pub struct ConversationsHistoryRequest {
517    /// Conversation ID to fetch history for.
518    pub channel: String,
519    /// Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](https://docs.slack.dev/apis/web-api/pagination.md) for more detail.
520    #[serde(skip_serializing_if = "Option::is_none")]
521    pub cursor: Option<String>,
522    /// Return all metadata associated with this message.
523    #[serde(skip_serializing_if = "Option::is_none")]
524    pub include_all_metadata: Option<bool>,
525    /// Include messages with `oldest` or `latest` timestamps in results. Ignored unless either timestamp is specified.
526    #[serde(skip_serializing_if = "Option::is_none")]
527    pub inclusive: Option<bool>,
528    /// Only messages before this Unix timestamp will be included in results. Default is the current time.
529    #[serde(skip_serializing_if = "Option::is_none")]
530    pub latest: Option<String>,
531    /// The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the conversation history hasn't been reached. Maximum of 999.
532    #[serde(skip_serializing_if = "Option::is_none")]
533    pub limit: Option<i64>,
534    /// Only messages after this Unix timestamp will be included in results.
535    #[serde(skip_serializing_if = "Option::is_none")]
536    pub oldest: Option<String>,
537}
538
539impl ConversationsHistoryRequest {
540    pub fn new(channel: impl Into<String>) -> Self {
541        Self {
542            channel: channel.into(),
543            cursor: None,
544            include_all_metadata: None,
545            inclusive: None,
546            latest: None,
547            limit: None,
548            oldest: None,
549        }
550    }
551
552    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
553        self.cursor = Some(cursor.into());
554        self
555    }
556
557    pub fn include_all_metadata(mut self, include_all_metadata: bool) -> Self {
558        self.include_all_metadata = Some(include_all_metadata);
559        self
560    }
561
562    pub fn inclusive(mut self, inclusive: bool) -> Self {
563        self.inclusive = Some(inclusive);
564        self
565    }
566
567    pub fn latest(mut self, latest: impl Into<String>) -> Self {
568        self.latest = Some(latest.into());
569        self
570    }
571
572    pub fn limit(mut self, limit: i64) -> Self {
573        self.limit = Some(limit);
574        self
575    }
576
577    pub fn oldest(mut self, oldest: impl Into<String>) -> Self {
578        self.oldest = Some(oldest.into());
579        self
580    }
581}
582
583impl SlackApiMethod for ConversationsHistoryRequest {
584    const METHOD: &'static str = "conversations.history";
585    type Response = ConversationsHistoryResponse;
586}
587
588impl CursorPaginated for ConversationsHistoryRequest {
589    fn set_cursor(&mut self, cursor: String) {
590        self.cursor = Some(cursor);
591    }
592}
593
594impl NextCursor for ConversationsHistoryResponse {
595    fn next_cursor(&self) -> Option<&str> {
596        self.response_metadata.as_ref()?.next_cursor.as_deref()
597    }
598}
599
600/// Successful response of the Slack Web API method [`conversations.history`](https://docs.slack.dev/reference/methods/conversations.history).
601#[doc(alias = "conversations.history")]
602#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
603pub struct ConversationsHistoryResponse {
604    #[serde(
605        default,
606        deserialize_with = "crate::de::vec",
607        skip_serializing_if = "Vec::is_empty"
608    )]
609    pub messages: Vec<Message>,
610    #[serde(
611        default,
612        deserialize_with = "crate::de::opt_bool",
613        skip_serializing_if = "Option::is_none"
614    )]
615    pub has_more: Option<bool>,
616    #[serde(
617        default,
618        deserialize_with = "crate::de::opt_i64",
619        skip_serializing_if = "Option::is_none"
620    )]
621    pub pin_count: Option<i64>,
622    #[serde(
623        default,
624        deserialize_with = "crate::de::opt_object",
625        skip_serializing_if = "Option::is_none"
626    )]
627    pub response_metadata: Option<ResponseMetadata>,
628    #[serde(
629        default,
630        deserialize_with = "crate::de::opt_string",
631        skip_serializing_if = "Option::is_none"
632    )]
633    pub latest: Option<String>,
634    #[serde(
635        default,
636        deserialize_with = "crate::de::opt_string",
637        skip_serializing_if = "Option::is_none"
638    )]
639    pub warning: Option<String>,
640}
641
642/// Arguments for the Slack Web API method [`conversations.info`](https://docs.slack.dev/reference/methods/conversations.info): Retrieve information about a conversation.
643///
644/// Send it with [`SlackClient::conversations_info`].
645#[doc(alias = "conversations.info")]
646#[derive(Debug, Clone, PartialEq, Serialize)]
647#[non_exhaustive]
648pub struct ConversationsInfoRequest {
649    /// Conversation ID to learn more about
650    pub channel: String,
651    /// Set this to `true` to receive the locale for this conversation. Defaults to `false`
652    #[serde(skip_serializing_if = "Option::is_none")]
653    pub include_locale: Option<bool>,
654    /// Set to `true` to include the member count for the specified conversation. Defaults to `false`
655    #[serde(skip_serializing_if = "Option::is_none")]
656    pub include_num_members: Option<bool>,
657}
658
659impl ConversationsInfoRequest {
660    pub fn new(channel: impl Into<String>) -> Self {
661        Self {
662            channel: channel.into(),
663            include_locale: None,
664            include_num_members: None,
665        }
666    }
667
668    pub fn include_locale(mut self, include_locale: bool) -> Self {
669        self.include_locale = Some(include_locale);
670        self
671    }
672
673    pub fn include_num_members(mut self, include_num_members: bool) -> Self {
674        self.include_num_members = Some(include_num_members);
675        self
676    }
677}
678
679impl SlackApiMethod for ConversationsInfoRequest {
680    const METHOD: &'static str = "conversations.info";
681    type Response = ConversationsInfoResponse;
682}
683
684/// Successful response of the Slack Web API method [`conversations.info`](https://docs.slack.dev/reference/methods/conversations.info).
685#[doc(alias = "conversations.info")]
686#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
687pub struct ConversationsInfoResponse {
688    #[serde(
689        default,
690        deserialize_with = "crate::de::opt_object",
691        skip_serializing_if = "Option::is_none"
692    )]
693    pub channel: Option<Conversation>,
694    #[serde(
695        default,
696        deserialize_with = "crate::de::opt_object",
697        skip_serializing_if = "Option::is_none"
698    )]
699    pub response_metadata: Option<ResponseMetadata>,
700    #[serde(
701        default,
702        deserialize_with = "crate::de::opt_string",
703        skip_serializing_if = "Option::is_none"
704    )]
705    pub warning: Option<String>,
706}
707
708/// Arguments for the Slack Web API method [`conversations.invite`](https://docs.slack.dev/reference/methods/conversations.invite): Invites users to a channel.
709///
710/// Send it with [`SlackClient::conversations_invite`].
711#[doc(alias = "conversations.invite")]
712#[derive(Debug, Clone, PartialEq, Serialize)]
713#[non_exhaustive]
714pub struct ConversationsInviteRequest {
715    /// The ID of the public or private channel to invite user(s) to.
716    pub channel: String,
717    /// A comma separated list of user IDs. Up to 1000 users may be listed.
718    pub users: String,
719    /// When set to `true` and multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults to `false`.
720    #[serde(skip_serializing_if = "Option::is_none")]
721    pub force: Option<bool>,
722}
723
724impl ConversationsInviteRequest {
725    pub fn new(channel: impl Into<String>, users: impl Into<String>) -> Self {
726        Self {
727            channel: channel.into(),
728            users: users.into(),
729            force: None,
730        }
731    }
732
733    pub fn force(mut self, force: bool) -> Self {
734        self.force = Some(force);
735        self
736    }
737}
738
739impl SlackApiMethod for ConversationsInviteRequest {
740    const METHOD: &'static str = "conversations.invite";
741    type Response = ConversationsInviteResponse;
742}
743
744/// Successful response of the Slack Web API method [`conversations.invite`](https://docs.slack.dev/reference/methods/conversations.invite).
745#[doc(alias = "conversations.invite")]
746#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
747pub struct ConversationsInviteResponse {
748    #[serde(
749        default,
750        deserialize_with = "crate::de::opt_object",
751        skip_serializing_if = "Option::is_none"
752    )]
753    pub channel: Option<Conversation>,
754    #[serde(
755        default,
756        deserialize_with = "crate::de::opt_object",
757        skip_serializing_if = "Option::is_none"
758    )]
759    pub response_metadata: Option<ResponseMetadata>,
760    #[serde(
761        default,
762        deserialize_with = "crate::de::opt_string",
763        skip_serializing_if = "Option::is_none"
764    )]
765    pub warning: Option<String>,
766}
767
768/// Arguments for the Slack Web API method [`conversations.inviteShared`](https://docs.slack.dev/reference/methods/conversations.inviteShared): Sends an invitation to a Slack Connect channel
769///
770/// Send it with [`SlackClient::conversations_invite_shared`].
771#[doc(alias = "conversations.inviteShared")]
772#[derive(Debug, Clone, PartialEq, Serialize)]
773#[non_exhaustive]
774pub struct ConversationsInviteSharedRequest {
775    /// ID of the channel on your team that you'd like to share
776    pub channel: String,
777    /// Optional email to receive this invite. Either `emails` or `user_ids` must be provided. Only one email or one user ID may be invited at a time.
778    #[serde(skip_serializing_if = "Option::is_none")]
779    pub emails: Option<Vec<String>>,
780    /// Optional user\_id to receive this invite. Either `emails` or `user_ids` must be provided. Only one email or one user ID may be invited at a time.
781    #[serde(skip_serializing_if = "Option::is_none")]
782    pub user_ids: Option<Vec<String>>,
783    /// Optional boolean on whether invite is to an external limited member. Defaults to `true`.
784    #[serde(skip_serializing_if = "Option::is_none")]
785    pub external_limited: Option<bool>,
786}
787
788impl ConversationsInviteSharedRequest {
789    pub fn new(channel: impl Into<String>) -> Self {
790        Self {
791            channel: channel.into(),
792            emails: None,
793            user_ids: None,
794            external_limited: None,
795        }
796    }
797
798    pub fn emails(mut self, emails: Vec<String>) -> Self {
799        self.emails = Some(emails);
800        self
801    }
802
803    pub fn user_ids(mut self, user_ids: Vec<String>) -> Self {
804        self.user_ids = Some(user_ids);
805        self
806    }
807
808    pub fn external_limited(mut self, external_limited: bool) -> Self {
809        self.external_limited = Some(external_limited);
810        self
811    }
812}
813
814impl SlackApiMethod for ConversationsInviteSharedRequest {
815    const METHOD: &'static str = "conversations.inviteShared";
816    type Response = ConversationsInviteSharedResponse;
817}
818
819/// Successful response of the Slack Web API method [`conversations.inviteShared`](https://docs.slack.dev/reference/methods/conversations.inviteShared).
820#[doc(alias = "conversations.inviteShared")]
821#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
822pub struct ConversationsInviteSharedResponse {
823    #[serde(
824        default,
825        deserialize_with = "crate::de::opt_string",
826        skip_serializing_if = "Option::is_none"
827    )]
828    pub invite_id: Option<String>,
829    #[serde(
830        default,
831        deserialize_with = "crate::de::opt_bool",
832        skip_serializing_if = "Option::is_none"
833    )]
834    pub is_legacy_shared_channel: Option<bool>,
835    #[serde(
836        default,
837        deserialize_with = "crate::de::opt_object",
838        skip_serializing_if = "Option::is_none"
839    )]
840    pub response_metadata: Option<ResponseMetadata>,
841    #[serde(
842        default,
843        deserialize_with = "crate::de::opt_string",
844        skip_serializing_if = "Option::is_none"
845    )]
846    pub warning: Option<String>,
847}
848
849/// Arguments for the Slack Web API method [`conversations.join`](https://docs.slack.dev/reference/methods/conversations.join): Joins an existing conversation.
850///
851/// Send it with [`SlackClient::conversations_join`].
852#[doc(alias = "conversations.join")]
853#[derive(Debug, Clone, PartialEq, Serialize)]
854#[non_exhaustive]
855pub struct ConversationsJoinRequest {
856    /// ID of conversation to join
857    pub channel: String,
858}
859
860impl ConversationsJoinRequest {
861    pub fn new(channel: impl Into<String>) -> Self {
862        Self {
863            channel: channel.into(),
864        }
865    }
866}
867
868impl SlackApiMethod for ConversationsJoinRequest {
869    const METHOD: &'static str = "conversations.join";
870    type Response = ConversationsJoinResponse;
871}
872
873/// Successful response of the Slack Web API method [`conversations.join`](https://docs.slack.dev/reference/methods/conversations.join).
874#[doc(alias = "conversations.join")]
875#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
876pub struct ConversationsJoinResponse {
877    #[serde(
878        default,
879        deserialize_with = "crate::de::opt_object",
880        skip_serializing_if = "Option::is_none"
881    )]
882    pub channel: Option<Conversation>,
883    #[serde(
884        default,
885        deserialize_with = "crate::de::opt_string",
886        skip_serializing_if = "Option::is_none"
887    )]
888    pub warning: Option<String>,
889    #[serde(
890        default,
891        deserialize_with = "crate::de::opt_object",
892        skip_serializing_if = "Option::is_none"
893    )]
894    pub response_metadata: Option<ResponseMetadata>,
895}
896
897/// Arguments for the Slack Web API method [`conversations.kick`](https://docs.slack.dev/reference/methods/conversations.kick): Removes a user from a conversation.
898///
899/// Send it with [`SlackClient::conversations_kick`].
900#[doc(alias = "conversations.kick")]
901#[derive(Debug, Clone, PartialEq, Serialize)]
902#[non_exhaustive]
903pub struct ConversationsKickRequest {
904    /// ID of conversation to remove user from.
905    pub channel: String,
906    /// User ID to be removed.
907    #[serde(skip_serializing_if = "Option::is_none")]
908    pub user: Option<String>,
909}
910
911impl ConversationsKickRequest {
912    pub fn new(channel: impl Into<String>) -> Self {
913        Self {
914            channel: channel.into(),
915            user: None,
916        }
917    }
918
919    pub fn user(mut self, user: impl Into<String>) -> Self {
920        self.user = Some(user.into());
921        self
922    }
923}
924
925impl SlackApiMethod for ConversationsKickRequest {
926    const METHOD: &'static str = "conversations.kick";
927    type Response = ConversationsKickResponse;
928}
929
930/// Successful response of the Slack Web API method [`conversations.kick`](https://docs.slack.dev/reference/methods/conversations.kick).
931#[doc(alias = "conversations.kick")]
932#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
933pub struct ConversationsKickResponse {
934    #[serde(
935        default,
936        deserialize_with = "crate::de::opt_object",
937        skip_serializing_if = "Option::is_none"
938    )]
939    pub errors: Option<serde_json::Map<String, serde_json::Value>>,
940    #[serde(
941        default,
942        deserialize_with = "crate::de::opt_object",
943        skip_serializing_if = "Option::is_none"
944    )]
945    pub response_metadata: Option<ResponseMetadata>,
946    #[serde(
947        default,
948        deserialize_with = "crate::de::opt_string",
949        skip_serializing_if = "Option::is_none"
950    )]
951    pub warning: Option<String>,
952}
953
954/// Arguments for the Slack Web API method [`conversations.leave`](https://docs.slack.dev/reference/methods/conversations.leave): Leaves a conversation.
955///
956/// Send it with [`SlackClient::conversations_leave`].
957#[doc(alias = "conversations.leave")]
958#[derive(Debug, Clone, PartialEq, Serialize)]
959#[non_exhaustive]
960pub struct ConversationsLeaveRequest {
961    /// Conversation to leave
962    pub channel: String,
963}
964
965impl ConversationsLeaveRequest {
966    pub fn new(channel: impl Into<String>) -> Self {
967        Self {
968            channel: channel.into(),
969        }
970    }
971}
972
973impl SlackApiMethod for ConversationsLeaveRequest {
974    const METHOD: &'static str = "conversations.leave";
975    type Response = ConversationsLeaveResponse;
976}
977
978/// Successful response of the Slack Web API method [`conversations.leave`](https://docs.slack.dev/reference/methods/conversations.leave).
979#[doc(alias = "conversations.leave")]
980#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
981pub struct ConversationsLeaveResponse {
982    /// Fields returned by Slack. This method has no documented response example.
983    #[serde(flatten)]
984    pub extra: serde_json::Map<String, serde_json::Value>,
985    #[serde(
986        default,
987        deserialize_with = "crate::de::opt_object",
988        skip_serializing_if = "Option::is_none"
989    )]
990    pub response_metadata: Option<ResponseMetadata>,
991    #[serde(
992        default,
993        deserialize_with = "crate::de::opt_string",
994        skip_serializing_if = "Option::is_none"
995    )]
996    pub warning: Option<String>,
997}
998
999/// Arguments for the Slack Web API method [`conversations.list`](https://docs.slack.dev/reference/methods/conversations.list): Lists all channels in a Slack team.
1000///
1001/// Send it with [`SlackClient::conversations_list`].
1002#[doc(alias = "conversations.list")]
1003#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1004#[non_exhaustive]
1005pub struct ConversationsListRequest {
1006    /// Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](https://docs.slack.dev/apis/web-api/pagination.md) for more detail.
1007    #[serde(skip_serializing_if = "Option::is_none")]
1008    pub cursor: Option<String>,
1009    /// Set to `true` to exclude archived channels from the list.
1010    #[serde(skip_serializing_if = "Option::is_none")]
1011    pub exclude_archived: Option<bool>,
1012    /// The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer under 1000.
1013    #[serde(skip_serializing_if = "Option::is_none")]
1014    pub limit: Option<i64>,
1015    /// encoded team id to list channels in, required if token belongs to org-wide app
1016    #[serde(skip_serializing_if = "Option::is_none")]
1017    pub team_id: Option<String>,
1018    /// Mix and match channel types by providing a comma-separated list of any combination of `public_channel`, `private_channel`, `mpim`, `im`
1019    #[serde(skip_serializing_if = "Option::is_none")]
1020    pub types: Option<String>,
1021}
1022
1023impl ConversationsListRequest {
1024    pub fn new() -> Self {
1025        Self {
1026            cursor: None,
1027            exclude_archived: None,
1028            limit: None,
1029            team_id: None,
1030            types: None,
1031        }
1032    }
1033
1034    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1035        self.cursor = Some(cursor.into());
1036        self
1037    }
1038
1039    pub fn exclude_archived(mut self, exclude_archived: bool) -> Self {
1040        self.exclude_archived = Some(exclude_archived);
1041        self
1042    }
1043
1044    pub fn limit(mut self, limit: i64) -> Self {
1045        self.limit = Some(limit);
1046        self
1047    }
1048
1049    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1050        self.team_id = Some(team_id.into());
1051        self
1052    }
1053
1054    pub fn types(mut self, types: impl Into<String>) -> Self {
1055        self.types = Some(types.into());
1056        self
1057    }
1058}
1059
1060impl SlackApiMethod for ConversationsListRequest {
1061    const METHOD: &'static str = "conversations.list";
1062    type Response = ConversationsListResponse;
1063}
1064
1065impl CursorPaginated for ConversationsListRequest {
1066    fn set_cursor(&mut self, cursor: String) {
1067        self.cursor = Some(cursor);
1068    }
1069}
1070
1071impl NextCursor for ConversationsListResponse {
1072    fn next_cursor(&self) -> Option<&str> {
1073        self.response_metadata.as_ref()?.next_cursor.as_deref()
1074    }
1075}
1076
1077/// Successful response of the Slack Web API method [`conversations.list`](https://docs.slack.dev/reference/methods/conversations.list).
1078#[doc(alias = "conversations.list")]
1079#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1080pub struct ConversationsListResponse {
1081    #[serde(
1082        default,
1083        deserialize_with = "crate::de::vec",
1084        skip_serializing_if = "Vec::is_empty"
1085    )]
1086    pub channels: Vec<Conversation>,
1087    #[serde(
1088        default,
1089        deserialize_with = "crate::de::opt_object",
1090        skip_serializing_if = "Option::is_none"
1091    )]
1092    pub response_metadata: Option<ResponseMetadata>,
1093    #[serde(
1094        default,
1095        deserialize_with = "crate::de::opt_string",
1096        skip_serializing_if = "Option::is_none"
1097    )]
1098    pub warning: Option<String>,
1099}
1100
1101/// Arguments for the Slack Web API method [`conversations.listConnectInvites`](https://docs.slack.dev/reference/methods/conversations.listConnectInvites): Lists shared channel invites that have been generated or received but have not been approved by all parties
1102///
1103/// Send it with [`SlackClient::conversations_list_connect_invites`].
1104#[doc(alias = "conversations.listConnectInvites")]
1105#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1106#[non_exhaustive]
1107pub struct ConversationsListConnectInvitesRequest {
1108    /// Encoded team id for the workspace to retrieve invites for, required if org token is used
1109    #[serde(skip_serializing_if = "Option::is_none")]
1110    pub team_id: Option<String>,
1111    /// Maximum number of invites to return
1112    #[serde(skip_serializing_if = "Option::is_none")]
1113    pub count: Option<i64>,
1114    /// Set to `next_cursor` returned by previous call to list items in subsequent page
1115    #[serde(skip_serializing_if = "Option::is_none")]
1116    pub cursor: Option<String>,
1117}
1118
1119impl ConversationsListConnectInvitesRequest {
1120    pub fn new() -> Self {
1121        Self {
1122            team_id: None,
1123            count: None,
1124            cursor: None,
1125        }
1126    }
1127
1128    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1129        self.team_id = Some(team_id.into());
1130        self
1131    }
1132
1133    pub fn count(mut self, count: i64) -> Self {
1134        self.count = Some(count);
1135        self
1136    }
1137
1138    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1139        self.cursor = Some(cursor.into());
1140        self
1141    }
1142}
1143
1144impl SlackApiMethod for ConversationsListConnectInvitesRequest {
1145    const METHOD: &'static str = "conversations.listConnectInvites";
1146    type Response = ConversationsListConnectInvitesResponse;
1147}
1148
1149impl CursorPaginated for ConversationsListConnectInvitesRequest {
1150    fn set_cursor(&mut self, cursor: String) {
1151        self.cursor = Some(cursor);
1152    }
1153}
1154
1155impl NextCursor for ConversationsListConnectInvitesResponse {
1156    fn next_cursor(&self) -> Option<&str> {
1157        self.response_metadata.as_ref()?.next_cursor.as_deref()
1158    }
1159}
1160
1161/// Successful response of the Slack Web API method [`conversations.listConnectInvites`](https://docs.slack.dev/reference/methods/conversations.listConnectInvites).
1162#[doc(alias = "conversations.listConnectInvites")]
1163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1164pub struct ConversationsListConnectInvitesResponse {
1165    #[serde(
1166        default,
1167        deserialize_with = "crate::de::vec",
1168        skip_serializing_if = "Vec::is_empty"
1169    )]
1170    pub invites: Vec<ConversationsListConnectInvitesResponseInvites>,
1171    #[serde(
1172        default,
1173        deserialize_with = "crate::de::opt_object",
1174        skip_serializing_if = "Option::is_none"
1175    )]
1176    pub response_metadata: Option<ResponseMetadata>,
1177    #[serde(
1178        default,
1179        deserialize_with = "crate::de::opt_string",
1180        skip_serializing_if = "Option::is_none"
1181    )]
1182    pub warning: Option<String>,
1183}
1184
1185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1186pub struct ConversationsListConnectInvitesResponseInvites {
1187    #[serde(
1188        default,
1189        deserialize_with = "crate::de::opt_string",
1190        skip_serializing_if = "Option::is_none"
1191    )]
1192    pub direction: Option<String>,
1193    #[serde(
1194        default,
1195        deserialize_with = "crate::de::opt_string",
1196        skip_serializing_if = "Option::is_none"
1197    )]
1198    pub status: Option<String>,
1199    #[serde(
1200        default,
1201        deserialize_with = "crate::de::opt_i64",
1202        skip_serializing_if = "Option::is_none"
1203    )]
1204    pub date_last_updated: Option<i64>,
1205    #[serde(
1206        default,
1207        deserialize_with = "crate::de::opt_string",
1208        skip_serializing_if = "Option::is_none"
1209    )]
1210    pub invite_type: Option<String>,
1211    #[serde(
1212        default,
1213        deserialize_with = "crate::de::opt_object",
1214        skip_serializing_if = "Option::is_none"
1215    )]
1216    pub invite: Option<ConversationsListConnectInvitesResponseInvitesInvite>,
1217    #[serde(
1218        default,
1219        deserialize_with = "crate::de::opt_object",
1220        skip_serializing_if = "Option::is_none"
1221    )]
1222    pub channel: Option<Conversation>,
1223    #[serde(
1224        default,
1225        deserialize_with = "crate::de::vec",
1226        skip_serializing_if = "Vec::is_empty"
1227    )]
1228    pub acceptances: Vec<ConversationsListConnectInvitesResponseInvitesAcceptances>,
1229}
1230
1231#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1232pub struct ConversationsListConnectInvitesResponseInvitesInvite {
1233    #[serde(
1234        default,
1235        deserialize_with = "crate::de::opt_string",
1236        skip_serializing_if = "Option::is_none"
1237    )]
1238    pub id: Option<String>,
1239    #[serde(
1240        default,
1241        deserialize_with = "crate::de::opt_i64",
1242        skip_serializing_if = "Option::is_none"
1243    )]
1244    pub date_created: Option<i64>,
1245    #[serde(
1246        default,
1247        deserialize_with = "crate::de::opt_i64",
1248        skip_serializing_if = "Option::is_none"
1249    )]
1250    pub date_invalid: Option<i64>,
1251    #[serde(
1252        default,
1253        deserialize_with = "crate::de::opt_object",
1254        skip_serializing_if = "Option::is_none"
1255    )]
1256    pub inviting_team: Option<Team>,
1257    #[serde(
1258        default,
1259        deserialize_with = "crate::de::opt_object",
1260        skip_serializing_if = "Option::is_none"
1261    )]
1262    pub inviting_user: Option<User>,
1263    #[serde(
1264        default,
1265        deserialize_with = "crate::de::opt_string",
1266        skip_serializing_if = "Option::is_none"
1267    )]
1268    pub link: Option<String>,
1269}
1270
1271#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1272pub struct ConversationsListConnectInvitesResponseInvitesAcceptances {
1273    #[serde(
1274        default,
1275        deserialize_with = "crate::de::opt_string",
1276        skip_serializing_if = "Option::is_none"
1277    )]
1278    pub approval_status: Option<String>,
1279    #[serde(
1280        default,
1281        deserialize_with = "crate::de::opt_i64",
1282        skip_serializing_if = "Option::is_none"
1283    )]
1284    pub date_accepted: Option<i64>,
1285    #[serde(
1286        default,
1287        deserialize_with = "crate::de::opt_i64",
1288        skip_serializing_if = "Option::is_none"
1289    )]
1290    pub date_invalid: Option<i64>,
1291    #[serde(
1292        default,
1293        deserialize_with = "crate::de::opt_i64",
1294        skip_serializing_if = "Option::is_none"
1295    )]
1296    pub date_last_updated: Option<i64>,
1297    #[serde(
1298        default,
1299        deserialize_with = "crate::de::opt_object",
1300        skip_serializing_if = "Option::is_none"
1301    )]
1302    pub accepting_team: Option<Team>,
1303    #[serde(
1304        default,
1305        deserialize_with = "crate::de::opt_object",
1306        skip_serializing_if = "Option::is_none"
1307    )]
1308    pub accepting_user: Option<User>,
1309    #[serde(
1310        default,
1311        deserialize_with = "crate::de::vec",
1312        skip_serializing_if = "Vec::is_empty"
1313    )]
1314    pub reviews: Vec<ConversationsListConnectInvitesResponseInvitesAcceptancesReviews>,
1315}
1316
1317#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1318pub struct ConversationsListConnectInvitesResponseInvitesAcceptancesReviews {
1319    #[serde(
1320        default,
1321        deserialize_with = "crate::de::opt_string",
1322        skip_serializing_if = "Option::is_none"
1323    )]
1324    pub r#type: Option<String>,
1325    #[serde(
1326        default,
1327        deserialize_with = "crate::de::opt_i64",
1328        skip_serializing_if = "Option::is_none"
1329    )]
1330    pub date_review: Option<i64>,
1331    #[serde(
1332        default,
1333        deserialize_with = "crate::de::opt_object",
1334        skip_serializing_if = "Option::is_none"
1335    )]
1336    pub reviewing_team: Option<Team>,
1337}
1338
1339/// Arguments for the Slack Web API method [`conversations.mark`](https://docs.slack.dev/reference/methods/conversations.mark): Sets the read cursor in a channel.
1340///
1341/// Send it with [`SlackClient::conversations_mark`].
1342#[doc(alias = "conversations.mark")]
1343#[derive(Debug, Clone, PartialEq, Serialize)]
1344#[non_exhaustive]
1345pub struct ConversationsMarkRequest {
1346    /// Channel or conversation to set the read cursor for.
1347    pub channel: String,
1348    /// Unique identifier of message you want marked as most recently seen in this conversation.
1349    pub ts: String,
1350}
1351
1352impl ConversationsMarkRequest {
1353    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
1354        Self {
1355            channel: channel.into(),
1356            ts: ts.into(),
1357        }
1358    }
1359}
1360
1361impl SlackApiMethod for ConversationsMarkRequest {
1362    const METHOD: &'static str = "conversations.mark";
1363    type Response = ConversationsMarkResponse;
1364}
1365
1366/// Successful response of the Slack Web API method [`conversations.mark`](https://docs.slack.dev/reference/methods/conversations.mark).
1367#[doc(alias = "conversations.mark")]
1368#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1369pub struct ConversationsMarkResponse {
1370    /// Fields returned by Slack. This method has no documented response example.
1371    #[serde(flatten)]
1372    pub extra: serde_json::Map<String, serde_json::Value>,
1373    #[serde(
1374        default,
1375        deserialize_with = "crate::de::opt_object",
1376        skip_serializing_if = "Option::is_none"
1377    )]
1378    pub response_metadata: Option<ResponseMetadata>,
1379    #[serde(
1380        default,
1381        deserialize_with = "crate::de::opt_string",
1382        skip_serializing_if = "Option::is_none"
1383    )]
1384    pub warning: Option<String>,
1385}
1386
1387/// Arguments for the Slack Web API method [`conversations.members`](https://docs.slack.dev/reference/methods/conversations.members): Retrieve members of a conversation.
1388///
1389/// Send it with [`SlackClient::conversations_members`].
1390#[doc(alias = "conversations.members")]
1391#[derive(Debug, Clone, PartialEq, Serialize)]
1392#[non_exhaustive]
1393pub struct ConversationsMembersRequest {
1394    /// ID of the conversation to retrieve members for
1395    pub channel: String,
1396    /// Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](https://docs.slack.dev/apis/web-api/pagination.md) for more detail.
1397    #[serde(skip_serializing_if = "Option::is_none")]
1398    pub cursor: Option<String>,
1399    /// The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
1400    #[serde(skip_serializing_if = "Option::is_none")]
1401    pub limit: Option<i64>,
1402}
1403
1404impl ConversationsMembersRequest {
1405    pub fn new(channel: impl Into<String>) -> Self {
1406        Self {
1407            channel: channel.into(),
1408            cursor: None,
1409            limit: None,
1410        }
1411    }
1412
1413    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1414        self.cursor = Some(cursor.into());
1415        self
1416    }
1417
1418    pub fn limit(mut self, limit: i64) -> Self {
1419        self.limit = Some(limit);
1420        self
1421    }
1422}
1423
1424impl SlackApiMethod for ConversationsMembersRequest {
1425    const METHOD: &'static str = "conversations.members";
1426    type Response = ConversationsMembersResponse;
1427}
1428
1429impl CursorPaginated for ConversationsMembersRequest {
1430    fn set_cursor(&mut self, cursor: String) {
1431        self.cursor = Some(cursor);
1432    }
1433}
1434
1435impl NextCursor for ConversationsMembersResponse {
1436    fn next_cursor(&self) -> Option<&str> {
1437        self.response_metadata.as_ref()?.next_cursor.as_deref()
1438    }
1439}
1440
1441/// Successful response of the Slack Web API method [`conversations.members`](https://docs.slack.dev/reference/methods/conversations.members).
1442#[doc(alias = "conversations.members")]
1443#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1444pub struct ConversationsMembersResponse {
1445    #[serde(
1446        default,
1447        deserialize_with = "crate::de::vec",
1448        skip_serializing_if = "Vec::is_empty"
1449    )]
1450    pub members: Vec<String>,
1451    #[serde(
1452        default,
1453        deserialize_with = "crate::de::opt_object",
1454        skip_serializing_if = "Option::is_none"
1455    )]
1456    pub response_metadata: Option<ResponseMetadata>,
1457    #[serde(
1458        default,
1459        deserialize_with = "crate::de::opt_string",
1460        skip_serializing_if = "Option::is_none"
1461    )]
1462    pub warning: Option<String>,
1463}
1464
1465/// Arguments for the Slack Web API method [`conversations.open`](https://docs.slack.dev/reference/methods/conversations.open): Opens or resumes a direct message or multi-person direct message.
1466///
1467/// Send it with [`SlackClient::conversations_open`].
1468#[doc(alias = "conversations.open")]
1469#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1470#[non_exhaustive]
1471pub struct ConversationsOpenRequest {
1472    /// Resume a conversation by supplying an `im` or `mpim`'s ID. Or provide the `users` field instead.
1473    #[serde(skip_serializing_if = "Option::is_none")]
1474    pub channel: Option<String>,
1475    /// Boolean, indicates you want the full IM channel definition in the response.
1476    #[serde(skip_serializing_if = "Option::is_none")]
1477    pub return_im: Option<bool>,
1478    /// Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a `channel` when not supplying `users`.
1479    #[serde(skip_serializing_if = "Option::is_none")]
1480    pub users: Option<String>,
1481    /// Do not create a direct message or multi-person direct message. This is used to see if there is an existing dm or mpdm.
1482    #[serde(skip_serializing_if = "Option::is_none")]
1483    pub prevent_creation: Option<bool>,
1484}
1485
1486impl ConversationsOpenRequest {
1487    pub fn new() -> Self {
1488        Self {
1489            channel: None,
1490            return_im: None,
1491            users: None,
1492            prevent_creation: None,
1493        }
1494    }
1495
1496    pub fn channel(mut self, channel: impl Into<String>) -> Self {
1497        self.channel = Some(channel.into());
1498        self
1499    }
1500
1501    pub fn return_im(mut self, return_im: bool) -> Self {
1502        self.return_im = Some(return_im);
1503        self
1504    }
1505
1506    pub fn users(mut self, users: impl Into<String>) -> Self {
1507        self.users = Some(users.into());
1508        self
1509    }
1510
1511    pub fn prevent_creation(mut self, prevent_creation: bool) -> Self {
1512        self.prevent_creation = Some(prevent_creation);
1513        self
1514    }
1515}
1516
1517impl SlackApiMethod for ConversationsOpenRequest {
1518    const METHOD: &'static str = "conversations.open";
1519    type Response = ConversationsOpenResponse;
1520}
1521
1522/// Successful response of the Slack Web API method [`conversations.open`](https://docs.slack.dev/reference/methods/conversations.open).
1523#[doc(alias = "conversations.open")]
1524#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1525pub struct ConversationsOpenResponse {
1526    #[serde(
1527        default,
1528        deserialize_with = "crate::de::opt_object",
1529        skip_serializing_if = "Option::is_none"
1530    )]
1531    pub channel: Option<Conversation>,
1532    #[serde(
1533        default,
1534        deserialize_with = "crate::de::opt_bool",
1535        skip_serializing_if = "Option::is_none"
1536    )]
1537    pub no_op: Option<bool>,
1538    #[serde(
1539        default,
1540        deserialize_with = "crate::de::opt_bool",
1541        skip_serializing_if = "Option::is_none"
1542    )]
1543    pub already_open: Option<bool>,
1544    #[serde(
1545        default,
1546        deserialize_with = "crate::de::opt_object",
1547        skip_serializing_if = "Option::is_none"
1548    )]
1549    pub response_metadata: Option<ResponseMetadata>,
1550    #[serde(
1551        default,
1552        deserialize_with = "crate::de::opt_string",
1553        skip_serializing_if = "Option::is_none"
1554    )]
1555    pub warning: Option<String>,
1556}
1557
1558/// Arguments for the Slack Web API method [`conversations.rename`](https://docs.slack.dev/reference/methods/conversations.rename): Renames a conversation.
1559///
1560/// Send it with [`SlackClient::conversations_rename`].
1561#[doc(alias = "conversations.rename")]
1562#[derive(Debug, Clone, PartialEq, Serialize)]
1563#[non_exhaustive]
1564pub struct ConversationsRenameRequest {
1565    /// ID of conversation to rename
1566    pub channel: String,
1567    /// New name for conversation.
1568    pub name: String,
1569}
1570
1571impl ConversationsRenameRequest {
1572    pub fn new(channel: impl Into<String>, name: impl Into<String>) -> Self {
1573        Self {
1574            channel: channel.into(),
1575            name: name.into(),
1576        }
1577    }
1578}
1579
1580impl SlackApiMethod for ConversationsRenameRequest {
1581    const METHOD: &'static str = "conversations.rename";
1582    type Response = ConversationsRenameResponse;
1583}
1584
1585/// Successful response of the Slack Web API method [`conversations.rename`](https://docs.slack.dev/reference/methods/conversations.rename).
1586#[doc(alias = "conversations.rename")]
1587#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1588pub struct ConversationsRenameResponse {
1589    #[serde(
1590        default,
1591        deserialize_with = "crate::de::opt_object",
1592        skip_serializing_if = "Option::is_none"
1593    )]
1594    pub channel: Option<Conversation>,
1595    #[serde(
1596        default,
1597        deserialize_with = "crate::de::opt_object",
1598        skip_serializing_if = "Option::is_none"
1599    )]
1600    pub response_metadata: Option<ResponseMetadata>,
1601    #[serde(
1602        default,
1603        deserialize_with = "crate::de::opt_string",
1604        skip_serializing_if = "Option::is_none"
1605    )]
1606    pub warning: Option<String>,
1607}
1608
1609/// Arguments for the Slack Web API method [`conversations.replies`](https://docs.slack.dev/reference/methods/conversations.replies): Retrieve a thread of messages posted to a conversation
1610///
1611/// Send it with [`SlackClient::conversations_replies`].
1612#[doc(alias = "conversations.replies")]
1613#[derive(Debug, Clone, PartialEq, Serialize)]
1614#[non_exhaustive]
1615pub struct ConversationsRepliesRequest {
1616    /// Conversation ID to fetch thread from.
1617    pub channel: String,
1618    /// Unique identifier of either a thread’s parent message or a message in the thread. `ts` must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by `ts` will return - it is just an ordinary, unthreaded message.
1619    pub ts: String,
1620    /// Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](https://docs.slack.dev/apis/web-api/pagination.md) for more detail.
1621    #[serde(skip_serializing_if = "Option::is_none")]
1622    pub cursor: Option<String>,
1623    /// Return all metadata associated with this message.
1624    #[serde(skip_serializing_if = "Option::is_none")]
1625    pub include_all_metadata: Option<bool>,
1626    /// Include messages with `oldest` or `latest` timestamps in results. Ignored unless either timestamp is specified.
1627    #[serde(skip_serializing_if = "Option::is_none")]
1628    pub inclusive: Option<bool>,
1629    /// Only messages before this Unix timestamp will be included in results.
1630    #[serde(skip_serializing_if = "Option::is_none")]
1631    pub latest: Option<String>,
1632    /// The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
1633    #[serde(skip_serializing_if = "Option::is_none")]
1634    pub limit: Option<i64>,
1635    /// Only messages after this Unix timestamp will be included in results.
1636    #[serde(skip_serializing_if = "Option::is_none")]
1637    pub oldest: Option<String>,
1638}
1639
1640impl ConversationsRepliesRequest {
1641    pub fn new(channel: impl Into<String>, ts: impl Into<String>) -> Self {
1642        Self {
1643            channel: channel.into(),
1644            ts: ts.into(),
1645            cursor: None,
1646            include_all_metadata: None,
1647            inclusive: None,
1648            latest: None,
1649            limit: None,
1650            oldest: None,
1651        }
1652    }
1653
1654    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1655        self.cursor = Some(cursor.into());
1656        self
1657    }
1658
1659    pub fn include_all_metadata(mut self, include_all_metadata: bool) -> Self {
1660        self.include_all_metadata = Some(include_all_metadata);
1661        self
1662    }
1663
1664    pub fn inclusive(mut self, inclusive: bool) -> Self {
1665        self.inclusive = Some(inclusive);
1666        self
1667    }
1668
1669    pub fn latest(mut self, latest: impl Into<String>) -> Self {
1670        self.latest = Some(latest.into());
1671        self
1672    }
1673
1674    pub fn limit(mut self, limit: i64) -> Self {
1675        self.limit = Some(limit);
1676        self
1677    }
1678
1679    pub fn oldest(mut self, oldest: impl Into<String>) -> Self {
1680        self.oldest = Some(oldest.into());
1681        self
1682    }
1683}
1684
1685impl SlackApiMethod for ConversationsRepliesRequest {
1686    const METHOD: &'static str = "conversations.replies";
1687    type Response = ConversationsRepliesResponse;
1688}
1689
1690impl CursorPaginated for ConversationsRepliesRequest {
1691    fn set_cursor(&mut self, cursor: String) {
1692        self.cursor = Some(cursor);
1693    }
1694}
1695
1696impl NextCursor for ConversationsRepliesResponse {
1697    fn next_cursor(&self) -> Option<&str> {
1698        self.response_metadata.as_ref()?.next_cursor.as_deref()
1699    }
1700}
1701
1702/// Successful response of the Slack Web API method [`conversations.replies`](https://docs.slack.dev/reference/methods/conversations.replies).
1703#[doc(alias = "conversations.replies")]
1704#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1705pub struct ConversationsRepliesResponse {
1706    #[serde(
1707        default,
1708        deserialize_with = "crate::de::vec",
1709        skip_serializing_if = "Vec::is_empty"
1710    )]
1711    pub messages: Vec<Message>,
1712    #[serde(
1713        default,
1714        deserialize_with = "crate::de::opt_bool",
1715        skip_serializing_if = "Option::is_none"
1716    )]
1717    pub has_more: Option<bool>,
1718    #[serde(
1719        default,
1720        deserialize_with = "crate::de::opt_object",
1721        skip_serializing_if = "Option::is_none"
1722    )]
1723    pub response_metadata: Option<ResponseMetadata>,
1724    #[serde(
1725        default,
1726        deserialize_with = "crate::de::opt_string",
1727        skip_serializing_if = "Option::is_none"
1728    )]
1729    pub warning: Option<String>,
1730}
1731
1732/// Arguments for the Slack Web API method [`conversations.requestSharedInvite.approve`](https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve): Approves a request to add an external user to a channel and sends them a Slack Connect invite
1733///
1734/// Send it with [`SlackClient::conversations_request_shared_invite_approve`].
1735#[doc(alias = "conversations.requestSharedInvite.approve")]
1736#[derive(Debug, Clone, PartialEq, Serialize)]
1737#[non_exhaustive]
1738pub struct ConversationsRequestSharedInviteApproveRequest {
1739    /// ID of the requested shared channel invite to approve.
1740    pub invite_id: String,
1741    /// Optional boolean on whether the invited team will have post-only permissions in the channel. Will override the value on the requested invite.
1742    #[serde(skip_serializing_if = "Option::is_none")]
1743    pub is_external_limited: Option<bool>,
1744    /// Optional channel\_id to which external user will be invited to. Will override the value on the requested invite.
1745    #[serde(skip_serializing_if = "Option::is_none")]
1746    pub channel_id: Option<String>,
1747    /// Object describing the text to send along with the invite. If this object is specified, both `text` and `is_override` are required properties. If `is_override` is set to `true`, `text` will override the original invitation message. Otherwise, `text` will be appended to the original invitation message. The total length of the message cannot exceed 560 characters. If `is_override` is set to `false`, the length of `text` and the user specified message on the invite request in total must be less than 560 characters.
1748    #[serde(skip_serializing_if = "Option::is_none")]
1749    pub message: Option<serde_json::Value>,
1750}
1751
1752impl ConversationsRequestSharedInviteApproveRequest {
1753    pub fn new(invite_id: impl Into<String>) -> Self {
1754        Self {
1755            invite_id: invite_id.into(),
1756            is_external_limited: None,
1757            channel_id: None,
1758            message: None,
1759        }
1760    }
1761
1762    pub fn is_external_limited(mut self, is_external_limited: bool) -> Self {
1763        self.is_external_limited = Some(is_external_limited);
1764        self
1765    }
1766
1767    pub fn channel_id(mut self, channel_id: impl Into<String>) -> Self {
1768        self.channel_id = Some(channel_id.into());
1769        self
1770    }
1771
1772    pub fn message(mut self, message: serde_json::Value) -> Self {
1773        self.message = Some(message);
1774        self
1775    }
1776}
1777
1778impl SlackApiMethod for ConversationsRequestSharedInviteApproveRequest {
1779    const METHOD: &'static str = "conversations.requestSharedInvite.approve";
1780    type Response = ConversationsRequestSharedInviteApproveResponse;
1781}
1782
1783/// Successful response of the Slack Web API method [`conversations.requestSharedInvite.approve`](https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve).
1784#[doc(alias = "conversations.requestSharedInvite.approve")]
1785#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1786pub struct ConversationsRequestSharedInviteApproveResponse {
1787    #[serde(
1788        default,
1789        deserialize_with = "crate::de::opt_string",
1790        skip_serializing_if = "Option::is_none"
1791    )]
1792    pub invite_id: Option<String>,
1793    #[serde(
1794        default,
1795        deserialize_with = "crate::de::opt_object",
1796        skip_serializing_if = "Option::is_none"
1797    )]
1798    pub response_metadata: Option<ResponseMetadata>,
1799    #[serde(
1800        default,
1801        deserialize_with = "crate::de::opt_string",
1802        skip_serializing_if = "Option::is_none"
1803    )]
1804    pub warning: Option<String>,
1805}
1806
1807/// Arguments for the Slack Web API method [`conversations.requestSharedInvite.deny`](https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny): Denies a request to invite an external user to a channel
1808///
1809/// Send it with [`SlackClient::conversations_request_shared_invite_deny`].
1810#[doc(alias = "conversations.requestSharedInvite.deny")]
1811#[derive(Debug, Clone, PartialEq, Serialize)]
1812#[non_exhaustive]
1813pub struct ConversationsRequestSharedInviteDenyRequest {
1814    /// ID of the requested shared channel invite to deny.
1815    pub invite_id: String,
1816    /// Optional message explaining why the request to invite was denied.
1817    #[serde(skip_serializing_if = "Option::is_none")]
1818    pub message: Option<String>,
1819}
1820
1821impl ConversationsRequestSharedInviteDenyRequest {
1822    pub fn new(invite_id: impl Into<String>) -> Self {
1823        Self {
1824            invite_id: invite_id.into(),
1825            message: None,
1826        }
1827    }
1828
1829    pub fn message(mut self, message: impl Into<String>) -> Self {
1830        self.message = Some(message.into());
1831        self
1832    }
1833}
1834
1835impl SlackApiMethod for ConversationsRequestSharedInviteDenyRequest {
1836    const METHOD: &'static str = "conversations.requestSharedInvite.deny";
1837    type Response = ConversationsRequestSharedInviteDenyResponse;
1838}
1839
1840/// Successful response of the Slack Web API method [`conversations.requestSharedInvite.deny`](https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny).
1841#[doc(alias = "conversations.requestSharedInvite.deny")]
1842#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1843pub struct ConversationsRequestSharedInviteDenyResponse {
1844    #[serde(
1845        default,
1846        deserialize_with = "crate::de::opt_string",
1847        skip_serializing_if = "Option::is_none"
1848    )]
1849    pub invite_id: Option<String>,
1850    #[serde(
1851        default,
1852        deserialize_with = "crate::de::opt_object",
1853        skip_serializing_if = "Option::is_none"
1854    )]
1855    pub response_metadata: Option<ResponseMetadata>,
1856    #[serde(
1857        default,
1858        deserialize_with = "crate::de::opt_string",
1859        skip_serializing_if = "Option::is_none"
1860    )]
1861    pub warning: Option<String>,
1862}
1863
1864/// Arguments for the Slack Web API method [`conversations.requestSharedInvite.list`](https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list): Lists requests to add external users to channels with ability to filter.
1865///
1866/// Send it with [`SlackClient::conversations_request_shared_invite_list`].
1867#[doc(alias = "conversations.requestSharedInvite.list")]
1868#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1869#[non_exhaustive]
1870pub struct ConversationsRequestSharedInviteListRequest {
1871    /// Optional filter to return invitation requests for the inviting user.
1872    #[serde(skip_serializing_if = "Option::is_none")]
1873    pub user_id: Option<String>,
1874    /// When true expired invitation requests will be returned, otherwise they will be excluded
1875    #[serde(skip_serializing_if = "Option::is_none")]
1876    pub include_expired: Option<bool>,
1877    /// When true approved invitation requests will be returned, otherwise they will be excluded
1878    #[serde(skip_serializing_if = "Option::is_none")]
1879    pub include_approved: Option<bool>,
1880    /// When true denied invitation requests will be returned, otherwise they will be excluded
1881    #[serde(skip_serializing_if = "Option::is_none")]
1882    pub include_denied: Option<bool>,
1883    /// An optional list of invitation ids to look up
1884    #[serde(skip_serializing_if = "Option::is_none")]
1885    pub invite_ids: Option<Vec<String>>,
1886    /// The number of items to return. Must be between 1 - 1000 (inclusive).
1887    #[serde(skip_serializing_if = "Option::is_none")]
1888    pub limit: Option<i64>,
1889    /// Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. See [pagination](https://docs.slack.dev/apis/web-api/pagination.md) for more detail.
1890    #[serde(skip_serializing_if = "Option::is_none")]
1891    pub cursor: Option<String>,
1892}
1893
1894impl ConversationsRequestSharedInviteListRequest {
1895    pub fn new() -> Self {
1896        Self {
1897            user_id: None,
1898            include_expired: None,
1899            include_approved: None,
1900            include_denied: None,
1901            invite_ids: None,
1902            limit: None,
1903            cursor: None,
1904        }
1905    }
1906
1907    pub fn user_id(mut self, user_id: impl Into<String>) -> Self {
1908        self.user_id = Some(user_id.into());
1909        self
1910    }
1911
1912    pub fn include_expired(mut self, include_expired: bool) -> Self {
1913        self.include_expired = Some(include_expired);
1914        self
1915    }
1916
1917    pub fn include_approved(mut self, include_approved: bool) -> Self {
1918        self.include_approved = Some(include_approved);
1919        self
1920    }
1921
1922    pub fn include_denied(mut self, include_denied: bool) -> Self {
1923        self.include_denied = Some(include_denied);
1924        self
1925    }
1926
1927    pub fn invite_ids(mut self, invite_ids: Vec<String>) -> Self {
1928        self.invite_ids = Some(invite_ids);
1929        self
1930    }
1931
1932    pub fn limit(mut self, limit: i64) -> Self {
1933        self.limit = Some(limit);
1934        self
1935    }
1936
1937    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1938        self.cursor = Some(cursor.into());
1939        self
1940    }
1941}
1942
1943impl SlackApiMethod for ConversationsRequestSharedInviteListRequest {
1944    const METHOD: &'static str = "conversations.requestSharedInvite.list";
1945    type Response = ConversationsRequestSharedInviteListResponse;
1946}
1947
1948impl CursorPaginated for ConversationsRequestSharedInviteListRequest {
1949    fn set_cursor(&mut self, cursor: String) {
1950        self.cursor = Some(cursor);
1951    }
1952}
1953
1954impl NextCursor for ConversationsRequestSharedInviteListResponse {
1955    fn next_cursor(&self) -> Option<&str> {
1956        self.response_metadata.as_ref()?.next_cursor.as_deref()
1957    }
1958}
1959
1960/// Successful response of the Slack Web API method [`conversations.requestSharedInvite.list`](https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list).
1961#[doc(alias = "conversations.requestSharedInvite.list")]
1962#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1963pub struct ConversationsRequestSharedInviteListResponse {
1964    #[serde(
1965        default,
1966        deserialize_with = "crate::de::vec",
1967        skip_serializing_if = "Vec::is_empty"
1968    )]
1969    pub invite_requests: Vec<ConversationsRequestSharedInviteListResponseInviteRequests>,
1970    #[serde(
1971        default,
1972        deserialize_with = "crate::de::opt_object",
1973        skip_serializing_if = "Option::is_none"
1974    )]
1975    pub response_metadata: Option<ResponseMetadata>,
1976    #[serde(
1977        default,
1978        deserialize_with = "crate::de::opt_string",
1979        skip_serializing_if = "Option::is_none"
1980    )]
1981    pub warning: Option<String>,
1982}
1983
1984#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1985pub struct ConversationsRequestSharedInviteListResponseInviteRequests {
1986    #[serde(
1987        default,
1988        deserialize_with = "crate::de::opt_i64",
1989        skip_serializing_if = "Option::is_none"
1990    )]
1991    pub date_last_updated: Option<i64>,
1992    #[serde(
1993        default,
1994        deserialize_with = "crate::de::opt_string",
1995        skip_serializing_if = "Option::is_none"
1996    )]
1997    pub id: Option<String>,
1998    #[serde(
1999        default,
2000        deserialize_with = "crate::de::opt_i64",
2001        skip_serializing_if = "Option::is_none"
2002    )]
2003    pub date_created: Option<i64>,
2004    #[serde(
2005        default,
2006        deserialize_with = "crate::de::opt_i64",
2007        skip_serializing_if = "Option::is_none"
2008    )]
2009    pub expires_at: Option<i64>,
2010    #[serde(
2011        default,
2012        deserialize_with = "crate::de::opt_object",
2013        skip_serializing_if = "Option::is_none"
2014    )]
2015    pub inviting_team: Option<Team>,
2016    #[serde(
2017        default,
2018        deserialize_with = "crate::de::opt_object",
2019        skip_serializing_if = "Option::is_none"
2020    )]
2021    pub inviting_user: Option<User>,
2022    #[serde(
2023        default,
2024        deserialize_with = "crate::de::opt_bool",
2025        skip_serializing_if = "Option::is_none"
2026    )]
2027    pub is_external_limited: Option<bool>,
2028    #[serde(
2029        default,
2030        deserialize_with = "crate::de::opt_bool",
2031        skip_serializing_if = "Option::is_none"
2032    )]
2033    pub is_sponsored: Option<bool>,
2034    #[serde(
2035        default,
2036        deserialize_with = "crate::de::opt_string",
2037        skip_serializing_if = "Option::is_none"
2038    )]
2039    pub recipient_email: Option<String>,
2040    #[serde(
2041        default,
2042        deserialize_with = "crate::de::opt_object",
2043        skip_serializing_if = "Option::is_none"
2044    )]
2045    pub target_user: Option<ConversationsRequestSharedInviteListResponseInviteRequestsTargetUser>,
2046    #[serde(
2047        default,
2048        deserialize_with = "crate::de::opt_i64",
2049        skip_serializing_if = "Option::is_none"
2050    )]
2051    pub date_denied: Option<i64>,
2052    #[serde(
2053        default,
2054        deserialize_with = "crate::de::opt_object",
2055        skip_serializing_if = "Option::is_none"
2056    )]
2057    pub channel: Option<Conversation>,
2058    #[serde(
2059        default,
2060        deserialize_with = "crate::de::opt_object",
2061        skip_serializing_if = "Option::is_none"
2062    )]
2063    pub reviewing_user:
2064        Option<ConversationsRequestSharedInviteListResponseInviteRequestsReviewingUser>,
2065}
2066
2067#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2068pub struct ConversationsRequestSharedInviteListResponseInviteRequestsTargetUser {
2069    #[serde(
2070        default,
2071        deserialize_with = "crate::de::opt_string",
2072        skip_serializing_if = "Option::is_none"
2073    )]
2074    pub recipient_email: Option<String>,
2075    #[serde(
2076        default,
2077        deserialize_with = "crate::de::opt_string",
2078        skip_serializing_if = "Option::is_none"
2079    )]
2080    pub recipient_user_id: Option<String>,
2081}
2082
2083#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2084pub struct ConversationsRequestSharedInviteListResponseInviteRequestsReviewingUser {
2085    #[serde(
2086        default,
2087        deserialize_with = "crate::de::opt_string",
2088        skip_serializing_if = "Option::is_none"
2089    )]
2090    pub id: Option<String>,
2091    #[serde(
2092        default,
2093        deserialize_with = "crate::de::opt_string",
2094        skip_serializing_if = "Option::is_none"
2095    )]
2096    pub team_id: Option<String>,
2097    #[serde(
2098        default,
2099        deserialize_with = "crate::de::opt_string",
2100        skip_serializing_if = "Option::is_none"
2101    )]
2102    pub name: Option<String>,
2103    #[serde(
2104        default,
2105        deserialize_with = "crate::de::opt_i64",
2106        skip_serializing_if = "Option::is_none"
2107    )]
2108    pub updated: Option<i64>,
2109    #[serde(
2110        default,
2111        deserialize_with = "crate::de::opt_string",
2112        skip_serializing_if = "Option::is_none"
2113    )]
2114    pub who_can_share_contact_card: Option<String>,
2115    #[serde(
2116        default,
2117        deserialize_with = "crate::de::opt_object",
2118        skip_serializing_if = "Option::is_none"
2119    )]
2120    pub profile: Option<UserProfile>,
2121}
2122
2123/// Arguments for the Slack Web API method [`conversations.setPurpose`](https://docs.slack.dev/reference/methods/conversations.setPurpose): Sets the channel description.
2124///
2125/// Send it with [`SlackClient::conversations_set_purpose`].
2126#[doc(alias = "conversations.setPurpose")]
2127#[derive(Debug, Clone, PartialEq, Serialize)]
2128#[non_exhaustive]
2129pub struct ConversationsSetPurposeRequest {
2130    /// Channel to set the description of
2131    pub channel: String,
2132    /// The description
2133    pub purpose: String,
2134}
2135
2136impl ConversationsSetPurposeRequest {
2137    pub fn new(channel: impl Into<String>, purpose: impl Into<String>) -> Self {
2138        Self {
2139            channel: channel.into(),
2140            purpose: purpose.into(),
2141        }
2142    }
2143}
2144
2145impl SlackApiMethod for ConversationsSetPurposeRequest {
2146    const METHOD: &'static str = "conversations.setPurpose";
2147    type Response = ConversationsSetPurposeResponse;
2148}
2149
2150/// Successful response of the Slack Web API method [`conversations.setPurpose`](https://docs.slack.dev/reference/methods/conversations.setPurpose).
2151#[doc(alias = "conversations.setPurpose")]
2152#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2153pub struct ConversationsSetPurposeResponse {
2154    #[serde(
2155        default,
2156        deserialize_with = "crate::de::opt_string",
2157        skip_serializing_if = "Option::is_none"
2158    )]
2159    pub purpose: Option<String>,
2160    #[serde(
2161        default,
2162        deserialize_with = "crate::de::opt_object",
2163        skip_serializing_if = "Option::is_none"
2164    )]
2165    pub response_metadata: Option<ResponseMetadata>,
2166    #[serde(
2167        default,
2168        deserialize_with = "crate::de::opt_string",
2169        skip_serializing_if = "Option::is_none"
2170    )]
2171    pub warning: Option<String>,
2172}
2173
2174/// Arguments for the Slack Web API method [`conversations.setTopic`](https://docs.slack.dev/reference/methods/conversations.setTopic): Sets the topic for a conversation.
2175///
2176/// Send it with [`SlackClient::conversations_set_topic`].
2177#[doc(alias = "conversations.setTopic")]
2178#[derive(Debug, Clone, PartialEq, Serialize)]
2179#[non_exhaustive]
2180pub struct ConversationsSetTopicRequest {
2181    /// Conversation to set the topic of
2182    pub channel: String,
2183    /// The new topic string. Does not support formatting or linkification.
2184    pub topic: String,
2185}
2186
2187impl ConversationsSetTopicRequest {
2188    pub fn new(channel: impl Into<String>, topic: impl Into<String>) -> Self {
2189        Self {
2190            channel: channel.into(),
2191            topic: topic.into(),
2192        }
2193    }
2194}
2195
2196impl SlackApiMethod for ConversationsSetTopicRequest {
2197    const METHOD: &'static str = "conversations.setTopic";
2198    type Response = ConversationsSetTopicResponse;
2199}
2200
2201/// Successful response of the Slack Web API method [`conversations.setTopic`](https://docs.slack.dev/reference/methods/conversations.setTopic).
2202#[doc(alias = "conversations.setTopic")]
2203#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2204pub struct ConversationsSetTopicResponse {
2205    #[serde(
2206        default,
2207        deserialize_with = "crate::de::opt_object",
2208        skip_serializing_if = "Option::is_none"
2209    )]
2210    pub channel: Option<Conversation>,
2211    #[serde(
2212        default,
2213        deserialize_with = "crate::de::opt_object",
2214        skip_serializing_if = "Option::is_none"
2215    )]
2216    pub response_metadata: Option<ResponseMetadata>,
2217    #[serde(
2218        default,
2219        deserialize_with = "crate::de::opt_string",
2220        skip_serializing_if = "Option::is_none"
2221    )]
2222    pub warning: Option<String>,
2223}
2224
2225/// Arguments for the Slack Web API method [`conversations.unarchive`](https://docs.slack.dev/reference/methods/conversations.unarchive): Reverses conversation archival.
2226///
2227/// Send it with [`SlackClient::conversations_unarchive`].
2228#[doc(alias = "conversations.unarchive")]
2229#[derive(Debug, Clone, PartialEq, Serialize)]
2230#[non_exhaustive]
2231pub struct ConversationsUnarchiveRequest {
2232    /// ID of conversation to unarchive
2233    pub channel: String,
2234}
2235
2236impl ConversationsUnarchiveRequest {
2237    pub fn new(channel: impl Into<String>) -> Self {
2238        Self {
2239            channel: channel.into(),
2240        }
2241    }
2242}
2243
2244impl SlackApiMethod for ConversationsUnarchiveRequest {
2245    const METHOD: &'static str = "conversations.unarchive";
2246    type Response = ConversationsUnarchiveResponse;
2247}
2248
2249/// Successful response of the Slack Web API method [`conversations.unarchive`](https://docs.slack.dev/reference/methods/conversations.unarchive).
2250#[doc(alias = "conversations.unarchive")]
2251#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2252pub struct ConversationsUnarchiveResponse {
2253    /// Fields returned by Slack. This method has no documented response example.
2254    #[serde(flatten)]
2255    pub extra: serde_json::Map<String, serde_json::Value>,
2256    #[serde(
2257        default,
2258        deserialize_with = "crate::de::opt_object",
2259        skip_serializing_if = "Option::is_none"
2260    )]
2261    pub response_metadata: Option<ResponseMetadata>,
2262    #[serde(
2263        default,
2264        deserialize_with = "crate::de::opt_string",
2265        skip_serializing_if = "Option::is_none"
2266    )]
2267    pub warning: Option<String>,
2268}
2269
2270impl SlackClient {
2271    /// Calls the Slack Web API method [`conversations.acceptSharedInvite`](https://docs.slack.dev/reference/methods/conversations.acceptSharedInvite): Accepts an invitation to a Slack Connect channel.
2272    ///
2273    /// Required scopes:
2274    ///
2275    /// - bot token: `conversations.connect:write`
2276    ///
2277    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2278    ///
2279    /// # Errors
2280    ///
2281    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2282    #[doc(alias = "conversations.acceptSharedInvite")]
2283    pub async fn conversations_accept_shared_invite(
2284        &self,
2285        request: &ConversationsAcceptSharedInviteRequest,
2286    ) -> Result<ConversationsAcceptSharedInviteResponse, SlackError> {
2287        self.call(request).await
2288    }
2289
2290    /// Calls the Slack Web API method [`conversations.approveSharedInvite`](https://docs.slack.dev/reference/methods/conversations.approveSharedInvite): Approves an invitation to a Slack Connect channel
2291    ///
2292    /// Required scopes:
2293    ///
2294    /// - bot token: `conversations.connect:manage`
2295    ///
2296    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2297    ///
2298    /// # Errors
2299    ///
2300    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2301    #[doc(alias = "conversations.approveSharedInvite")]
2302    pub async fn conversations_approve_shared_invite(
2303        &self,
2304        request: &ConversationsApproveSharedInviteRequest,
2305    ) -> Result<ConversationsApproveSharedInviteResponse, SlackError> {
2306        self.call(request).await
2307    }
2308
2309    /// Calls the Slack Web API method [`conversations.archive`](https://docs.slack.dev/reference/methods/conversations.archive): Archives a conversation.
2310    ///
2311    /// Required scopes:
2312    ///
2313    /// - bot token: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`
2314    /// - user token: `groups:write`, `im:write`, `mpim:write`, `channels:write`
2315    ///
2316    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2317    ///
2318    /// # Errors
2319    ///
2320    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2321    #[doc(alias = "conversations.archive")]
2322    pub async fn conversations_archive(
2323        &self,
2324        request: &ConversationsArchiveRequest,
2325    ) -> Result<ConversationsArchiveResponse, SlackError> {
2326        self.call(request).await
2327    }
2328
2329    /// Calls the Slack Web API method [`conversations.canvases.create`](https://docs.slack.dev/reference/methods/conversations.canvases.create): Create a channel canvas for a channel
2330    ///
2331    /// Required scopes:
2332    ///
2333    /// - bot token: `canvases:write`
2334    /// - user token: `canvases:write`
2335    ///
2336    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2337    ///
2338    /// # Errors
2339    ///
2340    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2341    #[doc(alias = "conversations.canvases.create")]
2342    pub async fn conversations_canvases_create(
2343        &self,
2344        request: &ConversationsCanvasesCreateRequest,
2345    ) -> Result<ConversationsCanvasesCreateResponse, SlackError> {
2346        self.call(request).await
2347    }
2348
2349    /// Calls the Slack Web API method [`conversations.close`](https://docs.slack.dev/reference/methods/conversations.close): Closes a direct message or multi-person direct message.
2350    ///
2351    /// Required scopes:
2352    ///
2353    /// - bot token: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`
2354    /// - user token: `groups:write`, `im:write`, `mpim:write`, `channels:write`
2355    ///
2356    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2357    ///
2358    /// # Errors
2359    ///
2360    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2361    #[doc(alias = "conversations.close")]
2362    pub async fn conversations_close(
2363        &self,
2364        request: &ConversationsCloseRequest,
2365    ) -> Result<ConversationsCloseResponse, SlackError> {
2366        self.call(request).await
2367    }
2368
2369    /// Calls the Slack Web API method [`conversations.create`](https://docs.slack.dev/reference/methods/conversations.create): Initiates a public or private channel-based conversation
2370    ///
2371    /// Required scopes:
2372    ///
2373    /// - bot token: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`
2374    /// - user token: `groups:write`, `im:write`, `mpim:write`, `channels:write`
2375    ///
2376    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2377    ///
2378    /// # Errors
2379    ///
2380    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2381    #[doc(alias = "conversations.create")]
2382    pub async fn conversations_create(
2383        &self,
2384        request: &ConversationsCreateRequest,
2385    ) -> Result<ConversationsCreateResponse, SlackError> {
2386        self.call(request).await
2387    }
2388
2389    /// Calls the Slack Web API method [`conversations.declineSharedInvite`](https://docs.slack.dev/reference/methods/conversations.declineSharedInvite): Declines a Slack Connect channel invite.
2390    ///
2391    /// Required scopes:
2392    ///
2393    /// - bot token: `conversations.connect:manage`
2394    ///
2395    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2396    ///
2397    /// # Errors
2398    ///
2399    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2400    #[doc(alias = "conversations.declineSharedInvite")]
2401    pub async fn conversations_decline_shared_invite(
2402        &self,
2403        request: &ConversationsDeclineSharedInviteRequest,
2404    ) -> Result<ConversationsDeclineSharedInviteResponse, SlackError> {
2405        self.call(request).await
2406    }
2407
2408    /// Calls the Slack Web API method [`conversations.externalInvitePermissions.set`](https://docs.slack.dev/reference/methods/conversations.externalInvitePermissions.set): Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'.
2409    ///
2410    /// Required scopes:
2411    ///
2412    /// - bot token: `conversations.connect:manage`
2413    ///
2414    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2415    ///
2416    /// # Errors
2417    ///
2418    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2419    #[doc(alias = "conversations.externalInvitePermissions.set")]
2420    pub async fn conversations_external_invite_permissions_set(
2421        &self,
2422        request: &ConversationsExternalInvitePermissionsSetRequest,
2423    ) -> Result<ConversationsExternalInvitePermissionsSetResponse, SlackError> {
2424        self.call(request).await
2425    }
2426
2427    /// Calls the Slack Web API method [`conversations.history`](https://docs.slack.dev/reference/methods/conversations.history): Fetches a conversation's history of messages and events.
2428    ///
2429    /// Required scopes:
2430    ///
2431    /// - bot token: `groups:history`, `im:history`, `mpim:history`, `channels:history`
2432    /// - user token: `groups:history`, `im:history`, `mpim:history`, `channels:history`
2433    ///
2434    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2435    ///
2436    /// # Errors
2437    ///
2438    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2439    #[doc(alias = "conversations.history")]
2440    pub async fn conversations_history(
2441        &self,
2442        request: &ConversationsHistoryRequest,
2443    ) -> Result<ConversationsHistoryResponse, SlackError> {
2444        self.call(request).await
2445    }
2446
2447    /// Calls the Slack Web API method [`conversations.info`](https://docs.slack.dev/reference/methods/conversations.info): Retrieve information about a conversation.
2448    ///
2449    /// Required scopes:
2450    ///
2451    /// - bot token: `groups:read`, `im:read`, `mpim:read`, `channels:read`
2452    /// - user token: `groups:read`, `im:read`, `mpim:read`, `channels:read`
2453    ///
2454    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2455    ///
2456    /// # Errors
2457    ///
2458    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2459    #[doc(alias = "conversations.info")]
2460    pub async fn conversations_info(
2461        &self,
2462        request: &ConversationsInfoRequest,
2463    ) -> Result<ConversationsInfoResponse, SlackError> {
2464        self.call(request).await
2465    }
2466
2467    /// Calls the Slack Web API method [`conversations.invite`](https://docs.slack.dev/reference/methods/conversations.invite): Invites users to a channel.
2468    ///
2469    /// Required scopes:
2470    ///
2471    /// - bot token: `channels:write.invites`, `groups:write.invites`, `channels:manage`, `groups:write`, `im:write`, `mpim:write`
2472    /// - user token: `channels:write.invites`, `groups:write.invites`, `channels:write`, `groups:write`, `im:write`, `mpim:write`
2473    ///
2474    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2475    ///
2476    /// # Errors
2477    ///
2478    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2479    #[doc(alias = "conversations.invite")]
2480    pub async fn conversations_invite(
2481        &self,
2482        request: &ConversationsInviteRequest,
2483    ) -> Result<ConversationsInviteResponse, SlackError> {
2484        self.call(request).await
2485    }
2486
2487    /// Calls the Slack Web API method [`conversations.inviteShared`](https://docs.slack.dev/reference/methods/conversations.inviteShared): Sends an invitation to a Slack Connect channel
2488    ///
2489    /// Required scopes:
2490    ///
2491    /// - bot token: `conversations.connect:write`
2492    ///
2493    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2494    ///
2495    /// # Errors
2496    ///
2497    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2498    #[doc(alias = "conversations.inviteShared")]
2499    pub async fn conversations_invite_shared(
2500        &self,
2501        request: &ConversationsInviteSharedRequest,
2502    ) -> Result<ConversationsInviteSharedResponse, SlackError> {
2503        self.call(request).await
2504    }
2505
2506    /// Calls the Slack Web API method [`conversations.join`](https://docs.slack.dev/reference/methods/conversations.join): Joins an existing conversation.
2507    ///
2508    /// Required scopes:
2509    ///
2510    /// - bot token: `channels:join`
2511    /// - user token: `channels:write`
2512    ///
2513    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2514    ///
2515    /// # Errors
2516    ///
2517    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2518    #[doc(alias = "conversations.join")]
2519    pub async fn conversations_join(
2520        &self,
2521        request: &ConversationsJoinRequest,
2522    ) -> Result<ConversationsJoinResponse, SlackError> {
2523        self.call(request).await
2524    }
2525
2526    /// Calls the Slack Web API method [`conversations.kick`](https://docs.slack.dev/reference/methods/conversations.kick): Removes a user from a conversation.
2527    ///
2528    /// Required scopes:
2529    ///
2530    /// - bot token: `groups:write`, `channels:manage`
2531    /// - user token: `groups:write`, `channels:write`
2532    ///
2533    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2534    ///
2535    /// # Errors
2536    ///
2537    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2538    #[doc(alias = "conversations.kick")]
2539    pub async fn conversations_kick(
2540        &self,
2541        request: &ConversationsKickRequest,
2542    ) -> Result<ConversationsKickResponse, SlackError> {
2543        self.call(request).await
2544    }
2545
2546    /// Calls the Slack Web API method [`conversations.leave`](https://docs.slack.dev/reference/methods/conversations.leave): Leaves a conversation.
2547    ///
2548    /// Required scopes:
2549    ///
2550    /// - bot token: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`
2551    /// - user token: `groups:write`, `im:write`, `mpim:write`, `channels:write`
2552    ///
2553    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2554    ///
2555    /// # Errors
2556    ///
2557    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2558    #[doc(alias = "conversations.leave")]
2559    pub async fn conversations_leave(
2560        &self,
2561        request: &ConversationsLeaveRequest,
2562    ) -> Result<ConversationsLeaveResponse, SlackError> {
2563        self.call(request).await
2564    }
2565
2566    /// Calls the Slack Web API method [`conversations.list`](https://docs.slack.dev/reference/methods/conversations.list): Lists all channels in a Slack team.
2567    ///
2568    /// Required scopes:
2569    ///
2570    /// - bot token: `groups:read`, `im:read`, `mpim:read`, `channels:read`
2571    /// - user token: `groups:read`, `im:read`, `mpim:read`, `channels:read`
2572    ///
2573    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2574    ///
2575    /// # Errors
2576    ///
2577    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2578    #[doc(alias = "conversations.list")]
2579    pub async fn conversations_list(
2580        &self,
2581        request: &ConversationsListRequest,
2582    ) -> Result<ConversationsListResponse, SlackError> {
2583        self.call(request).await
2584    }
2585
2586    /// Calls the Slack Web API method [`conversations.listConnectInvites`](https://docs.slack.dev/reference/methods/conversations.listConnectInvites): Lists shared channel invites that have been generated or received but have not been approved by all parties
2587    ///
2588    /// Required scopes:
2589    ///
2590    /// - bot token: `conversations.connect:manage`
2591    ///
2592    /// Rate limit: Tier 1 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2593    ///
2594    /// # Errors
2595    ///
2596    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2597    #[doc(alias = "conversations.listConnectInvites")]
2598    pub async fn conversations_list_connect_invites(
2599        &self,
2600        request: &ConversationsListConnectInvitesRequest,
2601    ) -> Result<ConversationsListConnectInvitesResponse, SlackError> {
2602        self.call(request).await
2603    }
2604
2605    /// Calls the Slack Web API method [`conversations.mark`](https://docs.slack.dev/reference/methods/conversations.mark): Sets the read cursor in a channel.
2606    ///
2607    /// Required scopes:
2608    ///
2609    /// - bot token: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`
2610    /// - user token: `groups:write`, `im:write`, `mpim:write`, `channels:write`
2611    ///
2612    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2613    ///
2614    /// # Errors
2615    ///
2616    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2617    #[doc(alias = "conversations.mark")]
2618    pub async fn conversations_mark(
2619        &self,
2620        request: &ConversationsMarkRequest,
2621    ) -> Result<ConversationsMarkResponse, SlackError> {
2622        self.call(request).await
2623    }
2624
2625    /// Calls the Slack Web API method [`conversations.members`](https://docs.slack.dev/reference/methods/conversations.members): Retrieve members of a conversation.
2626    ///
2627    /// Required scopes:
2628    ///
2629    /// - bot token: `groups:read`, `im:read`, `mpim:read`, `channels:read`
2630    /// - user token: `groups:read`, `im:read`, `mpim:read`, `channels:read`
2631    ///
2632    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2633    ///
2634    /// # Errors
2635    ///
2636    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2637    #[doc(alias = "conversations.members")]
2638    pub async fn conversations_members(
2639        &self,
2640        request: &ConversationsMembersRequest,
2641    ) -> Result<ConversationsMembersResponse, SlackError> {
2642        self.call(request).await
2643    }
2644
2645    /// Calls the Slack Web API method [`conversations.open`](https://docs.slack.dev/reference/methods/conversations.open): Opens or resumes a direct message or multi-person direct message.
2646    ///
2647    /// Required scopes:
2648    ///
2649    /// - bot token: `channels:manage`, `groups:write`, `im:write`, `mpim:write`
2650    /// - user token: `channels:write`, `groups:write`, `im:write`, `mpim:write`
2651    ///
2652    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2653    ///
2654    /// # Errors
2655    ///
2656    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2657    #[doc(alias = "conversations.open")]
2658    pub async fn conversations_open(
2659        &self,
2660        request: &ConversationsOpenRequest,
2661    ) -> Result<ConversationsOpenResponse, SlackError> {
2662        self.call(request).await
2663    }
2664
2665    /// Calls the Slack Web API method [`conversations.rename`](https://docs.slack.dev/reference/methods/conversations.rename): Renames a conversation.
2666    ///
2667    /// Required scopes:
2668    ///
2669    /// - bot token: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`
2670    /// - user token: `groups:write`, `im:write`, `mpim:write`, `channels:write`
2671    ///
2672    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2673    ///
2674    /// # Errors
2675    ///
2676    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2677    #[doc(alias = "conversations.rename")]
2678    pub async fn conversations_rename(
2679        &self,
2680        request: &ConversationsRenameRequest,
2681    ) -> Result<ConversationsRenameResponse, SlackError> {
2682        self.call(request).await
2683    }
2684
2685    /// Calls the Slack Web API method [`conversations.replies`](https://docs.slack.dev/reference/methods/conversations.replies): Retrieve a thread of messages posted to a conversation
2686    ///
2687    /// Required scopes:
2688    ///
2689    /// - bot token: `groups:history`, `im:history`, `mpim:history`, `channels:history`
2690    /// - user token: `groups:history`, `im:history`, `mpim:history`, `channels:history`
2691    ///
2692    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2693    ///
2694    /// # Errors
2695    ///
2696    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2697    #[doc(alias = "conversations.replies")]
2698    pub async fn conversations_replies(
2699        &self,
2700        request: &ConversationsRepliesRequest,
2701    ) -> Result<ConversationsRepliesResponse, SlackError> {
2702        self.call(request).await
2703    }
2704
2705    /// Calls the Slack Web API method [`conversations.requestSharedInvite.approve`](https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.approve): Approves a request to add an external user to a channel and sends them a Slack Connect invite
2706    ///
2707    /// Required scopes:
2708    ///
2709    /// - bot token: `conversations.connect:manage`
2710    ///
2711    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2712    ///
2713    /// # Errors
2714    ///
2715    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2716    #[doc(alias = "conversations.requestSharedInvite.approve")]
2717    pub async fn conversations_request_shared_invite_approve(
2718        &self,
2719        request: &ConversationsRequestSharedInviteApproveRequest,
2720    ) -> Result<ConversationsRequestSharedInviteApproveResponse, SlackError> {
2721        self.call(request).await
2722    }
2723
2724    /// Calls the Slack Web API method [`conversations.requestSharedInvite.deny`](https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.deny): Denies a request to invite an external user to a channel
2725    ///
2726    /// Required scopes:
2727    ///
2728    /// - bot token: `conversations.connect:manage`
2729    ///
2730    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2731    ///
2732    /// # Errors
2733    ///
2734    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2735    #[doc(alias = "conversations.requestSharedInvite.deny")]
2736    pub async fn conversations_request_shared_invite_deny(
2737        &self,
2738        request: &ConversationsRequestSharedInviteDenyRequest,
2739    ) -> Result<ConversationsRequestSharedInviteDenyResponse, SlackError> {
2740        self.call(request).await
2741    }
2742
2743    /// Calls the Slack Web API method [`conversations.requestSharedInvite.list`](https://docs.slack.dev/reference/methods/conversations.requestSharedInvite.list): Lists requests to add external users to channels with ability to filter.
2744    ///
2745    /// Required scopes:
2746    ///
2747    /// - bot token: `conversations.connect:manage`
2748    ///
2749    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2750    ///
2751    /// # Errors
2752    ///
2753    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2754    #[doc(alias = "conversations.requestSharedInvite.list")]
2755    pub async fn conversations_request_shared_invite_list(
2756        &self,
2757        request: &ConversationsRequestSharedInviteListRequest,
2758    ) -> Result<ConversationsRequestSharedInviteListResponse, SlackError> {
2759        self.call(request).await
2760    }
2761
2762    /// Calls the Slack Web API method [`conversations.setPurpose`](https://docs.slack.dev/reference/methods/conversations.setPurpose): Sets the channel description.
2763    ///
2764    /// Required scopes:
2765    ///
2766    /// - bot token: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:manage`, `groups:write`, `im:write`, `mpim:write`
2767    /// - user token: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:write`, `groups:write`, `im:write`, `mpim:write`
2768    ///
2769    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2770    ///
2771    /// # Errors
2772    ///
2773    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2774    #[doc(alias = "conversations.setPurpose")]
2775    pub async fn conversations_set_purpose(
2776        &self,
2777        request: &ConversationsSetPurposeRequest,
2778    ) -> Result<ConversationsSetPurposeResponse, SlackError> {
2779        self.call(request).await
2780    }
2781
2782    /// Calls the Slack Web API method [`conversations.setTopic`](https://docs.slack.dev/reference/methods/conversations.setTopic): Sets the topic for a conversation.
2783    ///
2784    /// Required scopes:
2785    ///
2786    /// - bot token: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:manage`, `groups:write`, `im:write`, `mpim:write`
2787    /// - user token: `channels:write.topic`, `groups:write.topic`, `mpim:write.topic`, `im:write.topic`, `channels:write`, `groups:write`, `im:write`, `mpim:write`
2788    ///
2789    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2790    ///
2791    /// # Errors
2792    ///
2793    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2794    #[doc(alias = "conversations.setTopic")]
2795    pub async fn conversations_set_topic(
2796        &self,
2797        request: &ConversationsSetTopicRequest,
2798    ) -> Result<ConversationsSetTopicResponse, SlackError> {
2799        self.call(request).await
2800    }
2801
2802    /// Calls the Slack Web API method [`conversations.unarchive`](https://docs.slack.dev/reference/methods/conversations.unarchive): Reverses conversation archival.
2803    ///
2804    /// Required scopes:
2805    ///
2806    /// - bot token: `groups:write`, `im:write`, `mpim:write`, `channels:write`, `channels:manage`
2807    /// - user token: `groups:write`, `im:write`, `mpim:write`, `channels:write`
2808    ///
2809    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2810    ///
2811    /// # Errors
2812    ///
2813    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2814    #[doc(alias = "conversations.unarchive")]
2815    pub async fn conversations_unarchive(
2816        &self,
2817        request: &ConversationsUnarchiveRequest,
2818    ) -> Result<ConversationsUnarchiveResponse, SlackError> {
2819        self.call(request).await
2820    }
2821}