Skip to main content

slack_web_api/api/
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 [`apps.activities.list`](https://docs.slack.dev/reference/methods/apps.activities.list): Get logs for a specified app
12///
13/// Send it with [`SlackClient::apps_activities_list`].
14#[doc(alias = "apps.activities.list")]
15#[derive(Debug, Clone, PartialEq, Serialize)]
16#[non_exhaustive]
17pub struct AppsActivitiesListRequest {
18    /// The id of the app to get activities from.
19    pub app_id: String,
20    /// The team who owns this log.
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub team_id: Option<String>,
23    /// 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.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    pub cursor: Option<String>,
26    /// The maximum number of items to return.
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub limit: Option<i64>,
29    /// 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', 'fatal').
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub min_log_level: Option<String>,
32    /// The event type of log events to be returned.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub log_event_type: Option<String>,
35    /// The source of log events to be returned. Acceptable values are ('slack', 'developer').
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub source: Option<String>,
38    /// The component type of log events to be returned. Acceptable values are ('events\_api', 'workflows', 'functions', 'tables').
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub component_type: Option<String>,
41    /// The component id of log events to be returned. Will be 'FnXXXXXX' for functions, and 'WfXXXXXX' for workflows
42    #[serde(skip_serializing_if = "Option::is_none")]
43    pub component_id: Option<String>,
44    /// The trace id of log events to be returned.
45    #[serde(skip_serializing_if = "Option::is_none")]
46    pub trace_id: Option<String>,
47    /// The earliest timestamp of the log to retrieve (epoch microseconds).
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub min_date_created: Option<i64>,
50    /// The latest timestamp of the log to retrieve (epoch microseconds).
51    #[serde(skip_serializing_if = "Option::is_none")]
52    pub max_date_created: Option<i64>,
53    /// The direction you want the data sorted by (always by timestamp)
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub sort_direction: Option<String>,
56}
57
58impl AppsActivitiesListRequest {
59    pub fn new(app_id: impl Into<String>) -> Self {
60        Self {
61            app_id: app_id.into(),
62            team_id: None,
63            cursor: None,
64            limit: None,
65            min_log_level: None,
66            log_event_type: None,
67            source: None,
68            component_type: None,
69            component_id: None,
70            trace_id: None,
71            min_date_created: None,
72            max_date_created: None,
73            sort_direction: None,
74        }
75    }
76
77    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
78        self.team_id = Some(team_id.into());
79        self
80    }
81
82    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
83        self.cursor = Some(cursor.into());
84        self
85    }
86
87    pub fn limit(mut self, limit: i64) -> Self {
88        self.limit = Some(limit);
89        self
90    }
91
92    pub fn min_log_level(mut self, min_log_level: impl Into<String>) -> Self {
93        self.min_log_level = Some(min_log_level.into());
94        self
95    }
96
97    pub fn log_event_type(mut self, log_event_type: impl Into<String>) -> Self {
98        self.log_event_type = Some(log_event_type.into());
99        self
100    }
101
102    pub fn source(mut self, source: impl Into<String>) -> Self {
103        self.source = Some(source.into());
104        self
105    }
106
107    pub fn component_type(mut self, component_type: impl Into<String>) -> Self {
108        self.component_type = Some(component_type.into());
109        self
110    }
111
112    pub fn component_id(mut self, component_id: impl Into<String>) -> Self {
113        self.component_id = Some(component_id.into());
114        self
115    }
116
117    pub fn trace_id(mut self, trace_id: impl Into<String>) -> Self {
118        self.trace_id = Some(trace_id.into());
119        self
120    }
121
122    pub fn min_date_created(mut self, min_date_created: i64) -> Self {
123        self.min_date_created = Some(min_date_created);
124        self
125    }
126
127    pub fn max_date_created(mut self, max_date_created: i64) -> Self {
128        self.max_date_created = Some(max_date_created);
129        self
130    }
131
132    pub fn sort_direction(mut self, sort_direction: impl Into<String>) -> Self {
133        self.sort_direction = Some(sort_direction.into());
134        self
135    }
136}
137
138impl SlackApiMethod for AppsActivitiesListRequest {
139    const METHOD: &'static str = "apps.activities.list";
140    type Response = AppsActivitiesListResponse;
141}
142
143impl CursorPaginated for AppsActivitiesListRequest {
144    fn set_cursor(&mut self, cursor: String) {
145        self.cursor = Some(cursor);
146    }
147}
148
149impl NextCursor for AppsActivitiesListResponse {
150    fn next_cursor(&self) -> Option<&str> {
151        self.response_metadata.as_ref()?.next_cursor.as_deref()
152    }
153}
154
155/// Successful response of the Slack Web API method [`apps.activities.list`](https://docs.slack.dev/reference/methods/apps.activities.list).
156#[doc(alias = "apps.activities.list")]
157#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
158pub struct AppsActivitiesListResponse {
159    #[serde(
160        default,
161        deserialize_with = "crate::de::vec",
162        skip_serializing_if = "Vec::is_empty"
163    )]
164    pub activities: Vec<AppsActivitiesListResponseActivities>,
165    #[serde(
166        default,
167        deserialize_with = "crate::de::opt_object",
168        skip_serializing_if = "Option::is_none"
169    )]
170    pub response_metadata: Option<ResponseMetadata>,
171    #[serde(
172        default,
173        deserialize_with = "crate::de::opt_string",
174        skip_serializing_if = "Option::is_none"
175    )]
176    pub warning: Option<String>,
177}
178
179#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
180pub struct AppsActivitiesListResponseActivities {
181    #[serde(
182        default,
183        deserialize_with = "crate::de::opt_string",
184        skip_serializing_if = "Option::is_none"
185    )]
186    pub level: Option<String>,
187    #[serde(
188        default,
189        deserialize_with = "crate::de::opt_string",
190        skip_serializing_if = "Option::is_none"
191    )]
192    pub event_type: Option<String>,
193    #[serde(
194        default,
195        deserialize_with = "crate::de::opt_string",
196        skip_serializing_if = "Option::is_none"
197    )]
198    pub source: Option<String>,
199    #[serde(
200        default,
201        deserialize_with = "crate::de::opt_string",
202        skip_serializing_if = "Option::is_none"
203    )]
204    pub component_type: Option<String>,
205    #[serde(
206        default,
207        deserialize_with = "crate::de::opt_string",
208        skip_serializing_if = "Option::is_none"
209    )]
210    pub component_id: Option<String>,
211    #[serde(
212        default,
213        deserialize_with = "crate::de::opt_object",
214        skip_serializing_if = "Option::is_none"
215    )]
216    pub payload: Option<AppsActivitiesListResponseActivitiesPayload>,
217    #[serde(
218        default,
219        deserialize_with = "crate::de::opt_i64",
220        skip_serializing_if = "Option::is_none"
221    )]
222    pub created: Option<i64>,
223    #[serde(
224        default,
225        deserialize_with = "crate::de::opt_string",
226        skip_serializing_if = "Option::is_none"
227    )]
228    pub trace_id: Option<String>,
229}
230
231#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
232pub struct AppsActivitiesListResponseActivitiesPayload {
233    #[serde(
234        default,
235        deserialize_with = "crate::de::opt_string",
236        skip_serializing_if = "Option::is_none"
237    )]
238    pub function_name: Option<String>,
239    #[serde(
240        default,
241        deserialize_with = "crate::de::opt_string",
242        skip_serializing_if = "Option::is_none"
243    )]
244    pub function_type: Option<String>,
245}
246
247/// Arguments for the Slack Web API method [`apps.auth.external.delete`](https://docs.slack.dev/reference/methods/apps.auth.external.delete): Delete external auth tokens only on the Slack side
248///
249/// Send it with [`SlackClient::apps_auth_external_delete`].
250#[doc(alias = "apps.auth.external.delete")]
251#[derive(Debug, Clone, PartialEq, Serialize, Default)]
252#[non_exhaustive]
253pub struct AppsAuthExternalDeleteRequest {
254    /// The id of the app whose tokens you want to delete
255    #[serde(skip_serializing_if = "Option::is_none")]
256    pub app_id: Option<String>,
257    /// The provider key of the provider whose tokens you want to delete
258    #[serde(skip_serializing_if = "Option::is_none")]
259    pub provider_key: Option<String>,
260    /// The id of the token that you want to delete
261    #[serde(skip_serializing_if = "Option::is_none")]
262    pub external_token_id: Option<String>,
263}
264
265impl AppsAuthExternalDeleteRequest {
266    pub fn new() -> Self {
267        Self {
268            app_id: None,
269            provider_key: None,
270            external_token_id: None,
271        }
272    }
273
274    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
275        self.app_id = Some(app_id.into());
276        self
277    }
278
279    pub fn provider_key(mut self, provider_key: impl Into<String>) -> Self {
280        self.provider_key = Some(provider_key.into());
281        self
282    }
283
284    pub fn external_token_id(mut self, external_token_id: impl Into<String>) -> Self {
285        self.external_token_id = Some(external_token_id.into());
286        self
287    }
288}
289
290impl SlackApiMethod for AppsAuthExternalDeleteRequest {
291    const METHOD: &'static str = "apps.auth.external.delete";
292    type Response = AppsAuthExternalDeleteResponse;
293}
294
295/// Successful response of the Slack Web API method [`apps.auth.external.delete`](https://docs.slack.dev/reference/methods/apps.auth.external.delete).
296#[doc(alias = "apps.auth.external.delete")]
297#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
298pub struct AppsAuthExternalDeleteResponse {
299    /// Fields returned by Slack. This method has no documented response example.
300    #[serde(flatten)]
301    pub extra: serde_json::Map<String, serde_json::Value>,
302    #[serde(
303        default,
304        deserialize_with = "crate::de::opt_object",
305        skip_serializing_if = "Option::is_none"
306    )]
307    pub response_metadata: Option<ResponseMetadata>,
308    #[serde(
309        default,
310        deserialize_with = "crate::de::opt_string",
311        skip_serializing_if = "Option::is_none"
312    )]
313    pub warning: Option<String>,
314}
315
316/// Arguments for the Slack Web API method [`apps.auth.external.get`](https://docs.slack.dev/reference/methods/apps.auth.external.get): Get the access token for the provided token ID
317///
318/// Send it with [`SlackClient::apps_auth_external_get`].
319#[doc(alias = "apps.auth.external.get")]
320#[derive(Debug, Clone, PartialEq, Serialize)]
321#[non_exhaustive]
322pub struct AppsAuthExternalGetRequest {
323    /// The id of the token you want to get the token for
324    pub external_token_id: String,
325    /// Always refresh existing token before returning even when the token has not expired
326    #[serde(skip_serializing_if = "Option::is_none")]
327    pub force_refresh: Option<bool>,
328}
329
330impl AppsAuthExternalGetRequest {
331    pub fn new(external_token_id: impl Into<String>) -> Self {
332        Self {
333            external_token_id: external_token_id.into(),
334            force_refresh: None,
335        }
336    }
337
338    pub fn force_refresh(mut self, force_refresh: bool) -> Self {
339        self.force_refresh = Some(force_refresh);
340        self
341    }
342}
343
344impl SlackApiMethod for AppsAuthExternalGetRequest {
345    const METHOD: &'static str = "apps.auth.external.get";
346    type Response = AppsAuthExternalGetResponse;
347}
348
349/// Successful response of the Slack Web API method [`apps.auth.external.get`](https://docs.slack.dev/reference/methods/apps.auth.external.get).
350#[doc(alias = "apps.auth.external.get")]
351#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
352pub struct AppsAuthExternalGetResponse {
353    #[serde(
354        default,
355        deserialize_with = "crate::de::opt_string",
356        skip_serializing_if = "Option::is_none"
357    )]
358    pub external_token: Option<String>,
359    #[serde(
360        default,
361        deserialize_with = "crate::de::opt_object",
362        skip_serializing_if = "Option::is_none"
363    )]
364    pub response_metadata: Option<ResponseMetadata>,
365    #[serde(
366        default,
367        deserialize_with = "crate::de::opt_string",
368        skip_serializing_if = "Option::is_none"
369    )]
370    pub warning: Option<String>,
371}
372
373/// Arguments for the Slack Web API method [`apps.connections.open`](https://docs.slack.dev/reference/methods/apps.connections.open): Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over.
374///
375/// Send it with [`SlackClient::apps_connections_open`].
376#[doc(alias = "apps.connections.open")]
377#[derive(Debug, Clone, PartialEq, Serialize, Default)]
378#[non_exhaustive]
379pub struct AppsConnectionsOpenRequest {}
380
381impl AppsConnectionsOpenRequest {
382    pub fn new() -> Self {
383        Self {}
384    }
385}
386
387impl SlackApiMethod for AppsConnectionsOpenRequest {
388    const METHOD: &'static str = "apps.connections.open";
389    type Response = AppsConnectionsOpenResponse;
390}
391
392/// Successful response of the Slack Web API method [`apps.connections.open`](https://docs.slack.dev/reference/methods/apps.connections.open).
393#[doc(alias = "apps.connections.open")]
394#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
395pub struct AppsConnectionsOpenResponse {
396    #[serde(
397        default,
398        deserialize_with = "crate::de::opt_string",
399        skip_serializing_if = "Option::is_none"
400    )]
401    pub url: Option<String>,
402    #[serde(
403        default,
404        deserialize_with = "crate::de::opt_object",
405        skip_serializing_if = "Option::is_none"
406    )]
407    pub response_metadata: Option<ResponseMetadata>,
408    #[serde(
409        default,
410        deserialize_with = "crate::de::opt_string",
411        skip_serializing_if = "Option::is_none"
412    )]
413    pub warning: Option<String>,
414}
415
416/// Arguments for the Slack Web API method [`apps.datastore.bulkDelete`](https://docs.slack.dev/reference/methods/apps.datastore.bulkDelete): Delete items from a datastore in bulk
417///
418/// Send it with [`SlackClient::apps_datastore_bulk_delete`].
419#[doc(alias = "apps.datastore.bulkDelete")]
420#[derive(Debug, Clone, PartialEq, Serialize)]
421#[non_exhaustive]
422pub struct AppsDatastoreBulkDeleteRequest {
423    /// name of the datastore
424    pub datastore: String,
425    /// IDs of items to be deleted
426    #[serde(serialize_with = "crate::form::as_json")]
427    pub ids: Vec<String>,
428    #[serde(skip_serializing_if = "Option::is_none")]
429    pub app_id: Option<String>,
430}
431
432impl AppsDatastoreBulkDeleteRequest {
433    pub fn new(datastore: impl Into<String>, ids: Vec<String>) -> Self {
434        Self {
435            datastore: datastore.into(),
436            ids,
437            app_id: None,
438        }
439    }
440
441    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
442        self.app_id = Some(app_id.into());
443        self
444    }
445}
446
447impl SlackApiMethod for AppsDatastoreBulkDeleteRequest {
448    const METHOD: &'static str = "apps.datastore.bulkDelete";
449    type Response = AppsDatastoreBulkDeleteResponse;
450}
451
452/// Successful response of the Slack Web API method [`apps.datastore.bulkDelete`](https://docs.slack.dev/reference/methods/apps.datastore.bulkDelete).
453#[doc(alias = "apps.datastore.bulkDelete")]
454#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
455pub struct AppsDatastoreBulkDeleteResponse {
456    #[serde(
457        default,
458        deserialize_with = "crate::de::vec",
459        skip_serializing_if = "Vec::is_empty"
460    )]
461    pub failed_items: Vec<serde_json::Value>,
462    #[serde(
463        default,
464        deserialize_with = "crate::de::opt_object",
465        skip_serializing_if = "Option::is_none"
466    )]
467    pub response_metadata: Option<ResponseMetadata>,
468    #[serde(
469        default,
470        deserialize_with = "crate::de::opt_string",
471        skip_serializing_if = "Option::is_none"
472    )]
473    pub warning: Option<String>,
474}
475
476/// Arguments for the Slack Web API method [`apps.datastore.bulkGet`](https://docs.slack.dev/reference/methods/apps.datastore.bulkGet): Get items from a datastore in bulk
477///
478/// Send it with [`SlackClient::apps_datastore_bulk_get`].
479#[doc(alias = "apps.datastore.bulkGet")]
480#[derive(Debug, Clone, PartialEq, Serialize)]
481#[non_exhaustive]
482pub struct AppsDatastoreBulkGetRequest {
483    /// name of the datastore
484    pub datastore: String,
485    /// items' ids
486    #[serde(serialize_with = "crate::form::as_json")]
487    pub ids: Vec<String>,
488    #[serde(skip_serializing_if = "Option::is_none")]
489    pub app_id: Option<String>,
490}
491
492impl AppsDatastoreBulkGetRequest {
493    pub fn new(datastore: impl Into<String>, ids: Vec<String>) -> Self {
494        Self {
495            datastore: datastore.into(),
496            ids,
497            app_id: None,
498        }
499    }
500
501    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
502        self.app_id = Some(app_id.into());
503        self
504    }
505}
506
507impl SlackApiMethod for AppsDatastoreBulkGetRequest {
508    const METHOD: &'static str = "apps.datastore.bulkGet";
509    type Response = AppsDatastoreBulkGetResponse;
510}
511
512/// Successful response of the Slack Web API method [`apps.datastore.bulkGet`](https://docs.slack.dev/reference/methods/apps.datastore.bulkGet).
513#[doc(alias = "apps.datastore.bulkGet")]
514#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
515pub struct AppsDatastoreBulkGetResponse {
516    #[serde(
517        default,
518        deserialize_with = "crate::de::opt_string",
519        skip_serializing_if = "Option::is_none"
520    )]
521    pub datastore: Option<String>,
522    #[serde(
523        default,
524        deserialize_with = "crate::de::vec",
525        skip_serializing_if = "Vec::is_empty"
526    )]
527    pub items: Vec<serde_json::Map<String, serde_json::Value>>,
528    #[serde(
529        default,
530        deserialize_with = "crate::de::opt_object",
531        skip_serializing_if = "Option::is_none"
532    )]
533    pub response_metadata: Option<ResponseMetadata>,
534    #[serde(
535        default,
536        deserialize_with = "crate::de::opt_string",
537        skip_serializing_if = "Option::is_none"
538    )]
539    pub warning: Option<String>,
540}
541
542/// Arguments for the Slack Web API method [`apps.datastore.bulkPut`](https://docs.slack.dev/reference/methods/apps.datastore.bulkPut): Creates or replaces existing items in bulk
543///
544/// Send it with [`SlackClient::apps_datastore_bulk_put`].
545#[doc(alias = "apps.datastore.bulkPut")]
546#[derive(Debug, Clone, PartialEq, Serialize)]
547#[non_exhaustive]
548pub struct AppsDatastoreBulkPutRequest {
549    /// name of the datastore
550    pub datastore: String,
551    /// attribute names and values of the items; limit of 25
552    #[serde(serialize_with = "crate::form::as_json")]
553    pub items: Vec<serde_json::Value>,
554    #[serde(skip_serializing_if = "Option::is_none")]
555    pub app_id: Option<String>,
556}
557
558impl AppsDatastoreBulkPutRequest {
559    pub fn new(datastore: impl Into<String>, items: Vec<serde_json::Value>) -> Self {
560        Self {
561            datastore: datastore.into(),
562            items,
563            app_id: None,
564        }
565    }
566
567    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
568        self.app_id = Some(app_id.into());
569        self
570    }
571}
572
573impl SlackApiMethod for AppsDatastoreBulkPutRequest {
574    const METHOD: &'static str = "apps.datastore.bulkPut";
575    type Response = AppsDatastoreBulkPutResponse;
576}
577
578/// Successful response of the Slack Web API method [`apps.datastore.bulkPut`](https://docs.slack.dev/reference/methods/apps.datastore.bulkPut).
579#[doc(alias = "apps.datastore.bulkPut")]
580#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
581pub struct AppsDatastoreBulkPutResponse {
582    #[serde(
583        default,
584        deserialize_with = "crate::de::opt_string",
585        skip_serializing_if = "Option::is_none"
586    )]
587    pub datastore: Option<String>,
588    #[serde(
589        default,
590        deserialize_with = "crate::de::vec",
591        skip_serializing_if = "Vec::is_empty"
592    )]
593    pub failed_items: Vec<serde_json::Value>,
594    #[serde(
595        default,
596        deserialize_with = "crate::de::opt_object",
597        skip_serializing_if = "Option::is_none"
598    )]
599    pub response_metadata: Option<ResponseMetadata>,
600    #[serde(
601        default,
602        deserialize_with = "crate::de::opt_string",
603        skip_serializing_if = "Option::is_none"
604    )]
605    pub warning: Option<String>,
606}
607
608/// Arguments for the Slack Web API method [`apps.datastore.count`](https://docs.slack.dev/reference/methods/apps.datastore.count): Count the number of items in a datastore that match a query
609///
610/// Send it with [`SlackClient::apps_datastore_count`].
611#[doc(alias = "apps.datastore.count")]
612#[derive(Debug, Clone, PartialEq, Serialize)]
613#[non_exhaustive]
614pub struct AppsDatastoreCountRequest {
615    /// Name of the datastore
616    pub datastore: String,
617    /// A query filter expression
618    #[serde(skip_serializing_if = "Option::is_none")]
619    pub expression: Option<String>,
620    /// A map of attributes referenced in expression
621    #[serde(skip_serializing_if = "Option::is_none")]
622    pub expression_attributes: Option<serde_json::Value>,
623    /// A map of values referenced in expression
624    #[serde(skip_serializing_if = "Option::is_none")]
625    pub expression_values: Option<serde_json::Value>,
626    /// Required if calling with user token
627    #[serde(skip_serializing_if = "Option::is_none")]
628    pub app_id: Option<String>,
629}
630
631impl AppsDatastoreCountRequest {
632    pub fn new(datastore: impl Into<String>) -> Self {
633        Self {
634            datastore: datastore.into(),
635            expression: None,
636            expression_attributes: None,
637            expression_values: None,
638            app_id: None,
639        }
640    }
641
642    pub fn expression(mut self, expression: impl Into<String>) -> Self {
643        self.expression = Some(expression.into());
644        self
645    }
646
647    pub fn expression_attributes(mut self, expression_attributes: serde_json::Value) -> Self {
648        self.expression_attributes = Some(expression_attributes);
649        self
650    }
651
652    pub fn expression_values(mut self, expression_values: serde_json::Value) -> Self {
653        self.expression_values = Some(expression_values);
654        self
655    }
656
657    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
658        self.app_id = Some(app_id.into());
659        self
660    }
661}
662
663impl SlackApiMethod for AppsDatastoreCountRequest {
664    const METHOD: &'static str = "apps.datastore.count";
665    type Response = AppsDatastoreCountResponse;
666}
667
668/// Successful response of the Slack Web API method [`apps.datastore.count`](https://docs.slack.dev/reference/methods/apps.datastore.count).
669#[doc(alias = "apps.datastore.count")]
670#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
671pub struct AppsDatastoreCountResponse {
672    #[serde(
673        default,
674        deserialize_with = "crate::de::opt_string",
675        skip_serializing_if = "Option::is_none"
676    )]
677    pub datastore: Option<String>,
678    #[serde(
679        default,
680        deserialize_with = "crate::de::opt_i64",
681        skip_serializing_if = "Option::is_none"
682    )]
683    pub count: Option<i64>,
684    #[serde(
685        default,
686        deserialize_with = "crate::de::opt_object",
687        skip_serializing_if = "Option::is_none"
688    )]
689    pub response_metadata: Option<ResponseMetadata>,
690    #[serde(
691        default,
692        deserialize_with = "crate::de::opt_string",
693        skip_serializing_if = "Option::is_none"
694    )]
695    pub warning: Option<String>,
696}
697
698/// Arguments for the Slack Web API method [`apps.datastore.delete`](https://docs.slack.dev/reference/methods/apps.datastore.delete): Delete an item from a datastore
699///
700/// Send it with [`SlackClient::apps_datastore_delete`].
701#[doc(alias = "apps.datastore.delete")]
702#[derive(Debug, Clone, PartialEq, Serialize)]
703#[non_exhaustive]
704pub struct AppsDatastoreDeleteRequest {
705    /// name of the datastore
706    pub datastore: String,
707    /// item id
708    pub id: String,
709    #[serde(skip_serializing_if = "Option::is_none")]
710    pub app_id: Option<String>,
711}
712
713impl AppsDatastoreDeleteRequest {
714    pub fn new(datastore: impl Into<String>, id: impl Into<String>) -> Self {
715        Self {
716            datastore: datastore.into(),
717            id: id.into(),
718            app_id: None,
719        }
720    }
721
722    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
723        self.app_id = Some(app_id.into());
724        self
725    }
726}
727
728impl SlackApiMethod for AppsDatastoreDeleteRequest {
729    const METHOD: &'static str = "apps.datastore.delete";
730    type Response = AppsDatastoreDeleteResponse;
731}
732
733/// Successful response of the Slack Web API method [`apps.datastore.delete`](https://docs.slack.dev/reference/methods/apps.datastore.delete).
734#[doc(alias = "apps.datastore.delete")]
735#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
736pub struct AppsDatastoreDeleteResponse {
737    /// Fields returned by Slack. This method has no documented response example.
738    #[serde(flatten)]
739    pub extra: serde_json::Map<String, serde_json::Value>,
740    #[serde(
741        default,
742        deserialize_with = "crate::de::opt_object",
743        skip_serializing_if = "Option::is_none"
744    )]
745    pub response_metadata: Option<ResponseMetadata>,
746    #[serde(
747        default,
748        deserialize_with = "crate::de::opt_string",
749        skip_serializing_if = "Option::is_none"
750    )]
751    pub warning: Option<String>,
752}
753
754/// Arguments for the Slack Web API method [`apps.datastore.get`](https://docs.slack.dev/reference/methods/apps.datastore.get): Get an item from a datastore
755///
756/// Send it with [`SlackClient::apps_datastore_get`].
757#[doc(alias = "apps.datastore.get")]
758#[derive(Debug, Clone, PartialEq, Serialize)]
759#[non_exhaustive]
760pub struct AppsDatastoreGetRequest {
761    /// name of the datastore
762    pub datastore: String,
763    /// item id
764    pub id: String,
765    #[serde(skip_serializing_if = "Option::is_none")]
766    pub app_id: Option<String>,
767}
768
769impl AppsDatastoreGetRequest {
770    pub fn new(datastore: impl Into<String>, id: impl Into<String>) -> Self {
771        Self {
772            datastore: datastore.into(),
773            id: id.into(),
774            app_id: None,
775        }
776    }
777
778    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
779        self.app_id = Some(app_id.into());
780        self
781    }
782}
783
784impl SlackApiMethod for AppsDatastoreGetRequest {
785    const METHOD: &'static str = "apps.datastore.get";
786    type Response = AppsDatastoreGetResponse;
787}
788
789/// Successful response of the Slack Web API method [`apps.datastore.get`](https://docs.slack.dev/reference/methods/apps.datastore.get).
790#[doc(alias = "apps.datastore.get")]
791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
792pub struct AppsDatastoreGetResponse {
793    #[serde(
794        default,
795        deserialize_with = "crate::de::opt_string",
796        skip_serializing_if = "Option::is_none"
797    )]
798    pub datastore: Option<String>,
799    #[serde(
800        default,
801        deserialize_with = "crate::de::opt_object",
802        skip_serializing_if = "Option::is_none"
803    )]
804    pub item: Option<serde_json::Map<String, serde_json::Value>>,
805    #[serde(
806        default,
807        deserialize_with = "crate::de::opt_object",
808        skip_serializing_if = "Option::is_none"
809    )]
810    pub response_metadata: Option<ResponseMetadata>,
811    #[serde(
812        default,
813        deserialize_with = "crate::de::opt_string",
814        skip_serializing_if = "Option::is_none"
815    )]
816    pub warning: Option<String>,
817}
818
819/// Arguments for the Slack Web API method [`apps.datastore.put`](https://docs.slack.dev/reference/methods/apps.datastore.put): Creates a new item, or replaces an old item with a new item.
820///
821/// Send it with [`SlackClient::apps_datastore_put`].
822#[doc(alias = "apps.datastore.put")]
823#[derive(Debug, Clone, PartialEq, Serialize)]
824#[non_exhaustive]
825pub struct AppsDatastorePutRequest {
826    /// name of the datastore
827    pub datastore: String,
828    /// attribute names and values of the item
829    pub item: serde_json::Value,
830    #[serde(skip_serializing_if = "Option::is_none")]
831    pub app_id: Option<String>,
832}
833
834impl AppsDatastorePutRequest {
835    pub fn new(datastore: impl Into<String>, item: serde_json::Value) -> Self {
836        Self {
837            datastore: datastore.into(),
838            item,
839            app_id: None,
840        }
841    }
842
843    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
844        self.app_id = Some(app_id.into());
845        self
846    }
847}
848
849impl SlackApiMethod for AppsDatastorePutRequest {
850    const METHOD: &'static str = "apps.datastore.put";
851    type Response = AppsDatastorePutResponse;
852}
853
854/// Successful response of the Slack Web API method [`apps.datastore.put`](https://docs.slack.dev/reference/methods/apps.datastore.put).
855#[doc(alias = "apps.datastore.put")]
856#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
857pub struct AppsDatastorePutResponse {
858    #[serde(
859        default,
860        deserialize_with = "crate::de::opt_string",
861        skip_serializing_if = "Option::is_none"
862    )]
863    pub datastore: Option<String>,
864    #[serde(
865        default,
866        deserialize_with = "crate::de::opt_object",
867        skip_serializing_if = "Option::is_none"
868    )]
869    pub item: Option<serde_json::Map<String, serde_json::Value>>,
870    #[serde(
871        default,
872        deserialize_with = "crate::de::opt_object",
873        skip_serializing_if = "Option::is_none"
874    )]
875    pub response_metadata: Option<ResponseMetadata>,
876    #[serde(
877        default,
878        deserialize_with = "crate::de::opt_string",
879        skip_serializing_if = "Option::is_none"
880    )]
881    pub warning: Option<String>,
882}
883
884/// Arguments for the Slack Web API method [`apps.datastore.query`](https://docs.slack.dev/reference/methods/apps.datastore.query): Query a datastore for items
885///
886/// Send it with [`SlackClient::apps_datastore_query`].
887#[doc(alias = "apps.datastore.query")]
888#[derive(Debug, Clone, PartialEq, Serialize)]
889#[non_exhaustive]
890pub struct AppsDatastoreQueryRequest {
891    /// Name of the datastore
892    pub datastore: String,
893    /// A query filter expression
894    #[serde(skip_serializing_if = "Option::is_none")]
895    pub expression: Option<String>,
896    /// A map of attributes referenced in expression
897    #[serde(skip_serializing_if = "Option::is_none")]
898    pub expression_attributes: Option<serde_json::Value>,
899    /// A map of values referenced in expression
900    #[serde(skip_serializing_if = "Option::is_none")]
901    pub expression_values: Option<serde_json::Value>,
902    /// Required if calling with user token
903    #[serde(skip_serializing_if = "Option::is_none")]
904    pub app_id: Option<String>,
905    /// Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
906    #[serde(skip_serializing_if = "Option::is_none")]
907    pub cursor: Option<String>,
908    /// The maximum number of items to evaluate for a given request (not necessarily the number of matching items). If the given request dataset size exceeds 1 MB before reaching the limit, the returned item count will likely be less than the limit. In any case where there are more items available beyond an imposed limit, a `next_cursor` value will be provided for use in subsequent requests.
909    #[serde(skip_serializing_if = "Option::is_none")]
910    pub limit: Option<i64>,
911}
912
913impl AppsDatastoreQueryRequest {
914    pub fn new(datastore: impl Into<String>) -> Self {
915        Self {
916            datastore: datastore.into(),
917            expression: None,
918            expression_attributes: None,
919            expression_values: None,
920            app_id: None,
921            cursor: None,
922            limit: None,
923        }
924    }
925
926    pub fn expression(mut self, expression: impl Into<String>) -> Self {
927        self.expression = Some(expression.into());
928        self
929    }
930
931    pub fn expression_attributes(mut self, expression_attributes: serde_json::Value) -> Self {
932        self.expression_attributes = Some(expression_attributes);
933        self
934    }
935
936    pub fn expression_values(mut self, expression_values: serde_json::Value) -> Self {
937        self.expression_values = Some(expression_values);
938        self
939    }
940
941    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
942        self.app_id = Some(app_id.into());
943        self
944    }
945
946    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
947        self.cursor = Some(cursor.into());
948        self
949    }
950
951    pub fn limit(mut self, limit: i64) -> Self {
952        self.limit = Some(limit);
953        self
954    }
955}
956
957impl SlackApiMethod for AppsDatastoreQueryRequest {
958    const METHOD: &'static str = "apps.datastore.query";
959    type Response = AppsDatastoreQueryResponse;
960}
961
962impl CursorPaginated for AppsDatastoreQueryRequest {
963    fn set_cursor(&mut self, cursor: String) {
964        self.cursor = Some(cursor);
965    }
966}
967
968impl NextCursor for AppsDatastoreQueryResponse {
969    fn next_cursor(&self) -> Option<&str> {
970        self.response_metadata.as_ref()?.next_cursor.as_deref()
971    }
972}
973
974/// Successful response of the Slack Web API method [`apps.datastore.query`](https://docs.slack.dev/reference/methods/apps.datastore.query).
975#[doc(alias = "apps.datastore.query")]
976#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
977pub struct AppsDatastoreQueryResponse {
978    #[serde(
979        default,
980        deserialize_with = "crate::de::opt_string",
981        skip_serializing_if = "Option::is_none"
982    )]
983    pub datastore: Option<String>,
984    #[serde(
985        default,
986        deserialize_with = "crate::de::vec",
987        skip_serializing_if = "Vec::is_empty"
988    )]
989    pub items: Vec<serde_json::Map<String, serde_json::Value>>,
990    #[serde(
991        default,
992        deserialize_with = "crate::de::opt_object",
993        skip_serializing_if = "Option::is_none"
994    )]
995    pub response_metadata: Option<ResponseMetadata>,
996    #[serde(
997        default,
998        deserialize_with = "crate::de::opt_string",
999        skip_serializing_if = "Option::is_none"
1000    )]
1001    pub warning: Option<String>,
1002}
1003
1004/// Arguments for the Slack Web API method [`apps.datastore.update`](https://docs.slack.dev/reference/methods/apps.datastore.update): Edits an existing item's attributes, or adds a new item if it does not already exist.
1005///
1006/// Send it with [`SlackClient::apps_datastore_update`].
1007#[doc(alias = "apps.datastore.update")]
1008#[derive(Debug, Clone, PartialEq, Serialize)]
1009#[non_exhaustive]
1010pub struct AppsDatastoreUpdateRequest {
1011    /// name of the datastore
1012    pub datastore: String,
1013    /// attribute names and values to be updated
1014    pub item: serde_json::Value,
1015    #[serde(skip_serializing_if = "Option::is_none")]
1016    pub app_id: Option<String>,
1017}
1018
1019impl AppsDatastoreUpdateRequest {
1020    pub fn new(datastore: impl Into<String>, item: serde_json::Value) -> Self {
1021        Self {
1022            datastore: datastore.into(),
1023            item,
1024            app_id: None,
1025        }
1026    }
1027
1028    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
1029        self.app_id = Some(app_id.into());
1030        self
1031    }
1032}
1033
1034impl SlackApiMethod for AppsDatastoreUpdateRequest {
1035    const METHOD: &'static str = "apps.datastore.update";
1036    type Response = AppsDatastoreUpdateResponse;
1037}
1038
1039/// Successful response of the Slack Web API method [`apps.datastore.update`](https://docs.slack.dev/reference/methods/apps.datastore.update).
1040#[doc(alias = "apps.datastore.update")]
1041#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1042pub struct AppsDatastoreUpdateResponse {
1043    #[serde(
1044        default,
1045        deserialize_with = "crate::de::opt_string",
1046        skip_serializing_if = "Option::is_none"
1047    )]
1048    pub datastore: Option<String>,
1049    #[serde(
1050        default,
1051        deserialize_with = "crate::de::opt_object",
1052        skip_serializing_if = "Option::is_none"
1053    )]
1054    pub item: Option<serde_json::Map<String, serde_json::Value>>,
1055    #[serde(
1056        default,
1057        deserialize_with = "crate::de::opt_object",
1058        skip_serializing_if = "Option::is_none"
1059    )]
1060    pub response_metadata: Option<ResponseMetadata>,
1061    #[serde(
1062        default,
1063        deserialize_with = "crate::de::opt_string",
1064        skip_serializing_if = "Option::is_none"
1065    )]
1066    pub warning: Option<String>,
1067}
1068
1069/// Arguments for the Slack Web API method [`apps.event.authorizations.list`](https://docs.slack.dev/reference/methods/apps.event.authorizations.list): Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.
1070///
1071/// Send it with [`SlackClient::apps_event_authorizations_list`].
1072#[doc(alias = "apps.event.authorizations.list")]
1073#[derive(Debug, Clone, PartialEq, Serialize)]
1074#[non_exhaustive]
1075pub struct AppsEventAuthorizationsListRequest {
1076    pub event_context: String,
1077    #[serde(skip_serializing_if = "Option::is_none")]
1078    pub cursor: Option<String>,
1079    #[serde(skip_serializing_if = "Option::is_none")]
1080    pub limit: Option<i64>,
1081}
1082
1083impl AppsEventAuthorizationsListRequest {
1084    pub fn new(event_context: impl Into<String>) -> Self {
1085        Self {
1086            event_context: event_context.into(),
1087            cursor: None,
1088            limit: None,
1089        }
1090    }
1091
1092    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
1093        self.cursor = Some(cursor.into());
1094        self
1095    }
1096
1097    pub fn limit(mut self, limit: i64) -> Self {
1098        self.limit = Some(limit);
1099        self
1100    }
1101}
1102
1103impl SlackApiMethod for AppsEventAuthorizationsListRequest {
1104    const METHOD: &'static str = "apps.event.authorizations.list";
1105    type Response = AppsEventAuthorizationsListResponse;
1106}
1107
1108impl CursorPaginated for AppsEventAuthorizationsListRequest {
1109    fn set_cursor(&mut self, cursor: String) {
1110        self.cursor = Some(cursor);
1111    }
1112}
1113
1114impl NextCursor for AppsEventAuthorizationsListResponse {
1115    fn next_cursor(&self) -> Option<&str> {
1116        self.response_metadata.as_ref()?.next_cursor.as_deref()
1117    }
1118}
1119
1120/// Successful response of the Slack Web API method [`apps.event.authorizations.list`](https://docs.slack.dev/reference/methods/apps.event.authorizations.list).
1121#[doc(alias = "apps.event.authorizations.list")]
1122#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1123pub struct AppsEventAuthorizationsListResponse {
1124    #[serde(
1125        default,
1126        deserialize_with = "crate::de::vec",
1127        skip_serializing_if = "Vec::is_empty"
1128    )]
1129    pub authorizations: Vec<AppsEventAuthorizationsListResponseAuthorizations>,
1130    #[serde(
1131        default,
1132        deserialize_with = "crate::de::opt_object",
1133        skip_serializing_if = "Option::is_none"
1134    )]
1135    pub response_metadata: Option<ResponseMetadata>,
1136    #[serde(
1137        default,
1138        deserialize_with = "crate::de::opt_string",
1139        skip_serializing_if = "Option::is_none"
1140    )]
1141    pub warning: Option<String>,
1142}
1143
1144#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1145pub struct AppsEventAuthorizationsListResponseAuthorizations {
1146    #[serde(
1147        default,
1148        deserialize_with = "crate::de::opt_string",
1149        skip_serializing_if = "Option::is_none"
1150    )]
1151    pub enterprise_id: Option<String>,
1152    #[serde(
1153        default,
1154        deserialize_with = "crate::de::opt_string",
1155        skip_serializing_if = "Option::is_none"
1156    )]
1157    pub team_id: Option<String>,
1158    #[serde(
1159        default,
1160        deserialize_with = "crate::de::opt_string",
1161        skip_serializing_if = "Option::is_none"
1162    )]
1163    pub user_id: Option<String>,
1164    #[serde(
1165        default,
1166        deserialize_with = "crate::de::opt_string",
1167        skip_serializing_if = "Option::is_none"
1168    )]
1169    pub is_bot: Option<String>,
1170}
1171
1172/// Arguments for the Slack Web API method [`apps.icon.set`](https://docs.slack.dev/reference/methods/apps.icon.set): Sets the app icon
1173///
1174/// Send it with [`SlackClient::apps_icon_set`].
1175#[doc(alias = "apps.icon.set")]
1176#[derive(Debug, Clone, PartialEq, Serialize)]
1177#[non_exhaustive]
1178pub struct AppsIconSetRequest {
1179    /// The ID of the app whose icon you want to set.
1180    pub app_id: String,
1181    /// File contents via `multipart/form-data`
1182    #[serde(skip_serializing_if = "Option::is_none")]
1183    pub file: Option<String>,
1184    /// URL of a publicly hosted image
1185    #[serde(skip_serializing_if = "Option::is_none")]
1186    pub url: Option<String>,
1187}
1188
1189impl AppsIconSetRequest {
1190    pub fn new(app_id: impl Into<String>) -> Self {
1191        Self {
1192            app_id: app_id.into(),
1193            file: None,
1194            url: None,
1195        }
1196    }
1197
1198    pub fn file(mut self, file: impl Into<String>) -> Self {
1199        self.file = Some(file.into());
1200        self
1201    }
1202
1203    pub fn url(mut self, url: impl Into<String>) -> Self {
1204        self.url = Some(url.into());
1205        self
1206    }
1207}
1208
1209impl SlackApiMethod for AppsIconSetRequest {
1210    const METHOD: &'static str = "apps.icon.set";
1211    type Response = AppsIconSetResponse;
1212}
1213
1214/// Successful response of the Slack Web API method [`apps.icon.set`](https://docs.slack.dev/reference/methods/apps.icon.set).
1215#[doc(alias = "apps.icon.set")]
1216#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1217pub struct AppsIconSetResponse {
1218    /// Fields returned by Slack. This method has no documented response example.
1219    #[serde(flatten)]
1220    pub extra: serde_json::Map<String, serde_json::Value>,
1221    #[serde(
1222        default,
1223        deserialize_with = "crate::de::opt_object",
1224        skip_serializing_if = "Option::is_none"
1225    )]
1226    pub response_metadata: Option<ResponseMetadata>,
1227    #[serde(
1228        default,
1229        deserialize_with = "crate::de::opt_string",
1230        skip_serializing_if = "Option::is_none"
1231    )]
1232    pub warning: Option<String>,
1233}
1234
1235/// Arguments for the Slack Web API method [`apps.managed.permissions.set`](https://docs.slack.dev/reference/methods/apps.managed.permissions.set): Set who can interact with a managed app
1236///
1237/// Send it with [`SlackClient::apps_managed_permissions_set`].
1238#[doc(alias = "apps.managed.permissions.set")]
1239#[derive(Debug, Clone, PartialEq, Serialize)]
1240#[non_exhaustive]
1241pub struct AppsManagedPermissionsSetRequest {
1242    /// Encoded ID of the managed app to configure
1243    pub app_id: String,
1244    /// Who can interact with the app. Use everyone to allow all members, or app\_owner to restrict access to the app's owner.
1245    pub permissions: String,
1246}
1247
1248impl AppsManagedPermissionsSetRequest {
1249    pub fn new(app_id: impl Into<String>, permissions: impl Into<String>) -> Self {
1250        Self {
1251            app_id: app_id.into(),
1252            permissions: permissions.into(),
1253        }
1254    }
1255}
1256
1257impl SlackApiMethod for AppsManagedPermissionsSetRequest {
1258    const METHOD: &'static str = "apps.managed.permissions.set";
1259    type Response = AppsManagedPermissionsSetResponse;
1260}
1261
1262/// Successful response of the Slack Web API method [`apps.managed.permissions.set`](https://docs.slack.dev/reference/methods/apps.managed.permissions.set).
1263#[doc(alias = "apps.managed.permissions.set")]
1264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1265pub struct AppsManagedPermissionsSetResponse {
1266    /// Fields returned by Slack. This method has no documented response example.
1267    #[serde(flatten)]
1268    pub extra: serde_json::Map<String, serde_json::Value>,
1269    #[serde(
1270        default,
1271        deserialize_with = "crate::de::opt_object",
1272        skip_serializing_if = "Option::is_none"
1273    )]
1274    pub response_metadata: Option<ResponseMetadata>,
1275    #[serde(
1276        default,
1277        deserialize_with = "crate::de::opt_string",
1278        skip_serializing_if = "Option::is_none"
1279    )]
1280    pub warning: Option<String>,
1281}
1282
1283/// Arguments for the Slack Web API method [`apps.manifest.create`](https://docs.slack.dev/reference/methods/apps.manifest.create): Create an app from an app manifest.
1284///
1285/// Send it with [`SlackClient::apps_manifest_create`].
1286#[doc(alias = "apps.manifest.create")]
1287#[derive(Debug, Clone, PartialEq, Serialize)]
1288#[non_exhaustive]
1289pub struct AppsManifestCreateRequest {
1290    /// A JSON app manifest encoded as a string. This manifest **must** use a valid [app manifest schema - read our guide to creating one](https://docs.slack.dev/app-manifests/configuring-apps-with-app-manifests.md#fields).
1291    pub manifest: String,
1292    /// When called with an org token, which specific team to create app on
1293    #[serde(skip_serializing_if = "Option::is_none")]
1294    pub team_id: Option<String>,
1295}
1296
1297impl AppsManifestCreateRequest {
1298    pub fn new(manifest: impl Into<String>) -> Self {
1299        Self {
1300            manifest: manifest.into(),
1301            team_id: None,
1302        }
1303    }
1304
1305    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
1306        self.team_id = Some(team_id.into());
1307        self
1308    }
1309}
1310
1311impl SlackApiMethod for AppsManifestCreateRequest {
1312    const METHOD: &'static str = "apps.manifest.create";
1313    type Response = AppsManifestCreateResponse;
1314}
1315
1316/// Successful response of the Slack Web API method [`apps.manifest.create`](https://docs.slack.dev/reference/methods/apps.manifest.create).
1317#[doc(alias = "apps.manifest.create")]
1318#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1319pub struct AppsManifestCreateResponse {
1320    #[serde(
1321        default,
1322        deserialize_with = "crate::de::opt_string",
1323        skip_serializing_if = "Option::is_none"
1324    )]
1325    pub app_id: Option<String>,
1326    #[serde(
1327        default,
1328        deserialize_with = "crate::de::opt_object",
1329        skip_serializing_if = "Option::is_none"
1330    )]
1331    pub credentials: Option<AppsManifestCreateResponseCredentials>,
1332    #[serde(
1333        default,
1334        deserialize_with = "crate::de::opt_string",
1335        skip_serializing_if = "Option::is_none"
1336    )]
1337    pub oauth_authorize_url: Option<String>,
1338    #[serde(
1339        default,
1340        deserialize_with = "crate::de::opt_object",
1341        skip_serializing_if = "Option::is_none"
1342    )]
1343    pub response_metadata: Option<ResponseMetadata>,
1344    #[serde(
1345        default,
1346        deserialize_with = "crate::de::opt_string",
1347        skip_serializing_if = "Option::is_none"
1348    )]
1349    pub warning: Option<String>,
1350}
1351
1352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1353pub struct AppsManifestCreateResponseCredentials {
1354    #[serde(
1355        default,
1356        deserialize_with = "crate::de::opt_string",
1357        skip_serializing_if = "Option::is_none"
1358    )]
1359    pub client_id: Option<String>,
1360    #[serde(
1361        default,
1362        deserialize_with = "crate::de::opt_string",
1363        skip_serializing_if = "Option::is_none"
1364    )]
1365    pub client_secret: Option<String>,
1366    #[serde(
1367        default,
1368        deserialize_with = "crate::de::opt_string",
1369        skip_serializing_if = "Option::is_none"
1370    )]
1371    pub verification_token: Option<String>,
1372    #[serde(
1373        default,
1374        deserialize_with = "crate::de::opt_string",
1375        skip_serializing_if = "Option::is_none"
1376    )]
1377    pub signing_secret: Option<String>,
1378}
1379
1380/// Arguments for the Slack Web API method [`apps.manifest.delete`](https://docs.slack.dev/reference/methods/apps.manifest.delete): Permanently deletes an app created through app manifests
1381///
1382/// Send it with [`SlackClient::apps_manifest_delete`].
1383#[doc(alias = "apps.manifest.delete")]
1384#[derive(Debug, Clone, PartialEq, Serialize)]
1385#[non_exhaustive]
1386pub struct AppsManifestDeleteRequest {
1387    /// The ID of the app you want to delete.
1388    pub app_id: String,
1389}
1390
1391impl AppsManifestDeleteRequest {
1392    pub fn new(app_id: impl Into<String>) -> Self {
1393        Self {
1394            app_id: app_id.into(),
1395        }
1396    }
1397}
1398
1399impl SlackApiMethod for AppsManifestDeleteRequest {
1400    const METHOD: &'static str = "apps.manifest.delete";
1401    type Response = AppsManifestDeleteResponse;
1402}
1403
1404/// Successful response of the Slack Web API method [`apps.manifest.delete`](https://docs.slack.dev/reference/methods/apps.manifest.delete).
1405#[doc(alias = "apps.manifest.delete")]
1406#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1407pub struct AppsManifestDeleteResponse {
1408    /// Fields returned by Slack. This method has no documented response example.
1409    #[serde(flatten)]
1410    pub extra: serde_json::Map<String, serde_json::Value>,
1411    #[serde(
1412        default,
1413        deserialize_with = "crate::de::opt_object",
1414        skip_serializing_if = "Option::is_none"
1415    )]
1416    pub response_metadata: Option<ResponseMetadata>,
1417    #[serde(
1418        default,
1419        deserialize_with = "crate::de::opt_string",
1420        skip_serializing_if = "Option::is_none"
1421    )]
1422    pub warning: Option<String>,
1423}
1424
1425/// Arguments for the Slack Web API method [`apps.manifest.export`](https://docs.slack.dev/reference/methods/apps.manifest.export): Export an app manifest from an existing app
1426///
1427/// Send it with [`SlackClient::apps_manifest_export`].
1428#[doc(alias = "apps.manifest.export")]
1429#[derive(Debug, Clone, PartialEq, Serialize)]
1430#[non_exhaustive]
1431pub struct AppsManifestExportRequest {
1432    /// The ID of the app whose configuration you want to export as a manifest.
1433    pub app_id: String,
1434}
1435
1436impl AppsManifestExportRequest {
1437    pub fn new(app_id: impl Into<String>) -> Self {
1438        Self {
1439            app_id: app_id.into(),
1440        }
1441    }
1442}
1443
1444impl SlackApiMethod for AppsManifestExportRequest {
1445    const METHOD: &'static str = "apps.manifest.export";
1446    type Response = AppsManifestExportResponse;
1447}
1448
1449/// Successful response of the Slack Web API method [`apps.manifest.export`](https://docs.slack.dev/reference/methods/apps.manifest.export).
1450#[doc(alias = "apps.manifest.export")]
1451#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1452pub struct AppsManifestExportResponse {
1453    #[serde(
1454        default,
1455        deserialize_with = "crate::de::opt_object",
1456        skip_serializing_if = "Option::is_none"
1457    )]
1458    pub manifest: Option<AppsManifestExportResponseManifest>,
1459    #[serde(
1460        default,
1461        deserialize_with = "crate::de::opt_object",
1462        skip_serializing_if = "Option::is_none"
1463    )]
1464    pub response_metadata: Option<ResponseMetadata>,
1465    #[serde(
1466        default,
1467        deserialize_with = "crate::de::opt_string",
1468        skip_serializing_if = "Option::is_none"
1469    )]
1470    pub warning: Option<String>,
1471}
1472
1473#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1474pub struct AppsManifestExportResponseManifest {
1475    #[serde(
1476        rename = "_metadata",
1477        default,
1478        deserialize_with = "crate::de::opt_object",
1479        skip_serializing_if = "Option::is_none"
1480    )]
1481    pub metadata: Option<AppsManifestExportResponseManifestMetadata>,
1482    #[serde(
1483        default,
1484        deserialize_with = "crate::de::opt_object",
1485        skip_serializing_if = "Option::is_none"
1486    )]
1487    pub display_information: Option<AppsManifestExportResponseManifestDisplayInformation>,
1488    #[serde(
1489        default,
1490        deserialize_with = "crate::de::opt_object",
1491        skip_serializing_if = "Option::is_none"
1492    )]
1493    pub features: Option<AppsManifestExportResponseManifestFeatures>,
1494    #[serde(
1495        default,
1496        deserialize_with = "crate::de::opt_object",
1497        skip_serializing_if = "Option::is_none"
1498    )]
1499    pub oauth_config: Option<AppsManifestExportResponseManifestOauthConfig>,
1500    #[serde(
1501        default,
1502        deserialize_with = "crate::de::opt_object",
1503        skip_serializing_if = "Option::is_none"
1504    )]
1505    pub settings: Option<AppsManifestExportResponseManifestSettings>,
1506}
1507
1508#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1509pub struct AppsManifestExportResponseManifestMetadata {
1510    #[serde(
1511        default,
1512        deserialize_with = "crate::de::opt_i64",
1513        skip_serializing_if = "Option::is_none"
1514    )]
1515    pub major_version: Option<i64>,
1516    #[serde(
1517        default,
1518        deserialize_with = "crate::de::opt_i64",
1519        skip_serializing_if = "Option::is_none"
1520    )]
1521    pub minor_version: Option<i64>,
1522}
1523
1524#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1525pub struct AppsManifestExportResponseManifestDisplayInformation {
1526    #[serde(
1527        default,
1528        deserialize_with = "crate::de::opt_string",
1529        skip_serializing_if = "Option::is_none"
1530    )]
1531    pub name: Option<String>,
1532    #[serde(
1533        default,
1534        deserialize_with = "crate::de::opt_string",
1535        skip_serializing_if = "Option::is_none"
1536    )]
1537    pub description: Option<String>,
1538    #[serde(
1539        default,
1540        deserialize_with = "crate::de::opt_string",
1541        skip_serializing_if = "Option::is_none"
1542    )]
1543    pub background_color: Option<String>,
1544    #[serde(
1545        default,
1546        deserialize_with = "crate::de::opt_string",
1547        skip_serializing_if = "Option::is_none"
1548    )]
1549    pub long_description: Option<String>,
1550}
1551
1552#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1553pub struct AppsManifestExportResponseManifestFeatures {
1554    #[serde(
1555        default,
1556        deserialize_with = "crate::de::opt_object",
1557        skip_serializing_if = "Option::is_none"
1558    )]
1559    pub app_home: Option<AppsManifestExportResponseManifestFeaturesAppHome>,
1560    #[serde(
1561        default,
1562        deserialize_with = "crate::de::opt_object",
1563        skip_serializing_if = "Option::is_none"
1564    )]
1565    pub bot_user: Option<AppsManifestExportResponseManifestFeaturesBotUser>,
1566    #[serde(
1567        default,
1568        deserialize_with = "crate::de::vec",
1569        skip_serializing_if = "Vec::is_empty"
1570    )]
1571    pub slash_commands: Vec<AppsManifestExportResponseManifestFeaturesSlashCommands>,
1572    #[serde(
1573        default,
1574        deserialize_with = "crate::de::vec",
1575        skip_serializing_if = "Vec::is_empty"
1576    )]
1577    pub workflow_steps: Vec<AppsManifestExportResponseManifestFeaturesWorkflowSteps>,
1578}
1579
1580#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1581pub struct AppsManifestExportResponseManifestFeaturesAppHome {
1582    #[serde(
1583        default,
1584        deserialize_with = "crate::de::opt_bool",
1585        skip_serializing_if = "Option::is_none"
1586    )]
1587    pub home_tab_enabled: Option<bool>,
1588    #[serde(
1589        default,
1590        deserialize_with = "crate::de::opt_bool",
1591        skip_serializing_if = "Option::is_none"
1592    )]
1593    pub messages_tab_enabled: Option<bool>,
1594    #[serde(
1595        default,
1596        deserialize_with = "crate::de::opt_bool",
1597        skip_serializing_if = "Option::is_none"
1598    )]
1599    pub messages_tab_read_only_enabled: Option<bool>,
1600}
1601
1602#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1603pub struct AppsManifestExportResponseManifestFeaturesBotUser {
1604    #[serde(
1605        default,
1606        deserialize_with = "crate::de::opt_string",
1607        skip_serializing_if = "Option::is_none"
1608    )]
1609    pub display_name: Option<String>,
1610    #[serde(
1611        default,
1612        deserialize_with = "crate::de::opt_bool",
1613        skip_serializing_if = "Option::is_none"
1614    )]
1615    pub always_online: Option<bool>,
1616}
1617
1618#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1619pub struct AppsManifestExportResponseManifestFeaturesSlashCommands {
1620    #[serde(
1621        default,
1622        deserialize_with = "crate::de::opt_string",
1623        skip_serializing_if = "Option::is_none"
1624    )]
1625    pub command: Option<String>,
1626    #[serde(
1627        default,
1628        deserialize_with = "crate::de::opt_string",
1629        skip_serializing_if = "Option::is_none"
1630    )]
1631    pub description: Option<String>,
1632    #[serde(
1633        default,
1634        deserialize_with = "crate::de::opt_string",
1635        skip_serializing_if = "Option::is_none"
1636    )]
1637    pub usage_hint: Option<String>,
1638    #[serde(
1639        default,
1640        deserialize_with = "crate::de::opt_bool",
1641        skip_serializing_if = "Option::is_none"
1642    )]
1643    pub should_escape: Option<bool>,
1644}
1645
1646#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1647pub struct AppsManifestExportResponseManifestFeaturesWorkflowSteps {
1648    #[serde(
1649        default,
1650        deserialize_with = "crate::de::opt_string",
1651        skip_serializing_if = "Option::is_none"
1652    )]
1653    pub name: Option<String>,
1654    #[serde(
1655        default,
1656        deserialize_with = "crate::de::opt_string",
1657        skip_serializing_if = "Option::is_none"
1658    )]
1659    pub callback_id: Option<String>,
1660}
1661
1662#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1663pub struct AppsManifestExportResponseManifestOauthConfig {
1664    #[serde(
1665        default,
1666        deserialize_with = "crate::de::vec",
1667        skip_serializing_if = "Vec::is_empty"
1668    )]
1669    pub redirect_urls: Vec<String>,
1670    #[serde(
1671        default,
1672        deserialize_with = "crate::de::opt_object",
1673        skip_serializing_if = "Option::is_none"
1674    )]
1675    pub scopes: Option<AppsManifestExportResponseManifestOauthConfigScopes>,
1676}
1677
1678#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1679pub struct AppsManifestExportResponseManifestOauthConfigScopes {
1680    #[serde(
1681        default,
1682        deserialize_with = "crate::de::vec",
1683        skip_serializing_if = "Vec::is_empty"
1684    )]
1685    pub bot: Vec<String>,
1686}
1687
1688#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1689pub struct AppsManifestExportResponseManifestSettings {
1690    #[serde(
1691        default,
1692        deserialize_with = "crate::de::opt_object",
1693        skip_serializing_if = "Option::is_none"
1694    )]
1695    pub event_subscriptions: Option<AppsManifestExportResponseManifestSettingsEventSubscriptions>,
1696    #[serde(
1697        default,
1698        deserialize_with = "crate::de::opt_object",
1699        skip_serializing_if = "Option::is_none"
1700    )]
1701    pub interactivity: Option<AppsManifestExportResponseManifestSettingsInteractivity>,
1702    #[serde(
1703        default,
1704        deserialize_with = "crate::de::opt_bool",
1705        skip_serializing_if = "Option::is_none"
1706    )]
1707    pub org_deploy_enabled: Option<bool>,
1708    #[serde(
1709        default,
1710        deserialize_with = "crate::de::opt_bool",
1711        skip_serializing_if = "Option::is_none"
1712    )]
1713    pub socket_mode_enabled: Option<bool>,
1714    #[serde(
1715        default,
1716        deserialize_with = "crate::de::opt_bool",
1717        skip_serializing_if = "Option::is_none"
1718    )]
1719    pub is_hosted: Option<bool>,
1720    #[serde(
1721        default,
1722        deserialize_with = "crate::de::opt_bool",
1723        skip_serializing_if = "Option::is_none"
1724    )]
1725    pub token_rotation_enabled: Option<bool>,
1726}
1727
1728#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1729pub struct AppsManifestExportResponseManifestSettingsEventSubscriptions {
1730    #[serde(
1731        default,
1732        deserialize_with = "crate::de::vec",
1733        skip_serializing_if = "Vec::is_empty"
1734    )]
1735    pub bot_events: Vec<String>,
1736}
1737
1738#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1739pub struct AppsManifestExportResponseManifestSettingsInteractivity {
1740    #[serde(
1741        default,
1742        deserialize_with = "crate::de::opt_bool",
1743        skip_serializing_if = "Option::is_none"
1744    )]
1745    pub is_enabled: Option<bool>,
1746}
1747
1748/// Arguments for the Slack Web API method [`apps.manifest.update`](https://docs.slack.dev/reference/methods/apps.manifest.update): Update an app from an app manifest
1749///
1750/// Send it with [`SlackClient::apps_manifest_update`].
1751#[doc(alias = "apps.manifest.update")]
1752#[derive(Debug, Clone, PartialEq, Serialize)]
1753#[non_exhaustive]
1754pub struct AppsManifestUpdateRequest {
1755    /// A JSON app manifest encoded as a string. This manifest **must** use a valid [app manifest schema - read our guide to creating one](https://docs.slack.dev/app-manifests/configuring-apps-with-app-manifests.md#fields). As this method entirely _replaces_ any previous configuration, manifest must contain both unmodified and modified fields.
1756    pub manifest: String,
1757    /// The ID of the app whose configuration you want to update.
1758    pub app_id: String,
1759}
1760
1761impl AppsManifestUpdateRequest {
1762    pub fn new(manifest: impl Into<String>, app_id: impl Into<String>) -> Self {
1763        Self {
1764            manifest: manifest.into(),
1765            app_id: app_id.into(),
1766        }
1767    }
1768}
1769
1770impl SlackApiMethod for AppsManifestUpdateRequest {
1771    const METHOD: &'static str = "apps.manifest.update";
1772    type Response = AppsManifestUpdateResponse;
1773}
1774
1775/// Successful response of the Slack Web API method [`apps.manifest.update`](https://docs.slack.dev/reference/methods/apps.manifest.update).
1776#[doc(alias = "apps.manifest.update")]
1777#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1778pub struct AppsManifestUpdateResponse {
1779    #[serde(
1780        default,
1781        deserialize_with = "crate::de::opt_string",
1782        skip_serializing_if = "Option::is_none"
1783    )]
1784    pub app_id: Option<String>,
1785    #[serde(
1786        default,
1787        deserialize_with = "crate::de::opt_bool",
1788        skip_serializing_if = "Option::is_none"
1789    )]
1790    pub permissions_updated: Option<bool>,
1791    #[serde(
1792        default,
1793        deserialize_with = "crate::de::opt_object",
1794        skip_serializing_if = "Option::is_none"
1795    )]
1796    pub response_metadata: Option<ResponseMetadata>,
1797    #[serde(
1798        default,
1799        deserialize_with = "crate::de::opt_string",
1800        skip_serializing_if = "Option::is_none"
1801    )]
1802    pub warning: Option<String>,
1803}
1804
1805/// Arguments for the Slack Web API method [`apps.manifest.validate`](https://docs.slack.dev/reference/methods/apps.manifest.validate): Validate an app manifest
1806///
1807/// Send it with [`SlackClient::apps_manifest_validate`].
1808#[doc(alias = "apps.manifest.validate")]
1809#[derive(Debug, Clone, PartialEq, Serialize)]
1810#[non_exhaustive]
1811pub struct AppsManifestValidateRequest {
1812    /// The manifest to be validated. Will be validated against the [app manifest schema - read our guide](https://docs.slack.dev/app-manifests/configuring-apps-with-app-manifests.md#fields).
1813    pub manifest: String,
1814    /// The ID of the app whose configuration you want to validate.
1815    #[serde(skip_serializing_if = "Option::is_none")]
1816    pub app_id: Option<String>,
1817}
1818
1819impl AppsManifestValidateRequest {
1820    pub fn new(manifest: impl Into<String>) -> Self {
1821        Self {
1822            manifest: manifest.into(),
1823            app_id: None,
1824        }
1825    }
1826
1827    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
1828        self.app_id = Some(app_id.into());
1829        self
1830    }
1831}
1832
1833impl SlackApiMethod for AppsManifestValidateRequest {
1834    const METHOD: &'static str = "apps.manifest.validate";
1835    type Response = AppsManifestValidateResponse;
1836}
1837
1838/// Successful response of the Slack Web API method [`apps.manifest.validate`](https://docs.slack.dev/reference/methods/apps.manifest.validate).
1839#[doc(alias = "apps.manifest.validate")]
1840#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1841pub struct AppsManifestValidateResponse {
1842    #[serde(
1843        default,
1844        deserialize_with = "crate::de::vec",
1845        skip_serializing_if = "Vec::is_empty"
1846    )]
1847    pub errors: Vec<serde_json::Value>,
1848    #[serde(
1849        default,
1850        deserialize_with = "crate::de::opt_object",
1851        skip_serializing_if = "Option::is_none"
1852    )]
1853    pub response_metadata: Option<ResponseMetadata>,
1854    #[serde(
1855        default,
1856        deserialize_with = "crate::de::opt_string",
1857        skip_serializing_if = "Option::is_none"
1858    )]
1859    pub warning: Option<String>,
1860}
1861
1862/// Arguments for the Slack Web API method [`apps.uninstall`](https://docs.slack.dev/reference/methods/apps.uninstall): Uninstalls your app from a workspace.
1863///
1864/// Send it with [`SlackClient::apps_uninstall`].
1865#[doc(alias = "apps.uninstall")]
1866#[derive(Debug, Clone, PartialEq, Serialize)]
1867#[non_exhaustive]
1868pub struct AppsUninstallRequest {
1869    /// Issued when you created your application.
1870    pub client_id: String,
1871    /// Issued when you created your application.
1872    pub client_secret: String,
1873}
1874
1875impl AppsUninstallRequest {
1876    pub fn new(client_id: impl Into<String>, client_secret: impl Into<String>) -> Self {
1877        Self {
1878            client_id: client_id.into(),
1879            client_secret: client_secret.into(),
1880        }
1881    }
1882}
1883
1884impl SlackApiMethod for AppsUninstallRequest {
1885    const METHOD: &'static str = "apps.uninstall";
1886    type Response = AppsUninstallResponse;
1887}
1888
1889/// Successful response of the Slack Web API method [`apps.uninstall`](https://docs.slack.dev/reference/methods/apps.uninstall).
1890#[doc(alias = "apps.uninstall")]
1891#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1892pub struct AppsUninstallResponse {
1893    /// Fields returned by Slack. This method has no documented response example.
1894    #[serde(flatten)]
1895    pub extra: serde_json::Map<String, serde_json::Value>,
1896    #[serde(
1897        default,
1898        deserialize_with = "crate::de::opt_object",
1899        skip_serializing_if = "Option::is_none"
1900    )]
1901    pub response_metadata: Option<ResponseMetadata>,
1902    #[serde(
1903        default,
1904        deserialize_with = "crate::de::opt_string",
1905        skip_serializing_if = "Option::is_none"
1906    )]
1907    pub warning: Option<String>,
1908}
1909
1910/// Arguments for the Slack Web API method [`apps.user.connection.update`](https://docs.slack.dev/reference/methods/apps.user.connection.update): Updates the connection status between a user and an app.
1911///
1912/// Send it with [`SlackClient::apps_user_connection_update`].
1913#[doc(alias = "apps.user.connection.update")]
1914#[derive(Debug, Clone, PartialEq, Serialize)]
1915#[non_exhaustive]
1916pub struct AppsUserConnectionUpdateRequest {
1917    /// The ID of the user for the status update.
1918    pub user_id: String,
1919    /// The status that should be set for the user.
1920    pub status: String,
1921}
1922
1923impl AppsUserConnectionUpdateRequest {
1924    pub fn new(user_id: impl Into<String>, status: impl Into<String>) -> Self {
1925        Self {
1926            user_id: user_id.into(),
1927            status: status.into(),
1928        }
1929    }
1930}
1931
1932impl SlackApiMethod for AppsUserConnectionUpdateRequest {
1933    const METHOD: &'static str = "apps.user.connection.update";
1934    type Response = AppsUserConnectionUpdateResponse;
1935}
1936
1937/// Successful response of the Slack Web API method [`apps.user.connection.update`](https://docs.slack.dev/reference/methods/apps.user.connection.update).
1938#[doc(alias = "apps.user.connection.update")]
1939#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1940pub struct AppsUserConnectionUpdateResponse {
1941    /// Fields returned by Slack. This method has no documented response example.
1942    #[serde(flatten)]
1943    pub extra: serde_json::Map<String, serde_json::Value>,
1944    #[serde(
1945        default,
1946        deserialize_with = "crate::de::opt_object",
1947        skip_serializing_if = "Option::is_none"
1948    )]
1949    pub response_metadata: Option<ResponseMetadata>,
1950    #[serde(
1951        default,
1952        deserialize_with = "crate::de::opt_string",
1953        skip_serializing_if = "Option::is_none"
1954    )]
1955    pub warning: Option<String>,
1956}
1957
1958impl SlackClient {
1959    /// Calls the Slack Web API method [`apps.activities.list`](https://docs.slack.dev/reference/methods/apps.activities.list): Get logs for a specified app
1960    ///
1961    /// Required scopes:
1962    ///
1963    /// - user token: `hosting:read`
1964    ///
1965    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1966    ///
1967    /// # Errors
1968    ///
1969    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1970    #[doc(alias = "apps.activities.list")]
1971    pub async fn apps_activities_list(
1972        &self,
1973        request: &AppsActivitiesListRequest,
1974    ) -> Result<AppsActivitiesListResponse, SlackError> {
1975        self.call(request).await
1976    }
1977
1978    /// Calls the Slack Web API method [`apps.auth.external.delete`](https://docs.slack.dev/reference/methods/apps.auth.external.delete): Delete external auth tokens only on the Slack side
1979    ///
1980    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1981    ///
1982    /// # Errors
1983    ///
1984    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1985    #[doc(alias = "apps.auth.external.delete")]
1986    pub async fn apps_auth_external_delete(
1987        &self,
1988        request: &AppsAuthExternalDeleteRequest,
1989    ) -> Result<AppsAuthExternalDeleteResponse, SlackError> {
1990        self.call(request).await
1991    }
1992
1993    /// Calls the Slack Web API method [`apps.auth.external.get`](https://docs.slack.dev/reference/methods/apps.auth.external.get): Get the access token for the provided token ID
1994    ///
1995    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1996    ///
1997    /// # Errors
1998    ///
1999    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2000    #[doc(alias = "apps.auth.external.get")]
2001    pub async fn apps_auth_external_get(
2002        &self,
2003        request: &AppsAuthExternalGetRequest,
2004    ) -> Result<AppsAuthExternalGetResponse, SlackError> {
2005        self.call(request).await
2006    }
2007
2008    /// Calls the Slack Web API method [`apps.connections.open`](https://docs.slack.dev/reference/methods/apps.connections.open): Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over.
2009    ///
2010    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2011    ///
2012    /// # Errors
2013    ///
2014    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2015    #[doc(alias = "apps.connections.open")]
2016    pub async fn apps_connections_open(
2017        &self,
2018        request: &AppsConnectionsOpenRequest,
2019    ) -> Result<AppsConnectionsOpenResponse, SlackError> {
2020        self.call(request).await
2021    }
2022
2023    /// Calls the Slack Web API method [`apps.datastore.bulkDelete`](https://docs.slack.dev/reference/methods/apps.datastore.bulkDelete): Delete items from a datastore in bulk
2024    ///
2025    /// Required scopes:
2026    ///
2027    /// - bot token: `datastore:write`
2028    ///
2029    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2030    ///
2031    /// # Errors
2032    ///
2033    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2034    #[doc(alias = "apps.datastore.bulkDelete")]
2035    pub async fn apps_datastore_bulk_delete(
2036        &self,
2037        request: &AppsDatastoreBulkDeleteRequest,
2038    ) -> Result<AppsDatastoreBulkDeleteResponse, SlackError> {
2039        self.call(request).await
2040    }
2041
2042    /// Calls the Slack Web API method [`apps.datastore.bulkGet`](https://docs.slack.dev/reference/methods/apps.datastore.bulkGet): Get items from a datastore in bulk
2043    ///
2044    /// Required scopes:
2045    ///
2046    /// - bot token: `datastore:read`
2047    ///
2048    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2049    ///
2050    /// # Errors
2051    ///
2052    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2053    #[doc(alias = "apps.datastore.bulkGet")]
2054    pub async fn apps_datastore_bulk_get(
2055        &self,
2056        request: &AppsDatastoreBulkGetRequest,
2057    ) -> Result<AppsDatastoreBulkGetResponse, SlackError> {
2058        self.call(request).await
2059    }
2060
2061    /// Calls the Slack Web API method [`apps.datastore.bulkPut`](https://docs.slack.dev/reference/methods/apps.datastore.bulkPut): Creates or replaces existing items in bulk
2062    ///
2063    /// Required scopes:
2064    ///
2065    /// - bot token: `datastore:write`
2066    ///
2067    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2068    ///
2069    /// # Errors
2070    ///
2071    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2072    #[doc(alias = "apps.datastore.bulkPut")]
2073    pub async fn apps_datastore_bulk_put(
2074        &self,
2075        request: &AppsDatastoreBulkPutRequest,
2076    ) -> Result<AppsDatastoreBulkPutResponse, SlackError> {
2077        self.call(request).await
2078    }
2079
2080    /// Calls the Slack Web API method [`apps.datastore.count`](https://docs.slack.dev/reference/methods/apps.datastore.count): Count the number of items in a datastore that match a query
2081    ///
2082    /// Required scopes:
2083    ///
2084    /// - bot token: `datastore:read`
2085    ///
2086    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2087    ///
2088    /// # Errors
2089    ///
2090    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2091    #[doc(alias = "apps.datastore.count")]
2092    pub async fn apps_datastore_count(
2093        &self,
2094        request: &AppsDatastoreCountRequest,
2095    ) -> Result<AppsDatastoreCountResponse, SlackError> {
2096        self.call(request).await
2097    }
2098
2099    /// Calls the Slack Web API method [`apps.datastore.delete`](https://docs.slack.dev/reference/methods/apps.datastore.delete): Delete an item from a datastore
2100    ///
2101    /// Required scopes:
2102    ///
2103    /// - bot token: `datastore:write`
2104    ///
2105    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2106    ///
2107    /// # Errors
2108    ///
2109    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2110    #[doc(alias = "apps.datastore.delete")]
2111    pub async fn apps_datastore_delete(
2112        &self,
2113        request: &AppsDatastoreDeleteRequest,
2114    ) -> Result<AppsDatastoreDeleteResponse, SlackError> {
2115        self.call(request).await
2116    }
2117
2118    /// Calls the Slack Web API method [`apps.datastore.get`](https://docs.slack.dev/reference/methods/apps.datastore.get): Get an item from a datastore
2119    ///
2120    /// Required scopes:
2121    ///
2122    /// - bot token: `datastore:read`
2123    ///
2124    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2125    ///
2126    /// # Errors
2127    ///
2128    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2129    #[doc(alias = "apps.datastore.get")]
2130    pub async fn apps_datastore_get(
2131        &self,
2132        request: &AppsDatastoreGetRequest,
2133    ) -> Result<AppsDatastoreGetResponse, SlackError> {
2134        self.call(request).await
2135    }
2136
2137    /// Calls the Slack Web API method [`apps.datastore.put`](https://docs.slack.dev/reference/methods/apps.datastore.put): Creates a new item, or replaces an old item with a new item.
2138    ///
2139    /// Required scopes:
2140    ///
2141    /// - bot token: `datastore:write`
2142    ///
2143    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2144    ///
2145    /// # Errors
2146    ///
2147    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2148    #[doc(alias = "apps.datastore.put")]
2149    pub async fn apps_datastore_put(
2150        &self,
2151        request: &AppsDatastorePutRequest,
2152    ) -> Result<AppsDatastorePutResponse, SlackError> {
2153        self.call(request).await
2154    }
2155
2156    /// Calls the Slack Web API method [`apps.datastore.query`](https://docs.slack.dev/reference/methods/apps.datastore.query): Query a datastore for items
2157    ///
2158    /// Required scopes:
2159    ///
2160    /// - bot token: `datastore:read`
2161    ///
2162    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2163    ///
2164    /// # Errors
2165    ///
2166    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2167    #[doc(alias = "apps.datastore.query")]
2168    pub async fn apps_datastore_query(
2169        &self,
2170        request: &AppsDatastoreQueryRequest,
2171    ) -> Result<AppsDatastoreQueryResponse, SlackError> {
2172        self.call(request).await
2173    }
2174
2175    /// Calls the Slack Web API method [`apps.datastore.update`](https://docs.slack.dev/reference/methods/apps.datastore.update): Edits an existing item's attributes, or adds a new item if it does not already exist.
2176    ///
2177    /// Required scopes:
2178    ///
2179    /// - bot token: `datastore:write`
2180    ///
2181    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2182    ///
2183    /// # Errors
2184    ///
2185    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2186    #[doc(alias = "apps.datastore.update")]
2187    pub async fn apps_datastore_update(
2188        &self,
2189        request: &AppsDatastoreUpdateRequest,
2190    ) -> Result<AppsDatastoreUpdateResponse, SlackError> {
2191        self.call(request).await
2192    }
2193
2194    /// Calls the Slack Web API method [`apps.event.authorizations.list`](https://docs.slack.dev/reference/methods/apps.event.authorizations.list): Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.
2195    ///
2196    /// Rate limit: Tier 5 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2197    ///
2198    /// # Errors
2199    ///
2200    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2201    #[doc(alias = "apps.event.authorizations.list")]
2202    pub async fn apps_event_authorizations_list(
2203        &self,
2204        request: &AppsEventAuthorizationsListRequest,
2205    ) -> Result<AppsEventAuthorizationsListResponse, SlackError> {
2206        self.call(request).await
2207    }
2208
2209    /// Calls the Slack Web API method [`apps.icon.set`](https://docs.slack.dev/reference/methods/apps.icon.set): Sets the app icon
2210    ///
2211    /// Required scopes:
2212    ///
2213    /// - user token: `app_configurations:write`
2214    ///
2215    /// Rate limit: Tier 1 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2216    ///
2217    /// # Errors
2218    ///
2219    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2220    #[doc(alias = "apps.icon.set")]
2221    pub async fn apps_icon_set(
2222        &self,
2223        request: &AppsIconSetRequest,
2224    ) -> Result<AppsIconSetResponse, SlackError> {
2225        self.call(request).await
2226    }
2227
2228    /// Calls the Slack Web API method [`apps.managed.permissions.set`](https://docs.slack.dev/reference/methods/apps.managed.permissions.set): Set who can interact with a managed app
2229    ///
2230    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2231    ///
2232    /// # Errors
2233    ///
2234    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2235    #[doc(alias = "apps.managed.permissions.set")]
2236    pub async fn apps_managed_permissions_set(
2237        &self,
2238        request: &AppsManagedPermissionsSetRequest,
2239    ) -> Result<AppsManagedPermissionsSetResponse, SlackError> {
2240        self.call(request).await
2241    }
2242
2243    /// Calls the Slack Web API method [`apps.manifest.create`](https://docs.slack.dev/reference/methods/apps.manifest.create): Create an app from an app manifest.
2244    ///
2245    /// Rate limit: Tier 1 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2246    ///
2247    /// # Errors
2248    ///
2249    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2250    #[doc(alias = "apps.manifest.create")]
2251    pub async fn apps_manifest_create(
2252        &self,
2253        request: &AppsManifestCreateRequest,
2254    ) -> Result<AppsManifestCreateResponse, SlackError> {
2255        self.call(request).await
2256    }
2257
2258    /// Calls the Slack Web API method [`apps.manifest.delete`](https://docs.slack.dev/reference/methods/apps.manifest.delete): Permanently deletes an app created through app manifests
2259    ///
2260    /// Rate limit: Tier 1 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2261    ///
2262    /// # Errors
2263    ///
2264    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2265    #[doc(alias = "apps.manifest.delete")]
2266    pub async fn apps_manifest_delete(
2267        &self,
2268        request: &AppsManifestDeleteRequest,
2269    ) -> Result<AppsManifestDeleteResponse, SlackError> {
2270        self.call(request).await
2271    }
2272
2273    /// Calls the Slack Web API method [`apps.manifest.export`](https://docs.slack.dev/reference/methods/apps.manifest.export): Export an app manifest from an existing app
2274    ///
2275    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2276    ///
2277    /// # Errors
2278    ///
2279    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2280    #[doc(alias = "apps.manifest.export")]
2281    pub async fn apps_manifest_export(
2282        &self,
2283        request: &AppsManifestExportRequest,
2284    ) -> Result<AppsManifestExportResponse, SlackError> {
2285        self.call(request).await
2286    }
2287
2288    /// Calls the Slack Web API method [`apps.manifest.update`](https://docs.slack.dev/reference/methods/apps.manifest.update): Update an app from an app manifest
2289    ///
2290    /// Rate limit: Tier 1 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2291    ///
2292    /// # Errors
2293    ///
2294    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2295    #[doc(alias = "apps.manifest.update")]
2296    pub async fn apps_manifest_update(
2297        &self,
2298        request: &AppsManifestUpdateRequest,
2299    ) -> Result<AppsManifestUpdateResponse, SlackError> {
2300        self.call(request).await
2301    }
2302
2303    /// Calls the Slack Web API method [`apps.manifest.validate`](https://docs.slack.dev/reference/methods/apps.manifest.validate): Validate an app manifest
2304    ///
2305    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2306    ///
2307    /// # Errors
2308    ///
2309    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2310    #[doc(alias = "apps.manifest.validate")]
2311    pub async fn apps_manifest_validate(
2312        &self,
2313        request: &AppsManifestValidateRequest,
2314    ) -> Result<AppsManifestValidateResponse, SlackError> {
2315        self.call(request).await
2316    }
2317
2318    /// Calls the Slack Web API method [`apps.uninstall`](https://docs.slack.dev/reference/methods/apps.uninstall): Uninstalls your app from a workspace.
2319    ///
2320    /// Rate limit: Tier 1 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2321    ///
2322    /// # Errors
2323    ///
2324    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2325    #[doc(alias = "apps.uninstall")]
2326    pub async fn apps_uninstall(
2327        &self,
2328        request: &AppsUninstallRequest,
2329    ) -> Result<AppsUninstallResponse, SlackError> {
2330        self.call(request).await
2331    }
2332
2333    /// Calls the Slack Web API method [`apps.user.connection.update`](https://docs.slack.dev/reference/methods/apps.user.connection.update): Updates the connection status between a user and an app.
2334    ///
2335    /// Required scopes:
2336    ///
2337    /// - user token: `users:write`
2338    ///
2339    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
2340    ///
2341    /// # Errors
2342    ///
2343    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
2344    #[doc(alias = "apps.user.connection.update")]
2345    pub async fn apps_user_connection_update(
2346        &self,
2347        request: &AppsUserConnectionUpdateRequest,
2348    ) -> Result<AppsUserConnectionUpdateResponse, SlackError> {
2349        self.call(request).await
2350    }
2351}