Skip to main content

slack_web_api/api/
admin_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 [`admin.conversations.archive`](https://docs.slack.dev/reference/methods/admin.conversations.archive): Archive a public or private channel.
12///
13/// Send it with [`SlackClient::admin_conversations_archive`].
14#[doc(alias = "admin.conversations.archive")]
15#[derive(Debug, Clone, PartialEq, Serialize)]
16#[non_exhaustive]
17pub struct AdminConversationsArchiveRequest {
18    /// The channel to archive.
19    pub channel_id: String,
20}
21
22impl AdminConversationsArchiveRequest {
23    pub fn new(channel_id: impl Into<String>) -> Self {
24        Self {
25            channel_id: channel_id.into(),
26        }
27    }
28}
29
30impl SlackApiMethod for AdminConversationsArchiveRequest {
31    const METHOD: &'static str = "admin.conversations.archive";
32    type Response = AdminConversationsArchiveResponse;
33}
34
35/// Successful response of the Slack Web API method [`admin.conversations.archive`](https://docs.slack.dev/reference/methods/admin.conversations.archive).
36#[doc(alias = "admin.conversations.archive")]
37#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
38pub struct AdminConversationsArchiveResponse {
39    /// Fields returned by Slack. This method has no documented response example.
40    #[serde(flatten)]
41    pub extra: serde_json::Map<String, serde_json::Value>,
42    #[serde(
43        default,
44        deserialize_with = "crate::de::opt_object",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub response_metadata: Option<ResponseMetadata>,
48    #[serde(
49        default,
50        deserialize_with = "crate::de::opt_string",
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub warning: Option<String>,
54}
55
56/// Arguments for the Slack Web API method [`admin.conversations.bulkArchive`](https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive): Archive public or private channels in bulk.
57///
58/// Send it with [`SlackClient::admin_conversations_bulk_archive`].
59#[doc(alias = "admin.conversations.bulkArchive")]
60#[derive(Debug, Clone, PartialEq, Serialize)]
61#[non_exhaustive]
62pub struct AdminConversationsBulkArchiveRequest {
63    /// An array of channel IDs to archive. No more than 100 items are allowed.
64    pub channel_ids: Vec<String>,
65}
66
67impl AdminConversationsBulkArchiveRequest {
68    pub fn new(channel_ids: Vec<String>) -> Self {
69        Self { channel_ids }
70    }
71}
72
73impl SlackApiMethod for AdminConversationsBulkArchiveRequest {
74    const METHOD: &'static str = "admin.conversations.bulkArchive";
75    type Response = AdminConversationsBulkArchiveResponse;
76}
77
78/// Successful response of the Slack Web API method [`admin.conversations.bulkArchive`](https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive).
79#[doc(alias = "admin.conversations.bulkArchive")]
80#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
81pub struct AdminConversationsBulkArchiveResponse {
82    #[serde(
83        default,
84        deserialize_with = "crate::de::opt_string",
85        skip_serializing_if = "Option::is_none"
86    )]
87    pub bulk_action_id: Option<String>,
88    #[serde(
89        default,
90        deserialize_with = "crate::de::vec",
91        skip_serializing_if = "Vec::is_empty"
92    )]
93    pub not_added: Vec<AdminConversationsBulkArchiveResponseNotAdded>,
94    #[serde(
95        default,
96        deserialize_with = "crate::de::opt_object",
97        skip_serializing_if = "Option::is_none"
98    )]
99    pub response_metadata: Option<ResponseMetadata>,
100    #[serde(
101        default,
102        deserialize_with = "crate::de::opt_string",
103        skip_serializing_if = "Option::is_none"
104    )]
105    pub warning: Option<String>,
106}
107
108#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
109pub struct AdminConversationsBulkArchiveResponseNotAdded {
110    #[serde(
111        default,
112        deserialize_with = "crate::de::opt_string",
113        skip_serializing_if = "Option::is_none"
114    )]
115    pub channel_id: Option<String>,
116    #[serde(
117        default,
118        deserialize_with = "crate::de::opt_string",
119        skip_serializing_if = "Option::is_none"
120    )]
121    pub error: Option<String>,
122}
123
124/// Arguments for the Slack Web API method [`admin.conversations.bulkDelete`](https://docs.slack.dev/reference/methods/admin.conversations.bulkDelete): Delete public or private channels in bulk
125///
126/// Send it with [`SlackClient::admin_conversations_bulk_delete`].
127#[doc(alias = "admin.conversations.bulkDelete")]
128#[derive(Debug, Clone, PartialEq, Serialize)]
129#[non_exhaustive]
130pub struct AdminConversationsBulkDeleteRequest {
131    /// An array of channel IDs.
132    pub channel_ids: Vec<String>,
133}
134
135impl AdminConversationsBulkDeleteRequest {
136    pub fn new(channel_ids: Vec<String>) -> Self {
137        Self { channel_ids }
138    }
139}
140
141impl SlackApiMethod for AdminConversationsBulkDeleteRequest {
142    const METHOD: &'static str = "admin.conversations.bulkDelete";
143    type Response = AdminConversationsBulkDeleteResponse;
144}
145
146/// Successful response of the Slack Web API method [`admin.conversations.bulkDelete`](https://docs.slack.dev/reference/methods/admin.conversations.bulkDelete).
147#[doc(alias = "admin.conversations.bulkDelete")]
148#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
149pub struct AdminConversationsBulkDeleteResponse {
150    #[serde(
151        default,
152        deserialize_with = "crate::de::opt_string",
153        skip_serializing_if = "Option::is_none"
154    )]
155    pub bulk_action_id: Option<String>,
156    #[serde(
157        default,
158        deserialize_with = "crate::de::vec",
159        skip_serializing_if = "Vec::is_empty"
160    )]
161    pub not_added: Vec<AdminConversationsBulkDeleteResponseNotAdded>,
162    #[serde(
163        default,
164        deserialize_with = "crate::de::opt_object",
165        skip_serializing_if = "Option::is_none"
166    )]
167    pub response_metadata: Option<ResponseMetadata>,
168    #[serde(
169        default,
170        deserialize_with = "crate::de::opt_string",
171        skip_serializing_if = "Option::is_none"
172    )]
173    pub warning: Option<String>,
174}
175
176#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
177pub struct AdminConversationsBulkDeleteResponseNotAdded {
178    #[serde(
179        default,
180        deserialize_with = "crate::de::opt_string",
181        skip_serializing_if = "Option::is_none"
182    )]
183    pub channel_id: Option<String>,
184    #[serde(
185        default,
186        deserialize_with = "crate::de::opt_string",
187        skip_serializing_if = "Option::is_none"
188    )]
189    pub error: Option<String>,
190}
191
192/// Arguments for the Slack Web API method [`admin.conversations.bulkMove`](https://docs.slack.dev/reference/methods/admin.conversations.bulkMove): Move public or private channels in bulk.
193///
194/// Send it with [`SlackClient::admin_conversations_bulk_move`].
195#[doc(alias = "admin.conversations.bulkMove")]
196#[derive(Debug, Clone, PartialEq, Serialize)]
197#[non_exhaustive]
198pub struct AdminConversationsBulkMoveRequest {
199    /// Target team ID
200    pub target_team_id: String,
201    /// An array of channel IDs.
202    pub channel_ids: Vec<String>,
203}
204
205impl AdminConversationsBulkMoveRequest {
206    pub fn new(target_team_id: impl Into<String>, channel_ids: Vec<String>) -> Self {
207        Self {
208            target_team_id: target_team_id.into(),
209            channel_ids,
210        }
211    }
212}
213
214impl SlackApiMethod for AdminConversationsBulkMoveRequest {
215    const METHOD: &'static str = "admin.conversations.bulkMove";
216    type Response = AdminConversationsBulkMoveResponse;
217}
218
219/// Successful response of the Slack Web API method [`admin.conversations.bulkMove`](https://docs.slack.dev/reference/methods/admin.conversations.bulkMove).
220#[doc(alias = "admin.conversations.bulkMove")]
221#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
222pub struct AdminConversationsBulkMoveResponse {
223    #[serde(
224        default,
225        deserialize_with = "crate::de::opt_string",
226        skip_serializing_if = "Option::is_none"
227    )]
228    pub bulk_action_id: Option<String>,
229    #[serde(
230        default,
231        deserialize_with = "crate::de::vec",
232        skip_serializing_if = "Vec::is_empty"
233    )]
234    pub not_added: Vec<AdminConversationsBulkMoveResponseNotAdded>,
235    #[serde(
236        default,
237        deserialize_with = "crate::de::opt_object",
238        skip_serializing_if = "Option::is_none"
239    )]
240    pub response_metadata: Option<ResponseMetadata>,
241    #[serde(
242        default,
243        deserialize_with = "crate::de::opt_string",
244        skip_serializing_if = "Option::is_none"
245    )]
246    pub warning: Option<String>,
247}
248
249#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
250pub struct AdminConversationsBulkMoveResponseNotAdded {
251    #[serde(
252        default,
253        deserialize_with = "crate::de::opt_string",
254        skip_serializing_if = "Option::is_none"
255    )]
256    pub channel_id: Option<String>,
257    #[serde(
258        default,
259        deserialize_with = "crate::de::opt_string",
260        skip_serializing_if = "Option::is_none"
261    )]
262    pub error: Option<String>,
263}
264
265/// Arguments for the Slack Web API method [`admin.conversations.bulkSetExcludeFromSlackAi`](https://docs.slack.dev/reference/methods/admin.conversations.bulkSetExcludeFromSlackAi): Exclude channels from Slack AI in bulk
266///
267/// Send it with [`SlackClient::admin_conversations_bulk_set_exclude_from_slack_ai`].
268#[doc(alias = "admin.conversations.bulkSetExcludeFromSlackAi")]
269#[derive(Debug, Clone, PartialEq, Serialize)]
270#[non_exhaustive]
271pub struct AdminConversationsBulkSetExcludeFromSlackAiRequest {
272    /// An array of channel IDs to exclude from Slack AI.
273    #[serde(serialize_with = "crate::form::as_json")]
274    pub channel_ids: Vec<String>,
275    /// Whether the channels should be excluded from Slack AI.
276    pub exclude: bool,
277}
278
279impl AdminConversationsBulkSetExcludeFromSlackAiRequest {
280    pub fn new(channel_ids: Vec<String>, exclude: bool) -> Self {
281        Self {
282            channel_ids,
283            exclude,
284        }
285    }
286}
287
288impl SlackApiMethod for AdminConversationsBulkSetExcludeFromSlackAiRequest {
289    const METHOD: &'static str = "admin.conversations.bulkSetExcludeFromSlackAi";
290    type Response = AdminConversationsBulkSetExcludeFromSlackAiResponse;
291}
292
293/// Successful response of the Slack Web API method [`admin.conversations.bulkSetExcludeFromSlackAi`](https://docs.slack.dev/reference/methods/admin.conversations.bulkSetExcludeFromSlackAi).
294#[doc(alias = "admin.conversations.bulkSetExcludeFromSlackAi")]
295#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
296pub struct AdminConversationsBulkSetExcludeFromSlackAiResponse {
297    #[serde(
298        default,
299        deserialize_with = "crate::de::opt_string",
300        skip_serializing_if = "Option::is_none"
301    )]
302    pub bulk_action_id: Option<String>,
303    #[serde(
304        default,
305        deserialize_with = "crate::de::vec",
306        skip_serializing_if = "Vec::is_empty"
307    )]
308    pub not_added: Vec<AdminConversationsBulkSetExcludeFromSlackAiResponseNotAdded>,
309    #[serde(
310        default,
311        deserialize_with = "crate::de::opt_object",
312        skip_serializing_if = "Option::is_none"
313    )]
314    pub response_metadata: Option<ResponseMetadata>,
315    #[serde(
316        default,
317        deserialize_with = "crate::de::opt_string",
318        skip_serializing_if = "Option::is_none"
319    )]
320    pub warning: Option<String>,
321}
322
323#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
324pub struct AdminConversationsBulkSetExcludeFromSlackAiResponseNotAdded {
325    #[serde(
326        default,
327        deserialize_with = "crate::de::opt_string",
328        skip_serializing_if = "Option::is_none"
329    )]
330    pub channel_id: Option<String>,
331    #[serde(
332        default,
333        deserialize_with = "crate::de::opt_string",
334        skip_serializing_if = "Option::is_none"
335    )]
336    pub error: Option<String>,
337}
338
339/// Arguments for the Slack Web API method [`admin.conversations.bulkSetProperties`](https://docs.slack.dev/reference/methods/admin.conversations.bulkSetProperties): Set properties on channels in bulk
340///
341/// Send it with [`SlackClient::admin_conversations_bulk_set_properties`].
342#[doc(alias = "admin.conversations.bulkSetProperties")]
343#[derive(Debug, Clone, PartialEq, Serialize)]
344#[non_exhaustive]
345pub struct AdminConversationsBulkSetPropertiesRequest {
346    /// An array of channel IDs on which to set the property.
347    pub channel_ids: Vec<String>,
348    /// The property for this channel in a key value format. Only one property can be updated at a time
349    pub property: String,
350}
351
352impl AdminConversationsBulkSetPropertiesRequest {
353    pub fn new(channel_ids: Vec<String>, property: impl Into<String>) -> Self {
354        Self {
355            channel_ids,
356            property: property.into(),
357        }
358    }
359}
360
361impl SlackApiMethod for AdminConversationsBulkSetPropertiesRequest {
362    const METHOD: &'static str = "admin.conversations.bulkSetProperties";
363    type Response = AdminConversationsBulkSetPropertiesResponse;
364}
365
366/// Successful response of the Slack Web API method [`admin.conversations.bulkSetProperties`](https://docs.slack.dev/reference/methods/admin.conversations.bulkSetProperties).
367#[doc(alias = "admin.conversations.bulkSetProperties")]
368#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
369pub struct AdminConversationsBulkSetPropertiesResponse {
370    /// Fields returned by Slack. This method has no documented response example.
371    #[serde(flatten)]
372    pub extra: serde_json::Map<String, serde_json::Value>,
373    #[serde(
374        default,
375        deserialize_with = "crate::de::opt_object",
376        skip_serializing_if = "Option::is_none"
377    )]
378    pub response_metadata: Option<ResponseMetadata>,
379    #[serde(
380        default,
381        deserialize_with = "crate::de::opt_string",
382        skip_serializing_if = "Option::is_none"
383    )]
384    pub warning: Option<String>,
385}
386
387/// Arguments for the Slack Web API method [`admin.conversations.convertToPrivate`](https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate): Convert a public channel to a private channel.
388///
389/// Send it with [`SlackClient::admin_conversations_convert_to_private`].
390#[doc(alias = "admin.conversations.convertToPrivate")]
391#[derive(Debug, Clone, PartialEq, Serialize)]
392#[non_exhaustive]
393pub struct AdminConversationsConvertToPrivateRequest {
394    /// The channel to convert to private.
395    pub channel_id: String,
396    /// Name of private channel to create. Only respected when converting an MPIM.
397    #[serde(skip_serializing_if = "Option::is_none")]
398    pub name: Option<String>,
399}
400
401impl AdminConversationsConvertToPrivateRequest {
402    pub fn new(channel_id: impl Into<String>) -> Self {
403        Self {
404            channel_id: channel_id.into(),
405            name: None,
406        }
407    }
408
409    pub fn name(mut self, name: impl Into<String>) -> Self {
410        self.name = Some(name.into());
411        self
412    }
413}
414
415impl SlackApiMethod for AdminConversationsConvertToPrivateRequest {
416    const METHOD: &'static str = "admin.conversations.convertToPrivate";
417    type Response = AdminConversationsConvertToPrivateResponse;
418}
419
420/// Successful response of the Slack Web API method [`admin.conversations.convertToPrivate`](https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate).
421#[doc(alias = "admin.conversations.convertToPrivate")]
422#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
423pub struct AdminConversationsConvertToPrivateResponse {
424    /// Fields returned by Slack. This method has no documented response example.
425    #[serde(flatten)]
426    pub extra: serde_json::Map<String, serde_json::Value>,
427    #[serde(
428        default,
429        deserialize_with = "crate::de::opt_object",
430        skip_serializing_if = "Option::is_none"
431    )]
432    pub response_metadata: Option<ResponseMetadata>,
433    #[serde(
434        default,
435        deserialize_with = "crate::de::opt_string",
436        skip_serializing_if = "Option::is_none"
437    )]
438    pub warning: Option<String>,
439}
440
441/// Arguments for the Slack Web API method [`admin.conversations.convertToPublic`](https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic): Convert a private channel to a public channel.
442///
443/// Send it with [`SlackClient::admin_conversations_convert_to_public`].
444#[doc(alias = "admin.conversations.convertToPublic")]
445#[derive(Debug, Clone, PartialEq, Serialize)]
446#[non_exhaustive]
447pub struct AdminConversationsConvertToPublicRequest {
448    /// The channel to convert to public.
449    pub channel_id: String,
450}
451
452impl AdminConversationsConvertToPublicRequest {
453    pub fn new(channel_id: impl Into<String>) -> Self {
454        Self {
455            channel_id: channel_id.into(),
456        }
457    }
458}
459
460impl SlackApiMethod for AdminConversationsConvertToPublicRequest {
461    const METHOD: &'static str = "admin.conversations.convertToPublic";
462    type Response = AdminConversationsConvertToPublicResponse;
463}
464
465/// Successful response of the Slack Web API method [`admin.conversations.convertToPublic`](https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic).
466#[doc(alias = "admin.conversations.convertToPublic")]
467#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
468pub struct AdminConversationsConvertToPublicResponse {
469    /// Fields returned by Slack. This method has no documented response example.
470    #[serde(flatten)]
471    pub extra: serde_json::Map<String, serde_json::Value>,
472    #[serde(
473        default,
474        deserialize_with = "crate::de::opt_object",
475        skip_serializing_if = "Option::is_none"
476    )]
477    pub response_metadata: Option<ResponseMetadata>,
478    #[serde(
479        default,
480        deserialize_with = "crate::de::opt_string",
481        skip_serializing_if = "Option::is_none"
482    )]
483    pub warning: Option<String>,
484}
485
486/// Arguments for the Slack Web API method [`admin.conversations.create`](https://docs.slack.dev/reference/methods/admin.conversations.create): Create a public or private channel-based conversation.
487///
488/// Send it with [`SlackClient::admin_conversations_create`].
489#[doc(alias = "admin.conversations.create")]
490#[derive(Debug, Clone, PartialEq, Serialize)]
491#[non_exhaustive]
492pub struct AdminConversationsCreateRequest {
493    /// Name of the public or private channel to create.
494    pub name: String,
495    /// When `true`, creates a private channel instead of a public channel
496    pub is_private: bool,
497    /// Description of the public or private channel to create.
498    #[serde(skip_serializing_if = "Option::is_none")]
499    pub description: Option<String>,
500    /// When `true`, the channel will be available org-wide. Note: if the channel is not `org_wide=true`, you must specify a `team_id` for this channel
501    #[serde(skip_serializing_if = "Option::is_none")]
502    pub org_wide: Option<bool>,
503    /// The workspace to create the channel in. Note: this argument is required unless you set `org_wide=true`.
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub team_id: Option<String>,
506}
507
508impl AdminConversationsCreateRequest {
509    pub fn new(name: impl Into<String>, is_private: bool) -> Self {
510        Self {
511            name: name.into(),
512            is_private,
513            description: None,
514            org_wide: None,
515            team_id: None,
516        }
517    }
518
519    pub fn description(mut self, description: impl Into<String>) -> Self {
520        self.description = Some(description.into());
521        self
522    }
523
524    pub fn org_wide(mut self, org_wide: bool) -> Self {
525        self.org_wide = Some(org_wide);
526        self
527    }
528
529    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
530        self.team_id = Some(team_id.into());
531        self
532    }
533}
534
535impl SlackApiMethod for AdminConversationsCreateRequest {
536    const METHOD: &'static str = "admin.conversations.create";
537    type Response = AdminConversationsCreateResponse;
538}
539
540/// Successful response of the Slack Web API method [`admin.conversations.create`](https://docs.slack.dev/reference/methods/admin.conversations.create).
541#[doc(alias = "admin.conversations.create")]
542#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
543pub struct AdminConversationsCreateResponse {
544    #[serde(
545        default,
546        deserialize_with = "crate::de::opt_string",
547        skip_serializing_if = "Option::is_none"
548    )]
549    pub channel_id: Option<String>,
550    #[serde(
551        default,
552        deserialize_with = "crate::de::opt_object",
553        skip_serializing_if = "Option::is_none"
554    )]
555    pub response_metadata: Option<ResponseMetadata>,
556    #[serde(
557        default,
558        deserialize_with = "crate::de::opt_string",
559        skip_serializing_if = "Option::is_none"
560    )]
561    pub warning: Option<String>,
562}
563
564/// Arguments for the Slack Web API method [`admin.conversations.createForObjects`](https://docs.slack.dev/reference/methods/admin.conversations.createForObjects): Create a Salesforce channel for the corresponding object provided.
565///
566/// Send it with [`SlackClient::admin_conversations_create_for_objects`].
567#[doc(alias = "admin.conversations.createForObjects")]
568#[derive(Debug, Clone, PartialEq, Serialize)]
569#[non_exhaustive]
570pub struct AdminConversationsCreateForObjectsRequest {
571    /// Object / Record ID (15 or 18 digit accepted). See [here](https://help.salesforce.com/s/articleView?id=000385008&type=1) for how to look up an ID.
572    pub object_id: String,
573    /// Salesforce org ID (15 or 18 digit accepted). See [here](https://help.salesforce.com/s/articleView?id=000385215&type=1) for how to look up Salesforce org ID.
574    pub salesforce_org_id: String,
575    /// Optional flag to add all team members related to the object to the newly created Salesforce channel. When true, adds a maximum of 100 team members to the channel.
576    #[serde(skip_serializing_if = "Option::is_none")]
577    pub invite_object_team: Option<bool>,
578}
579
580impl AdminConversationsCreateForObjectsRequest {
581    pub fn new(object_id: impl Into<String>, salesforce_org_id: impl Into<String>) -> Self {
582        Self {
583            object_id: object_id.into(),
584            salesforce_org_id: salesforce_org_id.into(),
585            invite_object_team: None,
586        }
587    }
588
589    pub fn invite_object_team(mut self, invite_object_team: bool) -> Self {
590        self.invite_object_team = Some(invite_object_team);
591        self
592    }
593}
594
595impl SlackApiMethod for AdminConversationsCreateForObjectsRequest {
596    const METHOD: &'static str = "admin.conversations.createForObjects";
597    type Response = AdminConversationsCreateForObjectsResponse;
598}
599
600/// Successful response of the Slack Web API method [`admin.conversations.createForObjects`](https://docs.slack.dev/reference/methods/admin.conversations.createForObjects).
601#[doc(alias = "admin.conversations.createForObjects")]
602#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
603pub struct AdminConversationsCreateForObjectsResponse {
604    #[serde(
605        default,
606        deserialize_with = "crate::de::opt_string",
607        skip_serializing_if = "Option::is_none"
608    )]
609    pub channel_id: Option<String>,
610    #[serde(
611        default,
612        deserialize_with = "crate::de::opt_object",
613        skip_serializing_if = "Option::is_none"
614    )]
615    pub response_metadata: Option<ResponseMetadata>,
616    #[serde(
617        default,
618        deserialize_with = "crate::de::opt_string",
619        skip_serializing_if = "Option::is_none"
620    )]
621    pub warning: Option<String>,
622}
623
624/// Arguments for the Slack Web API method [`admin.conversations.delete`](https://docs.slack.dev/reference/methods/admin.conversations.delete): Delete a public or private channel.
625///
626/// Send it with [`SlackClient::admin_conversations_delete`].
627#[doc(alias = "admin.conversations.delete")]
628#[derive(Debug, Clone, PartialEq, Serialize)]
629#[non_exhaustive]
630pub struct AdminConversationsDeleteRequest {
631    /// The channel to delete.
632    pub channel_id: String,
633}
634
635impl AdminConversationsDeleteRequest {
636    pub fn new(channel_id: impl Into<String>) -> Self {
637        Self {
638            channel_id: channel_id.into(),
639        }
640    }
641}
642
643impl SlackApiMethod for AdminConversationsDeleteRequest {
644    const METHOD: &'static str = "admin.conversations.delete";
645    type Response = AdminConversationsDeleteResponse;
646}
647
648/// Successful response of the Slack Web API method [`admin.conversations.delete`](https://docs.slack.dev/reference/methods/admin.conversations.delete).
649#[doc(alias = "admin.conversations.delete")]
650#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
651pub struct AdminConversationsDeleteResponse {
652    /// Fields returned by Slack. This method has no documented response example.
653    #[serde(flatten)]
654    pub extra: serde_json::Map<String, serde_json::Value>,
655    #[serde(
656        default,
657        deserialize_with = "crate::de::opt_object",
658        skip_serializing_if = "Option::is_none"
659    )]
660    pub response_metadata: Option<ResponseMetadata>,
661    #[serde(
662        default,
663        deserialize_with = "crate::de::opt_string",
664        skip_serializing_if = "Option::is_none"
665    )]
666    pub warning: Option<String>,
667}
668
669/// Arguments for the Slack Web API method [`admin.conversations.disconnectShared`](https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared): Disconnect a connected channel from one or more workspaces.
670///
671/// Send it with [`SlackClient::admin_conversations_disconnect_shared`].
672#[doc(alias = "admin.conversations.disconnectShared")]
673#[derive(Debug, Clone, PartialEq, Serialize)]
674#[non_exhaustive]
675pub struct AdminConversationsDisconnectSharedRequest {
676    /// The channel to be disconnected from some workspaces.
677    pub channel_id: String,
678    /// Used for disconnecting a team from a shared channel. Only one team ID may be passed at a time.
679    #[serde(skip_serializing_if = "Option::is_none")]
680    pub leaving_team_ids: Option<Vec<String>>,
681}
682
683impl AdminConversationsDisconnectSharedRequest {
684    pub fn new(channel_id: impl Into<String>) -> Self {
685        Self {
686            channel_id: channel_id.into(),
687            leaving_team_ids: None,
688        }
689    }
690
691    pub fn leaving_team_ids(mut self, leaving_team_ids: Vec<String>) -> Self {
692        self.leaving_team_ids = Some(leaving_team_ids);
693        self
694    }
695}
696
697impl SlackApiMethod for AdminConversationsDisconnectSharedRequest {
698    const METHOD: &'static str = "admin.conversations.disconnectShared";
699    type Response = AdminConversationsDisconnectSharedResponse;
700}
701
702/// Successful response of the Slack Web API method [`admin.conversations.disconnectShared`](https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared).
703#[doc(alias = "admin.conversations.disconnectShared")]
704#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
705pub struct AdminConversationsDisconnectSharedResponse {
706    /// Fields returned by Slack. This method has no documented response example.
707    #[serde(flatten)]
708    pub extra: serde_json::Map<String, serde_json::Value>,
709    #[serde(
710        default,
711        deserialize_with = "crate::de::opt_object",
712        skip_serializing_if = "Option::is_none"
713    )]
714    pub response_metadata: Option<ResponseMetadata>,
715    #[serde(
716        default,
717        deserialize_with = "crate::de::opt_string",
718        skip_serializing_if = "Option::is_none"
719    )]
720    pub warning: Option<String>,
721}
722
723/// Arguments for the Slack Web API method [`admin.conversations.ekm.listOriginalConnectedChannelInfo`](https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo): List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM.
724///
725/// Send it with [`SlackClient::admin_conversations_ekm_list_original_connected_channel_info`].
726#[doc(alias = "admin.conversations.ekm.listOriginalConnectedChannelInfo")]
727#[derive(Debug, Clone, PartialEq, Serialize, Default)]
728#[non_exhaustive]
729pub struct AdminConversationsEkmListOriginalConnectedChannelInfoRequest {
730    /// A comma-separated list of channels to filter to.
731    #[serde(skip_serializing_if = "Option::is_none")]
732    pub channel_ids: Option<String>,
733    /// A comma-separated list of the workspaces to which the channels you would like returned belong.
734    #[serde(skip_serializing_if = "Option::is_none")]
735    pub team_ids: Option<String>,
736    /// The maximum number of items to return. Must be between 1 - 1000 both inclusive.
737    #[serde(skip_serializing_if = "Option::is_none")]
738    pub limit: Option<i64>,
739    /// Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.
740    #[serde(skip_serializing_if = "Option::is_none")]
741    pub cursor: Option<String>,
742}
743
744impl AdminConversationsEkmListOriginalConnectedChannelInfoRequest {
745    pub fn new() -> Self {
746        Self {
747            channel_ids: None,
748            team_ids: None,
749            limit: None,
750            cursor: None,
751        }
752    }
753
754    pub fn channel_ids(mut self, channel_ids: impl Into<String>) -> Self {
755        self.channel_ids = Some(channel_ids.into());
756        self
757    }
758
759    pub fn team_ids(mut self, team_ids: impl Into<String>) -> Self {
760        self.team_ids = Some(team_ids.into());
761        self
762    }
763
764    pub fn limit(mut self, limit: i64) -> Self {
765        self.limit = Some(limit);
766        self
767    }
768
769    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
770        self.cursor = Some(cursor.into());
771        self
772    }
773}
774
775impl SlackApiMethod for AdminConversationsEkmListOriginalConnectedChannelInfoRequest {
776    const METHOD: &'static str = "admin.conversations.ekm.listOriginalConnectedChannelInfo";
777    type Response = AdminConversationsEkmListOriginalConnectedChannelInfoResponse;
778}
779
780impl CursorPaginated for AdminConversationsEkmListOriginalConnectedChannelInfoRequest {
781    fn set_cursor(&mut self, cursor: String) {
782        self.cursor = Some(cursor);
783    }
784}
785
786impl NextCursor for AdminConversationsEkmListOriginalConnectedChannelInfoResponse {
787    fn next_cursor(&self) -> Option<&str> {
788        self.response_metadata.as_ref()?.next_cursor.as_deref()
789    }
790}
791
792/// Successful response of the Slack Web API method [`admin.conversations.ekm.listOriginalConnectedChannelInfo`](https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo).
793#[doc(alias = "admin.conversations.ekm.listOriginalConnectedChannelInfo")]
794#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
795pub struct AdminConversationsEkmListOriginalConnectedChannelInfoResponse {
796    #[serde(
797        default,
798        deserialize_with = "crate::de::vec",
799        skip_serializing_if = "Vec::is_empty"
800    )]
801    pub channels: Vec<AdminConversationsEkmListOriginalConnectedChannelInfoResponseChannels>,
802    #[serde(
803        default,
804        deserialize_with = "crate::de::opt_object",
805        skip_serializing_if = "Option::is_none"
806    )]
807    pub response_metadata: Option<ResponseMetadata>,
808    #[serde(
809        default,
810        deserialize_with = "crate::de::opt_string",
811        skip_serializing_if = "Option::is_none"
812    )]
813    pub warning: Option<String>,
814}
815
816#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
817pub struct AdminConversationsEkmListOriginalConnectedChannelInfoResponseChannels {
818    #[serde(
819        default,
820        deserialize_with = "crate::de::opt_string",
821        skip_serializing_if = "Option::is_none"
822    )]
823    pub id: Option<String>,
824    #[serde(
825        default,
826        deserialize_with = "crate::de::opt_string",
827        skip_serializing_if = "Option::is_none"
828    )]
829    pub internal_team_ids: Option<String>,
830    #[serde(
831        default,
832        deserialize_with = "crate::de::opt_string",
833        skip_serializing_if = "Option::is_none"
834    )]
835    pub original_connected_host_id: Option<String>,
836    #[serde(
837        default,
838        deserialize_with = "crate::de::opt_string",
839        skip_serializing_if = "Option::is_none"
840    )]
841    pub original_connected_channel_id: Option<String>,
842}
843
844/// Arguments for the Slack Web API method [`admin.conversations.getConversationPrefs`](https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs): Get conversation preferences for a public or private channel.
845///
846/// Send it with [`SlackClient::admin_conversations_get_conversation_prefs`].
847#[doc(alias = "admin.conversations.getConversationPrefs")]
848#[derive(Debug, Clone, PartialEq, Serialize)]
849#[non_exhaustive]
850pub struct AdminConversationsGetConversationPrefsRequest {
851    /// The channel to get preferences for.
852    pub channel_id: String,
853}
854
855impl AdminConversationsGetConversationPrefsRequest {
856    pub fn new(channel_id: impl Into<String>) -> Self {
857        Self {
858            channel_id: channel_id.into(),
859        }
860    }
861}
862
863impl SlackApiMethod for AdminConversationsGetConversationPrefsRequest {
864    const METHOD: &'static str = "admin.conversations.getConversationPrefs";
865    type Response = AdminConversationsGetConversationPrefsResponse;
866}
867
868/// Successful response of the Slack Web API method [`admin.conversations.getConversationPrefs`](https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs).
869#[doc(alias = "admin.conversations.getConversationPrefs")]
870#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
871pub struct AdminConversationsGetConversationPrefsResponse {
872    #[serde(
873        default,
874        deserialize_with = "crate::de::opt_object",
875        skip_serializing_if = "Option::is_none"
876    )]
877    pub prefs: Option<AdminConversationsGetConversationPrefsResponsePrefs>,
878    #[serde(
879        default,
880        deserialize_with = "crate::de::opt_object",
881        skip_serializing_if = "Option::is_none"
882    )]
883    pub response_metadata: Option<ResponseMetadata>,
884    #[serde(
885        default,
886        deserialize_with = "crate::de::opt_string",
887        skip_serializing_if = "Option::is_none"
888    )]
889    pub warning: Option<String>,
890}
891
892#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
893pub struct AdminConversationsGetConversationPrefsResponsePrefs {
894    #[serde(
895        default,
896        deserialize_with = "crate::de::opt_object",
897        skip_serializing_if = "Option::is_none"
898    )]
899    pub who_can_post: Option<AdminConversationsGetConversationPrefsResponsePrefsWhoCanPost>,
900    #[serde(
901        default,
902        deserialize_with = "crate::de::opt_object",
903        skip_serializing_if = "Option::is_none"
904    )]
905    pub can_thread: Option<AdminConversationsGetConversationPrefsResponsePrefsCanThread>,
906    #[serde(
907        default,
908        deserialize_with = "crate::de::opt_object",
909        skip_serializing_if = "Option::is_none"
910    )]
911    pub enable_at_channel:
912        Option<AdminConversationsGetConversationPrefsResponsePrefsEnableAtChannel>,
913    #[serde(
914        default,
915        deserialize_with = "crate::de::opt_object",
916        skip_serializing_if = "Option::is_none"
917    )]
918    pub enable_at_here: Option<AdminConversationsGetConversationPrefsResponsePrefsEnableAtHere>,
919}
920
921#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
922pub struct AdminConversationsGetConversationPrefsResponsePrefsWhoCanPost {
923    #[serde(default, skip_serializing_if = "Option::is_none")]
924    pub r#type: Option<serde_json::Value>,
925    #[serde(default, skip_serializing_if = "Option::is_none")]
926    pub user: Option<serde_json::Value>,
927}
928
929#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
930pub struct AdminConversationsGetConversationPrefsResponsePrefsCanThread {
931    #[serde(default, skip_serializing_if = "Option::is_none")]
932    pub r#type: Option<serde_json::Value>,
933    #[serde(default, skip_serializing_if = "Option::is_none")]
934    pub user: Option<serde_json::Value>,
935}
936
937#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
938pub struct AdminConversationsGetConversationPrefsResponsePrefsEnableAtChannel {
939    #[serde(
940        default,
941        deserialize_with = "crate::de::opt_bool",
942        skip_serializing_if = "Option::is_none"
943    )]
944    pub enabled: Option<bool>,
945}
946
947#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
948pub struct AdminConversationsGetConversationPrefsResponsePrefsEnableAtHere {
949    #[serde(
950        default,
951        deserialize_with = "crate::de::opt_bool",
952        skip_serializing_if = "Option::is_none"
953    )]
954    pub enabled: Option<bool>,
955}
956
957/// Arguments for the Slack Web API method [`admin.conversations.getCustomRetention`](https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention): This API endpoint can be used by any admin to get a conversation's retention policy.
958///
959/// Send it with [`SlackClient::admin_conversations_get_custom_retention`].
960#[doc(alias = "admin.conversations.getCustomRetention")]
961#[derive(Debug, Clone, PartialEq, Serialize)]
962#[non_exhaustive]
963pub struct AdminConversationsGetCustomRetentionRequest {
964    /// The conversation to get the retention policy for.
965    pub channel_id: String,
966}
967
968impl AdminConversationsGetCustomRetentionRequest {
969    pub fn new(channel_id: impl Into<String>) -> Self {
970        Self {
971            channel_id: channel_id.into(),
972        }
973    }
974}
975
976impl SlackApiMethod for AdminConversationsGetCustomRetentionRequest {
977    const METHOD: &'static str = "admin.conversations.getCustomRetention";
978    type Response = AdminConversationsGetCustomRetentionResponse;
979}
980
981/// Successful response of the Slack Web API method [`admin.conversations.getCustomRetention`](https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention).
982#[doc(alias = "admin.conversations.getCustomRetention")]
983#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
984pub struct AdminConversationsGetCustomRetentionResponse {
985    #[serde(
986        default,
987        deserialize_with = "crate::de::opt_bool",
988        skip_serializing_if = "Option::is_none"
989    )]
990    pub is_policy_enabled: Option<bool>,
991    #[serde(
992        default,
993        deserialize_with = "crate::de::opt_i64",
994        skip_serializing_if = "Option::is_none"
995    )]
996    pub duration_days: Option<i64>,
997    #[serde(
998        default,
999        deserialize_with = "crate::de::opt_object",
1000        skip_serializing_if = "Option::is_none"
1001    )]
1002    pub response_metadata: Option<ResponseMetadata>,
1003    #[serde(
1004        default,
1005        deserialize_with = "crate::de::opt_string",
1006        skip_serializing_if = "Option::is_none"
1007    )]
1008    pub warning: Option<String>,
1009}
1010
1011/// Arguments for the Slack Web API method [`admin.conversations.getTeams`](https://docs.slack.dev/reference/methods/admin.conversations.getTeams): Get all the workspaces a given public or private channel is connected to within this Enterprise org.
1012///
1013/// Send it with [`SlackClient::admin_conversations_get_teams`].
1014#[doc(alias = "admin.conversations.getTeams")]
1015#[derive(Debug, Clone, PartialEq, Serialize)]
1016#[non_exhaustive]
1017pub struct AdminConversationsGetTeamsRequest {
1018    /// The channel to determine connected workspaces within the organization for.
1019    pub channel_id: String,
1020    /// Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
1021    #[serde(skip_serializing_if = "Option::is_none")]
1022    pub cursor: Option<String>,
1023    /// The maximum number of items to return. Must be between 1 - 1000 both inclusive.
1024    #[serde(skip_serializing_if = "Option::is_none")]
1025    pub limit: Option<i64>,
1026}
1027
1028impl AdminConversationsGetTeamsRequest {
1029    pub fn new(channel_id: impl Into<String>) -> Self {
1030        Self {
1031            channel_id: channel_id.into(),
1032            cursor: None,
1033            limit: None,
1034        }
1035    }
1036
1037    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1038        self.cursor = Some(cursor.into());
1039        self
1040    }
1041
1042    pub fn limit(mut self, limit: i64) -> Self {
1043        self.limit = Some(limit);
1044        self
1045    }
1046}
1047
1048impl SlackApiMethod for AdminConversationsGetTeamsRequest {
1049    const METHOD: &'static str = "admin.conversations.getTeams";
1050    type Response = AdminConversationsGetTeamsResponse;
1051}
1052
1053impl CursorPaginated for AdminConversationsGetTeamsRequest {
1054    fn set_cursor(&mut self, cursor: String) {
1055        self.cursor = Some(cursor);
1056    }
1057}
1058
1059impl NextCursor for AdminConversationsGetTeamsResponse {
1060    fn next_cursor(&self) -> Option<&str> {
1061        self.response_metadata.as_ref()?.next_cursor.as_deref()
1062    }
1063}
1064
1065/// Successful response of the Slack Web API method [`admin.conversations.getTeams`](https://docs.slack.dev/reference/methods/admin.conversations.getTeams).
1066#[doc(alias = "admin.conversations.getTeams")]
1067#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1068pub struct AdminConversationsGetTeamsResponse {
1069    #[serde(
1070        default,
1071        deserialize_with = "crate::de::vec",
1072        skip_serializing_if = "Vec::is_empty"
1073    )]
1074    pub team_ids: Vec<String>,
1075    #[serde(
1076        default,
1077        deserialize_with = "crate::de::opt_object",
1078        skip_serializing_if = "Option::is_none"
1079    )]
1080    pub response_metadata: Option<ResponseMetadata>,
1081    #[serde(
1082        default,
1083        deserialize_with = "crate::de::opt_string",
1084        skip_serializing_if = "Option::is_none"
1085    )]
1086    pub warning: Option<String>,
1087}
1088
1089/// Arguments for the Slack Web API method [`admin.conversations.invite`](https://docs.slack.dev/reference/methods/admin.conversations.invite): Invite a user to a public or private channel.
1090///
1091/// Send it with [`SlackClient::admin_conversations_invite`].
1092#[doc(alias = "admin.conversations.invite")]
1093#[derive(Debug, Clone, PartialEq, Serialize)]
1094#[non_exhaustive]
1095pub struct AdminConversationsInviteRequest {
1096    /// The users to invite.
1097    pub user_ids: Vec<String>,
1098    /// The channel that the users will be invited to.
1099    pub channel_id: String,
1100}
1101
1102impl AdminConversationsInviteRequest {
1103    pub fn new(user_ids: Vec<String>, channel_id: impl Into<String>) -> Self {
1104        Self {
1105            user_ids,
1106            channel_id: channel_id.into(),
1107        }
1108    }
1109}
1110
1111impl SlackApiMethod for AdminConversationsInviteRequest {
1112    const METHOD: &'static str = "admin.conversations.invite";
1113    type Response = AdminConversationsInviteResponse;
1114}
1115
1116/// Successful response of the Slack Web API method [`admin.conversations.invite`](https://docs.slack.dev/reference/methods/admin.conversations.invite).
1117#[doc(alias = "admin.conversations.invite")]
1118#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1119pub struct AdminConversationsInviteResponse {
1120    /// Fields returned by Slack. This method has no documented response example.
1121    #[serde(flatten)]
1122    pub extra: serde_json::Map<String, serde_json::Value>,
1123    #[serde(
1124        default,
1125        deserialize_with = "crate::de::opt_object",
1126        skip_serializing_if = "Option::is_none"
1127    )]
1128    pub response_metadata: Option<ResponseMetadata>,
1129    #[serde(
1130        default,
1131        deserialize_with = "crate::de::opt_string",
1132        skip_serializing_if = "Option::is_none"
1133    )]
1134    pub warning: Option<String>,
1135}
1136
1137/// Arguments for the Slack Web API method [`admin.conversations.linkObjects`](https://docs.slack.dev/reference/methods/admin.conversations.linkObjects): Link a Salesforce record to a channel
1138///
1139/// Send it with [`SlackClient::admin_conversations_link_objects`].
1140#[doc(alias = "admin.conversations.linkObjects")]
1141#[derive(Debug, Clone, PartialEq, Serialize)]
1142#[non_exhaustive]
1143pub struct AdminConversationsLinkObjectsRequest {
1144    /// Channel ID for Slack channel that will be linked to a Salesforce record.
1145    pub channel: String,
1146    /// Salesforce record ID (15 or 18 digit accepted). See [here](https://help.salesforce.com/s/articleView?id=000385008&type=1) for how to look up record ID.
1147    pub record_id: String,
1148    /// Salesforce org ID (15 or 18 digit accepted). See [here](https://help.salesforce.com/s/articleView?id=000385215&type=1) for how to look up Salesforce org ID.
1149    pub salesforce_org_id: String,
1150}
1151
1152impl AdminConversationsLinkObjectsRequest {
1153    pub fn new(
1154        channel: impl Into<String>,
1155        record_id: impl Into<String>,
1156        salesforce_org_id: impl Into<String>,
1157    ) -> Self {
1158        Self {
1159            channel: channel.into(),
1160            record_id: record_id.into(),
1161            salesforce_org_id: salesforce_org_id.into(),
1162        }
1163    }
1164}
1165
1166impl SlackApiMethod for AdminConversationsLinkObjectsRequest {
1167    const METHOD: &'static str = "admin.conversations.linkObjects";
1168    type Response = AdminConversationsLinkObjectsResponse;
1169}
1170
1171/// Successful response of the Slack Web API method [`admin.conversations.linkObjects`](https://docs.slack.dev/reference/methods/admin.conversations.linkObjects).
1172#[doc(alias = "admin.conversations.linkObjects")]
1173#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1174pub struct AdminConversationsLinkObjectsResponse {
1175    /// Fields returned by Slack. This method has no documented response example.
1176    #[serde(flatten)]
1177    pub extra: serde_json::Map<String, serde_json::Value>,
1178    #[serde(
1179        default,
1180        deserialize_with = "crate::de::opt_object",
1181        skip_serializing_if = "Option::is_none"
1182    )]
1183    pub response_metadata: Option<ResponseMetadata>,
1184    #[serde(
1185        default,
1186        deserialize_with = "crate::de::opt_string",
1187        skip_serializing_if = "Option::is_none"
1188    )]
1189    pub warning: Option<String>,
1190}
1191
1192/// Arguments for the Slack Web API method [`admin.conversations.lookup`](https://docs.slack.dev/reference/methods/admin.conversations.lookup): Returns channels on the given team using the filters.
1193///
1194/// Send it with [`SlackClient::admin_conversations_lookup`].
1195#[doc(alias = "admin.conversations.lookup")]
1196#[derive(Debug, Clone, PartialEq, Serialize)]
1197#[non_exhaustive]
1198pub struct AdminConversationsLookupRequest {
1199    /// Array of team IDs to filter by
1200    pub team_ids: Vec<String>,
1201    /// Filter by _public_ channels where the most recent message was sent _before_ last\_message\_activity
1202    pub last_message_activity_before: i64,
1203    /// Filter by _public_ channels with member count _equal to or less than_ the specified number
1204    #[serde(skip_serializing_if = "Option::is_none")]
1205    pub max_member_count: Option<i64>,
1206    /// Set `cursor` to `next_cursor` returned in the previous call, to fetch the next page.
1207    #[serde(skip_serializing_if = "Option::is_none")]
1208    pub cursor: Option<String>,
1209    /// Maximum number of results
1210    #[serde(skip_serializing_if = "Option::is_none")]
1211    pub limit: Option<i64>,
1212}
1213
1214impl AdminConversationsLookupRequest {
1215    pub fn new(team_ids: Vec<String>, last_message_activity_before: i64) -> Self {
1216        Self {
1217            team_ids,
1218            last_message_activity_before,
1219            max_member_count: None,
1220            cursor: None,
1221            limit: None,
1222        }
1223    }
1224
1225    pub fn max_member_count(mut self, max_member_count: i64) -> Self {
1226        self.max_member_count = Some(max_member_count);
1227        self
1228    }
1229
1230    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1231        self.cursor = Some(cursor.into());
1232        self
1233    }
1234
1235    pub fn limit(mut self, limit: i64) -> Self {
1236        self.limit = Some(limit);
1237        self
1238    }
1239}
1240
1241impl SlackApiMethod for AdminConversationsLookupRequest {
1242    const METHOD: &'static str = "admin.conversations.lookup";
1243    type Response = AdminConversationsLookupResponse;
1244}
1245
1246impl CursorPaginated for AdminConversationsLookupRequest {
1247    fn set_cursor(&mut self, cursor: String) {
1248        self.cursor = Some(cursor);
1249    }
1250}
1251
1252impl NextCursor for AdminConversationsLookupResponse {
1253    fn next_cursor(&self) -> Option<&str> {
1254        self.response_metadata.as_ref()?.next_cursor.as_deref()
1255    }
1256}
1257
1258/// Successful response of the Slack Web API method [`admin.conversations.lookup`](https://docs.slack.dev/reference/methods/admin.conversations.lookup).
1259#[doc(alias = "admin.conversations.lookup")]
1260#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1261pub struct AdminConversationsLookupResponse {
1262    #[serde(
1263        default,
1264        deserialize_with = "crate::de::vec",
1265        skip_serializing_if = "Vec::is_empty"
1266    )]
1267    pub channels: Vec<String>,
1268    #[serde(
1269        default,
1270        deserialize_with = "crate::de::opt_object",
1271        skip_serializing_if = "Option::is_none"
1272    )]
1273    pub response_metadata: Option<ResponseMetadata>,
1274    #[serde(
1275        default,
1276        deserialize_with = "crate::de::opt_string",
1277        skip_serializing_if = "Option::is_none"
1278    )]
1279    pub warning: Option<String>,
1280}
1281
1282/// Arguments for the Slack Web API method [`admin.conversations.removeCustomRetention`](https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention): This API endpoint can be used by any admin to remove a conversation's retention policy.
1283///
1284/// Send it with [`SlackClient::admin_conversations_remove_custom_retention`].
1285#[doc(alias = "admin.conversations.removeCustomRetention")]
1286#[derive(Debug, Clone, PartialEq, Serialize)]
1287#[non_exhaustive]
1288pub struct AdminConversationsRemoveCustomRetentionRequest {
1289    /// The conversation to set the retention policy for.
1290    pub channel_id: String,
1291}
1292
1293impl AdminConversationsRemoveCustomRetentionRequest {
1294    pub fn new(channel_id: impl Into<String>) -> Self {
1295        Self {
1296            channel_id: channel_id.into(),
1297        }
1298    }
1299}
1300
1301impl SlackApiMethod for AdminConversationsRemoveCustomRetentionRequest {
1302    const METHOD: &'static str = "admin.conversations.removeCustomRetention";
1303    type Response = AdminConversationsRemoveCustomRetentionResponse;
1304}
1305
1306/// Successful response of the Slack Web API method [`admin.conversations.removeCustomRetention`](https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention).
1307#[doc(alias = "admin.conversations.removeCustomRetention")]
1308#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1309pub struct AdminConversationsRemoveCustomRetentionResponse {
1310    /// Fields returned by Slack. This method has no documented response example.
1311    #[serde(flatten)]
1312    pub extra: serde_json::Map<String, serde_json::Value>,
1313    #[serde(
1314        default,
1315        deserialize_with = "crate::de::opt_object",
1316        skip_serializing_if = "Option::is_none"
1317    )]
1318    pub response_metadata: Option<ResponseMetadata>,
1319    #[serde(
1320        default,
1321        deserialize_with = "crate::de::opt_string",
1322        skip_serializing_if = "Option::is_none"
1323    )]
1324    pub warning: Option<String>,
1325}
1326
1327/// Arguments for the Slack Web API method [`admin.conversations.rename`](https://docs.slack.dev/reference/methods/admin.conversations.rename): Rename a public or private channel.
1328///
1329/// Send it with [`SlackClient::admin_conversations_rename`].
1330#[doc(alias = "admin.conversations.rename")]
1331#[derive(Debug, Clone, PartialEq, Serialize)]
1332#[non_exhaustive]
1333pub struct AdminConversationsRenameRequest {
1334    /// The channel to rename.
1335    pub channel_id: String,
1336    pub name: String,
1337}
1338
1339impl AdminConversationsRenameRequest {
1340    pub fn new(channel_id: impl Into<String>, name: impl Into<String>) -> Self {
1341        Self {
1342            channel_id: channel_id.into(),
1343            name: name.into(),
1344        }
1345    }
1346}
1347
1348impl SlackApiMethod for AdminConversationsRenameRequest {
1349    const METHOD: &'static str = "admin.conversations.rename";
1350    type Response = AdminConversationsRenameResponse;
1351}
1352
1353/// Successful response of the Slack Web API method [`admin.conversations.rename`](https://docs.slack.dev/reference/methods/admin.conversations.rename).
1354#[doc(alias = "admin.conversations.rename")]
1355#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1356pub struct AdminConversationsRenameResponse {
1357    /// Fields returned by Slack. This method has no documented response example.
1358    #[serde(flatten)]
1359    pub extra: serde_json::Map<String, serde_json::Value>,
1360    #[serde(
1361        default,
1362        deserialize_with = "crate::de::opt_object",
1363        skip_serializing_if = "Option::is_none"
1364    )]
1365    pub response_metadata: Option<ResponseMetadata>,
1366    #[serde(
1367        default,
1368        deserialize_with = "crate::de::opt_string",
1369        skip_serializing_if = "Option::is_none"
1370    )]
1371    pub warning: Option<String>,
1372}
1373
1374/// Arguments for the Slack Web API method [`admin.conversations.restrictAccess.addGroup`](https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup): Add an allowlist of IDP groups for accessing a channel
1375///
1376/// Send it with [`SlackClient::admin_conversations_restrict_access_add_group`].
1377#[doc(alias = "admin.conversations.restrictAccess.addGroup")]
1378#[derive(Debug, Clone, PartialEq, Serialize)]
1379#[non_exhaustive]
1380pub struct AdminConversationsRestrictAccessAddGroupRequest {
1381    /// The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-organization) ID to be an allowlist for the private channel.
1382    pub group_id: String,
1383    /// The channel to link this group to.
1384    pub channel_id: String,
1385    /// The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.
1386    #[serde(skip_serializing_if = "Option::is_none")]
1387    pub team_id: Option<String>,
1388}
1389
1390impl AdminConversationsRestrictAccessAddGroupRequest {
1391    pub fn new(group_id: impl Into<String>, channel_id: impl Into<String>) -> Self {
1392        Self {
1393            group_id: group_id.into(),
1394            channel_id: channel_id.into(),
1395            team_id: None,
1396        }
1397    }
1398
1399    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1400        self.team_id = Some(team_id.into());
1401        self
1402    }
1403}
1404
1405impl SlackApiMethod for AdminConversationsRestrictAccessAddGroupRequest {
1406    const METHOD: &'static str = "admin.conversations.restrictAccess.addGroup";
1407    type Response = AdminConversationsRestrictAccessAddGroupResponse;
1408}
1409
1410/// Successful response of the Slack Web API method [`admin.conversations.restrictAccess.addGroup`](https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup).
1411#[doc(alias = "admin.conversations.restrictAccess.addGroup")]
1412#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1413pub struct AdminConversationsRestrictAccessAddGroupResponse {
1414    /// Fields returned by Slack. This method has no documented response example.
1415    #[serde(flatten)]
1416    pub extra: serde_json::Map<String, serde_json::Value>,
1417    #[serde(
1418        default,
1419        deserialize_with = "crate::de::opt_object",
1420        skip_serializing_if = "Option::is_none"
1421    )]
1422    pub response_metadata: Option<ResponseMetadata>,
1423    #[serde(
1424        default,
1425        deserialize_with = "crate::de::opt_string",
1426        skip_serializing_if = "Option::is_none"
1427    )]
1428    pub warning: Option<String>,
1429}
1430
1431/// Arguments for the Slack Web API method [`admin.conversations.restrictAccess.listGroups`](https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups): List all IDP Groups linked to a channel
1432///
1433/// Send it with [`SlackClient::admin_conversations_restrict_access_list_groups`].
1434#[doc(alias = "admin.conversations.restrictAccess.listGroups")]
1435#[derive(Debug, Clone, PartialEq, Serialize)]
1436#[non_exhaustive]
1437pub struct AdminConversationsRestrictAccessListGroupsRequest {
1438    pub channel_id: String,
1439    /// The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.
1440    #[serde(skip_serializing_if = "Option::is_none")]
1441    pub team_id: Option<String>,
1442}
1443
1444impl AdminConversationsRestrictAccessListGroupsRequest {
1445    pub fn new(channel_id: impl Into<String>) -> Self {
1446        Self {
1447            channel_id: channel_id.into(),
1448            team_id: None,
1449        }
1450    }
1451
1452    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1453        self.team_id = Some(team_id.into());
1454        self
1455    }
1456}
1457
1458impl SlackApiMethod for AdminConversationsRestrictAccessListGroupsRequest {
1459    const METHOD: &'static str = "admin.conversations.restrictAccess.listGroups";
1460    type Response = AdminConversationsRestrictAccessListGroupsResponse;
1461}
1462
1463/// Successful response of the Slack Web API method [`admin.conversations.restrictAccess.listGroups`](https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups).
1464#[doc(alias = "admin.conversations.restrictAccess.listGroups")]
1465#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1466pub struct AdminConversationsRestrictAccessListGroupsResponse {
1467    #[serde(
1468        default,
1469        deserialize_with = "crate::de::vec",
1470        skip_serializing_if = "Vec::is_empty"
1471    )]
1472    pub group_ids: Vec<String>,
1473    #[serde(
1474        default,
1475        deserialize_with = "crate::de::opt_object",
1476        skip_serializing_if = "Option::is_none"
1477    )]
1478    pub response_metadata: Option<ResponseMetadata>,
1479    #[serde(
1480        default,
1481        deserialize_with = "crate::de::opt_string",
1482        skip_serializing_if = "Option::is_none"
1483    )]
1484    pub warning: Option<String>,
1485}
1486
1487/// Arguments for the Slack Web API method [`admin.conversations.restrictAccess.removeGroup`](https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup): Remove a linked IDP group linked from a private channel
1488///
1489/// Send it with [`SlackClient::admin_conversations_restrict_access_remove_group`].
1490#[doc(alias = "admin.conversations.restrictAccess.removeGroup")]
1491#[derive(Debug, Clone, PartialEq, Serialize)]
1492#[non_exhaustive]
1493pub struct AdminConversationsRestrictAccessRemoveGroupRequest {
1494    /// The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.
1495    pub team_id: String,
1496    /// The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-organization) ID to remove from the private channel.
1497    pub group_id: String,
1498    /// The channel to remove the linked group from.
1499    pub channel_id: String,
1500}
1501
1502impl AdminConversationsRestrictAccessRemoveGroupRequest {
1503    pub fn new(
1504        team_id: impl Into<String>,
1505        group_id: impl Into<String>,
1506        channel_id: impl Into<String>,
1507    ) -> Self {
1508        Self {
1509            team_id: team_id.into(),
1510            group_id: group_id.into(),
1511            channel_id: channel_id.into(),
1512        }
1513    }
1514}
1515
1516impl SlackApiMethod for AdminConversationsRestrictAccessRemoveGroupRequest {
1517    const METHOD: &'static str = "admin.conversations.restrictAccess.removeGroup";
1518    type Response = AdminConversationsRestrictAccessRemoveGroupResponse;
1519}
1520
1521/// Successful response of the Slack Web API method [`admin.conversations.restrictAccess.removeGroup`](https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup).
1522#[doc(alias = "admin.conversations.restrictAccess.removeGroup")]
1523#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1524pub struct AdminConversationsRestrictAccessRemoveGroupResponse {
1525    /// Fields returned by Slack. This method has no documented response example.
1526    #[serde(flatten)]
1527    pub extra: serde_json::Map<String, serde_json::Value>,
1528    #[serde(
1529        default,
1530        deserialize_with = "crate::de::opt_object",
1531        skip_serializing_if = "Option::is_none"
1532    )]
1533    pub response_metadata: Option<ResponseMetadata>,
1534    #[serde(
1535        default,
1536        deserialize_with = "crate::de::opt_string",
1537        skip_serializing_if = "Option::is_none"
1538    )]
1539    pub warning: Option<String>,
1540}
1541
1542/// Arguments for the Slack Web API method [`admin.conversations.search`](https://docs.slack.dev/reference/methods/admin.conversations.search): Search for public or private channels in an Enterprise organization.
1543///
1544/// Send it with [`SlackClient::admin_conversations_search`].
1545#[doc(alias = "admin.conversations.search")]
1546#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1547#[non_exhaustive]
1548pub struct AdminConversationsSearchRequest {
1549    /// Comma separated string of team IDs, signifying the internal workspaces to search through.
1550    #[serde(skip_serializing_if = "Option::is_none")]
1551    pub team_ids: Option<Vec<String>>,
1552    /// Array of encoded team IDs, signifying the external orgs to search through.
1553    #[serde(
1554        skip_serializing_if = "Option::is_none",
1555        serialize_with = "crate::form::as_json"
1556    )]
1557    pub connected_team_ids: Option<Vec<String>>,
1558    /// Name of the the channel to query by.
1559    #[serde(skip_serializing_if = "Option::is_none")]
1560    pub query: Option<String>,
1561    /// Maximum number of items to be returned. Must be between 1 - 20 both inclusive. Default is 10.
1562    #[serde(skip_serializing_if = "Option::is_none")]
1563    pub limit: Option<i64>,
1564    /// Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.
1565    #[serde(skip_serializing_if = "Option::is_none")]
1566    pub cursor: Option<String>,
1567    /// The type of channel to include or exclude in the search. For example `private` will search private channels, while `private_exclude` will exclude them. For a full list of types, check the [Types section](#types).
1568    #[serde(skip_serializing_if = "Option::is_none")]
1569    pub search_channel_types: Option<Vec<String>>,
1570    /// Possible values are `relevant` (search ranking based on what we think is closest), `name` (alphabetical), `member_count` (number of users in the channel), and `created` (date channel was created). You can optionally pair this with the `sort_dir` arg to change how it is sorted
1571    #[serde(skip_serializing_if = "Option::is_none")]
1572    pub sort: Option<String>,
1573    /// Sort direction. Possible values are `asc` for ascending order like (1, 2, 3) or (a, b, c), and `desc` for descending order like (3, 2, 1) or (c, b, a)
1574    #[serde(skip_serializing_if = "Option::is_none")]
1575    pub sort_dir: Option<String>,
1576    /// Only return the total\_count of channels. Omits channel data and allows access for admins without channel manager permissions.
1577    #[serde(skip_serializing_if = "Option::is_none")]
1578    pub total_count_only: Option<bool>,
1579}
1580
1581impl AdminConversationsSearchRequest {
1582    pub fn new() -> Self {
1583        Self {
1584            team_ids: None,
1585            connected_team_ids: None,
1586            query: None,
1587            limit: None,
1588            cursor: None,
1589            search_channel_types: None,
1590            sort: None,
1591            sort_dir: None,
1592            total_count_only: None,
1593        }
1594    }
1595
1596    pub fn team_ids(mut self, team_ids: Vec<String>) -> Self {
1597        self.team_ids = Some(team_ids);
1598        self
1599    }
1600
1601    pub fn connected_team_ids(mut self, connected_team_ids: Vec<String>) -> Self {
1602        self.connected_team_ids = Some(connected_team_ids);
1603        self
1604    }
1605
1606    pub fn query(mut self, query: impl Into<String>) -> Self {
1607        self.query = Some(query.into());
1608        self
1609    }
1610
1611    pub fn limit(mut self, limit: i64) -> Self {
1612        self.limit = Some(limit);
1613        self
1614    }
1615
1616    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1617        self.cursor = Some(cursor.into());
1618        self
1619    }
1620
1621    pub fn search_channel_types(mut self, search_channel_types: Vec<String>) -> Self {
1622        self.search_channel_types = Some(search_channel_types);
1623        self
1624    }
1625
1626    pub fn sort(mut self, sort: impl Into<String>) -> Self {
1627        self.sort = Some(sort.into());
1628        self
1629    }
1630
1631    pub fn sort_dir(mut self, sort_dir: impl Into<String>) -> Self {
1632        self.sort_dir = Some(sort_dir.into());
1633        self
1634    }
1635
1636    pub fn total_count_only(mut self, total_count_only: bool) -> Self {
1637        self.total_count_only = Some(total_count_only);
1638        self
1639    }
1640}
1641
1642impl SlackApiMethod for AdminConversationsSearchRequest {
1643    const METHOD: &'static str = "admin.conversations.search";
1644    type Response = AdminConversationsSearchResponse;
1645}
1646
1647impl CursorPaginated for AdminConversationsSearchRequest {
1648    fn set_cursor(&mut self, cursor: String) {
1649        self.cursor = Some(cursor);
1650    }
1651}
1652
1653impl NextCursor for AdminConversationsSearchResponse {
1654    fn next_cursor(&self) -> Option<&str> {
1655        self.next_cursor
1656            .as_deref()
1657            .filter(|c| !c.is_empty())
1658            .or_else(|| self.response_metadata.as_ref()?.next_cursor.as_deref())
1659    }
1660}
1661
1662/// Successful response of the Slack Web API method [`admin.conversations.search`](https://docs.slack.dev/reference/methods/admin.conversations.search).
1663#[doc(alias = "admin.conversations.search")]
1664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1665pub struct AdminConversationsSearchResponse {
1666    #[serde(
1667        default,
1668        deserialize_with = "crate::de::vec",
1669        skip_serializing_if = "Vec::is_empty"
1670    )]
1671    pub conversations: Vec<AdminConversationsSearchResponseConversations>,
1672    #[serde(
1673        default,
1674        deserialize_with = "crate::de::opt_string",
1675        skip_serializing_if = "Option::is_none"
1676    )]
1677    pub next_cursor: Option<String>,
1678    #[serde(
1679        default,
1680        deserialize_with = "crate::de::opt_i64",
1681        skip_serializing_if = "Option::is_none"
1682    )]
1683    pub total_count: Option<i64>,
1684    #[serde(
1685        default,
1686        deserialize_with = "crate::de::opt_object",
1687        skip_serializing_if = "Option::is_none"
1688    )]
1689    pub response_metadata: Option<ResponseMetadata>,
1690    #[serde(
1691        default,
1692        deserialize_with = "crate::de::opt_string",
1693        skip_serializing_if = "Option::is_none"
1694    )]
1695    pub warning: Option<String>,
1696}
1697
1698#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1699pub struct AdminConversationsSearchResponseConversations {
1700    #[serde(
1701        default,
1702        deserialize_with = "crate::de::opt_string",
1703        skip_serializing_if = "Option::is_none"
1704    )]
1705    pub id: Option<String>,
1706    #[serde(
1707        default,
1708        deserialize_with = "crate::de::opt_string",
1709        skip_serializing_if = "Option::is_none"
1710    )]
1711    pub name: Option<String>,
1712    #[serde(
1713        default,
1714        deserialize_with = "crate::de::opt_string",
1715        skip_serializing_if = "Option::is_none"
1716    )]
1717    pub purpose: Option<String>,
1718    #[serde(
1719        default,
1720        deserialize_with = "crate::de::opt_i64",
1721        skip_serializing_if = "Option::is_none"
1722    )]
1723    pub member_count: Option<i64>,
1724    #[serde(
1725        default,
1726        deserialize_with = "crate::de::opt_i64",
1727        skip_serializing_if = "Option::is_none"
1728    )]
1729    pub created: Option<i64>,
1730    #[serde(
1731        default,
1732        deserialize_with = "crate::de::opt_string",
1733        skip_serializing_if = "Option::is_none"
1734    )]
1735    pub creator_id: Option<String>,
1736    #[serde(
1737        default,
1738        deserialize_with = "crate::de::opt_bool",
1739        skip_serializing_if = "Option::is_none"
1740    )]
1741    pub is_private: Option<bool>,
1742    #[serde(
1743        default,
1744        deserialize_with = "crate::de::opt_bool",
1745        skip_serializing_if = "Option::is_none"
1746    )]
1747    pub is_archived: Option<bool>,
1748    #[serde(
1749        default,
1750        deserialize_with = "crate::de::opt_bool",
1751        skip_serializing_if = "Option::is_none"
1752    )]
1753    pub is_general: Option<bool>,
1754    #[serde(
1755        default,
1756        deserialize_with = "crate::de::opt_i64",
1757        skip_serializing_if = "Option::is_none"
1758    )]
1759    pub last_activity_ts: Option<i64>,
1760    #[serde(
1761        default,
1762        deserialize_with = "crate::de::opt_bool",
1763        skip_serializing_if = "Option::is_none"
1764    )]
1765    pub is_ext_shared: Option<bool>,
1766    #[serde(
1767        default,
1768        deserialize_with = "crate::de::opt_bool",
1769        skip_serializing_if = "Option::is_none"
1770    )]
1771    pub is_global_shared: Option<bool>,
1772    #[serde(
1773        default,
1774        deserialize_with = "crate::de::opt_bool",
1775        skip_serializing_if = "Option::is_none"
1776    )]
1777    pub is_org_default: Option<bool>,
1778    #[serde(
1779        default,
1780        deserialize_with = "crate::de::opt_bool",
1781        skip_serializing_if = "Option::is_none"
1782    )]
1783    pub is_org_mandatory: Option<bool>,
1784    #[serde(
1785        default,
1786        deserialize_with = "crate::de::opt_bool",
1787        skip_serializing_if = "Option::is_none"
1788    )]
1789    pub is_org_shared: Option<bool>,
1790    #[serde(
1791        default,
1792        deserialize_with = "crate::de::opt_bool",
1793        skip_serializing_if = "Option::is_none"
1794    )]
1795    pub is_frozen: Option<bool>,
1796    #[serde(
1797        default,
1798        deserialize_with = "crate::de::vec",
1799        skip_serializing_if = "Vec::is_empty"
1800    )]
1801    pub connected_team_ids: Vec<serde_json::Value>,
1802    #[serde(
1803        default,
1804        deserialize_with = "crate::de::opt_i64",
1805        skip_serializing_if = "Option::is_none"
1806    )]
1807    pub internal_team_ids_count: Option<i64>,
1808    #[serde(
1809        default,
1810        deserialize_with = "crate::de::opt_string",
1811        skip_serializing_if = "Option::is_none"
1812    )]
1813    pub internal_team_ids_sample_team: Option<String>,
1814    #[serde(
1815        default,
1816        deserialize_with = "crate::de::vec",
1817        skip_serializing_if = "Vec::is_empty"
1818    )]
1819    pub pending_connected_team_ids: Vec<serde_json::Value>,
1820    #[serde(
1821        default,
1822        deserialize_with = "crate::de::opt_bool",
1823        skip_serializing_if = "Option::is_none"
1824    )]
1825    pub is_pending_ext_shared: Option<bool>,
1826}
1827
1828/// Arguments for the Slack Web API method [`admin.conversations.setConversationPrefs`](https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs): Set the posting permissions for a public or private channel.
1829///
1830/// Send it with [`SlackClient::admin_conversations_set_conversation_prefs`].
1831#[doc(alias = "admin.conversations.setConversationPrefs")]
1832#[derive(Debug, Clone, PartialEq, Serialize)]
1833#[non_exhaustive]
1834pub struct AdminConversationsSetConversationPrefsRequest {
1835    /// The channel to set the prefs for
1836    pub channel_id: String,
1837    /// The prefs for this channel in a stringified JSON format.
1838    pub prefs: String,
1839}
1840
1841impl AdminConversationsSetConversationPrefsRequest {
1842    pub fn new(channel_id: impl Into<String>, prefs: impl Into<String>) -> Self {
1843        Self {
1844            channel_id: channel_id.into(),
1845            prefs: prefs.into(),
1846        }
1847    }
1848}
1849
1850impl SlackApiMethod for AdminConversationsSetConversationPrefsRequest {
1851    const METHOD: &'static str = "admin.conversations.setConversationPrefs";
1852    type Response = AdminConversationsSetConversationPrefsResponse;
1853}
1854
1855/// Successful response of the Slack Web API method [`admin.conversations.setConversationPrefs`](https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs).
1856#[doc(alias = "admin.conversations.setConversationPrefs")]
1857#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1858pub struct AdminConversationsSetConversationPrefsResponse {
1859    /// Fields returned by Slack. This method has no documented response example.
1860    #[serde(flatten)]
1861    pub extra: serde_json::Map<String, serde_json::Value>,
1862    #[serde(
1863        default,
1864        deserialize_with = "crate::de::opt_object",
1865        skip_serializing_if = "Option::is_none"
1866    )]
1867    pub response_metadata: Option<ResponseMetadata>,
1868    #[serde(
1869        default,
1870        deserialize_with = "crate::de::opt_string",
1871        skip_serializing_if = "Option::is_none"
1872    )]
1873    pub warning: Option<String>,
1874}
1875
1876/// Arguments for the Slack Web API method [`admin.conversations.setCustomRetention`](https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention): This API endpoint can be used by any admin to set a conversation's retention policy.
1877///
1878/// Send it with [`SlackClient::admin_conversations_set_custom_retention`].
1879#[doc(alias = "admin.conversations.setCustomRetention")]
1880#[derive(Debug, Clone, PartialEq, Serialize)]
1881#[non_exhaustive]
1882pub struct AdminConversationsSetCustomRetentionRequest {
1883    /// The conversation to set the retention policy for.
1884    pub channel_id: String,
1885    /// The message retention duration in days to set for this conversation
1886    pub duration_days: i64,
1887}
1888
1889impl AdminConversationsSetCustomRetentionRequest {
1890    pub fn new(channel_id: impl Into<String>, duration_days: i64) -> Self {
1891        Self {
1892            channel_id: channel_id.into(),
1893            duration_days,
1894        }
1895    }
1896}
1897
1898impl SlackApiMethod for AdminConversationsSetCustomRetentionRequest {
1899    const METHOD: &'static str = "admin.conversations.setCustomRetention";
1900    type Response = AdminConversationsSetCustomRetentionResponse;
1901}
1902
1903/// Successful response of the Slack Web API method [`admin.conversations.setCustomRetention`](https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention).
1904#[doc(alias = "admin.conversations.setCustomRetention")]
1905#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1906pub struct AdminConversationsSetCustomRetentionResponse {
1907    /// Fields returned by Slack. This method has no documented response example.
1908    #[serde(flatten)]
1909    pub extra: serde_json::Map<String, serde_json::Value>,
1910    #[serde(
1911        default,
1912        deserialize_with = "crate::de::opt_object",
1913        skip_serializing_if = "Option::is_none"
1914    )]
1915    pub response_metadata: Option<ResponseMetadata>,
1916    #[serde(
1917        default,
1918        deserialize_with = "crate::de::opt_string",
1919        skip_serializing_if = "Option::is_none"
1920    )]
1921    pub warning: Option<String>,
1922}
1923
1924/// Arguments for the Slack Web API method [`admin.conversations.setTeams`](https://docs.slack.dev/reference/methods/admin.conversations.setTeams): Set the workspaces in an Enterprise org that connect to a public or private channel.
1925///
1926/// Send it with [`SlackClient::admin_conversations_set_teams`].
1927#[doc(alias = "admin.conversations.setTeams")]
1928#[derive(Debug, Clone, PartialEq, Serialize)]
1929#[non_exhaustive]
1930pub struct AdminConversationsSetTeamsRequest {
1931    /// The encoded `channel_id` to add or remove to workspaces.
1932    pub channel_id: String,
1933    /// The workspace to which the channel belongs if the channel is a local workspace channel. Omit this argument if the channel is a cross-workspace or org-wide shared channel.
1934    #[serde(skip_serializing_if = "Option::is_none")]
1935    pub team_id: Option<String>,
1936    /// A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.
1937    #[serde(skip_serializing_if = "Option::is_none")]
1938    pub target_team_ids: Option<Vec<String>>,
1939    /// True if channel has to be converted to an org channel
1940    #[serde(skip_serializing_if = "Option::is_none")]
1941    pub org_channel: Option<bool>,
1942}
1943
1944impl AdminConversationsSetTeamsRequest {
1945    pub fn new(channel_id: impl Into<String>) -> Self {
1946        Self {
1947            channel_id: channel_id.into(),
1948            team_id: None,
1949            target_team_ids: None,
1950            org_channel: None,
1951        }
1952    }
1953
1954    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1955        self.team_id = Some(team_id.into());
1956        self
1957    }
1958
1959    pub fn target_team_ids(mut self, target_team_ids: Vec<String>) -> Self {
1960        self.target_team_ids = Some(target_team_ids);
1961        self
1962    }
1963
1964    pub fn org_channel(mut self, org_channel: bool) -> Self {
1965        self.org_channel = Some(org_channel);
1966        self
1967    }
1968}
1969
1970impl SlackApiMethod for AdminConversationsSetTeamsRequest {
1971    const METHOD: &'static str = "admin.conversations.setTeams";
1972    type Response = AdminConversationsSetTeamsResponse;
1973}
1974
1975/// Successful response of the Slack Web API method [`admin.conversations.setTeams`](https://docs.slack.dev/reference/methods/admin.conversations.setTeams).
1976#[doc(alias = "admin.conversations.setTeams")]
1977#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1978pub struct AdminConversationsSetTeamsResponse {
1979    /// Fields returned by Slack. This method has no documented response example.
1980    #[serde(flatten)]
1981    pub extra: serde_json::Map<String, serde_json::Value>,
1982    #[serde(
1983        default,
1984        deserialize_with = "crate::de::opt_object",
1985        skip_serializing_if = "Option::is_none"
1986    )]
1987    pub response_metadata: Option<ResponseMetadata>,
1988    #[serde(
1989        default,
1990        deserialize_with = "crate::de::opt_string",
1991        skip_serializing_if = "Option::is_none"
1992    )]
1993    pub warning: Option<String>,
1994}
1995
1996/// Arguments for the Slack Web API method [`admin.conversations.unarchive`](https://docs.slack.dev/reference/methods/admin.conversations.unarchive): Unarchive a public or private channel.
1997///
1998/// Send it with [`SlackClient::admin_conversations_unarchive`].
1999#[doc(alias = "admin.conversations.unarchive")]
2000#[derive(Debug, Clone, PartialEq, Serialize)]
2001#[non_exhaustive]
2002pub struct AdminConversationsUnarchiveRequest {
2003    /// The channel to unarchive.
2004    pub channel_id: String,
2005}
2006
2007impl AdminConversationsUnarchiveRequest {
2008    pub fn new(channel_id: impl Into<String>) -> Self {
2009        Self {
2010            channel_id: channel_id.into(),
2011        }
2012    }
2013}
2014
2015impl SlackApiMethod for AdminConversationsUnarchiveRequest {
2016    const METHOD: &'static str = "admin.conversations.unarchive";
2017    type Response = AdminConversationsUnarchiveResponse;
2018}
2019
2020/// Successful response of the Slack Web API method [`admin.conversations.unarchive`](https://docs.slack.dev/reference/methods/admin.conversations.unarchive).
2021#[doc(alias = "admin.conversations.unarchive")]
2022#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2023pub struct AdminConversationsUnarchiveResponse {
2024    /// Fields returned by Slack. This method has no documented response example.
2025    #[serde(flatten)]
2026    pub extra: serde_json::Map<String, serde_json::Value>,
2027    #[serde(
2028        default,
2029        deserialize_with = "crate::de::opt_object",
2030        skip_serializing_if = "Option::is_none"
2031    )]
2032    pub response_metadata: Option<ResponseMetadata>,
2033    #[serde(
2034        default,
2035        deserialize_with = "crate::de::opt_string",
2036        skip_serializing_if = "Option::is_none"
2037    )]
2038    pub warning: Option<String>,
2039}
2040
2041/// Arguments for the Slack Web API method [`admin.conversations.unlinkObjects`](https://docs.slack.dev/reference/methods/admin.conversations.unlinkObjects): Unlink a Salesforce record from a channel
2042///
2043/// Send it with [`SlackClient::admin_conversations_unlink_objects`].
2044#[doc(alias = "admin.conversations.unlinkObjects")]
2045#[derive(Debug, Clone, PartialEq, Serialize)]
2046#[non_exhaustive]
2047pub struct AdminConversationsUnlinkObjectsRequest {
2048    /// Channel ID for Slack channel that will be unlinked from the Salesforce record.
2049    pub channel: String,
2050    /// Channel name you would like to give to the channel that is being unlinked from the Salesforce record.
2051    pub new_name: String,
2052}
2053
2054impl AdminConversationsUnlinkObjectsRequest {
2055    pub fn new(channel: impl Into<String>, new_name: impl Into<String>) -> Self {
2056        Self {
2057            channel: channel.into(),
2058            new_name: new_name.into(),
2059        }
2060    }
2061}
2062
2063impl SlackApiMethod for AdminConversationsUnlinkObjectsRequest {
2064    const METHOD: &'static str = "admin.conversations.unlinkObjects";
2065    type Response = AdminConversationsUnlinkObjectsResponse;
2066}
2067
2068/// Successful response of the Slack Web API method [`admin.conversations.unlinkObjects`](https://docs.slack.dev/reference/methods/admin.conversations.unlinkObjects).
2069#[doc(alias = "admin.conversations.unlinkObjects")]
2070#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2071pub struct AdminConversationsUnlinkObjectsResponse {
2072    /// Fields returned by Slack. This method has no documented response example.
2073    #[serde(flatten)]
2074    pub extra: serde_json::Map<String, serde_json::Value>,
2075    #[serde(
2076        default,
2077        deserialize_with = "crate::de::opt_object",
2078        skip_serializing_if = "Option::is_none"
2079    )]
2080    pub response_metadata: Option<ResponseMetadata>,
2081    #[serde(
2082        default,
2083        deserialize_with = "crate::de::opt_string",
2084        skip_serializing_if = "Option::is_none"
2085    )]
2086    pub warning: Option<String>,
2087}
2088
2089impl SlackClient {
2090    /// Calls the Slack Web API method [`admin.conversations.archive`](https://docs.slack.dev/reference/methods/admin.conversations.archive): Archive a public or private channel.
2091    ///
2092    /// Required scopes:
2093    ///
2094    /// - user token: `admin.conversations:write`
2095    ///
2096    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2097    ///
2098    /// # Errors
2099    ///
2100    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2101    #[doc(alias = "admin.conversations.archive")]
2102    pub async fn admin_conversations_archive(
2103        &self,
2104        request: &AdminConversationsArchiveRequest,
2105    ) -> Result<AdminConversationsArchiveResponse, SlackError> {
2106        self.call(request).await
2107    }
2108
2109    /// Calls the Slack Web API method [`admin.conversations.bulkArchive`](https://docs.slack.dev/reference/methods/admin.conversations.bulkArchive): Archive public or private channels in bulk.
2110    ///
2111    /// Required scopes:
2112    ///
2113    /// - user token: `admin.conversations:write`
2114    ///
2115    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2116    ///
2117    /// # Errors
2118    ///
2119    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2120    #[doc(alias = "admin.conversations.bulkArchive")]
2121    pub async fn admin_conversations_bulk_archive(
2122        &self,
2123        request: &AdminConversationsBulkArchiveRequest,
2124    ) -> Result<AdminConversationsBulkArchiveResponse, SlackError> {
2125        self.call(request).await
2126    }
2127
2128    /// Calls the Slack Web API method [`admin.conversations.bulkDelete`](https://docs.slack.dev/reference/methods/admin.conversations.bulkDelete): Delete public or private channels in bulk
2129    ///
2130    /// Required scopes:
2131    ///
2132    /// - user token: `admin.conversations:write`
2133    ///
2134    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2135    ///
2136    /// # Errors
2137    ///
2138    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2139    #[doc(alias = "admin.conversations.bulkDelete")]
2140    pub async fn admin_conversations_bulk_delete(
2141        &self,
2142        request: &AdminConversationsBulkDeleteRequest,
2143    ) -> Result<AdminConversationsBulkDeleteResponse, SlackError> {
2144        self.call(request).await
2145    }
2146
2147    /// Calls the Slack Web API method [`admin.conversations.bulkMove`](https://docs.slack.dev/reference/methods/admin.conversations.bulkMove): Move public or private channels in bulk.
2148    ///
2149    /// Required scopes:
2150    ///
2151    /// - user token: `admin.conversations:write`
2152    ///
2153    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2154    ///
2155    /// # Errors
2156    ///
2157    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2158    #[doc(alias = "admin.conversations.bulkMove")]
2159    pub async fn admin_conversations_bulk_move(
2160        &self,
2161        request: &AdminConversationsBulkMoveRequest,
2162    ) -> Result<AdminConversationsBulkMoveResponse, SlackError> {
2163        self.call(request).await
2164    }
2165
2166    /// Calls the Slack Web API method [`admin.conversations.bulkSetExcludeFromSlackAi`](https://docs.slack.dev/reference/methods/admin.conversations.bulkSetExcludeFromSlackAi): Exclude channels from Slack AI in bulk
2167    ///
2168    /// Required scopes:
2169    ///
2170    /// - user token: `admin.conversations:write`
2171    ///
2172    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2173    ///
2174    /// # Errors
2175    ///
2176    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2177    #[doc(alias = "admin.conversations.bulkSetExcludeFromSlackAi")]
2178    pub async fn admin_conversations_bulk_set_exclude_from_slack_ai(
2179        &self,
2180        request: &AdminConversationsBulkSetExcludeFromSlackAiRequest,
2181    ) -> Result<AdminConversationsBulkSetExcludeFromSlackAiResponse, SlackError> {
2182        self.call(request).await
2183    }
2184
2185    /// Calls the Slack Web API method [`admin.conversations.bulkSetProperties`](https://docs.slack.dev/reference/methods/admin.conversations.bulkSetProperties): Set properties on channels in bulk
2186    ///
2187    /// Required scopes:
2188    ///
2189    /// - user token: `admin.conversations:write`
2190    ///
2191    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2192    ///
2193    /// # Errors
2194    ///
2195    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2196    #[doc(alias = "admin.conversations.bulkSetProperties")]
2197    pub async fn admin_conversations_bulk_set_properties(
2198        &self,
2199        request: &AdminConversationsBulkSetPropertiesRequest,
2200    ) -> Result<AdminConversationsBulkSetPropertiesResponse, SlackError> {
2201        self.call(request).await
2202    }
2203
2204    /// Calls the Slack Web API method [`admin.conversations.convertToPrivate`](https://docs.slack.dev/reference/methods/admin.conversations.convertToPrivate): Convert a public channel to a private channel.
2205    ///
2206    /// Required scopes:
2207    ///
2208    /// - user token: `admin.conversations:write`
2209    ///
2210    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2211    ///
2212    /// # Errors
2213    ///
2214    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2215    #[doc(alias = "admin.conversations.convertToPrivate")]
2216    pub async fn admin_conversations_convert_to_private(
2217        &self,
2218        request: &AdminConversationsConvertToPrivateRequest,
2219    ) -> Result<AdminConversationsConvertToPrivateResponse, SlackError> {
2220        self.call(request).await
2221    }
2222
2223    /// Calls the Slack Web API method [`admin.conversations.convertToPublic`](https://docs.slack.dev/reference/methods/admin.conversations.convertToPublic): Convert a private channel to a public channel.
2224    ///
2225    /// Required scopes:
2226    ///
2227    /// - user token: `admin.conversations:write`
2228    ///
2229    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2230    ///
2231    /// # Errors
2232    ///
2233    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2234    #[doc(alias = "admin.conversations.convertToPublic")]
2235    pub async fn admin_conversations_convert_to_public(
2236        &self,
2237        request: &AdminConversationsConvertToPublicRequest,
2238    ) -> Result<AdminConversationsConvertToPublicResponse, SlackError> {
2239        self.call(request).await
2240    }
2241
2242    /// Calls the Slack Web API method [`admin.conversations.create`](https://docs.slack.dev/reference/methods/admin.conversations.create): Create a public or private channel-based conversation.
2243    ///
2244    /// Required scopes:
2245    ///
2246    /// - user token: `admin.conversations:write`
2247    ///
2248    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2249    ///
2250    /// # Errors
2251    ///
2252    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2253    #[doc(alias = "admin.conversations.create")]
2254    pub async fn admin_conversations_create(
2255        &self,
2256        request: &AdminConversationsCreateRequest,
2257    ) -> Result<AdminConversationsCreateResponse, SlackError> {
2258        self.call(request).await
2259    }
2260
2261    /// Calls the Slack Web API method [`admin.conversations.createForObjects`](https://docs.slack.dev/reference/methods/admin.conversations.createForObjects): Create a Salesforce channel for the corresponding object provided.
2262    ///
2263    /// Required scopes:
2264    ///
2265    /// - user token: `admin.conversations:manage_objects`
2266    ///
2267    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2268    ///
2269    /// # Errors
2270    ///
2271    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2272    #[doc(alias = "admin.conversations.createForObjects")]
2273    pub async fn admin_conversations_create_for_objects(
2274        &self,
2275        request: &AdminConversationsCreateForObjectsRequest,
2276    ) -> Result<AdminConversationsCreateForObjectsResponse, SlackError> {
2277        self.call(request).await
2278    }
2279
2280    /// Calls the Slack Web API method [`admin.conversations.delete`](https://docs.slack.dev/reference/methods/admin.conversations.delete): Delete a public or private channel.
2281    ///
2282    /// Required scopes:
2283    ///
2284    /// - user token: `admin.conversations:write`
2285    ///
2286    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2287    ///
2288    /// # Errors
2289    ///
2290    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2291    #[doc(alias = "admin.conversations.delete")]
2292    pub async fn admin_conversations_delete(
2293        &self,
2294        request: &AdminConversationsDeleteRequest,
2295    ) -> Result<AdminConversationsDeleteResponse, SlackError> {
2296        self.call(request).await
2297    }
2298
2299    /// Calls the Slack Web API method [`admin.conversations.disconnectShared`](https://docs.slack.dev/reference/methods/admin.conversations.disconnectShared): Disconnect a connected channel from one or more workspaces.
2300    ///
2301    /// Required scopes:
2302    ///
2303    /// - user token: `admin.conversations:write`
2304    ///
2305    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2306    ///
2307    /// # Errors
2308    ///
2309    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2310    #[doc(alias = "admin.conversations.disconnectShared")]
2311    pub async fn admin_conversations_disconnect_shared(
2312        &self,
2313        request: &AdminConversationsDisconnectSharedRequest,
2314    ) -> Result<AdminConversationsDisconnectSharedResponse, SlackError> {
2315        self.call(request).await
2316    }
2317
2318    /// Calls the Slack Web API method [`admin.conversations.ekm.listOriginalConnectedChannelInfo`](https://docs.slack.dev/reference/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo): List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM.
2319    ///
2320    /// Required scopes:
2321    ///
2322    /// - user token: `admin.conversations:read`
2323    ///
2324    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2325    ///
2326    /// # Errors
2327    ///
2328    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2329    #[doc(alias = "admin.conversations.ekm.listOriginalConnectedChannelInfo")]
2330    pub async fn admin_conversations_ekm_list_original_connected_channel_info(
2331        &self,
2332        request: &AdminConversationsEkmListOriginalConnectedChannelInfoRequest,
2333    ) -> Result<AdminConversationsEkmListOriginalConnectedChannelInfoResponse, SlackError> {
2334        self.call(request).await
2335    }
2336
2337    /// Calls the Slack Web API method [`admin.conversations.getConversationPrefs`](https://docs.slack.dev/reference/methods/admin.conversations.getConversationPrefs): Get conversation preferences for a public or private channel.
2338    ///
2339    /// Required scopes:
2340    ///
2341    /// - user token: `admin.conversations:read`
2342    ///
2343    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2344    ///
2345    /// # Errors
2346    ///
2347    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2348    #[doc(alias = "admin.conversations.getConversationPrefs")]
2349    pub async fn admin_conversations_get_conversation_prefs(
2350        &self,
2351        request: &AdminConversationsGetConversationPrefsRequest,
2352    ) -> Result<AdminConversationsGetConversationPrefsResponse, SlackError> {
2353        self.call(request).await
2354    }
2355
2356    /// Calls the Slack Web API method [`admin.conversations.getCustomRetention`](https://docs.slack.dev/reference/methods/admin.conversations.getCustomRetention): This API endpoint can be used by any admin to get a conversation's retention policy.
2357    ///
2358    /// Required scopes:
2359    ///
2360    /// - user token: `admin.conversations:read`
2361    ///
2362    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2363    ///
2364    /// # Errors
2365    ///
2366    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2367    #[doc(alias = "admin.conversations.getCustomRetention")]
2368    pub async fn admin_conversations_get_custom_retention(
2369        &self,
2370        request: &AdminConversationsGetCustomRetentionRequest,
2371    ) -> Result<AdminConversationsGetCustomRetentionResponse, SlackError> {
2372        self.call(request).await
2373    }
2374
2375    /// Calls the Slack Web API method [`admin.conversations.getTeams`](https://docs.slack.dev/reference/methods/admin.conversations.getTeams): Get all the workspaces a given public or private channel is connected to within this Enterprise org.
2376    ///
2377    /// Required scopes:
2378    ///
2379    /// - user token: `admin.conversations:read`
2380    ///
2381    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2382    ///
2383    /// # Errors
2384    ///
2385    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2386    #[doc(alias = "admin.conversations.getTeams")]
2387    pub async fn admin_conversations_get_teams(
2388        &self,
2389        request: &AdminConversationsGetTeamsRequest,
2390    ) -> Result<AdminConversationsGetTeamsResponse, SlackError> {
2391        self.call(request).await
2392    }
2393
2394    /// Calls the Slack Web API method [`admin.conversations.invite`](https://docs.slack.dev/reference/methods/admin.conversations.invite): Invite a user to a public or private channel.
2395    ///
2396    /// Required scopes:
2397    ///
2398    /// - user token: `admin.conversations:write`
2399    ///
2400    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2401    ///
2402    /// # Errors
2403    ///
2404    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2405    #[doc(alias = "admin.conversations.invite")]
2406    pub async fn admin_conversations_invite(
2407        &self,
2408        request: &AdminConversationsInviteRequest,
2409    ) -> Result<AdminConversationsInviteResponse, SlackError> {
2410        self.call(request).await
2411    }
2412
2413    /// Calls the Slack Web API method [`admin.conversations.linkObjects`](https://docs.slack.dev/reference/methods/admin.conversations.linkObjects): Link a Salesforce record to a channel
2414    ///
2415    /// Required scopes:
2416    ///
2417    /// - user token: `admin.conversations:manage_objects`
2418    ///
2419    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2420    ///
2421    /// # Errors
2422    ///
2423    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2424    #[doc(alias = "admin.conversations.linkObjects")]
2425    pub async fn admin_conversations_link_objects(
2426        &self,
2427        request: &AdminConversationsLinkObjectsRequest,
2428    ) -> Result<AdminConversationsLinkObjectsResponse, SlackError> {
2429        self.call(request).await
2430    }
2431
2432    /// Calls the Slack Web API method [`admin.conversations.lookup`](https://docs.slack.dev/reference/methods/admin.conversations.lookup): Returns channels on the given team using the filters.
2433    ///
2434    /// Required scopes:
2435    ///
2436    /// - user token: `admin.conversations:read`
2437    ///
2438    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2439    ///
2440    /// # Errors
2441    ///
2442    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2443    #[doc(alias = "admin.conversations.lookup")]
2444    pub async fn admin_conversations_lookup(
2445        &self,
2446        request: &AdminConversationsLookupRequest,
2447    ) -> Result<AdminConversationsLookupResponse, SlackError> {
2448        self.call(request).await
2449    }
2450
2451    /// Calls the Slack Web API method [`admin.conversations.removeCustomRetention`](https://docs.slack.dev/reference/methods/admin.conversations.removeCustomRetention): This API endpoint can be used by any admin to remove a conversation's retention policy.
2452    ///
2453    /// Required scopes:
2454    ///
2455    /// - user token: `admin.conversations:write`
2456    ///
2457    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2458    ///
2459    /// # Errors
2460    ///
2461    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2462    #[doc(alias = "admin.conversations.removeCustomRetention")]
2463    pub async fn admin_conversations_remove_custom_retention(
2464        &self,
2465        request: &AdminConversationsRemoveCustomRetentionRequest,
2466    ) -> Result<AdminConversationsRemoveCustomRetentionResponse, SlackError> {
2467        self.call(request).await
2468    }
2469
2470    /// Calls the Slack Web API method [`admin.conversations.rename`](https://docs.slack.dev/reference/methods/admin.conversations.rename): Rename a public or private channel.
2471    ///
2472    /// Required scopes:
2473    ///
2474    /// - user token: `admin.conversations:write`
2475    ///
2476    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2477    ///
2478    /// # Errors
2479    ///
2480    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2481    #[doc(alias = "admin.conversations.rename")]
2482    pub async fn admin_conversations_rename(
2483        &self,
2484        request: &AdminConversationsRenameRequest,
2485    ) -> Result<AdminConversationsRenameResponse, SlackError> {
2486        self.call(request).await
2487    }
2488
2489    /// Calls the Slack Web API method [`admin.conversations.restrictAccess.addGroup`](https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.addGroup): Add an allowlist of IDP groups for accessing a channel
2490    ///
2491    /// Required scopes:
2492    ///
2493    /// - user token: `admin.conversations:write`
2494    ///
2495    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2496    ///
2497    /// # Errors
2498    ///
2499    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2500    #[doc(alias = "admin.conversations.restrictAccess.addGroup")]
2501    pub async fn admin_conversations_restrict_access_add_group(
2502        &self,
2503        request: &AdminConversationsRestrictAccessAddGroupRequest,
2504    ) -> Result<AdminConversationsRestrictAccessAddGroupResponse, SlackError> {
2505        self.call(request).await
2506    }
2507
2508    /// Calls the Slack Web API method [`admin.conversations.restrictAccess.listGroups`](https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.listGroups): List all IDP Groups linked to a channel
2509    ///
2510    /// Required scopes:
2511    ///
2512    /// - user token: `admin.conversations:read`
2513    ///
2514    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2515    ///
2516    /// # Errors
2517    ///
2518    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2519    #[doc(alias = "admin.conversations.restrictAccess.listGroups")]
2520    pub async fn admin_conversations_restrict_access_list_groups(
2521        &self,
2522        request: &AdminConversationsRestrictAccessListGroupsRequest,
2523    ) -> Result<AdminConversationsRestrictAccessListGroupsResponse, SlackError> {
2524        self.call(request).await
2525    }
2526
2527    /// Calls the Slack Web API method [`admin.conversations.restrictAccess.removeGroup`](https://docs.slack.dev/reference/methods/admin.conversations.restrictAccess.removeGroup): Remove a linked IDP group linked from a private channel
2528    ///
2529    /// Required scopes:
2530    ///
2531    /// - user token: `admin.conversations:write`
2532    ///
2533    /// Rate limit: Tier 1 (<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 = "admin.conversations.restrictAccess.removeGroup")]
2539    pub async fn admin_conversations_restrict_access_remove_group(
2540        &self,
2541        request: &AdminConversationsRestrictAccessRemoveGroupRequest,
2542    ) -> Result<AdminConversationsRestrictAccessRemoveGroupResponse, SlackError> {
2543        self.call(request).await
2544    }
2545
2546    /// Calls the Slack Web API method [`admin.conversations.search`](https://docs.slack.dev/reference/methods/admin.conversations.search): Search for public or private channels in an Enterprise organization.
2547    ///
2548    /// Required scopes:
2549    ///
2550    /// - user token: `admin.conversations:read`
2551    ///
2552    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2553    ///
2554    /// # Errors
2555    ///
2556    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2557    #[doc(alias = "admin.conversations.search")]
2558    pub async fn admin_conversations_search(
2559        &self,
2560        request: &AdminConversationsSearchRequest,
2561    ) -> Result<AdminConversationsSearchResponse, SlackError> {
2562        self.call(request).await
2563    }
2564
2565    /// Calls the Slack Web API method [`admin.conversations.setConversationPrefs`](https://docs.slack.dev/reference/methods/admin.conversations.setConversationPrefs): Set the posting permissions for a public or private channel.
2566    ///
2567    /// Required scopes:
2568    ///
2569    /// - user token: `admin.conversations:write`
2570    ///
2571    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2572    ///
2573    /// # Errors
2574    ///
2575    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2576    #[doc(alias = "admin.conversations.setConversationPrefs")]
2577    pub async fn admin_conversations_set_conversation_prefs(
2578        &self,
2579        request: &AdminConversationsSetConversationPrefsRequest,
2580    ) -> Result<AdminConversationsSetConversationPrefsResponse, SlackError> {
2581        self.call(request).await
2582    }
2583
2584    /// Calls the Slack Web API method [`admin.conversations.setCustomRetention`](https://docs.slack.dev/reference/methods/admin.conversations.setCustomRetention): This API endpoint can be used by any admin to set a conversation's retention policy.
2585    ///
2586    /// Required scopes:
2587    ///
2588    /// - user token: `admin.conversations:write`
2589    ///
2590    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2591    ///
2592    /// # Errors
2593    ///
2594    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2595    #[doc(alias = "admin.conversations.setCustomRetention")]
2596    pub async fn admin_conversations_set_custom_retention(
2597        &self,
2598        request: &AdminConversationsSetCustomRetentionRequest,
2599    ) -> Result<AdminConversationsSetCustomRetentionResponse, SlackError> {
2600        self.call(request).await
2601    }
2602
2603    /// Calls the Slack Web API method [`admin.conversations.setTeams`](https://docs.slack.dev/reference/methods/admin.conversations.setTeams): Set the workspaces in an Enterprise org that connect to a public or private channel.
2604    ///
2605    /// Required scopes:
2606    ///
2607    /// - user token: `admin.conversations:write`
2608    ///
2609    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2610    ///
2611    /// # Errors
2612    ///
2613    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2614    #[doc(alias = "admin.conversations.setTeams")]
2615    pub async fn admin_conversations_set_teams(
2616        &self,
2617        request: &AdminConversationsSetTeamsRequest,
2618    ) -> Result<AdminConversationsSetTeamsResponse, SlackError> {
2619        self.call(request).await
2620    }
2621
2622    /// Calls the Slack Web API method [`admin.conversations.unarchive`](https://docs.slack.dev/reference/methods/admin.conversations.unarchive): Unarchive a public or private channel.
2623    ///
2624    /// Required scopes:
2625    ///
2626    /// - user token: `admin.conversations:write`
2627    ///
2628    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2629    ///
2630    /// # Errors
2631    ///
2632    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2633    #[doc(alias = "admin.conversations.unarchive")]
2634    pub async fn admin_conversations_unarchive(
2635        &self,
2636        request: &AdminConversationsUnarchiveRequest,
2637    ) -> Result<AdminConversationsUnarchiveResponse, SlackError> {
2638        self.call(request).await
2639    }
2640
2641    /// Calls the Slack Web API method [`admin.conversations.unlinkObjects`](https://docs.slack.dev/reference/methods/admin.conversations.unlinkObjects): Unlink a Salesforce record from a channel
2642    ///
2643    /// Required scopes:
2644    ///
2645    /// - user token: `admin.conversations:manage_objects`
2646    ///
2647    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2648    ///
2649    /// # Errors
2650    ///
2651    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2652    #[doc(alias = "admin.conversations.unlinkObjects")]
2653    pub async fn admin_conversations_unlink_objects(
2654        &self,
2655        request: &AdminConversationsUnlinkObjectsRequest,
2656    ) -> Result<AdminConversationsUnlinkObjectsResponse, SlackError> {
2657        self.call(request).await
2658    }
2659}