Skip to main content

slack_web_api/api/
admin_apps.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.apps.activities.list`](https://docs.slack.dev/reference/methods/admin.apps.activities.list): Get logs for a specified team/org
12///
13/// Send it with [`SlackClient::admin_apps_activities_list`].
14#[doc(alias = "admin.apps.activities.list")]
15#[derive(Debug, Clone, PartialEq, Serialize, Default)]
16#[non_exhaustive]
17pub struct AdminAppsActivitiesListRequest {
18    /// The ID of the app to get activities from.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub app_id: Option<String>,
21    /// The team who owns this log.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub team_id: Option<String>,
24    /// Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. See [pagination](https://docs.slack.dev/apis/web-api/pagination.md) for more detail.
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub cursor: Option<String>,
27    /// The maximum number of items to return.
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub limit: Option<i64>,
30    /// The minimum log level of the log events to be returned. Defaults to `info`. Acceptable values (in order of relative importance from smallest to largest) are `trace`, `debug`, `info`, `warn`, `error` and `fatal`.
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub min_log_level: Option<String>,
33    /// The event type of log events to be returned.
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub log_event_type: Option<String>,
36    /// The source of log events to be returned. Acceptable values are `slack` and `developer`.
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub source: Option<String>,
39    /// The component type of log events to be returned. Acceptable values are `events_api`, `workflows`, `functions` and `tables`.
40    #[serde(skip_serializing_if = "Option::is_none")]
41    pub component_type: Option<String>,
42    /// The component ID of log events to be returned. Will be `FnXXXXXX` for functions, and `WfXXXXXX` for workflows
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub component_id: Option<String>,
45    /// The trace ID of log events to be returned.
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub trace_id: Option<String>,
48    /// The earliest timestamp of the log to retrieve (epoch microseconds).
49    #[serde(skip_serializing_if = "Option::is_none")]
50    pub min_date_created: Option<i64>,
51    /// The latest timestamp of the log to retrieve (epoch microseconds).
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub max_date_created: Option<i64>,
54    /// The direction you want the data sorted by (always by timestamp)
55    #[serde(skip_serializing_if = "Option::is_none")]
56    pub sort_direction: Option<String>,
57}
58
59impl AdminAppsActivitiesListRequest {
60    pub fn new() -> Self {
61        Self {
62            app_id: None,
63            team_id: None,
64            cursor: None,
65            limit: None,
66            min_log_level: None,
67            log_event_type: None,
68            source: None,
69            component_type: None,
70            component_id: None,
71            trace_id: None,
72            min_date_created: None,
73            max_date_created: None,
74            sort_direction: None,
75        }
76    }
77
78    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
79        self.app_id = Some(app_id.into());
80        self
81    }
82
83    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
84        self.team_id = Some(team_id.into());
85        self
86    }
87
88    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
89        self.cursor = Some(cursor.into());
90        self
91    }
92
93    pub fn limit(mut self, limit: i64) -> Self {
94        self.limit = Some(limit);
95        self
96    }
97
98    pub fn min_log_level(mut self, min_log_level: impl Into<String>) -> Self {
99        self.min_log_level = Some(min_log_level.into());
100        self
101    }
102
103    pub fn log_event_type(mut self, log_event_type: impl Into<String>) -> Self {
104        self.log_event_type = Some(log_event_type.into());
105        self
106    }
107
108    pub fn source(mut self, source: impl Into<String>) -> Self {
109        self.source = Some(source.into());
110        self
111    }
112
113    pub fn component_type(mut self, component_type: impl Into<String>) -> Self {
114        self.component_type = Some(component_type.into());
115        self
116    }
117
118    pub fn component_id(mut self, component_id: impl Into<String>) -> Self {
119        self.component_id = Some(component_id.into());
120        self
121    }
122
123    pub fn trace_id(mut self, trace_id: impl Into<String>) -> Self {
124        self.trace_id = Some(trace_id.into());
125        self
126    }
127
128    pub fn min_date_created(mut self, min_date_created: i64) -> Self {
129        self.min_date_created = Some(min_date_created);
130        self
131    }
132
133    pub fn max_date_created(mut self, max_date_created: i64) -> Self {
134        self.max_date_created = Some(max_date_created);
135        self
136    }
137
138    pub fn sort_direction(mut self, sort_direction: impl Into<String>) -> Self {
139        self.sort_direction = Some(sort_direction.into());
140        self
141    }
142}
143
144impl SlackApiMethod for AdminAppsActivitiesListRequest {
145    const METHOD: &'static str = "admin.apps.activities.list";
146    type Response = AdminAppsActivitiesListResponse;
147}
148
149impl CursorPaginated for AdminAppsActivitiesListRequest {
150    fn set_cursor(&mut self, cursor: String) {
151        self.cursor = Some(cursor);
152    }
153}
154
155impl NextCursor for AdminAppsActivitiesListResponse {
156    fn next_cursor(&self) -> Option<&str> {
157        self.response_metadata.as_ref()?.next_cursor.as_deref()
158    }
159}
160
161/// Successful response of the Slack Web API method [`admin.apps.activities.list`](https://docs.slack.dev/reference/methods/admin.apps.activities.list).
162#[doc(alias = "admin.apps.activities.list")]
163#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
164pub struct AdminAppsActivitiesListResponse {
165    #[serde(
166        default,
167        deserialize_with = "crate::de::vec",
168        skip_serializing_if = "Vec::is_empty"
169    )]
170    pub activities: Vec<AdminAppsActivitiesListResponseActivities>,
171    #[serde(
172        default,
173        deserialize_with = "crate::de::opt_object",
174        skip_serializing_if = "Option::is_none"
175    )]
176    pub response_metadata: Option<ResponseMetadata>,
177    #[serde(
178        default,
179        deserialize_with = "crate::de::opt_string",
180        skip_serializing_if = "Option::is_none"
181    )]
182    pub warning: Option<String>,
183}
184
185#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
186pub struct AdminAppsActivitiesListResponseActivities {
187    #[serde(
188        default,
189        deserialize_with = "crate::de::opt_string",
190        skip_serializing_if = "Option::is_none"
191    )]
192    pub app_id: Option<String>,
193    #[serde(
194        default,
195        deserialize_with = "crate::de::opt_string",
196        skip_serializing_if = "Option::is_none"
197    )]
198    pub level: Option<String>,
199    #[serde(
200        default,
201        deserialize_with = "crate::de::opt_string",
202        skip_serializing_if = "Option::is_none"
203    )]
204    pub event_type: Option<String>,
205    #[serde(
206        default,
207        deserialize_with = "crate::de::opt_string",
208        skip_serializing_if = "Option::is_none"
209    )]
210    pub source: Option<String>,
211    #[serde(
212        default,
213        deserialize_with = "crate::de::opt_string",
214        skip_serializing_if = "Option::is_none"
215    )]
216    pub component_type: Option<String>,
217    #[serde(
218        default,
219        deserialize_with = "crate::de::opt_string",
220        skip_serializing_if = "Option::is_none"
221    )]
222    pub component_id: Option<String>,
223    #[serde(
224        default,
225        deserialize_with = "crate::de::opt_object",
226        skip_serializing_if = "Option::is_none"
227    )]
228    pub payload: Option<AdminAppsActivitiesListResponseActivitiesPayload>,
229    #[serde(
230        default,
231        deserialize_with = "crate::de::opt_i64",
232        skip_serializing_if = "Option::is_none"
233    )]
234    pub created: Option<i64>,
235    #[serde(
236        default,
237        deserialize_with = "crate::de::opt_string",
238        skip_serializing_if = "Option::is_none"
239    )]
240    pub trace_id: Option<String>,
241}
242
243#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
244pub struct AdminAppsActivitiesListResponseActivitiesPayload {
245    #[serde(
246        default,
247        deserialize_with = "crate::de::opt_string",
248        skip_serializing_if = "Option::is_none"
249    )]
250    pub function_name: Option<String>,
251    #[serde(
252        default,
253        deserialize_with = "crate::de::opt_string",
254        skip_serializing_if = "Option::is_none"
255    )]
256    pub function_type: Option<String>,
257}
258
259/// Arguments for the Slack Web API method [`admin.apps.approve`](https://docs.slack.dev/reference/methods/admin.apps.approve): Approve an app for installation on a workspace.
260///
261/// Send it with [`SlackClient::admin_apps_approve`].
262#[doc(alias = "admin.apps.approve")]
263#[derive(Debug, Clone, PartialEq, Serialize, Default)]
264#[non_exhaustive]
265pub struct AdminAppsApproveRequest {
266    /// Auto-create an Admin-Approved App automation rule that pre-approves future child app installs from this manager app.
267    #[serde(skip_serializing_if = "Option::is_none")]
268    pub allow_child_auto_install: Option<bool>,
269    /// The id of the app to approve.
270    #[serde(skip_serializing_if = "Option::is_none")]
271    pub app_id: Option<String>,
272    /// The id of the request to approve.
273    #[serde(skip_serializing_if = "Option::is_none")]
274    pub request_id: Option<String>,
275    /// The ID of the workspace to approve the app on
276    #[serde(skip_serializing_if = "Option::is_none")]
277    pub team_id: Option<String>,
278    /// The ID of the enterprise to approve the app on
279    #[serde(skip_serializing_if = "Option::is_none")]
280    pub enterprise_id: Option<String>,
281    /// User scopes to approve for the app
282    #[serde(skip_serializing_if = "Option::is_none")]
283    pub user_scopes: Option<String>,
284    /// Bot scopes to approve for the app
285    #[serde(skip_serializing_if = "Option::is_none")]
286    pub bot_scopes: Option<String>,
287}
288
289impl AdminAppsApproveRequest {
290    pub fn new() -> Self {
291        Self {
292            allow_child_auto_install: None,
293            app_id: None,
294            request_id: None,
295            team_id: None,
296            enterprise_id: None,
297            user_scopes: None,
298            bot_scopes: None,
299        }
300    }
301
302    pub fn allow_child_auto_install(mut self, allow_child_auto_install: bool) -> Self {
303        self.allow_child_auto_install = Some(allow_child_auto_install);
304        self
305    }
306
307    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
308        self.app_id = Some(app_id.into());
309        self
310    }
311
312    pub fn request_id(mut self, request_id: impl Into<String>) -> Self {
313        self.request_id = Some(request_id.into());
314        self
315    }
316
317    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
318        self.team_id = Some(team_id.into());
319        self
320    }
321
322    pub fn enterprise_id(mut self, enterprise_id: impl Into<String>) -> Self {
323        self.enterprise_id = Some(enterprise_id.into());
324        self
325    }
326
327    pub fn user_scopes(mut self, user_scopes: impl Into<String>) -> Self {
328        self.user_scopes = Some(user_scopes.into());
329        self
330    }
331
332    pub fn bot_scopes(mut self, bot_scopes: impl Into<String>) -> Self {
333        self.bot_scopes = Some(bot_scopes.into());
334        self
335    }
336}
337
338impl SlackApiMethod for AdminAppsApproveRequest {
339    const METHOD: &'static str = "admin.apps.approve";
340    type Response = AdminAppsApproveResponse;
341}
342
343/// Successful response of the Slack Web API method [`admin.apps.approve`](https://docs.slack.dev/reference/methods/admin.apps.approve).
344#[doc(alias = "admin.apps.approve")]
345#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
346pub struct AdminAppsApproveResponse {
347    /// Fields returned by Slack. This method has no documented response example.
348    #[serde(flatten)]
349    pub extra: serde_json::Map<String, serde_json::Value>,
350    #[serde(
351        default,
352        deserialize_with = "crate::de::opt_object",
353        skip_serializing_if = "Option::is_none"
354    )]
355    pub response_metadata: Option<ResponseMetadata>,
356    #[serde(
357        default,
358        deserialize_with = "crate::de::opt_string",
359        skip_serializing_if = "Option::is_none"
360    )]
361    pub warning: Option<String>,
362}
363
364/// Arguments for the Slack Web API method [`admin.apps.approved.list`](https://docs.slack.dev/reference/methods/admin.apps.approved.list): List approved apps for an org or workspace.
365///
366/// Send it with [`SlackClient::admin_apps_approved_list`].
367#[doc(alias = "admin.apps.approved.list")]
368#[derive(Debug, Clone, PartialEq, Serialize, Default)]
369#[non_exhaustive]
370pub struct AdminAppsApprovedListRequest {
371    /// The maximum number of items to return. Must be between 1 - 1000 both inclusive.
372    #[serde(skip_serializing_if = "Option::is_none")]
373    pub limit: Option<i64>,
374    /// Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
375    #[serde(skip_serializing_if = "Option::is_none")]
376    pub cursor: Option<String>,
377    #[serde(skip_serializing_if = "Option::is_none")]
378    pub team_id: Option<String>,
379    #[serde(skip_serializing_if = "Option::is_none")]
380    pub enterprise_id: Option<String>,
381    /// Limit the results to only include certified apps. When false, no certified apps will appear in the result
382    #[serde(skip_serializing_if = "Option::is_none")]
383    pub certified: Option<bool>,
384}
385
386impl AdminAppsApprovedListRequest {
387    pub fn new() -> Self {
388        Self {
389            limit: None,
390            cursor: None,
391            team_id: None,
392            enterprise_id: None,
393            certified: None,
394        }
395    }
396
397    pub fn limit(mut self, limit: i64) -> Self {
398        self.limit = Some(limit);
399        self
400    }
401
402    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
403        self.cursor = Some(cursor.into());
404        self
405    }
406
407    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
408        self.team_id = Some(team_id.into());
409        self
410    }
411
412    pub fn enterprise_id(mut self, enterprise_id: impl Into<String>) -> Self {
413        self.enterprise_id = Some(enterprise_id.into());
414        self
415    }
416
417    pub fn certified(mut self, certified: bool) -> Self {
418        self.certified = Some(certified);
419        self
420    }
421}
422
423impl SlackApiMethod for AdminAppsApprovedListRequest {
424    const METHOD: &'static str = "admin.apps.approved.list";
425    type Response = AdminAppsApprovedListResponse;
426}
427
428impl CursorPaginated for AdminAppsApprovedListRequest {
429    fn set_cursor(&mut self, cursor: String) {
430        self.cursor = Some(cursor);
431    }
432}
433
434impl NextCursor for AdminAppsApprovedListResponse {
435    fn next_cursor(&self) -> Option<&str> {
436        self.response_metadata.as_ref()?.next_cursor.as_deref()
437    }
438}
439
440/// Successful response of the Slack Web API method [`admin.apps.approved.list`](https://docs.slack.dev/reference/methods/admin.apps.approved.list).
441#[doc(alias = "admin.apps.approved.list")]
442#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
443pub struct AdminAppsApprovedListResponse {
444    #[serde(
445        default,
446        deserialize_with = "crate::de::vec",
447        skip_serializing_if = "Vec::is_empty"
448    )]
449    pub approved_apps: Vec<AdminAppsApprovedListResponseApprovedApps>,
450    #[serde(
451        default,
452        deserialize_with = "crate::de::opt_object",
453        skip_serializing_if = "Option::is_none"
454    )]
455    pub response_metadata: Option<ResponseMetadata>,
456    #[serde(
457        default,
458        deserialize_with = "crate::de::opt_string",
459        skip_serializing_if = "Option::is_none"
460    )]
461    pub warning: Option<String>,
462}
463
464#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
465pub struct AdminAppsApprovedListResponseApprovedApps {
466    #[serde(
467        default,
468        deserialize_with = "crate::de::opt_object",
469        skip_serializing_if = "Option::is_none"
470    )]
471    pub app: Option<AdminAppsApprovedListResponseApprovedAppsApp>,
472    #[serde(
473        default,
474        deserialize_with = "crate::de::vec",
475        skip_serializing_if = "Vec::is_empty"
476    )]
477    pub scopes: Vec<AdminAppsApprovedListResponseApprovedAppsScopes>,
478    #[serde(
479        default,
480        deserialize_with = "crate::de::opt_i64",
481        skip_serializing_if = "Option::is_none"
482    )]
483    pub date_updated: Option<i64>,
484    #[serde(
485        default,
486        deserialize_with = "crate::de::opt_object",
487        skip_serializing_if = "Option::is_none"
488    )]
489    pub last_resolved_by: Option<AdminAppsApprovedListResponseApprovedAppsLastResolvedBy>,
490}
491
492#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
493pub struct AdminAppsApprovedListResponseApprovedAppsApp {
494    #[serde(
495        default,
496        deserialize_with = "crate::de::opt_string",
497        skip_serializing_if = "Option::is_none"
498    )]
499    pub id: Option<String>,
500    #[serde(
501        default,
502        deserialize_with = "crate::de::opt_string",
503        skip_serializing_if = "Option::is_none"
504    )]
505    pub name: Option<String>,
506    #[serde(
507        default,
508        deserialize_with = "crate::de::opt_string",
509        skip_serializing_if = "Option::is_none"
510    )]
511    pub description: Option<String>,
512    #[serde(
513        default,
514        deserialize_with = "crate::de::opt_string",
515        skip_serializing_if = "Option::is_none"
516    )]
517    pub help_url: Option<String>,
518    #[serde(
519        default,
520        deserialize_with = "crate::de::opt_string",
521        skip_serializing_if = "Option::is_none"
522    )]
523    pub privacy_policy_url: Option<String>,
524    #[serde(
525        default,
526        deserialize_with = "crate::de::opt_string",
527        skip_serializing_if = "Option::is_none"
528    )]
529    pub app_homepage_url: Option<String>,
530    #[serde(
531        default,
532        deserialize_with = "crate::de::opt_string",
533        skip_serializing_if = "Option::is_none"
534    )]
535    pub app_directory_url: Option<String>,
536    #[serde(
537        default,
538        deserialize_with = "crate::de::opt_bool",
539        skip_serializing_if = "Option::is_none"
540    )]
541    pub is_app_directory_approved: Option<bool>,
542    #[serde(
543        default,
544        deserialize_with = "crate::de::opt_bool",
545        skip_serializing_if = "Option::is_none"
546    )]
547    pub is_internal: Option<bool>,
548    #[serde(
549        default,
550        deserialize_with = "crate::de::opt_string",
551        skip_serializing_if = "Option::is_none"
552    )]
553    pub developer_type: Option<String>,
554    #[serde(
555        default,
556        deserialize_with = "crate::de::opt_bool",
557        skip_serializing_if = "Option::is_none"
558    )]
559    pub socket_mode_enabled: Option<bool>,
560    #[serde(
561        default,
562        deserialize_with = "crate::de::opt_object",
563        skip_serializing_if = "Option::is_none"
564    )]
565    pub icons: Option<Icons>,
566    #[serde(
567        default,
568        deserialize_with = "crate::de::opt_string",
569        skip_serializing_if = "Option::is_none"
570    )]
571    pub additional_info: Option<String>,
572}
573
574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
575pub struct AdminAppsApprovedListResponseApprovedAppsScopes {
576    #[serde(
577        default,
578        deserialize_with = "crate::de::opt_string",
579        skip_serializing_if = "Option::is_none"
580    )]
581    pub name: Option<String>,
582    #[serde(
583        default,
584        deserialize_with = "crate::de::opt_string",
585        skip_serializing_if = "Option::is_none"
586    )]
587    pub description: Option<String>,
588    #[serde(
589        default,
590        deserialize_with = "crate::de::opt_bool",
591        skip_serializing_if = "Option::is_none"
592    )]
593    pub is_sensitive: Option<bool>,
594    #[serde(
595        default,
596        deserialize_with = "crate::de::opt_string",
597        skip_serializing_if = "Option::is_none"
598    )]
599    pub token_type: Option<String>,
600}
601
602#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
603pub struct AdminAppsApprovedListResponseApprovedAppsLastResolvedBy {
604    #[serde(
605        default,
606        deserialize_with = "crate::de::opt_string",
607        skip_serializing_if = "Option::is_none"
608    )]
609    pub actor_id: Option<String>,
610    #[serde(
611        default,
612        deserialize_with = "crate::de::opt_string",
613        skip_serializing_if = "Option::is_none"
614    )]
615    pub actor_type: Option<String>,
616}
617
618/// Arguments for the Slack Web API method [`admin.apps.clearResolution`](https://docs.slack.dev/reference/methods/admin.apps.clearResolution): Clear an app resolution
619///
620/// Send it with [`SlackClient::admin_apps_clear_resolution`].
621#[doc(alias = "admin.apps.clearResolution")]
622#[derive(Debug, Clone, PartialEq, Serialize)]
623#[non_exhaustive]
624pub struct AdminAppsClearResolutionRequest {
625    /// The id of the app whose resolution you want to clear/undo.
626    pub app_id: String,
627    /// The workspace to clear the app resolution from
628    #[serde(skip_serializing_if = "Option::is_none")]
629    pub team_id: Option<String>,
630    /// The enterprise to clear the app resolution from
631    #[serde(skip_serializing_if = "Option::is_none")]
632    pub enterprise_id: Option<String>,
633}
634
635impl AdminAppsClearResolutionRequest {
636    pub fn new(app_id: impl Into<String>) -> Self {
637        Self {
638            app_id: app_id.into(),
639            team_id: None,
640            enterprise_id: None,
641        }
642    }
643
644    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
645        self.team_id = Some(team_id.into());
646        self
647    }
648
649    pub fn enterprise_id(mut self, enterprise_id: impl Into<String>) -> Self {
650        self.enterprise_id = Some(enterprise_id.into());
651        self
652    }
653}
654
655impl SlackApiMethod for AdminAppsClearResolutionRequest {
656    const METHOD: &'static str = "admin.apps.clearResolution";
657    type Response = AdminAppsClearResolutionResponse;
658}
659
660/// Successful response of the Slack Web API method [`admin.apps.clearResolution`](https://docs.slack.dev/reference/methods/admin.apps.clearResolution).
661#[doc(alias = "admin.apps.clearResolution")]
662#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
663pub struct AdminAppsClearResolutionResponse {
664    /// Fields returned by Slack. This method has no documented response example.
665    #[serde(flatten)]
666    pub extra: serde_json::Map<String, serde_json::Value>,
667    #[serde(
668        default,
669        deserialize_with = "crate::de::opt_object",
670        skip_serializing_if = "Option::is_none"
671    )]
672    pub response_metadata: Option<ResponseMetadata>,
673    #[serde(
674        default,
675        deserialize_with = "crate::de::opt_string",
676        skip_serializing_if = "Option::is_none"
677    )]
678    pub warning: Option<String>,
679}
680
681/// Arguments for the Slack Web API method [`admin.apps.config.lookup`](https://docs.slack.dev/reference/methods/admin.apps.config.lookup): Look up the app config for connectors by their IDs
682///
683/// Send it with [`SlackClient::admin_apps_config_lookup`].
684#[doc(alias = "admin.apps.config.lookup")]
685#[derive(Debug, Clone, PartialEq, Serialize, Default)]
686#[non_exhaustive]
687pub struct AdminAppsConfigLookupRequest {
688    /// An array of app IDs to get app configs for
689    #[serde(skip_serializing_if = "Option::is_none")]
690    pub app_ids: Option<Vec<String>>,
691    /// return apps with the corresponding rich link preview layouts
692    #[serde(skip_serializing_if = "Option::is_none")]
693    pub rich_link_preview_types: Option<Vec<String>>,
694}
695
696impl AdminAppsConfigLookupRequest {
697    pub fn new() -> Self {
698        Self {
699            app_ids: None,
700            rich_link_preview_types: None,
701        }
702    }
703
704    pub fn app_ids(mut self, app_ids: Vec<String>) -> Self {
705        self.app_ids = Some(app_ids);
706        self
707    }
708
709    pub fn rich_link_preview_types(mut self, rich_link_preview_types: Vec<String>) -> Self {
710        self.rich_link_preview_types = Some(rich_link_preview_types);
711        self
712    }
713}
714
715impl SlackApiMethod for AdminAppsConfigLookupRequest {
716    const METHOD: &'static str = "admin.apps.config.lookup";
717    type Response = AdminAppsConfigLookupResponse;
718}
719
720/// Successful response of the Slack Web API method [`admin.apps.config.lookup`](https://docs.slack.dev/reference/methods/admin.apps.config.lookup).
721#[doc(alias = "admin.apps.config.lookup")]
722#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
723pub struct AdminAppsConfigLookupResponse {
724    #[serde(
725        default,
726        deserialize_with = "crate::de::vec",
727        skip_serializing_if = "Vec::is_empty"
728    )]
729    pub configs: Vec<AdminAppsConfigLookupResponseConfigs>,
730    #[serde(
731        default,
732        deserialize_with = "crate::de::opt_object",
733        skip_serializing_if = "Option::is_none"
734    )]
735    pub response_metadata: Option<ResponseMetadata>,
736    #[serde(
737        default,
738        deserialize_with = "crate::de::opt_string",
739        skip_serializing_if = "Option::is_none"
740    )]
741    pub warning: Option<String>,
742}
743
744#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
745pub struct AdminAppsConfigLookupResponseConfigs {
746    #[serde(
747        default,
748        deserialize_with = "crate::de::opt_string",
749        skip_serializing_if = "Option::is_none"
750    )]
751    pub app_id: Option<String>,
752    #[serde(
753        default,
754        deserialize_with = "crate::de::opt_string",
755        skip_serializing_if = "Option::is_none"
756    )]
757    pub workflow_auth_strategy: Option<String>,
758    #[serde(
759        default,
760        deserialize_with = "crate::de::opt_string",
761        skip_serializing_if = "Option::is_none"
762    )]
763    pub rich_link_preview_type: Option<String>,
764    #[serde(
765        default,
766        deserialize_with = "crate::de::opt_object",
767        skip_serializing_if = "Option::is_none"
768    )]
769    pub domain_restrictions: Option<AdminAppsConfigLookupResponseConfigsDomainRestrictions>,
770}
771
772#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
773pub struct AdminAppsConfigLookupResponseConfigsDomainRestrictions {
774    #[serde(
775        default,
776        deserialize_with = "crate::de::vec",
777        skip_serializing_if = "Vec::is_empty"
778    )]
779    pub emails: Vec<String>,
780    #[serde(
781        default,
782        deserialize_with = "crate::de::vec",
783        skip_serializing_if = "Vec::is_empty"
784    )]
785    pub urls: Vec<String>,
786}
787
788/// Arguments for the Slack Web API method [`admin.apps.config.set`](https://docs.slack.dev/reference/methods/admin.apps.config.set): Set the app config for a connector
789///
790/// Send it with [`SlackClient::admin_apps_config_set`].
791#[doc(alias = "admin.apps.config.set")]
792#[derive(Debug, Clone, PartialEq, Serialize)]
793#[non_exhaustive]
794pub struct AdminAppsConfigSetRequest {
795    /// The encoded app ID to set the app config for
796    pub app_id: String,
797    /// The workflow auth permission. Can be one of `builder_choice` or `end_user_only`.
798    #[serde(skip_serializing_if = "Option::is_none")]
799    pub workflow_auth_strategy: Option<String>,
800    /// Indicates the app-level override for rich link preview. Unsupported for free teams.
801    #[serde(skip_serializing_if = "Option::is_none")]
802    pub rich_link_preview_type: Option<String>,
803    /// Domain restrictions for the app. Should be an object with two properties: `urls` and `emails`. Each is an array of strings, and each sets the allowed URLs and emails for connector authorization, respectively.
804    #[serde(skip_serializing_if = "Option::is_none")]
805    pub domain_restrictions: Option<serde_json::Value>,
806}
807
808impl AdminAppsConfigSetRequest {
809    pub fn new(app_id: impl Into<String>) -> Self {
810        Self {
811            app_id: app_id.into(),
812            workflow_auth_strategy: None,
813            rich_link_preview_type: None,
814            domain_restrictions: None,
815        }
816    }
817
818    pub fn workflow_auth_strategy(mut self, workflow_auth_strategy: impl Into<String>) -> Self {
819        self.workflow_auth_strategy = Some(workflow_auth_strategy.into());
820        self
821    }
822
823    pub fn rich_link_preview_type(mut self, rich_link_preview_type: impl Into<String>) -> Self {
824        self.rich_link_preview_type = Some(rich_link_preview_type.into());
825        self
826    }
827
828    pub fn domain_restrictions(mut self, domain_restrictions: serde_json::Value) -> Self {
829        self.domain_restrictions = Some(domain_restrictions);
830        self
831    }
832}
833
834impl SlackApiMethod for AdminAppsConfigSetRequest {
835    const METHOD: &'static str = "admin.apps.config.set";
836    type Response = AdminAppsConfigSetResponse;
837}
838
839/// Successful response of the Slack Web API method [`admin.apps.config.set`](https://docs.slack.dev/reference/methods/admin.apps.config.set).
840#[doc(alias = "admin.apps.config.set")]
841#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
842pub struct AdminAppsConfigSetResponse {
843    /// Fields returned by Slack. This method has no documented response example.
844    #[serde(flatten)]
845    pub extra: serde_json::Map<String, serde_json::Value>,
846    #[serde(
847        default,
848        deserialize_with = "crate::de::opt_object",
849        skip_serializing_if = "Option::is_none"
850    )]
851    pub response_metadata: Option<ResponseMetadata>,
852    #[serde(
853        default,
854        deserialize_with = "crate::de::opt_string",
855        skip_serializing_if = "Option::is_none"
856    )]
857    pub warning: Option<String>,
858}
859
860/// Arguments for the Slack Web API method [`admin.apps.mcp.servers.list`](https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.list): List third-party app MCP servers approved for an organization.
861///
862/// Send it with [`SlackClient::admin_apps_mcp_servers_list`].
863#[doc(alias = "admin.apps.mcp.servers.list")]
864#[derive(Debug, Clone, PartialEq, Serialize, Default)]
865#[non_exhaustive]
866pub struct AdminAppsMcpServersListRequest {
867    /// The maximum number of items to return. Must be between 1 - 1000 both inclusive.
868    #[serde(skip_serializing_if = "Option::is_none")]
869    pub limit: Option<i64>,
870    /// Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
871    #[serde(skip_serializing_if = "Option::is_none")]
872    pub cursor: Option<String>,
873}
874
875impl AdminAppsMcpServersListRequest {
876    pub fn new() -> Self {
877        Self {
878            limit: None,
879            cursor: None,
880        }
881    }
882
883    pub fn limit(mut self, limit: i64) -> Self {
884        self.limit = Some(limit);
885        self
886    }
887
888    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
889        self.cursor = Some(cursor.into());
890        self
891    }
892}
893
894impl SlackApiMethod for AdminAppsMcpServersListRequest {
895    const METHOD: &'static str = "admin.apps.mcp.servers.list";
896    type Response = AdminAppsMcpServersListResponse;
897}
898
899impl CursorPaginated for AdminAppsMcpServersListRequest {
900    fn set_cursor(&mut self, cursor: String) {
901        self.cursor = Some(cursor);
902    }
903}
904
905impl NextCursor for AdminAppsMcpServersListResponse {
906    fn next_cursor(&self) -> Option<&str> {
907        self.response_metadata.as_ref()?.next_cursor.as_deref()
908    }
909}
910
911/// Successful response of the Slack Web API method [`admin.apps.mcp.servers.list`](https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.list).
912#[doc(alias = "admin.apps.mcp.servers.list")]
913#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
914pub struct AdminAppsMcpServersListResponse {
915    /// Fields returned by Slack. This method has no documented response example.
916    #[serde(flatten)]
917    pub extra: serde_json::Map<String, serde_json::Value>,
918    #[serde(
919        default,
920        deserialize_with = "crate::de::opt_object",
921        skip_serializing_if = "Option::is_none"
922    )]
923    pub response_metadata: Option<ResponseMetadata>,
924    #[serde(
925        default,
926        deserialize_with = "crate::de::opt_string",
927        skip_serializing_if = "Option::is_none"
928    )]
929    pub warning: Option<String>,
930}
931
932/// Arguments for the Slack Web API method [`admin.apps.mcp.servers.permissions.list`](https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.list): List MCP servers for an app with their access control permissions.
933///
934/// Send it with [`SlackClient::admin_apps_mcp_servers_permissions_list`].
935#[doc(alias = "admin.apps.mcp.servers.permissions.list")]
936#[derive(Debug, Clone, PartialEq, Serialize)]
937#[non_exhaustive]
938pub struct AdminAppsMcpServersPermissionsListRequest {
939    /// Encoded ID of the app
940    pub app_id: String,
941}
942
943impl AdminAppsMcpServersPermissionsListRequest {
944    pub fn new(app_id: impl Into<String>) -> Self {
945        Self {
946            app_id: app_id.into(),
947        }
948    }
949}
950
951impl SlackApiMethod for AdminAppsMcpServersPermissionsListRequest {
952    const METHOD: &'static str = "admin.apps.mcp.servers.permissions.list";
953    type Response = AdminAppsMcpServersPermissionsListResponse;
954}
955
956/// Successful response of the Slack Web API method [`admin.apps.mcp.servers.permissions.list`](https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.list).
957#[doc(alias = "admin.apps.mcp.servers.permissions.list")]
958#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
959pub struct AdminAppsMcpServersPermissionsListResponse {
960    /// Fields returned by Slack. This method has no documented response example.
961    #[serde(flatten)]
962    pub extra: serde_json::Map<String, serde_json::Value>,
963    #[serde(
964        default,
965        deserialize_with = "crate::de::opt_object",
966        skip_serializing_if = "Option::is_none"
967    )]
968    pub response_metadata: Option<ResponseMetadata>,
969    #[serde(
970        default,
971        deserialize_with = "crate::de::opt_string",
972        skip_serializing_if = "Option::is_none"
973    )]
974    pub warning: Option<String>,
975}
976
977/// Arguments for the Slack Web API method [`admin.apps.mcp.servers.permissions.set`](https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.set): Set the access control permission for who can use an MCP server.
978///
979/// Send it with [`SlackClient::admin_apps_mcp_servers_permissions_set`].
980#[doc(alias = "admin.apps.mcp.servers.permissions.set")]
981#[derive(Debug, Clone, PartialEq, Serialize)]
982#[non_exhaustive]
983pub struct AdminAppsMcpServersPermissionsSetRequest {
984    /// Encoded ID of the app
985    pub app_id: String,
986    /// Encoded ID of the MCP server
987    pub server_id: String,
988    /// The type of permission that defines who can use this MCP server
989    pub permission_type: String,
990    /// List of user IDs to set for named\_entities or named\_entities\_exclude
991    #[serde(
992        skip_serializing_if = "Option::is_none",
993        serialize_with = "crate::form::as_json"
994    )]
995    pub user_ids: Option<Vec<String>>,
996    /// List of encoded usergroup IDs
997    #[serde(skip_serializing_if = "Option::is_none")]
998    pub usergroup_ids: Option<Vec<String>>,
999}
1000
1001impl AdminAppsMcpServersPermissionsSetRequest {
1002    pub fn new(
1003        app_id: impl Into<String>,
1004        server_id: impl Into<String>,
1005        permission_type: impl Into<String>,
1006    ) -> Self {
1007        Self {
1008            app_id: app_id.into(),
1009            server_id: server_id.into(),
1010            permission_type: permission_type.into(),
1011            user_ids: None,
1012            usergroup_ids: None,
1013        }
1014    }
1015
1016    pub fn user_ids(mut self, user_ids: Vec<String>) -> Self {
1017        self.user_ids = Some(user_ids);
1018        self
1019    }
1020
1021    pub fn usergroup_ids(mut self, usergroup_ids: Vec<String>) -> Self {
1022        self.usergroup_ids = Some(usergroup_ids);
1023        self
1024    }
1025}
1026
1027impl SlackApiMethod for AdminAppsMcpServersPermissionsSetRequest {
1028    const METHOD: &'static str = "admin.apps.mcp.servers.permissions.set";
1029    type Response = AdminAppsMcpServersPermissionsSetResponse;
1030}
1031
1032/// Successful response of the Slack Web API method [`admin.apps.mcp.servers.permissions.set`](https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.set).
1033#[doc(alias = "admin.apps.mcp.servers.permissions.set")]
1034#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1035pub struct AdminAppsMcpServersPermissionsSetResponse {
1036    /// Fields returned by Slack. This method has no documented response example.
1037    #[serde(flatten)]
1038    pub extra: serde_json::Map<String, serde_json::Value>,
1039    #[serde(
1040        default,
1041        deserialize_with = "crate::de::opt_object",
1042        skip_serializing_if = "Option::is_none"
1043    )]
1044    pub response_metadata: Option<ResponseMetadata>,
1045    #[serde(
1046        default,
1047        deserialize_with = "crate::de::opt_string",
1048        skip_serializing_if = "Option::is_none"
1049    )]
1050    pub warning: Option<String>,
1051}
1052
1053/// Arguments for the Slack Web API method [`admin.apps.permissions.add`](https://docs.slack.dev/reference/methods/admin.apps.permissions.add): Grant permission for entities to access an app that has its permission type set to named_entities.
1054///
1055/// Send it with [`SlackClient::admin_apps_permissions_add`].
1056#[doc(alias = "admin.apps.permissions.add")]
1057#[derive(Debug, Clone, PartialEq, Serialize)]
1058#[non_exhaustive]
1059pub struct AdminAppsPermissionsAddRequest {
1060    /// Encoded ID of the app
1061    pub app_id: String,
1062    /// List of user IDs to allow for named\_entities visibility
1063    #[serde(
1064        skip_serializing_if = "Option::is_none",
1065        serialize_with = "crate::form::as_json"
1066    )]
1067    pub user_ids: Option<Vec<String>>,
1068    /// List of encoded usergroup IDs
1069    #[serde(skip_serializing_if = "Option::is_none")]
1070    pub usergroup_ids: Option<Vec<String>>,
1071    /// List of encoded channel IDs to add to the channel restriction list. Interpretation depends on the app's `channel_restriction_mode`, which is configured via the `admin.apps.permissions.set` method.
1072    #[serde(skip_serializing_if = "Option::is_none")]
1073    pub channel_ids: Option<Vec<String>>,
1074}
1075
1076impl AdminAppsPermissionsAddRequest {
1077    pub fn new(app_id: impl Into<String>) -> Self {
1078        Self {
1079            app_id: app_id.into(),
1080            user_ids: None,
1081            usergroup_ids: None,
1082            channel_ids: None,
1083        }
1084    }
1085
1086    pub fn user_ids(mut self, user_ids: Vec<String>) -> Self {
1087        self.user_ids = Some(user_ids);
1088        self
1089    }
1090
1091    pub fn usergroup_ids(mut self, usergroup_ids: Vec<String>) -> Self {
1092        self.usergroup_ids = Some(usergroup_ids);
1093        self
1094    }
1095
1096    pub fn channel_ids(mut self, channel_ids: Vec<String>) -> Self {
1097        self.channel_ids = Some(channel_ids);
1098        self
1099    }
1100}
1101
1102impl SlackApiMethod for AdminAppsPermissionsAddRequest {
1103    const METHOD: &'static str = "admin.apps.permissions.add";
1104    type Response = AdminAppsPermissionsAddResponse;
1105}
1106
1107/// Successful response of the Slack Web API method [`admin.apps.permissions.add`](https://docs.slack.dev/reference/methods/admin.apps.permissions.add).
1108#[doc(alias = "admin.apps.permissions.add")]
1109#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1110pub struct AdminAppsPermissionsAddResponse {
1111    /// Fields returned by Slack. This method has no documented response example.
1112    #[serde(flatten)]
1113    pub extra: serde_json::Map<String, serde_json::Value>,
1114    #[serde(
1115        default,
1116        deserialize_with = "crate::de::opt_object",
1117        skip_serializing_if = "Option::is_none"
1118    )]
1119    pub response_metadata: Option<ResponseMetadata>,
1120    #[serde(
1121        default,
1122        deserialize_with = "crate::de::opt_string",
1123        skip_serializing_if = "Option::is_none"
1124    )]
1125    pub warning: Option<String>,
1126}
1127
1128/// Arguments for the Slack Web API method [`admin.apps.permissions.list`](https://docs.slack.dev/reference/methods/admin.apps.permissions.list): Returns the permission type of an app and the entities that have been granted access.
1129///
1130/// Send it with [`SlackClient::admin_apps_permissions_list`].
1131#[doc(alias = "admin.apps.permissions.list")]
1132#[derive(Debug, Clone, PartialEq, Serialize)]
1133#[non_exhaustive]
1134pub struct AdminAppsPermissionsListRequest {
1135    /// Encoded ID of the app
1136    pub app_id: String,
1137}
1138
1139impl AdminAppsPermissionsListRequest {
1140    pub fn new(app_id: impl Into<String>) -> Self {
1141        Self {
1142            app_id: app_id.into(),
1143        }
1144    }
1145}
1146
1147impl SlackApiMethod for AdminAppsPermissionsListRequest {
1148    const METHOD: &'static str = "admin.apps.permissions.list";
1149    type Response = AdminAppsPermissionsListResponse;
1150}
1151
1152/// Successful response of the Slack Web API method [`admin.apps.permissions.list`](https://docs.slack.dev/reference/methods/admin.apps.permissions.list).
1153#[doc(alias = "admin.apps.permissions.list")]
1154#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1155pub struct AdminAppsPermissionsListResponse {
1156    /// Fields returned by Slack. This method has no documented response example.
1157    #[serde(flatten)]
1158    pub extra: serde_json::Map<String, serde_json::Value>,
1159    #[serde(
1160        default,
1161        deserialize_with = "crate::de::opt_object",
1162        skip_serializing_if = "Option::is_none"
1163    )]
1164    pub response_metadata: Option<ResponseMetadata>,
1165    #[serde(
1166        default,
1167        deserialize_with = "crate::de::opt_string",
1168        skip_serializing_if = "Option::is_none"
1169    )]
1170    pub warning: Option<String>,
1171}
1172
1173/// Arguments for the Slack Web API method [`admin.apps.permissions.remove`](https://docs.slack.dev/reference/methods/admin.apps.permissions.remove): Revoke an entity's access to an app that has its permission type set to named_entities.
1174///
1175/// Send it with [`SlackClient::admin_apps_permissions_remove`].
1176#[doc(alias = "admin.apps.permissions.remove")]
1177#[derive(Debug, Clone, PartialEq, Serialize)]
1178#[non_exhaustive]
1179pub struct AdminAppsPermissionsRemoveRequest {
1180    /// Encoded ID of the app
1181    pub app_id: String,
1182    /// List of user IDs whose named\_entities access will be revoked
1183    #[serde(
1184        skip_serializing_if = "Option::is_none",
1185        serialize_with = "crate::form::as_json"
1186    )]
1187    pub user_ids: Option<Vec<String>>,
1188    /// List of encoded usergroup IDs
1189    #[serde(skip_serializing_if = "Option::is_none")]
1190    pub usergroup_ids: Option<Vec<String>>,
1191    /// List of encoded channel IDs to remove from the channel restriction list. Interpretation depends on the app's `channel_restriction_mode`, which is configured via the `admin.apps.permissions.set` method.
1192    #[serde(skip_serializing_if = "Option::is_none")]
1193    pub channel_ids: Option<Vec<String>>,
1194}
1195
1196impl AdminAppsPermissionsRemoveRequest {
1197    pub fn new(app_id: impl Into<String>) -> Self {
1198        Self {
1199            app_id: app_id.into(),
1200            user_ids: None,
1201            usergroup_ids: None,
1202            channel_ids: None,
1203        }
1204    }
1205
1206    pub fn user_ids(mut self, user_ids: Vec<String>) -> Self {
1207        self.user_ids = Some(user_ids);
1208        self
1209    }
1210
1211    pub fn usergroup_ids(mut self, usergroup_ids: Vec<String>) -> Self {
1212        self.usergroup_ids = Some(usergroup_ids);
1213        self
1214    }
1215
1216    pub fn channel_ids(mut self, channel_ids: Vec<String>) -> Self {
1217        self.channel_ids = Some(channel_ids);
1218        self
1219    }
1220}
1221
1222impl SlackApiMethod for AdminAppsPermissionsRemoveRequest {
1223    const METHOD: &'static str = "admin.apps.permissions.remove";
1224    type Response = AdminAppsPermissionsRemoveResponse;
1225}
1226
1227/// Successful response of the Slack Web API method [`admin.apps.permissions.remove`](https://docs.slack.dev/reference/methods/admin.apps.permissions.remove).
1228#[doc(alias = "admin.apps.permissions.remove")]
1229#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1230pub struct AdminAppsPermissionsRemoveResponse {
1231    #[serde(
1232        default,
1233        deserialize_with = "crate::de::opt_string",
1234        skip_serializing_if = "Option::is_none"
1235    )]
1236    pub permission_type: Option<String>,
1237    #[serde(
1238        default,
1239        deserialize_with = "crate::de::opt_string",
1240        skip_serializing_if = "Option::is_none"
1241    )]
1242    pub channel_restriction_mode: Option<String>,
1243    #[serde(
1244        default,
1245        deserialize_with = "crate::de::vec",
1246        skip_serializing_if = "Vec::is_empty"
1247    )]
1248    pub channel_ids: Vec<String>,
1249    #[serde(
1250        default,
1251        deserialize_with = "crate::de::opt_object",
1252        skip_serializing_if = "Option::is_none"
1253    )]
1254    pub response_metadata: Option<ResponseMetadata>,
1255    #[serde(
1256        default,
1257        deserialize_with = "crate::de::opt_string",
1258        skip_serializing_if = "Option::is_none"
1259    )]
1260    pub warning: Option<String>,
1261}
1262
1263/// Arguments for the Slack Web API method [`admin.apps.permissions.set`](https://docs.slack.dev/reference/methods/admin.apps.permissions.set): Set the permission type for who can access an app.
1264///
1265/// Send it with [`SlackClient::admin_apps_permissions_set`].
1266#[doc(alias = "admin.apps.permissions.set")]
1267#[derive(Debug, Clone, PartialEq, Serialize)]
1268#[non_exhaustive]
1269pub struct AdminAppsPermissionsSetRequest {
1270    /// Encoded ID of the app
1271    pub app_id: String,
1272    /// The type of permission that defines who can access the app
1273    pub permission_type: String,
1274    /// List of user IDs to allow for named\_entities visibility
1275    #[serde(
1276        skip_serializing_if = "Option::is_none",
1277        serialize_with = "crate::form::as_json"
1278    )]
1279    pub user_ids: Option<Vec<String>>,
1280    /// List of encoded usergroup IDs
1281    #[serde(skip_serializing_if = "Option::is_none")]
1282    pub usergroup_ids: Option<Vec<String>>,
1283    /// The mode that defines where the app can be used in channels
1284    #[serde(skip_serializing_if = "Option::is_none")]
1285    pub channel_restriction_mode: Option<String>,
1286    /// List of encoded channel IDs for channel restrictions. Semantics depend on channel\_restriction\_mode: allowlist for specific\_channels, exclusion list for all\_channels\_except
1287    #[serde(skip_serializing_if = "Option::is_none")]
1288    pub channel_ids: Option<Vec<String>>,
1289}
1290
1291impl AdminAppsPermissionsSetRequest {
1292    pub fn new(app_id: impl Into<String>, permission_type: impl Into<String>) -> Self {
1293        Self {
1294            app_id: app_id.into(),
1295            permission_type: permission_type.into(),
1296            user_ids: None,
1297            usergroup_ids: None,
1298            channel_restriction_mode: None,
1299            channel_ids: None,
1300        }
1301    }
1302
1303    pub fn user_ids(mut self, user_ids: Vec<String>) -> Self {
1304        self.user_ids = Some(user_ids);
1305        self
1306    }
1307
1308    pub fn usergroup_ids(mut self, usergroup_ids: Vec<String>) -> Self {
1309        self.usergroup_ids = Some(usergroup_ids);
1310        self
1311    }
1312
1313    pub fn channel_restriction_mode(mut self, channel_restriction_mode: impl Into<String>) -> Self {
1314        self.channel_restriction_mode = Some(channel_restriction_mode.into());
1315        self
1316    }
1317
1318    pub fn channel_ids(mut self, channel_ids: Vec<String>) -> Self {
1319        self.channel_ids = Some(channel_ids);
1320        self
1321    }
1322}
1323
1324impl SlackApiMethod for AdminAppsPermissionsSetRequest {
1325    const METHOD: &'static str = "admin.apps.permissions.set";
1326    type Response = AdminAppsPermissionsSetResponse;
1327}
1328
1329/// Successful response of the Slack Web API method [`admin.apps.permissions.set`](https://docs.slack.dev/reference/methods/admin.apps.permissions.set).
1330#[doc(alias = "admin.apps.permissions.set")]
1331#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1332pub struct AdminAppsPermissionsSetResponse {
1333    #[serde(
1334        default,
1335        deserialize_with = "crate::de::opt_string",
1336        skip_serializing_if = "Option::is_none"
1337    )]
1338    pub permission_type: Option<String>,
1339    #[serde(
1340        default,
1341        deserialize_with = "crate::de::opt_string",
1342        skip_serializing_if = "Option::is_none"
1343    )]
1344    pub channel_restriction_mode: Option<String>,
1345    #[serde(
1346        default,
1347        deserialize_with = "crate::de::vec",
1348        skip_serializing_if = "Vec::is_empty"
1349    )]
1350    pub channel_ids: Vec<String>,
1351    #[serde(
1352        default,
1353        deserialize_with = "crate::de::opt_object",
1354        skip_serializing_if = "Option::is_none"
1355    )]
1356    pub response_metadata: Option<ResponseMetadata>,
1357    #[serde(
1358        default,
1359        deserialize_with = "crate::de::opt_string",
1360        skip_serializing_if = "Option::is_none"
1361    )]
1362    pub warning: Option<String>,
1363}
1364
1365/// Arguments for the Slack Web API method [`admin.apps.requests.cancel`](https://docs.slack.dev/reference/methods/admin.apps.requests.cancel): Cancel app request for team
1366///
1367/// Send it with [`SlackClient::admin_apps_requests_cancel`].
1368#[doc(alias = "admin.apps.requests.cancel")]
1369#[derive(Debug, Clone, PartialEq, Serialize)]
1370#[non_exhaustive]
1371pub struct AdminAppsRequestsCancelRequest {
1372    /// The id of the request to cancel.
1373    pub request_id: String,
1374    /// The ID of the workspace where this request belongs
1375    #[serde(skip_serializing_if = "Option::is_none")]
1376    pub team_id: Option<String>,
1377    /// The ID of the enterprise where this request belongs
1378    #[serde(skip_serializing_if = "Option::is_none")]
1379    pub enterprise_id: Option<String>,
1380}
1381
1382impl AdminAppsRequestsCancelRequest {
1383    pub fn new(request_id: impl Into<String>) -> Self {
1384        Self {
1385            request_id: request_id.into(),
1386            team_id: None,
1387            enterprise_id: None,
1388        }
1389    }
1390
1391    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1392        self.team_id = Some(team_id.into());
1393        self
1394    }
1395
1396    pub fn enterprise_id(mut self, enterprise_id: impl Into<String>) -> Self {
1397        self.enterprise_id = Some(enterprise_id.into());
1398        self
1399    }
1400}
1401
1402impl SlackApiMethod for AdminAppsRequestsCancelRequest {
1403    const METHOD: &'static str = "admin.apps.requests.cancel";
1404    type Response = AdminAppsRequestsCancelResponse;
1405}
1406
1407/// Successful response of the Slack Web API method [`admin.apps.requests.cancel`](https://docs.slack.dev/reference/methods/admin.apps.requests.cancel).
1408#[doc(alias = "admin.apps.requests.cancel")]
1409#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1410pub struct AdminAppsRequestsCancelResponse {
1411    /// Fields returned by Slack. This method has no documented response example.
1412    #[serde(flatten)]
1413    pub extra: serde_json::Map<String, serde_json::Value>,
1414    #[serde(
1415        default,
1416        deserialize_with = "crate::de::opt_object",
1417        skip_serializing_if = "Option::is_none"
1418    )]
1419    pub response_metadata: Option<ResponseMetadata>,
1420    #[serde(
1421        default,
1422        deserialize_with = "crate::de::opt_string",
1423        skip_serializing_if = "Option::is_none"
1424    )]
1425    pub warning: Option<String>,
1426}
1427
1428/// Arguments for the Slack Web API method [`admin.apps.requests.list`](https://docs.slack.dev/reference/methods/admin.apps.requests.list): List app requests for a team/workspace.
1429///
1430/// Send it with [`SlackClient::admin_apps_requests_list`].
1431#[doc(alias = "admin.apps.requests.list")]
1432#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1433#[non_exhaustive]
1434pub struct AdminAppsRequestsListRequest {
1435    /// The maximum number of items to return. Must be between 1 - 1000 both inclusive.
1436    #[serde(skip_serializing_if = "Option::is_none")]
1437    pub limit: Option<i64>,
1438    /// Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
1439    #[serde(skip_serializing_if = "Option::is_none")]
1440    pub cursor: Option<String>,
1441    #[serde(skip_serializing_if = "Option::is_none")]
1442    pub team_id: Option<String>,
1443    #[serde(skip_serializing_if = "Option::is_none")]
1444    pub enterprise_id: Option<String>,
1445    /// Include requests for certified apps
1446    #[serde(skip_serializing_if = "Option::is_none")]
1447    pub certified: Option<bool>,
1448}
1449
1450impl AdminAppsRequestsListRequest {
1451    pub fn new() -> Self {
1452        Self {
1453            limit: None,
1454            cursor: None,
1455            team_id: None,
1456            enterprise_id: None,
1457            certified: None,
1458        }
1459    }
1460
1461    pub fn limit(mut self, limit: i64) -> Self {
1462        self.limit = Some(limit);
1463        self
1464    }
1465
1466    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1467        self.cursor = Some(cursor.into());
1468        self
1469    }
1470
1471    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1472        self.team_id = Some(team_id.into());
1473        self
1474    }
1475
1476    pub fn enterprise_id(mut self, enterprise_id: impl Into<String>) -> Self {
1477        self.enterprise_id = Some(enterprise_id.into());
1478        self
1479    }
1480
1481    pub fn certified(mut self, certified: bool) -> Self {
1482        self.certified = Some(certified);
1483        self
1484    }
1485}
1486
1487impl SlackApiMethod for AdminAppsRequestsListRequest {
1488    const METHOD: &'static str = "admin.apps.requests.list";
1489    type Response = AdminAppsRequestsListResponse;
1490}
1491
1492impl CursorPaginated for AdminAppsRequestsListRequest {
1493    fn set_cursor(&mut self, cursor: String) {
1494        self.cursor = Some(cursor);
1495    }
1496}
1497
1498impl NextCursor for AdminAppsRequestsListResponse {
1499    fn next_cursor(&self) -> Option<&str> {
1500        self.response_metadata.as_ref()?.next_cursor.as_deref()
1501    }
1502}
1503
1504/// Successful response of the Slack Web API method [`admin.apps.requests.list`](https://docs.slack.dev/reference/methods/admin.apps.requests.list).
1505#[doc(alias = "admin.apps.requests.list")]
1506#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1507pub struct AdminAppsRequestsListResponse {
1508    #[serde(
1509        default,
1510        deserialize_with = "crate::de::vec",
1511        skip_serializing_if = "Vec::is_empty"
1512    )]
1513    pub app_requests: Vec<AdminAppsRequestsListResponseAppRequests>,
1514    #[serde(
1515        default,
1516        deserialize_with = "crate::de::opt_object",
1517        skip_serializing_if = "Option::is_none"
1518    )]
1519    pub response_metadata: Option<ResponseMetadata>,
1520    #[serde(
1521        default,
1522        deserialize_with = "crate::de::opt_string",
1523        skip_serializing_if = "Option::is_none"
1524    )]
1525    pub warning: Option<String>,
1526}
1527
1528#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1529pub struct AdminAppsRequestsListResponseAppRequests {
1530    #[serde(
1531        default,
1532        deserialize_with = "crate::de::opt_string",
1533        skip_serializing_if = "Option::is_none"
1534    )]
1535    pub id: Option<String>,
1536    #[serde(
1537        default,
1538        deserialize_with = "crate::de::opt_object",
1539        skip_serializing_if = "Option::is_none"
1540    )]
1541    pub app: Option<AdminAppsRequestsListResponseAppRequestsApp>,
1542    #[serde(default, skip_serializing_if = "Option::is_none")]
1543    pub previous_resolution: Option<serde_json::Value>,
1544    #[serde(
1545        default,
1546        deserialize_with = "crate::de::opt_object",
1547        skip_serializing_if = "Option::is_none"
1548    )]
1549    pub user: Option<AdminAppsRequestsListResponseAppRequestsUser>,
1550    #[serde(
1551        default,
1552        deserialize_with = "crate::de::opt_object",
1553        skip_serializing_if = "Option::is_none"
1554    )]
1555    pub team: Option<Team>,
1556    #[serde(
1557        default,
1558        deserialize_with = "crate::de::vec",
1559        skip_serializing_if = "Vec::is_empty"
1560    )]
1561    pub scopes: Vec<AdminAppsRequestsListResponseAppRequestsScopes>,
1562    #[serde(
1563        default,
1564        deserialize_with = "crate::de::opt_string",
1565        skip_serializing_if = "Option::is_none"
1566    )]
1567    pub message: Option<String>,
1568    #[serde(
1569        default,
1570        deserialize_with = "crate::de::opt_bool",
1571        skip_serializing_if = "Option::is_none"
1572    )]
1573    pub is_user_app_collaborator: Option<bool>,
1574    #[serde(
1575        default,
1576        deserialize_with = "crate::de::opt_i64",
1577        skip_serializing_if = "Option::is_none"
1578    )]
1579    pub date_created: Option<i64>,
1580}
1581
1582#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1583pub struct AdminAppsRequestsListResponseAppRequestsApp {
1584    #[serde(
1585        default,
1586        deserialize_with = "crate::de::opt_string",
1587        skip_serializing_if = "Option::is_none"
1588    )]
1589    pub id: Option<String>,
1590    #[serde(
1591        default,
1592        deserialize_with = "crate::de::opt_string",
1593        skip_serializing_if = "Option::is_none"
1594    )]
1595    pub name: Option<String>,
1596    #[serde(
1597        default,
1598        deserialize_with = "crate::de::opt_string",
1599        skip_serializing_if = "Option::is_none"
1600    )]
1601    pub description: Option<String>,
1602    #[serde(
1603        default,
1604        deserialize_with = "crate::de::opt_string",
1605        skip_serializing_if = "Option::is_none"
1606    )]
1607    pub help_url: Option<String>,
1608    #[serde(
1609        default,
1610        deserialize_with = "crate::de::opt_string",
1611        skip_serializing_if = "Option::is_none"
1612    )]
1613    pub privacy_policy_url: Option<String>,
1614    #[serde(
1615        default,
1616        deserialize_with = "crate::de::opt_string",
1617        skip_serializing_if = "Option::is_none"
1618    )]
1619    pub app_homepage_url: Option<String>,
1620    #[serde(
1621        default,
1622        deserialize_with = "crate::de::opt_string",
1623        skip_serializing_if = "Option::is_none"
1624    )]
1625    pub app_directory_url: Option<String>,
1626    #[serde(
1627        default,
1628        deserialize_with = "crate::de::opt_bool",
1629        skip_serializing_if = "Option::is_none"
1630    )]
1631    pub is_app_directory_approved: Option<bool>,
1632    #[serde(
1633        default,
1634        deserialize_with = "crate::de::opt_bool",
1635        skip_serializing_if = "Option::is_none"
1636    )]
1637    pub is_internal: Option<bool>,
1638    #[serde(
1639        default,
1640        deserialize_with = "crate::de::opt_string",
1641        skip_serializing_if = "Option::is_none"
1642    )]
1643    pub developer_type: Option<String>,
1644    #[serde(
1645        default,
1646        deserialize_with = "crate::de::opt_bool",
1647        skip_serializing_if = "Option::is_none"
1648    )]
1649    pub socket_mode_enabled: Option<bool>,
1650    #[serde(
1651        default,
1652        deserialize_with = "crate::de::opt_object",
1653        skip_serializing_if = "Option::is_none"
1654    )]
1655    pub icons: Option<Icons>,
1656    #[serde(
1657        default,
1658        deserialize_with = "crate::de::opt_string",
1659        skip_serializing_if = "Option::is_none"
1660    )]
1661    pub additional_info: Option<String>,
1662}
1663
1664#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1665pub struct AdminAppsRequestsListResponseAppRequestsUser {
1666    #[serde(
1667        default,
1668        deserialize_with = "crate::de::opt_string",
1669        skip_serializing_if = "Option::is_none"
1670    )]
1671    pub id: Option<String>,
1672    #[serde(
1673        default,
1674        deserialize_with = "crate::de::opt_string",
1675        skip_serializing_if = "Option::is_none"
1676    )]
1677    pub name: Option<String>,
1678    #[serde(
1679        default,
1680        deserialize_with = "crate::de::opt_string",
1681        skip_serializing_if = "Option::is_none"
1682    )]
1683    pub email: Option<String>,
1684}
1685
1686#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1687pub struct AdminAppsRequestsListResponseAppRequestsScopes {
1688    #[serde(
1689        default,
1690        deserialize_with = "crate::de::opt_string",
1691        skip_serializing_if = "Option::is_none"
1692    )]
1693    pub name: Option<String>,
1694    #[serde(
1695        default,
1696        deserialize_with = "crate::de::opt_string",
1697        skip_serializing_if = "Option::is_none"
1698    )]
1699    pub description: Option<String>,
1700    #[serde(
1701        default,
1702        deserialize_with = "crate::de::opt_bool",
1703        skip_serializing_if = "Option::is_none"
1704    )]
1705    pub is_sensitive: Option<bool>,
1706    #[serde(
1707        default,
1708        deserialize_with = "crate::de::opt_string",
1709        skip_serializing_if = "Option::is_none"
1710    )]
1711    pub token_type: Option<String>,
1712    #[serde(
1713        default,
1714        deserialize_with = "crate::de::opt_bool",
1715        skip_serializing_if = "Option::is_none"
1716    )]
1717    pub is_optional: Option<bool>,
1718    #[serde(
1719        default,
1720        deserialize_with = "crate::de::opt_bool",
1721        skip_serializing_if = "Option::is_none"
1722    )]
1723    pub is_approved: Option<bool>,
1724}
1725
1726/// Arguments for the Slack Web API method [`admin.apps.restrict`](https://docs.slack.dev/reference/methods/admin.apps.restrict): Restrict an app for installation on a workspace.
1727///
1728/// Send it with [`SlackClient::admin_apps_restrict`].
1729#[doc(alias = "admin.apps.restrict")]
1730#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1731#[non_exhaustive]
1732pub struct AdminAppsRestrictRequest {
1733    /// The id of the app to restrict.
1734    #[serde(skip_serializing_if = "Option::is_none")]
1735    pub app_id: Option<String>,
1736    /// The id of the request to restrict.
1737    #[serde(skip_serializing_if = "Option::is_none")]
1738    pub request_id: Option<String>,
1739    /// The ID of the workspace to approve the app on
1740    #[serde(skip_serializing_if = "Option::is_none")]
1741    pub team_id: Option<String>,
1742    /// The ID of the enterprise to approve the app on
1743    #[serde(skip_serializing_if = "Option::is_none")]
1744    pub enterprise_id: Option<String>,
1745}
1746
1747impl AdminAppsRestrictRequest {
1748    pub fn new() -> Self {
1749        Self {
1750            app_id: None,
1751            request_id: None,
1752            team_id: None,
1753            enterprise_id: None,
1754        }
1755    }
1756
1757    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
1758        self.app_id = Some(app_id.into());
1759        self
1760    }
1761
1762    pub fn request_id(mut self, request_id: impl Into<String>) -> Self {
1763        self.request_id = Some(request_id.into());
1764        self
1765    }
1766
1767    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1768        self.team_id = Some(team_id.into());
1769        self
1770    }
1771
1772    pub fn enterprise_id(mut self, enterprise_id: impl Into<String>) -> Self {
1773        self.enterprise_id = Some(enterprise_id.into());
1774        self
1775    }
1776}
1777
1778impl SlackApiMethod for AdminAppsRestrictRequest {
1779    const METHOD: &'static str = "admin.apps.restrict";
1780    type Response = AdminAppsRestrictResponse;
1781}
1782
1783/// Successful response of the Slack Web API method [`admin.apps.restrict`](https://docs.slack.dev/reference/methods/admin.apps.restrict).
1784#[doc(alias = "admin.apps.restrict")]
1785#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1786pub struct AdminAppsRestrictResponse {
1787    /// Fields returned by Slack. This method has no documented response example.
1788    #[serde(flatten)]
1789    pub extra: serde_json::Map<String, serde_json::Value>,
1790    #[serde(
1791        default,
1792        deserialize_with = "crate::de::opt_object",
1793        skip_serializing_if = "Option::is_none"
1794    )]
1795    pub response_metadata: Option<ResponseMetadata>,
1796    #[serde(
1797        default,
1798        deserialize_with = "crate::de::opt_string",
1799        skip_serializing_if = "Option::is_none"
1800    )]
1801    pub warning: Option<String>,
1802}
1803
1804/// Arguments for the Slack Web API method [`admin.apps.restricted.list`](https://docs.slack.dev/reference/methods/admin.apps.restricted.list): List restricted apps for an org or workspace.
1805///
1806/// Send it with [`SlackClient::admin_apps_restricted_list`].
1807#[doc(alias = "admin.apps.restricted.list")]
1808#[derive(Debug, Clone, PartialEq, Serialize, Default)]
1809#[non_exhaustive]
1810pub struct AdminAppsRestrictedListRequest {
1811    /// The maximum number of items to return. Must be between 1 - 1000 both inclusive.
1812    #[serde(skip_serializing_if = "Option::is_none")]
1813    pub limit: Option<i64>,
1814    /// Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
1815    #[serde(skip_serializing_if = "Option::is_none")]
1816    pub cursor: Option<String>,
1817    #[serde(skip_serializing_if = "Option::is_none")]
1818    pub team_id: Option<String>,
1819    #[serde(skip_serializing_if = "Option::is_none")]
1820    pub enterprise_id: Option<String>,
1821    /// Limit the results to only include certified apps. When false, no certified apps will appear in the result
1822    #[serde(skip_serializing_if = "Option::is_none")]
1823    pub certified: Option<bool>,
1824}
1825
1826impl AdminAppsRestrictedListRequest {
1827    pub fn new() -> Self {
1828        Self {
1829            limit: None,
1830            cursor: None,
1831            team_id: None,
1832            enterprise_id: None,
1833            certified: None,
1834        }
1835    }
1836
1837    pub fn limit(mut self, limit: i64) -> Self {
1838        self.limit = Some(limit);
1839        self
1840    }
1841
1842    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1843        self.cursor = Some(cursor.into());
1844        self
1845    }
1846
1847    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1848        self.team_id = Some(team_id.into());
1849        self
1850    }
1851
1852    pub fn enterprise_id(mut self, enterprise_id: impl Into<String>) -> Self {
1853        self.enterprise_id = Some(enterprise_id.into());
1854        self
1855    }
1856
1857    pub fn certified(mut self, certified: bool) -> Self {
1858        self.certified = Some(certified);
1859        self
1860    }
1861}
1862
1863impl SlackApiMethod for AdminAppsRestrictedListRequest {
1864    const METHOD: &'static str = "admin.apps.restricted.list";
1865    type Response = AdminAppsRestrictedListResponse;
1866}
1867
1868impl CursorPaginated for AdminAppsRestrictedListRequest {
1869    fn set_cursor(&mut self, cursor: String) {
1870        self.cursor = Some(cursor);
1871    }
1872}
1873
1874impl NextCursor for AdminAppsRestrictedListResponse {
1875    fn next_cursor(&self) -> Option<&str> {
1876        self.response_metadata.as_ref()?.next_cursor.as_deref()
1877    }
1878}
1879
1880/// Successful response of the Slack Web API method [`admin.apps.restricted.list`](https://docs.slack.dev/reference/methods/admin.apps.restricted.list).
1881#[doc(alias = "admin.apps.restricted.list")]
1882#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1883pub struct AdminAppsRestrictedListResponse {
1884    #[serde(
1885        default,
1886        deserialize_with = "crate::de::vec",
1887        skip_serializing_if = "Vec::is_empty"
1888    )]
1889    pub restricted_apps: Vec<AdminAppsRestrictedListResponseRestrictedApps>,
1890    #[serde(
1891        default,
1892        deserialize_with = "crate::de::opt_object",
1893        skip_serializing_if = "Option::is_none"
1894    )]
1895    pub response_metadata: Option<ResponseMetadata>,
1896    #[serde(
1897        default,
1898        deserialize_with = "crate::de::opt_string",
1899        skip_serializing_if = "Option::is_none"
1900    )]
1901    pub warning: Option<String>,
1902}
1903
1904#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1905pub struct AdminAppsRestrictedListResponseRestrictedApps {
1906    #[serde(
1907        default,
1908        deserialize_with = "crate::de::opt_object",
1909        skip_serializing_if = "Option::is_none"
1910    )]
1911    pub app: Option<AdminAppsRestrictedListResponseRestrictedAppsApp>,
1912    #[serde(
1913        default,
1914        deserialize_with = "crate::de::vec",
1915        skip_serializing_if = "Vec::is_empty"
1916    )]
1917    pub scopes: Vec<AdminAppsRestrictedListResponseRestrictedAppsScopes>,
1918    #[serde(
1919        default,
1920        deserialize_with = "crate::de::opt_i64",
1921        skip_serializing_if = "Option::is_none"
1922    )]
1923    pub date_updated: Option<i64>,
1924    #[serde(
1925        default,
1926        deserialize_with = "crate::de::opt_object",
1927        skip_serializing_if = "Option::is_none"
1928    )]
1929    pub last_resolved_by: Option<AdminAppsRestrictedListResponseRestrictedAppsLastResolvedBy>,
1930}
1931
1932#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1933pub struct AdminAppsRestrictedListResponseRestrictedAppsApp {
1934    #[serde(
1935        default,
1936        deserialize_with = "crate::de::opt_string",
1937        skip_serializing_if = "Option::is_none"
1938    )]
1939    pub id: Option<String>,
1940    #[serde(
1941        default,
1942        deserialize_with = "crate::de::opt_string",
1943        skip_serializing_if = "Option::is_none"
1944    )]
1945    pub name: Option<String>,
1946    #[serde(
1947        default,
1948        deserialize_with = "crate::de::opt_string",
1949        skip_serializing_if = "Option::is_none"
1950    )]
1951    pub description: Option<String>,
1952    #[serde(
1953        default,
1954        deserialize_with = "crate::de::opt_string",
1955        skip_serializing_if = "Option::is_none"
1956    )]
1957    pub help_url: Option<String>,
1958    #[serde(
1959        default,
1960        deserialize_with = "crate::de::opt_string",
1961        skip_serializing_if = "Option::is_none"
1962    )]
1963    pub privacy_policy_url: Option<String>,
1964    #[serde(
1965        default,
1966        deserialize_with = "crate::de::opt_string",
1967        skip_serializing_if = "Option::is_none"
1968    )]
1969    pub app_homepage_url: Option<String>,
1970    #[serde(
1971        default,
1972        deserialize_with = "crate::de::opt_string",
1973        skip_serializing_if = "Option::is_none"
1974    )]
1975    pub app_directory_url: Option<String>,
1976    #[serde(
1977        default,
1978        deserialize_with = "crate::de::opt_bool",
1979        skip_serializing_if = "Option::is_none"
1980    )]
1981    pub is_app_directory_approved: Option<bool>,
1982    #[serde(
1983        default,
1984        deserialize_with = "crate::de::opt_bool",
1985        skip_serializing_if = "Option::is_none"
1986    )]
1987    pub is_internal: Option<bool>,
1988    #[serde(
1989        default,
1990        deserialize_with = "crate::de::opt_string",
1991        skip_serializing_if = "Option::is_none"
1992    )]
1993    pub developer_type: Option<String>,
1994    #[serde(
1995        default,
1996        deserialize_with = "crate::de::opt_bool",
1997        skip_serializing_if = "Option::is_none"
1998    )]
1999    pub socket_mode_enabled: Option<bool>,
2000    #[serde(
2001        default,
2002        deserialize_with = "crate::de::opt_object",
2003        skip_serializing_if = "Option::is_none"
2004    )]
2005    pub icons: Option<Icons>,
2006    #[serde(
2007        default,
2008        deserialize_with = "crate::de::opt_string",
2009        skip_serializing_if = "Option::is_none"
2010    )]
2011    pub additional_info: Option<String>,
2012}
2013
2014#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2015pub struct AdminAppsRestrictedListResponseRestrictedAppsScopes {
2016    #[serde(
2017        default,
2018        deserialize_with = "crate::de::opt_string",
2019        skip_serializing_if = "Option::is_none"
2020    )]
2021    pub name: Option<String>,
2022    #[serde(
2023        default,
2024        deserialize_with = "crate::de::opt_string",
2025        skip_serializing_if = "Option::is_none"
2026    )]
2027    pub description: Option<String>,
2028    #[serde(
2029        default,
2030        deserialize_with = "crate::de::opt_bool",
2031        skip_serializing_if = "Option::is_none"
2032    )]
2033    pub is_sensitive: Option<bool>,
2034    #[serde(
2035        default,
2036        deserialize_with = "crate::de::opt_string",
2037        skip_serializing_if = "Option::is_none"
2038    )]
2039    pub token_type: Option<String>,
2040}
2041
2042#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2043pub struct AdminAppsRestrictedListResponseRestrictedAppsLastResolvedBy {
2044    #[serde(
2045        default,
2046        deserialize_with = "crate::de::opt_string",
2047        skip_serializing_if = "Option::is_none"
2048    )]
2049    pub actor_id: Option<String>,
2050    #[serde(
2051        default,
2052        deserialize_with = "crate::de::opt_string",
2053        skip_serializing_if = "Option::is_none"
2054    )]
2055    pub actor_type: Option<String>,
2056}
2057
2058/// Arguments for the Slack Web API method [`admin.apps.uninstall`](https://docs.slack.dev/reference/methods/admin.apps.uninstall): Uninstall an app from one or many workspaces, or an entire enterprise organization.
2059///
2060/// Send it with [`SlackClient::admin_apps_uninstall`].
2061#[doc(alias = "admin.apps.uninstall")]
2062#[derive(Debug, Clone, PartialEq, Serialize)]
2063#[non_exhaustive]
2064pub struct AdminAppsUninstallRequest {
2065    /// The ID of the app to uninstall.
2066    pub app_id: String,
2067    /// IDs of the teams to uninstall from (max 100). With an org-level token, this or `enterprise_id` is required.
2068    #[serde(skip_serializing_if = "Option::is_none")]
2069    pub team_ids: Option<String>,
2070    /// The enterprise to completely uninstall the application from (across all workspaces). With an org-level token, this or `team_ids` is required.
2071    #[serde(skip_serializing_if = "Option::is_none")]
2072    pub enterprise_id: Option<String>,
2073}
2074
2075impl AdminAppsUninstallRequest {
2076    pub fn new(app_id: impl Into<String>) -> Self {
2077        Self {
2078            app_id: app_id.into(),
2079            team_ids: None,
2080            enterprise_id: None,
2081        }
2082    }
2083
2084    pub fn team_ids(mut self, team_ids: impl Into<String>) -> Self {
2085        self.team_ids = Some(team_ids.into());
2086        self
2087    }
2088
2089    pub fn enterprise_id(mut self, enterprise_id: impl Into<String>) -> Self {
2090        self.enterprise_id = Some(enterprise_id.into());
2091        self
2092    }
2093}
2094
2095impl SlackApiMethod for AdminAppsUninstallRequest {
2096    const METHOD: &'static str = "admin.apps.uninstall";
2097    type Response = AdminAppsUninstallResponse;
2098}
2099
2100/// Successful response of the Slack Web API method [`admin.apps.uninstall`](https://docs.slack.dev/reference/methods/admin.apps.uninstall).
2101#[doc(alias = "admin.apps.uninstall")]
2102#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2103pub struct AdminAppsUninstallResponse {
2104    /// Fields returned by Slack. This method has no documented response example.
2105    #[serde(flatten)]
2106    pub extra: serde_json::Map<String, serde_json::Value>,
2107    #[serde(
2108        default,
2109        deserialize_with = "crate::de::opt_object",
2110        skip_serializing_if = "Option::is_none"
2111    )]
2112    pub response_metadata: Option<ResponseMetadata>,
2113    #[serde(
2114        default,
2115        deserialize_with = "crate::de::opt_string",
2116        skip_serializing_if = "Option::is_none"
2117    )]
2118    pub warning: Option<String>,
2119}
2120
2121impl SlackClient {
2122    /// Calls the Slack Web API method [`admin.apps.activities.list`](https://docs.slack.dev/reference/methods/admin.apps.activities.list): Get logs for a specified team/org
2123    ///
2124    /// Required scopes:
2125    ///
2126    /// - user token: `admin.app_activities:read`
2127    ///
2128    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2129    ///
2130    /// # Errors
2131    ///
2132    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2133    #[doc(alias = "admin.apps.activities.list")]
2134    pub async fn admin_apps_activities_list(
2135        &self,
2136        request: &AdminAppsActivitiesListRequest,
2137    ) -> Result<AdminAppsActivitiesListResponse, SlackError> {
2138        self.call(request).await
2139    }
2140
2141    /// Calls the Slack Web API method [`admin.apps.approve`](https://docs.slack.dev/reference/methods/admin.apps.approve): Approve an app for installation on a workspace.
2142    ///
2143    /// Required scopes:
2144    ///
2145    /// - user token: `admin.apps:write`
2146    ///
2147    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2148    ///
2149    /// # Errors
2150    ///
2151    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2152    #[doc(alias = "admin.apps.approve")]
2153    pub async fn admin_apps_approve(
2154        &self,
2155        request: &AdminAppsApproveRequest,
2156    ) -> Result<AdminAppsApproveResponse, SlackError> {
2157        self.call(request).await
2158    }
2159
2160    /// Calls the Slack Web API method [`admin.apps.approved.list`](https://docs.slack.dev/reference/methods/admin.apps.approved.list): List approved apps for an org or workspace.
2161    ///
2162    /// Required scopes:
2163    ///
2164    /// - user token: `admin.apps:read`
2165    ///
2166    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2167    ///
2168    /// # Errors
2169    ///
2170    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2171    #[doc(alias = "admin.apps.approved.list")]
2172    pub async fn admin_apps_approved_list(
2173        &self,
2174        request: &AdminAppsApprovedListRequest,
2175    ) -> Result<AdminAppsApprovedListResponse, SlackError> {
2176        self.call(request).await
2177    }
2178
2179    /// Calls the Slack Web API method [`admin.apps.clearResolution`](https://docs.slack.dev/reference/methods/admin.apps.clearResolution): Clear an app resolution
2180    ///
2181    /// Required scopes:
2182    ///
2183    /// - user token: `admin.apps:write`
2184    ///
2185    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2186    ///
2187    /// # Errors
2188    ///
2189    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2190    #[doc(alias = "admin.apps.clearResolution")]
2191    pub async fn admin_apps_clear_resolution(
2192        &self,
2193        request: &AdminAppsClearResolutionRequest,
2194    ) -> Result<AdminAppsClearResolutionResponse, SlackError> {
2195        self.call(request).await
2196    }
2197
2198    /// Calls the Slack Web API method [`admin.apps.config.lookup`](https://docs.slack.dev/reference/methods/admin.apps.config.lookup): Look up the app config for connectors by their IDs
2199    ///
2200    /// Required scopes:
2201    ///
2202    /// - user token: `admin.apps:read`
2203    ///
2204    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2205    ///
2206    /// # Errors
2207    ///
2208    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2209    #[doc(alias = "admin.apps.config.lookup")]
2210    pub async fn admin_apps_config_lookup(
2211        &self,
2212        request: &AdminAppsConfigLookupRequest,
2213    ) -> Result<AdminAppsConfigLookupResponse, SlackError> {
2214        self.call(request).await
2215    }
2216
2217    /// Calls the Slack Web API method [`admin.apps.config.set`](https://docs.slack.dev/reference/methods/admin.apps.config.set): Set the app config for a connector
2218    ///
2219    /// Required scopes:
2220    ///
2221    /// - user token: `admin.apps:write`
2222    ///
2223    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2224    ///
2225    /// # Errors
2226    ///
2227    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2228    #[doc(alias = "admin.apps.config.set")]
2229    pub async fn admin_apps_config_set(
2230        &self,
2231        request: &AdminAppsConfigSetRequest,
2232    ) -> Result<AdminAppsConfigSetResponse, SlackError> {
2233        self.call(request).await
2234    }
2235
2236    /// Calls the Slack Web API method [`admin.apps.mcp.servers.list`](https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.list): List third-party app MCP servers approved for an organization.
2237    ///
2238    /// Required scopes:
2239    ///
2240    /// - user token: `admin.apps:read`
2241    ///
2242    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2243    ///
2244    /// # Errors
2245    ///
2246    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2247    #[doc(alias = "admin.apps.mcp.servers.list")]
2248    pub async fn admin_apps_mcp_servers_list(
2249        &self,
2250        request: &AdminAppsMcpServersListRequest,
2251    ) -> Result<AdminAppsMcpServersListResponse, SlackError> {
2252        self.call(request).await
2253    }
2254
2255    /// Calls the Slack Web API method [`admin.apps.mcp.servers.permissions.list`](https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.list): List MCP servers for an app with their access control permissions.
2256    ///
2257    /// Required scopes:
2258    ///
2259    /// - user token: `admin.apps:read`
2260    ///
2261    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2262    ///
2263    /// # Errors
2264    ///
2265    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2266    #[doc(alias = "admin.apps.mcp.servers.permissions.list")]
2267    pub async fn admin_apps_mcp_servers_permissions_list(
2268        &self,
2269        request: &AdminAppsMcpServersPermissionsListRequest,
2270    ) -> Result<AdminAppsMcpServersPermissionsListResponse, SlackError> {
2271        self.call(request).await
2272    }
2273
2274    /// Calls the Slack Web API method [`admin.apps.mcp.servers.permissions.set`](https://docs.slack.dev/reference/methods/admin.apps.mcp.servers.permissions.set): Set the access control permission for who can use an MCP server.
2275    ///
2276    /// Required scopes:
2277    ///
2278    /// - user token: `admin.apps:write`
2279    ///
2280    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2281    ///
2282    /// # Errors
2283    ///
2284    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2285    #[doc(alias = "admin.apps.mcp.servers.permissions.set")]
2286    pub async fn admin_apps_mcp_servers_permissions_set(
2287        &self,
2288        request: &AdminAppsMcpServersPermissionsSetRequest,
2289    ) -> Result<AdminAppsMcpServersPermissionsSetResponse, SlackError> {
2290        self.call(request).await
2291    }
2292
2293    /// Calls the Slack Web API method [`admin.apps.permissions.add`](https://docs.slack.dev/reference/methods/admin.apps.permissions.add): Grant permission for entities to access an app that has its permission type set to named_entities.
2294    ///
2295    /// Required scopes:
2296    ///
2297    /// - user token: `admin.apps:write`
2298    ///
2299    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2300    ///
2301    /// # Errors
2302    ///
2303    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2304    #[doc(alias = "admin.apps.permissions.add")]
2305    pub async fn admin_apps_permissions_add(
2306        &self,
2307        request: &AdminAppsPermissionsAddRequest,
2308    ) -> Result<AdminAppsPermissionsAddResponse, SlackError> {
2309        self.call(request).await
2310    }
2311
2312    /// Calls the Slack Web API method [`admin.apps.permissions.list`](https://docs.slack.dev/reference/methods/admin.apps.permissions.list): Returns the permission type of an app and the entities that have been granted access.
2313    ///
2314    /// Required scopes:
2315    ///
2316    /// - user token: `admin.apps:read`
2317    ///
2318    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2319    ///
2320    /// # Errors
2321    ///
2322    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2323    #[doc(alias = "admin.apps.permissions.list")]
2324    pub async fn admin_apps_permissions_list(
2325        &self,
2326        request: &AdminAppsPermissionsListRequest,
2327    ) -> Result<AdminAppsPermissionsListResponse, SlackError> {
2328        self.call(request).await
2329    }
2330
2331    /// Calls the Slack Web API method [`admin.apps.permissions.remove`](https://docs.slack.dev/reference/methods/admin.apps.permissions.remove): Revoke an entity's access to an app that has its permission type set to named_entities.
2332    ///
2333    /// Required scopes:
2334    ///
2335    /// - user token: `admin.apps:write`
2336    ///
2337    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2338    ///
2339    /// # Errors
2340    ///
2341    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2342    #[doc(alias = "admin.apps.permissions.remove")]
2343    pub async fn admin_apps_permissions_remove(
2344        &self,
2345        request: &AdminAppsPermissionsRemoveRequest,
2346    ) -> Result<AdminAppsPermissionsRemoveResponse, SlackError> {
2347        self.call(request).await
2348    }
2349
2350    /// Calls the Slack Web API method [`admin.apps.permissions.set`](https://docs.slack.dev/reference/methods/admin.apps.permissions.set): Set the permission type for who can access an app.
2351    ///
2352    /// Required scopes:
2353    ///
2354    /// - user token: `admin.apps:write`
2355    ///
2356    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2357    ///
2358    /// # Errors
2359    ///
2360    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2361    #[doc(alias = "admin.apps.permissions.set")]
2362    pub async fn admin_apps_permissions_set(
2363        &self,
2364        request: &AdminAppsPermissionsSetRequest,
2365    ) -> Result<AdminAppsPermissionsSetResponse, SlackError> {
2366        self.call(request).await
2367    }
2368
2369    /// Calls the Slack Web API method [`admin.apps.requests.cancel`](https://docs.slack.dev/reference/methods/admin.apps.requests.cancel): Cancel app request for team
2370    ///
2371    /// Required scopes:
2372    ///
2373    /// - user token: `admin.apps:write`
2374    ///
2375    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2376    ///
2377    /// # Errors
2378    ///
2379    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2380    #[doc(alias = "admin.apps.requests.cancel")]
2381    pub async fn admin_apps_requests_cancel(
2382        &self,
2383        request: &AdminAppsRequestsCancelRequest,
2384    ) -> Result<AdminAppsRequestsCancelResponse, SlackError> {
2385        self.call(request).await
2386    }
2387
2388    /// Calls the Slack Web API method [`admin.apps.requests.list`](https://docs.slack.dev/reference/methods/admin.apps.requests.list): List app requests for a team/workspace.
2389    ///
2390    /// Required scopes:
2391    ///
2392    /// - user token: `admin.apps:read`
2393    ///
2394    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2395    ///
2396    /// # Errors
2397    ///
2398    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2399    #[doc(alias = "admin.apps.requests.list")]
2400    pub async fn admin_apps_requests_list(
2401        &self,
2402        request: &AdminAppsRequestsListRequest,
2403    ) -> Result<AdminAppsRequestsListResponse, SlackError> {
2404        self.call(request).await
2405    }
2406
2407    /// Calls the Slack Web API method [`admin.apps.restrict`](https://docs.slack.dev/reference/methods/admin.apps.restrict): Restrict an app for installation on a workspace.
2408    ///
2409    /// Required scopes:
2410    ///
2411    /// - user token: `admin.apps:write`
2412    ///
2413    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2414    ///
2415    /// # Errors
2416    ///
2417    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2418    #[doc(alias = "admin.apps.restrict")]
2419    pub async fn admin_apps_restrict(
2420        &self,
2421        request: &AdminAppsRestrictRequest,
2422    ) -> Result<AdminAppsRestrictResponse, SlackError> {
2423        self.call(request).await
2424    }
2425
2426    /// Calls the Slack Web API method [`admin.apps.restricted.list`](https://docs.slack.dev/reference/methods/admin.apps.restricted.list): List restricted apps for an org or workspace.
2427    ///
2428    /// Required scopes:
2429    ///
2430    /// - user token: `admin.apps:read`
2431    ///
2432    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2433    ///
2434    /// # Errors
2435    ///
2436    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2437    #[doc(alias = "admin.apps.restricted.list")]
2438    pub async fn admin_apps_restricted_list(
2439        &self,
2440        request: &AdminAppsRestrictedListRequest,
2441    ) -> Result<AdminAppsRestrictedListResponse, SlackError> {
2442        self.call(request).await
2443    }
2444
2445    /// Calls the Slack Web API method [`admin.apps.uninstall`](https://docs.slack.dev/reference/methods/admin.apps.uninstall): Uninstall an app from one or many workspaces, or an entire enterprise organization.
2446    ///
2447    /// Required scopes:
2448    ///
2449    /// - user token: `admin.apps:write`
2450    ///
2451    /// Rate limit: Tier 1 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2452    ///
2453    /// # Errors
2454    ///
2455    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2456    #[doc(alias = "admin.apps.uninstall")]
2457    pub async fn admin_apps_uninstall(
2458        &self,
2459        request: &AdminAppsUninstallRequest,
2460    ) -> Result<AdminAppsUninstallResponse, SlackError> {
2461        self.call(request).await
2462    }
2463}