sfr_slack_api/builder/
files_complete_upload_external.rs1use sfr_types as st;
4
5use crate::api::files_complete_upload_external::FilesCompleteUploadExternal;
6
7#[derive(Debug, Default)]
9pub struct FilesCompleteUploadExternalBuilder {
10 files: Vec<st::FilesCompleteUploadExternalRequestFile>,
12
13 channel_id: Option<String>,
15
16 initial_comment: Option<String>,
18
19 thread_ts: Option<String>,
21}
22
23impl FilesCompleteUploadExternalBuilder {
24 pub fn new() -> Self {
26 Self::default()
27 }
28
29 pub fn build(self) -> FilesCompleteUploadExternal {
31 let result = st::FilesCompleteUploadExternalRequest {
32 files: self.files,
33 channel_id: self.channel_id,
34 initial_comment: self.initial_comment,
35 thread_ts: self.thread_ts,
36 };
37
38 result.into()
39 }
40
41 pub fn add_file(mut self, id: String, title: Option<String>) -> Self {
43 self.files
44 .push(st::FilesCompleteUploadExternalRequestFile { id, title });
45 self
46 }
47
48 pub fn channel_id(mut self, channel_id: Option<String>) -> Self {
50 self.channel_id = channel_id;
51 self
52 }
53
54 pub fn initial_comment(mut self, initial_comment: Option<String>) -> Self {
56 self.initial_comment = initial_comment;
57 self
58 }
59
60 pub fn thread_ts(mut self, thread_ts: Option<String>) -> Self {
62 self.thread_ts = thread_ts;
63 self
64 }
65}