Skip to main content

slack_web_api/api/
files.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 [`files.comments.delete`](https://docs.slack.dev/reference/methods/files.comments.delete): Deletes an existing comment on a file.
12///
13/// Send it with [`SlackClient::files_comments_delete`].
14#[doc(alias = "files.comments.delete")]
15#[derive(Debug, Clone, PartialEq, Serialize)]
16#[non_exhaustive]
17pub struct FilesCommentsDeleteRequest {
18    /// File to delete a comment from.
19    pub file: String,
20    /// The comment to delete.
21    pub id: String,
22}
23
24impl FilesCommentsDeleteRequest {
25    pub fn new(file: impl Into<String>, id: impl Into<String>) -> Self {
26        Self {
27            file: file.into(),
28            id: id.into(),
29        }
30    }
31}
32
33impl SlackApiMethod for FilesCommentsDeleteRequest {
34    const METHOD: &'static str = "files.comments.delete";
35    type Response = FilesCommentsDeleteResponse;
36}
37
38/// Successful response of the Slack Web API method [`files.comments.delete`](https://docs.slack.dev/reference/methods/files.comments.delete).
39#[doc(alias = "files.comments.delete")]
40#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
41pub struct FilesCommentsDeleteResponse {
42    /// Fields returned by Slack. This method has no documented response example.
43    #[serde(flatten)]
44    pub extra: serde_json::Map<String, serde_json::Value>,
45    #[serde(
46        default,
47        deserialize_with = "crate::de::opt_object",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub response_metadata: Option<ResponseMetadata>,
51    #[serde(
52        default,
53        deserialize_with = "crate::de::opt_string",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub warning: Option<String>,
57}
58
59/// Arguments for the Slack Web API method [`files.completeUploadExternal`](https://docs.slack.dev/reference/methods/files.completeUploadExternal): Finishes an upload started with files.getUploadURLExternal
60///
61/// Send it with [`SlackClient::files_complete_upload_external`].
62#[doc(alias = "files.completeUploadExternal")]
63#[derive(Debug, Clone, PartialEq, Serialize)]
64#[non_exhaustive]
65pub struct FilesCompleteUploadExternalRequest {
66    /// Array of file ids and their corresponding (optional) titles.
67    #[serde(serialize_with = "crate::form::as_json")]
68    pub files: Vec<serde_json::Value>,
69    /// Channel ID where the file will be shared. If not specified the file will be private.
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub channel_id: Option<String>,
72    /// Provide another message's `ts` value to upload this file as a reply. Never use a reply's `ts` value; use its parent instead. Also make sure to provide only one channel when using 'thread\_ts'
73    #[serde(skip_serializing_if = "Option::is_none")]
74    pub thread_ts: Option<String>,
75    /// Comma-separated string of channel IDs or user IDs where the file will be shared.
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub channels: Option<String>,
78    /// The message text introducing the file in specified channels.
79    #[serde(skip_serializing_if = "Option::is_none")]
80    pub initial_comment: Option<String>,
81    /// A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the `initial_comment` field is provided, the `blocks` field is ignored
82    #[serde(
83        skip_serializing_if = "Option::is_none",
84        serialize_with = "crate::form::as_json"
85    )]
86    pub blocks: Option<Vec<crate::blocks::Block>>,
87    /// Set your bot's user name for the file share message. Requires the [`chat:write.customize`](https://docs.slack.dev/reference/scopes/chat.write.customize.md) scope.
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub username: Option<String>,
90    /// URL to an image to use as the icon for the file share message. Requires the [`chat:write.customize`](https://docs.slack.dev/reference/scopes/chat.write.customize.md) scope.
91    #[serde(skip_serializing_if = "Option::is_none")]
92    pub icon_url: Option<String>,
93    /// Emoji to use as the icon for the file share message. Overrides `icon_url`. Requires the [`chat:write.customize`](https://docs.slack.dev/reference/scopes/chat.write.customize.md) scope.
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub icon_emoji: Option<String>,
96}
97
98impl FilesCompleteUploadExternalRequest {
99    pub fn new(files: Vec<serde_json::Value>) -> Self {
100        Self {
101            files,
102            channel_id: None,
103            thread_ts: None,
104            channels: None,
105            initial_comment: None,
106            blocks: None,
107            username: None,
108            icon_url: None,
109            icon_emoji: None,
110        }
111    }
112
113    pub fn channel_id(mut self, channel_id: impl Into<String>) -> Self {
114        self.channel_id = Some(channel_id.into());
115        self
116    }
117
118    pub fn thread_ts(mut self, thread_ts: impl Into<String>) -> Self {
119        self.thread_ts = Some(thread_ts.into());
120        self
121    }
122
123    pub fn channels(mut self, channels: impl Into<String>) -> Self {
124        self.channels = Some(channels.into());
125        self
126    }
127
128    pub fn initial_comment(mut self, initial_comment: impl Into<String>) -> Self {
129        self.initial_comment = Some(initial_comment.into());
130        self
131    }
132
133    pub fn blocks(mut self, blocks: Vec<crate::blocks::Block>) -> Self {
134        self.blocks = Some(blocks);
135        self
136    }
137
138    pub fn username(mut self, username: impl Into<String>) -> Self {
139        self.username = Some(username.into());
140        self
141    }
142
143    pub fn icon_url(mut self, icon_url: impl Into<String>) -> Self {
144        self.icon_url = Some(icon_url.into());
145        self
146    }
147
148    pub fn icon_emoji(mut self, icon_emoji: impl Into<String>) -> Self {
149        self.icon_emoji = Some(icon_emoji.into());
150        self
151    }
152}
153
154impl SlackApiMethod for FilesCompleteUploadExternalRequest {
155    const METHOD: &'static str = "files.completeUploadExternal";
156    type Response = FilesCompleteUploadExternalResponse;
157}
158
159/// Successful response of the Slack Web API method [`files.completeUploadExternal`](https://docs.slack.dev/reference/methods/files.completeUploadExternal).
160#[doc(alias = "files.completeUploadExternal")]
161#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
162pub struct FilesCompleteUploadExternalResponse {
163    #[serde(
164        default,
165        deserialize_with = "crate::de::vec",
166        skip_serializing_if = "Vec::is_empty"
167    )]
168    pub files: Vec<FilesCompleteUploadExternalResponseFiles>,
169    #[serde(
170        default,
171        deserialize_with = "crate::de::opt_object",
172        skip_serializing_if = "Option::is_none"
173    )]
174    pub response_metadata: Option<ResponseMetadata>,
175    #[serde(
176        default,
177        deserialize_with = "crate::de::opt_string",
178        skip_serializing_if = "Option::is_none"
179    )]
180    pub warning: Option<String>,
181}
182
183#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
184pub struct FilesCompleteUploadExternalResponseFiles {
185    #[serde(
186        default,
187        deserialize_with = "crate::de::opt_string",
188        skip_serializing_if = "Option::is_none"
189    )]
190    pub id: Option<String>,
191    #[serde(
192        default,
193        deserialize_with = "crate::de::opt_string",
194        skip_serializing_if = "Option::is_none"
195    )]
196    pub title: Option<String>,
197}
198
199/// Arguments for the Slack Web API method [`files.delete`](https://docs.slack.dev/reference/methods/files.delete): Deletes a file.
200///
201/// Send it with [`SlackClient::files_delete`].
202#[doc(alias = "files.delete")]
203#[derive(Debug, Clone, PartialEq, Serialize)]
204#[non_exhaustive]
205pub struct FilesDeleteRequest {
206    /// ID of file to delete.
207    pub file: String,
208}
209
210impl FilesDeleteRequest {
211    pub fn new(file: impl Into<String>) -> Self {
212        Self { file: file.into() }
213    }
214}
215
216impl SlackApiMethod for FilesDeleteRequest {
217    const METHOD: &'static str = "files.delete";
218    type Response = FilesDeleteResponse;
219}
220
221/// Successful response of the Slack Web API method [`files.delete`](https://docs.slack.dev/reference/methods/files.delete).
222#[doc(alias = "files.delete")]
223#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
224pub struct FilesDeleteResponse {
225    /// Fields returned by Slack. This method has no documented response example.
226    #[serde(flatten)]
227    pub extra: serde_json::Map<String, serde_json::Value>,
228    #[serde(
229        default,
230        deserialize_with = "crate::de::opt_object",
231        skip_serializing_if = "Option::is_none"
232    )]
233    pub response_metadata: Option<ResponseMetadata>,
234    #[serde(
235        default,
236        deserialize_with = "crate::de::opt_string",
237        skip_serializing_if = "Option::is_none"
238    )]
239    pub warning: Option<String>,
240}
241
242/// Arguments for the Slack Web API method [`files.getUploadURLExternal`](https://docs.slack.dev/reference/methods/files.getUploadURLExternal): Gets a URL for an edge external file upload
243///
244/// Send it with [`SlackClient::files_get_upload_url_external`].
245#[doc(alias = "files.getUploadURLExternal")]
246#[derive(Debug, Clone, PartialEq, Serialize)]
247#[non_exhaustive]
248pub struct FilesGetUploadUrlExternalRequest {
249    /// Size in bytes of the file being uploaded.
250    pub length: i64,
251    /// Name of the file being uploaded.
252    pub filename: String,
253    /// Syntax type of the snippet being uploaded.
254    #[serde(skip_serializing_if = "Option::is_none")]
255    pub snippet_type: Option<String>,
256    /// Description of image for screen-reader.
257    #[serde(skip_serializing_if = "Option::is_none")]
258    pub alt_txt: Option<String>,
259}
260
261impl FilesGetUploadUrlExternalRequest {
262    pub fn new(length: i64, filename: impl Into<String>) -> Self {
263        Self {
264            length,
265            filename: filename.into(),
266            snippet_type: None,
267            alt_txt: None,
268        }
269    }
270
271    pub fn snippet_type(mut self, snippet_type: impl Into<String>) -> Self {
272        self.snippet_type = Some(snippet_type.into());
273        self
274    }
275
276    pub fn alt_txt(mut self, alt_txt: impl Into<String>) -> Self {
277        self.alt_txt = Some(alt_txt.into());
278        self
279    }
280}
281
282impl SlackApiMethod for FilesGetUploadUrlExternalRequest {
283    const METHOD: &'static str = "files.getUploadURLExternal";
284    type Response = FilesGetUploadUrlExternalResponse;
285}
286
287/// Successful response of the Slack Web API method [`files.getUploadURLExternal`](https://docs.slack.dev/reference/methods/files.getUploadURLExternal).
288#[doc(alias = "files.getUploadURLExternal")]
289#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
290pub struct FilesGetUploadUrlExternalResponse {
291    #[serde(
292        default,
293        deserialize_with = "crate::de::opt_string",
294        skip_serializing_if = "Option::is_none"
295    )]
296    pub upload_url: Option<String>,
297    #[serde(
298        default,
299        deserialize_with = "crate::de::opt_string",
300        skip_serializing_if = "Option::is_none"
301    )]
302    pub file_id: Option<String>,
303    #[serde(
304        default,
305        deserialize_with = "crate::de::opt_object",
306        skip_serializing_if = "Option::is_none"
307    )]
308    pub response_metadata: Option<ResponseMetadata>,
309    #[serde(
310        default,
311        deserialize_with = "crate::de::opt_string",
312        skip_serializing_if = "Option::is_none"
313    )]
314    pub warning: Option<String>,
315}
316
317/// Arguments for the Slack Web API method [`files.info`](https://docs.slack.dev/reference/methods/files.info): Gets information about a file.
318///
319/// Send it with [`SlackClient::files_info`].
320#[doc(alias = "files.info")]
321#[derive(Debug, Clone, PartialEq, Serialize)]
322#[non_exhaustive]
323pub struct FilesInfoRequest {
324    /// Specify a file by providing its ID.
325    pub file: String,
326    #[serde(skip_serializing_if = "Option::is_none")]
327    pub count: Option<i64>,
328    /// Parameter for pagination. File comments are paginated for a single file. Set `cursor` equal to the `next_cursor` attribute returned by the previous request's `response_metadata`. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection of comments. See [pagination](https://docs.slack.dev/apis/web-api/pagination.md) for more details.
329    #[serde(skip_serializing_if = "Option::is_none")]
330    pub cursor: Option<String>,
331    /// The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.
332    #[serde(skip_serializing_if = "Option::is_none")]
333    pub limit: Option<i64>,
334    #[serde(skip_serializing_if = "Option::is_none")]
335    pub page: Option<i64>,
336}
337
338impl FilesInfoRequest {
339    pub fn new(file: impl Into<String>) -> Self {
340        Self {
341            file: file.into(),
342            count: None,
343            cursor: None,
344            limit: None,
345            page: None,
346        }
347    }
348
349    pub fn count(mut self, count: i64) -> Self {
350        self.count = Some(count);
351        self
352    }
353
354    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
355        self.cursor = Some(cursor.into());
356        self
357    }
358
359    pub fn limit(mut self, limit: i64) -> Self {
360        self.limit = Some(limit);
361        self
362    }
363
364    pub fn page(mut self, page: i64) -> Self {
365        self.page = Some(page);
366        self
367    }
368}
369
370impl SlackApiMethod for FilesInfoRequest {
371    const METHOD: &'static str = "files.info";
372    type Response = FilesInfoResponse;
373}
374
375impl CursorPaginated for FilesInfoRequest {
376    fn set_cursor(&mut self, cursor: String) {
377        self.cursor = Some(cursor);
378    }
379}
380
381impl NextCursor for FilesInfoResponse {
382    fn next_cursor(&self) -> Option<&str> {
383        self.response_metadata.as_ref()?.next_cursor.as_deref()
384    }
385}
386
387/// Successful response of the Slack Web API method [`files.info`](https://docs.slack.dev/reference/methods/files.info).
388#[doc(alias = "files.info")]
389#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
390pub struct FilesInfoResponse {
391    #[serde(
392        default,
393        deserialize_with = "crate::de::opt_object",
394        skip_serializing_if = "Option::is_none"
395    )]
396    pub file: Option<File>,
397    #[serde(
398        default,
399        deserialize_with = "crate::de::vec",
400        skip_serializing_if = "Vec::is_empty"
401    )]
402    pub comments: Vec<serde_json::Value>,
403    #[serde(
404        default,
405        deserialize_with = "crate::de::opt_object",
406        skip_serializing_if = "Option::is_none"
407    )]
408    pub response_metadata: Option<ResponseMetadata>,
409    #[serde(
410        default,
411        deserialize_with = "crate::de::opt_string",
412        skip_serializing_if = "Option::is_none"
413    )]
414    pub warning: Option<String>,
415}
416
417/// Arguments for the Slack Web API method [`files.list`](https://docs.slack.dev/reference/methods/files.list): List for a team, in a channel, or from a user with applied filters.
418///
419/// Send it with [`SlackClient::files_list`].
420#[doc(alias = "files.list")]
421#[derive(Debug, Clone, PartialEq, Serialize, Default)]
422#[non_exhaustive]
423pub struct FilesListRequest {
424    /// Filter files appearing in a specific channel, indicated by its ID.
425    #[serde(skip_serializing_if = "Option::is_none")]
426    pub channel: Option<String>,
427    #[serde(skip_serializing_if = "Option::is_none")]
428    pub count: Option<i64>,
429    #[serde(skip_serializing_if = "Option::is_none")]
430    pub page: Option<i64>,
431    /// Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.
432    #[serde(skip_serializing_if = "Option::is_none")]
433    pub show_files_hidden_by_limit: Option<bool>,
434    /// encoded team id to list files in, required if org token is used
435    #[serde(skip_serializing_if = "Option::is_none")]
436    pub team_id: Option<String>,
437    /// Filter files created after this timestamp (inclusive).
438    #[serde(skip_serializing_if = "Option::is_none")]
439    pub ts_from: Option<String>,
440    /// Filter files created before this timestamp (inclusive).
441    #[serde(skip_serializing_if = "Option::is_none")]
442    pub ts_to: Option<String>,
443    /// Filter files by type ([see below](#file_types)). You can pass multiple values in the types argument, like `types=spaces,snippets`.The default value is `all`, which does not filter the list.
444    #[serde(skip_serializing_if = "Option::is_none")]
445    pub types: Option<String>,
446    /// Filter files created by a single user.
447    #[serde(skip_serializing_if = "Option::is_none")]
448    pub user: Option<String>,
449}
450
451impl FilesListRequest {
452    pub fn new() -> Self {
453        Self {
454            channel: None,
455            count: None,
456            page: None,
457            show_files_hidden_by_limit: None,
458            team_id: None,
459            ts_from: None,
460            ts_to: None,
461            types: None,
462            user: None,
463        }
464    }
465
466    pub fn channel(mut self, channel: impl Into<String>) -> Self {
467        self.channel = Some(channel.into());
468        self
469    }
470
471    pub fn count(mut self, count: i64) -> Self {
472        self.count = Some(count);
473        self
474    }
475
476    pub fn page(mut self, page: i64) -> Self {
477        self.page = Some(page);
478        self
479    }
480
481    pub fn show_files_hidden_by_limit(mut self, show_files_hidden_by_limit: bool) -> Self {
482        self.show_files_hidden_by_limit = Some(show_files_hidden_by_limit);
483        self
484    }
485
486    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
487        self.team_id = Some(team_id.into());
488        self
489    }
490
491    pub fn ts_from(mut self, ts_from: impl Into<String>) -> Self {
492        self.ts_from = Some(ts_from.into());
493        self
494    }
495
496    pub fn ts_to(mut self, ts_to: impl Into<String>) -> Self {
497        self.ts_to = Some(ts_to.into());
498        self
499    }
500
501    pub fn types(mut self, types: impl Into<String>) -> Self {
502        self.types = Some(types.into());
503        self
504    }
505
506    pub fn user(mut self, user: impl Into<String>) -> Self {
507        self.user = Some(user.into());
508        self
509    }
510}
511
512impl SlackApiMethod for FilesListRequest {
513    const METHOD: &'static str = "files.list";
514    type Response = FilesListResponse;
515}
516
517/// Successful response of the Slack Web API method [`files.list`](https://docs.slack.dev/reference/methods/files.list).
518#[doc(alias = "files.list")]
519#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
520pub struct FilesListResponse {
521    #[serde(
522        default,
523        deserialize_with = "crate::de::vec",
524        skip_serializing_if = "Vec::is_empty"
525    )]
526    pub files: Vec<File>,
527    #[serde(
528        default,
529        deserialize_with = "crate::de::opt_object",
530        skip_serializing_if = "Option::is_none"
531    )]
532    pub paging: Option<FilesListResponsePaging>,
533    #[serde(
534        default,
535        deserialize_with = "crate::de::opt_object",
536        skip_serializing_if = "Option::is_none"
537    )]
538    pub response_metadata: Option<ResponseMetadata>,
539    #[serde(
540        default,
541        deserialize_with = "crate::de::opt_string",
542        skip_serializing_if = "Option::is_none"
543    )]
544    pub warning: Option<String>,
545}
546
547#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
548pub struct FilesListResponsePaging {
549    #[serde(
550        default,
551        deserialize_with = "crate::de::opt_i64",
552        skip_serializing_if = "Option::is_none"
553    )]
554    pub count: Option<i64>,
555    #[serde(
556        default,
557        deserialize_with = "crate::de::opt_i64",
558        skip_serializing_if = "Option::is_none"
559    )]
560    pub total: Option<i64>,
561    #[serde(
562        default,
563        deserialize_with = "crate::de::opt_i64",
564        skip_serializing_if = "Option::is_none"
565    )]
566    pub page: Option<i64>,
567    #[serde(
568        default,
569        deserialize_with = "crate::de::opt_i64",
570        skip_serializing_if = "Option::is_none"
571    )]
572    pub pages: Option<i64>,
573}
574
575/// Arguments for the Slack Web API method [`files.remote.add`](https://docs.slack.dev/reference/methods/files.remote.add): Adds a file from a remote service
576///
577/// Send it with [`SlackClient::files_remote_add`].
578#[doc(alias = "files.remote.add")]
579#[derive(Debug, Clone, PartialEq, Serialize)]
580#[non_exhaustive]
581pub struct FilesRemoteAddRequest {
582    /// Creator defined GUID for the file.
583    pub external_id: String,
584    /// URL of the remote file.
585    pub external_url: String,
586    /// Title of the file being shared.
587    pub title: String,
588    /// type of file
589    #[serde(skip_serializing_if = "Option::is_none")]
590    pub filetype: Option<String>,
591    /// A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file.
592    #[serde(skip_serializing_if = "Option::is_none")]
593    pub indexable_file_contents: Option<String>,
594    /// Preview of the document via `multipart/form-data`.
595    #[serde(skip_serializing_if = "Option::is_none")]
596    pub preview_image: Option<String>,
597}
598
599impl FilesRemoteAddRequest {
600    pub fn new(
601        external_id: impl Into<String>,
602        external_url: impl Into<String>,
603        title: impl Into<String>,
604    ) -> Self {
605        Self {
606            external_id: external_id.into(),
607            external_url: external_url.into(),
608            title: title.into(),
609            filetype: None,
610            indexable_file_contents: None,
611            preview_image: None,
612        }
613    }
614
615    pub fn filetype(mut self, filetype: impl Into<String>) -> Self {
616        self.filetype = Some(filetype.into());
617        self
618    }
619
620    pub fn indexable_file_contents(mut self, indexable_file_contents: impl Into<String>) -> Self {
621        self.indexable_file_contents = Some(indexable_file_contents.into());
622        self
623    }
624
625    pub fn preview_image(mut self, preview_image: impl Into<String>) -> Self {
626        self.preview_image = Some(preview_image.into());
627        self
628    }
629}
630
631impl SlackApiMethod for FilesRemoteAddRequest {
632    const METHOD: &'static str = "files.remote.add";
633    type Response = FilesRemoteAddResponse;
634}
635
636/// Successful response of the Slack Web API method [`files.remote.add`](https://docs.slack.dev/reference/methods/files.remote.add).
637#[doc(alias = "files.remote.add")]
638#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
639pub struct FilesRemoteAddResponse {
640    #[serde(
641        default,
642        deserialize_with = "crate::de::opt_object",
643        skip_serializing_if = "Option::is_none"
644    )]
645    pub file: Option<File>,
646    #[serde(
647        default,
648        deserialize_with = "crate::de::opt_object",
649        skip_serializing_if = "Option::is_none"
650    )]
651    pub response_metadata: Option<ResponseMetadata>,
652    #[serde(
653        default,
654        deserialize_with = "crate::de::opt_string",
655        skip_serializing_if = "Option::is_none"
656    )]
657    pub warning: Option<String>,
658}
659
660/// Arguments for the Slack Web API method [`files.remote.info`](https://docs.slack.dev/reference/methods/files.remote.info): Retrieve information about a remote file added to Slack
661///
662/// Send it with [`SlackClient::files_remote_info`].
663#[doc(alias = "files.remote.info")]
664#[derive(Debug, Clone, PartialEq, Serialize, Default)]
665#[non_exhaustive]
666pub struct FilesRemoteInfoRequest {
667    /// Creator defined GUID for the file.
668    #[serde(skip_serializing_if = "Option::is_none")]
669    pub external_id: Option<String>,
670    /// Specify a file by providing its ID.
671    #[serde(skip_serializing_if = "Option::is_none")]
672    pub file: Option<String>,
673}
674
675impl FilesRemoteInfoRequest {
676    pub fn new() -> Self {
677        Self {
678            external_id: None,
679            file: None,
680        }
681    }
682
683    pub fn external_id(mut self, external_id: impl Into<String>) -> Self {
684        self.external_id = Some(external_id.into());
685        self
686    }
687
688    pub fn file(mut self, file: impl Into<String>) -> Self {
689        self.file = Some(file.into());
690        self
691    }
692}
693
694impl SlackApiMethod for FilesRemoteInfoRequest {
695    const METHOD: &'static str = "files.remote.info";
696    type Response = FilesRemoteInfoResponse;
697}
698
699/// Successful response of the Slack Web API method [`files.remote.info`](https://docs.slack.dev/reference/methods/files.remote.info).
700#[doc(alias = "files.remote.info")]
701#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
702pub struct FilesRemoteInfoResponse {
703    #[serde(
704        default,
705        deserialize_with = "crate::de::opt_object",
706        skip_serializing_if = "Option::is_none"
707    )]
708    pub file: Option<File>,
709    #[serde(
710        default,
711        deserialize_with = "crate::de::opt_object",
712        skip_serializing_if = "Option::is_none"
713    )]
714    pub response_metadata: Option<ResponseMetadata>,
715    #[serde(
716        default,
717        deserialize_with = "crate::de::opt_string",
718        skip_serializing_if = "Option::is_none"
719    )]
720    pub warning: Option<String>,
721}
722
723/// Arguments for the Slack Web API method [`files.remote.list`](https://docs.slack.dev/reference/methods/files.remote.list): Retrieve information about a remote file added to Slack
724///
725/// Send it with [`SlackClient::files_remote_list`].
726#[doc(alias = "files.remote.list")]
727#[derive(Debug, Clone, PartialEq, Serialize, Default)]
728#[non_exhaustive]
729pub struct FilesRemoteListRequest {
730    /// Filter files appearing in a specific channel, indicated by its ID.
731    #[serde(skip_serializing_if = "Option::is_none")]
732    pub channel: Option<String>,
733    /// Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](https://docs.slack.dev/apis/web-api/pagination.md) for more detail.
734    #[serde(skip_serializing_if = "Option::is_none")]
735    pub cursor: Option<String>,
736    /// The maximum number of items to return.
737    #[serde(skip_serializing_if = "Option::is_none")]
738    pub limit: Option<i64>,
739    /// Filter files created after this timestamp (inclusive).
740    #[serde(skip_serializing_if = "Option::is_none")]
741    pub ts_from: Option<String>,
742    /// Filter files created before this timestamp (inclusive).
743    #[serde(skip_serializing_if = "Option::is_none")]
744    pub ts_to: Option<String>,
745}
746
747impl FilesRemoteListRequest {
748    pub fn new() -> Self {
749        Self {
750            channel: None,
751            cursor: None,
752            limit: None,
753            ts_from: None,
754            ts_to: None,
755        }
756    }
757
758    pub fn channel(mut self, channel: impl Into<String>) -> Self {
759        self.channel = Some(channel.into());
760        self
761    }
762
763    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
764        self.cursor = Some(cursor.into());
765        self
766    }
767
768    pub fn limit(mut self, limit: i64) -> Self {
769        self.limit = Some(limit);
770        self
771    }
772
773    pub fn ts_from(mut self, ts_from: impl Into<String>) -> Self {
774        self.ts_from = Some(ts_from.into());
775        self
776    }
777
778    pub fn ts_to(mut self, ts_to: impl Into<String>) -> Self {
779        self.ts_to = Some(ts_to.into());
780        self
781    }
782}
783
784impl SlackApiMethod for FilesRemoteListRequest {
785    const METHOD: &'static str = "files.remote.list";
786    type Response = FilesRemoteListResponse;
787}
788
789impl CursorPaginated for FilesRemoteListRequest {
790    fn set_cursor(&mut self, cursor: String) {
791        self.cursor = Some(cursor);
792    }
793}
794
795impl NextCursor for FilesRemoteListResponse {
796    fn next_cursor(&self) -> Option<&str> {
797        self.response_metadata.as_ref()?.next_cursor.as_deref()
798    }
799}
800
801/// Successful response of the Slack Web API method [`files.remote.list`](https://docs.slack.dev/reference/methods/files.remote.list).
802#[doc(alias = "files.remote.list")]
803#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
804pub struct FilesRemoteListResponse {
805    #[serde(
806        default,
807        deserialize_with = "crate::de::vec",
808        skip_serializing_if = "Vec::is_empty"
809    )]
810    pub files: Vec<serde_json::Value>,
811    #[serde(
812        default,
813        deserialize_with = "crate::de::opt_object",
814        skip_serializing_if = "Option::is_none"
815    )]
816    pub response_metadata: Option<ResponseMetadata>,
817    #[serde(
818        default,
819        deserialize_with = "crate::de::opt_string",
820        skip_serializing_if = "Option::is_none"
821    )]
822    pub warning: Option<String>,
823}
824
825/// Arguments for the Slack Web API method [`files.remote.remove`](https://docs.slack.dev/reference/methods/files.remote.remove): Remove a remote file.
826///
827/// Send it with [`SlackClient::files_remote_remove`].
828#[doc(alias = "files.remote.remove")]
829#[derive(Debug, Clone, PartialEq, Serialize, Default)]
830#[non_exhaustive]
831pub struct FilesRemoteRemoveRequest {
832    /// Creator defined GUID for the file.
833    #[serde(skip_serializing_if = "Option::is_none")]
834    pub external_id: Option<String>,
835    /// Specify a file by providing its ID.
836    #[serde(skip_serializing_if = "Option::is_none")]
837    pub file: Option<String>,
838}
839
840impl FilesRemoteRemoveRequest {
841    pub fn new() -> Self {
842        Self {
843            external_id: None,
844            file: None,
845        }
846    }
847
848    pub fn external_id(mut self, external_id: impl Into<String>) -> Self {
849        self.external_id = Some(external_id.into());
850        self
851    }
852
853    pub fn file(mut self, file: impl Into<String>) -> Self {
854        self.file = Some(file.into());
855        self
856    }
857}
858
859impl SlackApiMethod for FilesRemoteRemoveRequest {
860    const METHOD: &'static str = "files.remote.remove";
861    type Response = FilesRemoteRemoveResponse;
862}
863
864/// Successful response of the Slack Web API method [`files.remote.remove`](https://docs.slack.dev/reference/methods/files.remote.remove).
865#[doc(alias = "files.remote.remove")]
866#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
867pub struct FilesRemoteRemoveResponse {
868    /// Fields returned by Slack. This method has no documented response example.
869    #[serde(flatten)]
870    pub extra: serde_json::Map<String, serde_json::Value>,
871    #[serde(
872        default,
873        deserialize_with = "crate::de::opt_object",
874        skip_serializing_if = "Option::is_none"
875    )]
876    pub response_metadata: Option<ResponseMetadata>,
877    #[serde(
878        default,
879        deserialize_with = "crate::de::opt_string",
880        skip_serializing_if = "Option::is_none"
881    )]
882    pub warning: Option<String>,
883}
884
885/// Arguments for the Slack Web API method [`files.remote.share`](https://docs.slack.dev/reference/methods/files.remote.share): Share a remote file into a channel.
886///
887/// Send it with [`SlackClient::files_remote_share`].
888#[doc(alias = "files.remote.share")]
889#[derive(Debug, Clone, PartialEq, Serialize)]
890#[non_exhaustive]
891pub struct FilesRemoteShareRequest {
892    /// Comma-separated list of channel IDs where the file will be shared.
893    pub channels: String,
894    /// The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or `file` or both are required.
895    #[serde(skip_serializing_if = "Option::is_none")]
896    pub external_id: Option<String>,
897    /// Specify a file registered with Slack by providing its ID. Either this field or `external_id` or both are required.
898    #[serde(skip_serializing_if = "Option::is_none")]
899    pub file: Option<String>,
900}
901
902impl FilesRemoteShareRequest {
903    pub fn new(channels: impl Into<String>) -> Self {
904        Self {
905            channels: channels.into(),
906            external_id: None,
907            file: None,
908        }
909    }
910
911    pub fn external_id(mut self, external_id: impl Into<String>) -> Self {
912        self.external_id = Some(external_id.into());
913        self
914    }
915
916    pub fn file(mut self, file: impl Into<String>) -> Self {
917        self.file = Some(file.into());
918        self
919    }
920}
921
922impl SlackApiMethod for FilesRemoteShareRequest {
923    const METHOD: &'static str = "files.remote.share";
924    type Response = FilesRemoteShareResponse;
925}
926
927/// Successful response of the Slack Web API method [`files.remote.share`](https://docs.slack.dev/reference/methods/files.remote.share).
928#[doc(alias = "files.remote.share")]
929#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
930pub struct FilesRemoteShareResponse {
931    #[serde(
932        default,
933        deserialize_with = "crate::de::opt_object",
934        skip_serializing_if = "Option::is_none"
935    )]
936    pub file: Option<File>,
937    #[serde(
938        default,
939        deserialize_with = "crate::de::opt_object",
940        skip_serializing_if = "Option::is_none"
941    )]
942    pub response_metadata: Option<ResponseMetadata>,
943    #[serde(
944        default,
945        deserialize_with = "crate::de::opt_string",
946        skip_serializing_if = "Option::is_none"
947    )]
948    pub warning: Option<String>,
949}
950
951/// Arguments for the Slack Web API method [`files.remote.update`](https://docs.slack.dev/reference/methods/files.remote.update): Updates an existing remote file.
952///
953/// Send it with [`SlackClient::files_remote_update`].
954#[doc(alias = "files.remote.update")]
955#[derive(Debug, Clone, PartialEq, Serialize, Default)]
956#[non_exhaustive]
957pub struct FilesRemoteUpdateRequest {
958    /// Creator defined GUID for the file.
959    #[serde(skip_serializing_if = "Option::is_none")]
960    pub external_id: Option<String>,
961    /// URL of the remote file.
962    #[serde(skip_serializing_if = "Option::is_none")]
963    pub external_url: Option<String>,
964    /// Specify a file by providing its ID.
965    #[serde(skip_serializing_if = "Option::is_none")]
966    pub file: Option<String>,
967    /// type of file
968    #[serde(skip_serializing_if = "Option::is_none")]
969    pub filetype: Option<String>,
970    /// File containing contents that can be used to improve searchability for the remote file.
971    #[serde(skip_serializing_if = "Option::is_none")]
972    pub indexable_file_contents: Option<String>,
973    /// Preview of the document via `multipart/form-data`.
974    #[serde(skip_serializing_if = "Option::is_none")]
975    pub preview_image: Option<String>,
976    /// Title of the file being shared.
977    #[serde(skip_serializing_if = "Option::is_none")]
978    pub title: Option<String>,
979}
980
981impl FilesRemoteUpdateRequest {
982    pub fn new() -> Self {
983        Self {
984            external_id: None,
985            external_url: None,
986            file: None,
987            filetype: None,
988            indexable_file_contents: None,
989            preview_image: None,
990            title: None,
991        }
992    }
993
994    pub fn external_id(mut self, external_id: impl Into<String>) -> Self {
995        self.external_id = Some(external_id.into());
996        self
997    }
998
999    pub fn external_url(mut self, external_url: impl Into<String>) -> Self {
1000        self.external_url = Some(external_url.into());
1001        self
1002    }
1003
1004    pub fn file(mut self, file: impl Into<String>) -> Self {
1005        self.file = Some(file.into());
1006        self
1007    }
1008
1009    pub fn filetype(mut self, filetype: impl Into<String>) -> Self {
1010        self.filetype = Some(filetype.into());
1011        self
1012    }
1013
1014    pub fn indexable_file_contents(mut self, indexable_file_contents: impl Into<String>) -> Self {
1015        self.indexable_file_contents = Some(indexable_file_contents.into());
1016        self
1017    }
1018
1019    pub fn preview_image(mut self, preview_image: impl Into<String>) -> Self {
1020        self.preview_image = Some(preview_image.into());
1021        self
1022    }
1023
1024    pub fn title(mut self, title: impl Into<String>) -> Self {
1025        self.title = Some(title.into());
1026        self
1027    }
1028}
1029
1030impl SlackApiMethod for FilesRemoteUpdateRequest {
1031    const METHOD: &'static str = "files.remote.update";
1032    type Response = FilesRemoteUpdateResponse;
1033}
1034
1035/// Successful response of the Slack Web API method [`files.remote.update`](https://docs.slack.dev/reference/methods/files.remote.update).
1036#[doc(alias = "files.remote.update")]
1037#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1038pub struct FilesRemoteUpdateResponse {
1039    #[serde(
1040        default,
1041        deserialize_with = "crate::de::opt_object",
1042        skip_serializing_if = "Option::is_none"
1043    )]
1044    pub file: Option<File>,
1045    #[serde(
1046        default,
1047        deserialize_with = "crate::de::opt_object",
1048        skip_serializing_if = "Option::is_none"
1049    )]
1050    pub response_metadata: Option<ResponseMetadata>,
1051    #[serde(
1052        default,
1053        deserialize_with = "crate::de::opt_string",
1054        skip_serializing_if = "Option::is_none"
1055    )]
1056    pub warning: Option<String>,
1057}
1058
1059/// Arguments for the Slack Web API method [`files.revokePublicURL`](https://docs.slack.dev/reference/methods/files.revokePublicURL): Revokes public/external sharing access for a file
1060///
1061/// Send it with [`SlackClient::files_revoke_public_url`].
1062#[doc(alias = "files.revokePublicURL")]
1063#[derive(Debug, Clone, PartialEq, Serialize)]
1064#[non_exhaustive]
1065pub struct FilesRevokePublicUrlRequest {
1066    /// File to revoke
1067    pub file: String,
1068}
1069
1070impl FilesRevokePublicUrlRequest {
1071    pub fn new(file: impl Into<String>) -> Self {
1072        Self { file: file.into() }
1073    }
1074}
1075
1076impl SlackApiMethod for FilesRevokePublicUrlRequest {
1077    const METHOD: &'static str = "files.revokePublicURL";
1078    type Response = FilesRevokePublicUrlResponse;
1079}
1080
1081/// Successful response of the Slack Web API method [`files.revokePublicURL`](https://docs.slack.dev/reference/methods/files.revokePublicURL).
1082#[doc(alias = "files.revokePublicURL")]
1083#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1084pub struct FilesRevokePublicUrlResponse {
1085    /// Fields returned by Slack. This method has no documented response example.
1086    #[serde(flatten)]
1087    pub extra: serde_json::Map<String, serde_json::Value>,
1088    #[serde(
1089        default,
1090        deserialize_with = "crate::de::opt_object",
1091        skip_serializing_if = "Option::is_none"
1092    )]
1093    pub response_metadata: Option<ResponseMetadata>,
1094    #[serde(
1095        default,
1096        deserialize_with = "crate::de::opt_string",
1097        skip_serializing_if = "Option::is_none"
1098    )]
1099    pub warning: Option<String>,
1100}
1101
1102/// Arguments for the Slack Web API method [`files.sharedPublicURL`](https://docs.slack.dev/reference/methods/files.sharedPublicURL): Enables a file for public/external sharing.
1103///
1104/// Send it with [`SlackClient::files_shared_public_url`].
1105#[doc(alias = "files.sharedPublicURL")]
1106#[derive(Debug, Clone, PartialEq, Serialize)]
1107#[non_exhaustive]
1108pub struct FilesSharedPublicUrlRequest {
1109    /// File to share
1110    pub file: String,
1111}
1112
1113impl FilesSharedPublicUrlRequest {
1114    pub fn new(file: impl Into<String>) -> Self {
1115        Self { file: file.into() }
1116    }
1117}
1118
1119impl SlackApiMethod for FilesSharedPublicUrlRequest {
1120    const METHOD: &'static str = "files.sharedPublicURL";
1121    type Response = FilesSharedPublicUrlResponse;
1122}
1123
1124/// Successful response of the Slack Web API method [`files.sharedPublicURL`](https://docs.slack.dev/reference/methods/files.sharedPublicURL).
1125#[doc(alias = "files.sharedPublicURL")]
1126#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1127pub struct FilesSharedPublicUrlResponse {
1128    /// Fields returned by Slack. This method has no documented response example.
1129    #[serde(flatten)]
1130    pub extra: serde_json::Map<String, serde_json::Value>,
1131    #[serde(
1132        default,
1133        deserialize_with = "crate::de::opt_object",
1134        skip_serializing_if = "Option::is_none"
1135    )]
1136    pub response_metadata: Option<ResponseMetadata>,
1137    #[serde(
1138        default,
1139        deserialize_with = "crate::de::opt_string",
1140        skip_serializing_if = "Option::is_none"
1141    )]
1142    pub warning: Option<String>,
1143}
1144
1145impl SlackClient {
1146    /// Calls the Slack Web API method [`files.comments.delete`](https://docs.slack.dev/reference/methods/files.comments.delete): Deletes an existing comment on a file.
1147    ///
1148    /// Required scopes:
1149    ///
1150    /// - bot token: `files:write`
1151    /// - user token: `files:write`
1152    ///
1153    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1154    ///
1155    /// # Errors
1156    ///
1157    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1158    #[doc(alias = "files.comments.delete")]
1159    pub async fn files_comments_delete(
1160        &self,
1161        request: &FilesCommentsDeleteRequest,
1162    ) -> Result<FilesCommentsDeleteResponse, SlackError> {
1163        self.call(request).await
1164    }
1165
1166    /// Calls the Slack Web API method [`files.completeUploadExternal`](https://docs.slack.dev/reference/methods/files.completeUploadExternal): Finishes an upload started with files.getUploadURLExternal
1167    ///
1168    /// Required scopes:
1169    ///
1170    /// - bot token: `files:write`
1171    /// - user token: `files:write`
1172    ///
1173    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1174    ///
1175    /// # Errors
1176    ///
1177    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1178    #[doc(alias = "files.completeUploadExternal")]
1179    pub async fn files_complete_upload_external(
1180        &self,
1181        request: &FilesCompleteUploadExternalRequest,
1182    ) -> Result<FilesCompleteUploadExternalResponse, SlackError> {
1183        self.call(request).await
1184    }
1185
1186    /// Calls the Slack Web API method [`files.delete`](https://docs.slack.dev/reference/methods/files.delete): Deletes a file.
1187    ///
1188    /// Required scopes:
1189    ///
1190    /// - bot token: `files:write`
1191    /// - user token: `files:write`
1192    ///
1193    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1194    ///
1195    /// # Errors
1196    ///
1197    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1198    #[doc(alias = "files.delete")]
1199    pub async fn files_delete(
1200        &self,
1201        request: &FilesDeleteRequest,
1202    ) -> Result<FilesDeleteResponse, SlackError> {
1203        self.call(request).await
1204    }
1205
1206    /// Calls the Slack Web API method [`files.getUploadURLExternal`](https://docs.slack.dev/reference/methods/files.getUploadURLExternal): Gets a URL for an edge external file upload
1207    ///
1208    /// Required scopes:
1209    ///
1210    /// - bot token: `files:write`
1211    /// - user token: `files:write`
1212    ///
1213    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1214    ///
1215    /// # Errors
1216    ///
1217    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1218    #[doc(alias = "files.getUploadURLExternal")]
1219    pub async fn files_get_upload_url_external(
1220        &self,
1221        request: &FilesGetUploadUrlExternalRequest,
1222    ) -> Result<FilesGetUploadUrlExternalResponse, SlackError> {
1223        self.call(request).await
1224    }
1225
1226    /// Calls the Slack Web API method [`files.info`](https://docs.slack.dev/reference/methods/files.info): Gets information about a file.
1227    ///
1228    /// Required scopes:
1229    ///
1230    /// - bot token: `files:read`
1231    /// - user token: `files:read`
1232    ///
1233    /// Rate limit: Tier 4 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1234    ///
1235    /// # Errors
1236    ///
1237    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1238    #[doc(alias = "files.info")]
1239    pub async fn files_info(
1240        &self,
1241        request: &FilesInfoRequest,
1242    ) -> Result<FilesInfoResponse, SlackError> {
1243        self.call(request).await
1244    }
1245
1246    /// Calls the Slack Web API method [`files.list`](https://docs.slack.dev/reference/methods/files.list): List for a team, in a channel, or from a user with applied filters.
1247    ///
1248    /// Required scopes:
1249    ///
1250    /// - bot token: `files:read`
1251    /// - user token: `files:read`
1252    ///
1253    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1254    ///
1255    /// # Errors
1256    ///
1257    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1258    #[doc(alias = "files.list")]
1259    pub async fn files_list(
1260        &self,
1261        request: &FilesListRequest,
1262    ) -> Result<FilesListResponse, SlackError> {
1263        self.call(request).await
1264    }
1265
1266    /// Calls the Slack Web API method [`files.remote.add`](https://docs.slack.dev/reference/methods/files.remote.add): Adds a file from a remote service
1267    ///
1268    /// Required scopes:
1269    ///
1270    /// - bot token: `remote_files:write`
1271    ///
1272    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1273    ///
1274    /// # Errors
1275    ///
1276    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1277    #[doc(alias = "files.remote.add")]
1278    pub async fn files_remote_add(
1279        &self,
1280        request: &FilesRemoteAddRequest,
1281    ) -> Result<FilesRemoteAddResponse, SlackError> {
1282        self.call(request).await
1283    }
1284
1285    /// Calls the Slack Web API method [`files.remote.info`](https://docs.slack.dev/reference/methods/files.remote.info): Retrieve information about a remote file added to Slack
1286    ///
1287    /// Required scopes:
1288    ///
1289    /// - bot token: `remote_files:read`
1290    /// - user token: `remote_files:read`
1291    ///
1292    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1293    ///
1294    /// # Errors
1295    ///
1296    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1297    #[doc(alias = "files.remote.info")]
1298    pub async fn files_remote_info(
1299        &self,
1300        request: &FilesRemoteInfoRequest,
1301    ) -> Result<FilesRemoteInfoResponse, SlackError> {
1302        self.call(request).await
1303    }
1304
1305    /// Calls the Slack Web API method [`files.remote.list`](https://docs.slack.dev/reference/methods/files.remote.list): Retrieve information about a remote file added to Slack
1306    ///
1307    /// Required scopes:
1308    ///
1309    /// - bot token: `remote_files:read`
1310    /// - user token: `remote_files:read`
1311    ///
1312    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1313    ///
1314    /// # Errors
1315    ///
1316    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1317    #[doc(alias = "files.remote.list")]
1318    pub async fn files_remote_list(
1319        &self,
1320        request: &FilesRemoteListRequest,
1321    ) -> Result<FilesRemoteListResponse, SlackError> {
1322        self.call(request).await
1323    }
1324
1325    /// Calls the Slack Web API method [`files.remote.remove`](https://docs.slack.dev/reference/methods/files.remote.remove): Remove a remote file.
1326    ///
1327    /// Required scopes:
1328    ///
1329    /// - bot token: `remote_files:write`
1330    ///
1331    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1332    ///
1333    /// # Errors
1334    ///
1335    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1336    #[doc(alias = "files.remote.remove")]
1337    pub async fn files_remote_remove(
1338        &self,
1339        request: &FilesRemoteRemoveRequest,
1340    ) -> Result<FilesRemoteRemoveResponse, SlackError> {
1341        self.call(request).await
1342    }
1343
1344    /// Calls the Slack Web API method [`files.remote.share`](https://docs.slack.dev/reference/methods/files.remote.share): Share a remote file into a channel.
1345    ///
1346    /// Required scopes:
1347    ///
1348    /// - bot token: `remote_files:share`
1349    /// - user token: `remote_files:share`
1350    ///
1351    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1352    ///
1353    /// # Errors
1354    ///
1355    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1356    #[doc(alias = "files.remote.share")]
1357    pub async fn files_remote_share(
1358        &self,
1359        request: &FilesRemoteShareRequest,
1360    ) -> Result<FilesRemoteShareResponse, SlackError> {
1361        self.call(request).await
1362    }
1363
1364    /// Calls the Slack Web API method [`files.remote.update`](https://docs.slack.dev/reference/methods/files.remote.update): Updates an existing remote file.
1365    ///
1366    /// Required scopes:
1367    ///
1368    /// - bot token: `remote_files:write`
1369    ///
1370    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1371    ///
1372    /// # Errors
1373    ///
1374    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1375    #[doc(alias = "files.remote.update")]
1376    pub async fn files_remote_update(
1377        &self,
1378        request: &FilesRemoteUpdateRequest,
1379    ) -> Result<FilesRemoteUpdateResponse, SlackError> {
1380        self.call(request).await
1381    }
1382
1383    /// Calls the Slack Web API method [`files.revokePublicURL`](https://docs.slack.dev/reference/methods/files.revokePublicURL): Revokes public/external sharing access for a file
1384    ///
1385    /// Required scopes:
1386    ///
1387    /// - bot token: `files:write`
1388    /// - user token: `files:write`
1389    ///
1390    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1391    ///
1392    /// # Errors
1393    ///
1394    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1395    #[doc(alias = "files.revokePublicURL")]
1396    pub async fn files_revoke_public_url(
1397        &self,
1398        request: &FilesRevokePublicUrlRequest,
1399    ) -> Result<FilesRevokePublicUrlResponse, SlackError> {
1400        self.call(request).await
1401    }
1402
1403    /// Calls the Slack Web API method [`files.sharedPublicURL`](https://docs.slack.dev/reference/methods/files.sharedPublicURL): Enables a file for public/external sharing.
1404    ///
1405    /// Required scopes:
1406    ///
1407    /// - user token: `files:write`
1408    ///
1409    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1410    ///
1411    /// # Errors
1412    ///
1413    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1414    #[doc(alias = "files.sharedPublicURL")]
1415    pub async fn files_shared_public_url(
1416        &self,
1417        request: &FilesSharedPublicUrlRequest,
1418    ) -> Result<FilesSharedPublicUrlResponse, SlackError> {
1419        self.call(request).await
1420    }
1421}