Skip to main content

slack_web_api/api/
admin_workflows.rs

1// このファイルは codegen/generate.py が生成する。手で編集しない
2
3#![allow(unused_imports)]
4
5use crate::objects::*;
6use crate::{
7    CursorPaginated, NextCursor, ResponseMetadata, SlackApiMethod, SlackClient, SlackError,
8};
9use serde::{Deserialize, Serialize};
10
11/// Arguments for the Slack Web API method [`admin.workflows.collaborators.add`](https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add): Add collaborators to workflows within the team or enterprise
12///
13/// Send it with [`SlackClient::admin_workflows_collaborators_add`].
14#[doc(alias = "admin.workflows.collaborators.add")]
15#[derive(Debug, Clone, PartialEq, Serialize)]
16#[non_exhaustive]
17pub struct AdminWorkflowsCollaboratorsAddRequest {
18    /// Array of workflow IDs to edit; max 50
19    pub workflow_ids: Vec<String>,
20    /// Array of collaborators (encoded user IDs) to add; max 50
21    pub collaborator_ids: Vec<String>,
22}
23
24impl AdminWorkflowsCollaboratorsAddRequest {
25    pub fn new(workflow_ids: Vec<String>, collaborator_ids: Vec<String>) -> Self {
26        Self {
27            workflow_ids,
28            collaborator_ids,
29        }
30    }
31}
32
33impl SlackApiMethod for AdminWorkflowsCollaboratorsAddRequest {
34    const METHOD: &'static str = "admin.workflows.collaborators.add";
35    type Response = AdminWorkflowsCollaboratorsAddResponse;
36}
37
38/// Successful response of the Slack Web API method [`admin.workflows.collaborators.add`](https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add).
39#[doc(alias = "admin.workflows.collaborators.add")]
40#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
41pub struct AdminWorkflowsCollaboratorsAddResponse {
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 [`admin.workflows.collaborators.remove`](https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove): Remove collaborators from workflows within the team or enterprise
60///
61/// Send it with [`SlackClient::admin_workflows_collaborators_remove`].
62#[doc(alias = "admin.workflows.collaborators.remove")]
63#[derive(Debug, Clone, PartialEq, Serialize)]
64#[non_exhaustive]
65pub struct AdminWorkflowsCollaboratorsRemoveRequest {
66    /// Array of workflow IDs to edit; max 50
67    pub workflow_ids: Vec<String>,
68    /// Array of collaborators (encoded user IDs) to remove; max 50
69    pub collaborator_ids: Vec<String>,
70}
71
72impl AdminWorkflowsCollaboratorsRemoveRequest {
73    pub fn new(workflow_ids: Vec<String>, collaborator_ids: Vec<String>) -> Self {
74        Self {
75            workflow_ids,
76            collaborator_ids,
77        }
78    }
79}
80
81impl SlackApiMethod for AdminWorkflowsCollaboratorsRemoveRequest {
82    const METHOD: &'static str = "admin.workflows.collaborators.remove";
83    type Response = AdminWorkflowsCollaboratorsRemoveResponse;
84}
85
86/// Successful response of the Slack Web API method [`admin.workflows.collaborators.remove`](https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove).
87#[doc(alias = "admin.workflows.collaborators.remove")]
88#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
89pub struct AdminWorkflowsCollaboratorsRemoveResponse {
90    /// Fields returned by Slack. This method has no documented response example.
91    #[serde(flatten)]
92    pub extra: serde_json::Map<String, serde_json::Value>,
93    #[serde(
94        default,
95        deserialize_with = "crate::de::opt_object",
96        skip_serializing_if = "Option::is_none"
97    )]
98    pub response_metadata: Option<ResponseMetadata>,
99    #[serde(
100        default,
101        deserialize_with = "crate::de::opt_string",
102        skip_serializing_if = "Option::is_none"
103    )]
104    pub warning: Option<String>,
105}
106
107/// Arguments for the Slack Web API method [`admin.workflows.permissions.lookup`](https://docs.slack.dev/reference/methods/admin.workflows.permissions.lookup): Look up the permissions for a set of workflows
108///
109/// Send it with [`SlackClient::admin_workflows_permissions_lookup`].
110#[doc(alias = "admin.workflows.permissions.lookup")]
111#[derive(Debug, Clone, PartialEq, Serialize)]
112#[non_exhaustive]
113pub struct AdminWorkflowsPermissionsLookupRequest {
114    /// An array of workflow IDs to look up permissions for
115    pub workflow_ids: Vec<String>,
116    /// Maximum number of triggers to fetch for each workflow when determining overall run permissions; max 1000
117    #[serde(skip_serializing_if = "Option::is_none")]
118    pub max_workflow_triggers: Option<i64>,
119}
120
121impl AdminWorkflowsPermissionsLookupRequest {
122    pub fn new(workflow_ids: Vec<String>) -> Self {
123        Self {
124            workflow_ids,
125            max_workflow_triggers: None,
126        }
127    }
128
129    pub fn max_workflow_triggers(mut self, max_workflow_triggers: i64) -> Self {
130        self.max_workflow_triggers = Some(max_workflow_triggers);
131        self
132    }
133}
134
135impl SlackApiMethod for AdminWorkflowsPermissionsLookupRequest {
136    const METHOD: &'static str = "admin.workflows.permissions.lookup";
137    type Response = AdminWorkflowsPermissionsLookupResponse;
138}
139
140/// Successful response of the Slack Web API method [`admin.workflows.permissions.lookup`](https://docs.slack.dev/reference/methods/admin.workflows.permissions.lookup).
141#[doc(alias = "admin.workflows.permissions.lookup")]
142#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
143pub struct AdminWorkflowsPermissionsLookupResponse {
144    /// Fields returned by Slack. This method has no documented response example.
145    #[serde(flatten)]
146    pub extra: serde_json::Map<String, serde_json::Value>,
147    #[serde(
148        default,
149        deserialize_with = "crate::de::opt_object",
150        skip_serializing_if = "Option::is_none"
151    )]
152    pub response_metadata: Option<ResponseMetadata>,
153    #[serde(
154        default,
155        deserialize_with = "crate::de::opt_string",
156        skip_serializing_if = "Option::is_none"
157    )]
158    pub warning: Option<String>,
159}
160
161/// Arguments for the Slack Web API method [`admin.workflows.search`](https://docs.slack.dev/reference/methods/admin.workflows.search): Search workflows within the team or enterprise
162///
163/// Send it with [`SlackClient::admin_workflows_search`].
164#[doc(alias = "admin.workflows.search")]
165#[derive(Debug, Clone, PartialEq, Serialize, Default)]
166#[non_exhaustive]
167pub struct AdminWorkflowsSearchRequest {
168    /// A search query to filter for workflow name or description
169    #[serde(skip_serializing_if = "Option::is_none")]
170    pub query: Option<String>,
171    /// The parent app ID for which to return workflows
172    #[serde(skip_serializing_if = "Option::is_none")]
173    pub app_id: Option<String>,
174    /// Set `cursor` to `next_cursor` returned by the previous call to list items in the next page
175    #[serde(skip_serializing_if = "Option::is_none")]
176    pub cursor: Option<String>,
177    /// The number of results that will be returned by the API on each invocation
178    #[serde(skip_serializing_if = "Option::is_none")]
179    pub limit: Option<i64>,
180    /// Only include workflows with no collaborators in the result; default is false
181    #[serde(skip_serializing_if = "Option::is_none")]
182    pub no_collaborators: Option<bool>,
183    /// Only include workflows where all of the provided user IDs are a manager/collaborator of that workflow
184    #[serde(skip_serializing_if = "Option::is_none")]
185    pub collaborator_ids: Option<Vec<String>>,
186    /// Number of trigger IDs to fetch for each workflow; default is 10
187    #[serde(skip_serializing_if = "Option::is_none")]
188    pub num_trigger_ids: Option<i64>,
189    /// Filter workflows by their Sales Elevate status
190    #[serde(skip_serializing_if = "Option::is_none")]
191    pub is_sales_elevate: Option<bool>,
192    /// Source of workflow creation, either from code or workflow builder
193    #[serde(skip_serializing_if = "Option::is_none")]
194    pub source: Option<String>,
195    /// The field used to sort the returned workflows
196    #[serde(skip_serializing_if = "Option::is_none")]
197    pub sort: Option<String>,
198    /// Sort direction. Possible values are `asc` for ascending order like (1, 2, 3) or (a, b, c), and `desc` for descending order like (3, 2, 1) or (c, b, a)
199    #[serde(skip_serializing_if = "Option::is_none")]
200    pub sort_dir: Option<String>,
201    /// Only include workflows with this trigger type
202    #[serde(skip_serializing_if = "Option::is_none")]
203    pub trigger_type_id: Option<String>,
204    /// Filter workflows by their published status
205    #[serde(skip_serializing_if = "Option::is_none")]
206    pub publish_status: Option<String>,
207    /// Only include workflows that use all of the provided step function ids
208    #[serde(skip_serializing_if = "Option::is_none")]
209    pub step_function_ids: Option<Vec<String>>,
210}
211
212impl AdminWorkflowsSearchRequest {
213    pub fn new() -> Self {
214        Self {
215            query: None,
216            app_id: None,
217            cursor: None,
218            limit: None,
219            no_collaborators: None,
220            collaborator_ids: None,
221            num_trigger_ids: None,
222            is_sales_elevate: None,
223            source: None,
224            sort: None,
225            sort_dir: None,
226            trigger_type_id: None,
227            publish_status: None,
228            step_function_ids: None,
229        }
230    }
231
232    pub fn query(mut self, query: impl Into<String>) -> Self {
233        self.query = Some(query.into());
234        self
235    }
236
237    pub fn app_id(mut self, app_id: impl Into<String>) -> Self {
238        self.app_id = Some(app_id.into());
239        self
240    }
241
242    pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
243        self.cursor = Some(cursor.into());
244        self
245    }
246
247    pub fn limit(mut self, limit: i64) -> Self {
248        self.limit = Some(limit);
249        self
250    }
251
252    pub fn no_collaborators(mut self, no_collaborators: bool) -> Self {
253        self.no_collaborators = Some(no_collaborators);
254        self
255    }
256
257    pub fn collaborator_ids(mut self, collaborator_ids: Vec<String>) -> Self {
258        self.collaborator_ids = Some(collaborator_ids);
259        self
260    }
261
262    pub fn num_trigger_ids(mut self, num_trigger_ids: i64) -> Self {
263        self.num_trigger_ids = Some(num_trigger_ids);
264        self
265    }
266
267    pub fn is_sales_elevate(mut self, is_sales_elevate: bool) -> Self {
268        self.is_sales_elevate = Some(is_sales_elevate);
269        self
270    }
271
272    pub fn source(mut self, source: impl Into<String>) -> Self {
273        self.source = Some(source.into());
274        self
275    }
276
277    pub fn sort(mut self, sort: impl Into<String>) -> Self {
278        self.sort = Some(sort.into());
279        self
280    }
281
282    pub fn sort_dir(mut self, sort_dir: impl Into<String>) -> Self {
283        self.sort_dir = Some(sort_dir.into());
284        self
285    }
286
287    pub fn trigger_type_id(mut self, trigger_type_id: impl Into<String>) -> Self {
288        self.trigger_type_id = Some(trigger_type_id.into());
289        self
290    }
291
292    pub fn publish_status(mut self, publish_status: impl Into<String>) -> Self {
293        self.publish_status = Some(publish_status.into());
294        self
295    }
296
297    pub fn step_function_ids(mut self, step_function_ids: Vec<String>) -> Self {
298        self.step_function_ids = Some(step_function_ids);
299        self
300    }
301}
302
303impl SlackApiMethod for AdminWorkflowsSearchRequest {
304    const METHOD: &'static str = "admin.workflows.search";
305    type Response = AdminWorkflowsSearchResponse;
306}
307
308impl CursorPaginated for AdminWorkflowsSearchRequest {
309    fn set_cursor(&mut self, cursor: String) {
310        self.cursor = Some(cursor);
311    }
312}
313
314impl NextCursor for AdminWorkflowsSearchResponse {
315    fn next_cursor(&self) -> Option<&str> {
316        self.response_metadata.as_ref()?.next_cursor.as_deref()
317    }
318}
319
320/// Successful response of the Slack Web API method [`admin.workflows.search`](https://docs.slack.dev/reference/methods/admin.workflows.search).
321#[doc(alias = "admin.workflows.search")]
322#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
323pub struct AdminWorkflowsSearchResponse {
324    #[serde(
325        default,
326        deserialize_with = "crate::de::opt_i64",
327        skip_serializing_if = "Option::is_none"
328    )]
329    pub total_found: Option<i64>,
330    #[serde(
331        default,
332        deserialize_with = "crate::de::vec",
333        skip_serializing_if = "Vec::is_empty"
334    )]
335    pub workflows: Vec<AdminWorkflowsSearchResponseWorkflows>,
336    #[serde(
337        default,
338        deserialize_with = "crate::de::opt_object",
339        skip_serializing_if = "Option::is_none"
340    )]
341    pub response_metadata: Option<ResponseMetadata>,
342    #[serde(
343        default,
344        deserialize_with = "crate::de::opt_string",
345        skip_serializing_if = "Option::is_none"
346    )]
347    pub warning: Option<String>,
348}
349
350#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
351pub struct AdminWorkflowsSearchResponseWorkflows {
352    #[serde(
353        default,
354        deserialize_with = "crate::de::opt_string",
355        skip_serializing_if = "Option::is_none"
356    )]
357    pub id: Option<String>,
358    #[serde(
359        default,
360        deserialize_with = "crate::de::opt_string",
361        skip_serializing_if = "Option::is_none"
362    )]
363    pub workflow_function_id: Option<String>,
364    #[serde(
365        default,
366        deserialize_with = "crate::de::opt_string",
367        skip_serializing_if = "Option::is_none"
368    )]
369    pub callback_id: Option<String>,
370    #[serde(
371        default,
372        deserialize_with = "crate::de::opt_string",
373        skip_serializing_if = "Option::is_none"
374    )]
375    pub title: Option<String>,
376    #[serde(
377        default,
378        deserialize_with = "crate::de::opt_string",
379        skip_serializing_if = "Option::is_none"
380    )]
381    pub description: Option<String>,
382    #[serde(
383        default,
384        deserialize_with = "crate::de::opt_object",
385        skip_serializing_if = "Option::is_none"
386    )]
387    pub input_parameters: Option<AdminWorkflowsSearchResponseWorkflowsInputParameters>,
388    #[serde(
389        default,
390        deserialize_with = "crate::de::vec",
391        skip_serializing_if = "Vec::is_empty"
392    )]
393    pub steps: Vec<AdminWorkflowsSearchResponseWorkflowsSteps>,
394    #[serde(
395        default,
396        deserialize_with = "crate::de::vec",
397        skip_serializing_if = "Vec::is_empty"
398    )]
399    pub collaborators: Vec<String>,
400    #[serde(
401        default,
402        deserialize_with = "crate::de::opt_object",
403        skip_serializing_if = "Option::is_none"
404    )]
405    pub icons: Option<Icons>,
406    #[serde(
407        default,
408        deserialize_with = "crate::de::opt_bool",
409        skip_serializing_if = "Option::is_none"
410    )]
411    pub is_published: Option<bool>,
412    #[serde(
413        default,
414        deserialize_with = "crate::de::opt_string",
415        skip_serializing_if = "Option::is_none"
416    )]
417    pub last_updated_by: Option<String>,
418    #[serde(
419        default,
420        deserialize_with = "crate::de::opt_i64",
421        skip_serializing_if = "Option::is_none"
422    )]
423    pub unpublished_change_count: Option<i64>,
424    #[serde(
425        default,
426        deserialize_with = "crate::de::opt_string",
427        skip_serializing_if = "Option::is_none"
428    )]
429    pub app_id: Option<String>,
430    #[serde(
431        default,
432        deserialize_with = "crate::de::opt_string",
433        skip_serializing_if = "Option::is_none"
434    )]
435    pub source: Option<String>,
436    #[serde(
437        default,
438        deserialize_with = "crate::de::opt_string",
439        skip_serializing_if = "Option::is_none"
440    )]
441    pub billing_type: Option<String>,
442    #[serde(
443        default,
444        deserialize_with = "crate::de::opt_i64",
445        skip_serializing_if = "Option::is_none"
446    )]
447    pub date_updated: Option<i64>,
448    #[serde(
449        default,
450        deserialize_with = "crate::de::opt_bool",
451        skip_serializing_if = "Option::is_none"
452    )]
453    pub is_billable: Option<bool>,
454    #[serde(
455        default,
456        deserialize_with = "crate::de::opt_i64",
457        skip_serializing_if = "Option::is_none"
458    )]
459    pub creation_source_type: Option<i64>,
460    #[serde(
461        default,
462        deserialize_with = "crate::de::opt_string",
463        skip_serializing_if = "Option::is_none"
464    )]
465    pub creation_source_id: Option<String>,
466    #[serde(
467        default,
468        deserialize_with = "crate::de::opt_string",
469        skip_serializing_if = "Option::is_none"
470    )]
471    pub last_published_version_id: Option<String>,
472    #[serde(
473        default,
474        deserialize_with = "crate::de::opt_string",
475        skip_serializing_if = "Option::is_none"
476    )]
477    pub last_published_date: Option<String>,
478    #[serde(
479        default,
480        deserialize_with = "crate::de::vec",
481        skip_serializing_if = "Vec::is_empty"
482    )]
483    pub trigger_ids: Vec<String>,
484    #[serde(
485        default,
486        deserialize_with = "crate::de::opt_bool",
487        skip_serializing_if = "Option::is_none"
488    )]
489    pub is_sales_home_workflow: Option<bool>,
490    #[serde(
491        default,
492        deserialize_with = "crate::de::opt_bool",
493        skip_serializing_if = "Option::is_none"
494    )]
495    pub is_sales_elevate: Option<bool>,
496    #[serde(
497        default,
498        deserialize_with = "crate::de::vec",
499        skip_serializing_if = "Vec::is_empty"
500    )]
501    pub trigger_types: Vec<AdminWorkflowsSearchResponseWorkflowsTriggerTypes>,
502}
503
504#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
505pub struct AdminWorkflowsSearchResponseWorkflowsInputParameters {
506    #[serde(
507        rename = "Ft014FQ980RZ__user_id",
508        default,
509        deserialize_with = "crate::de::opt_object",
510        skip_serializing_if = "Option::is_none"
511    )]
512    pub ft014_fq980_rz_user_id:
513        Option<AdminWorkflowsSearchResponseWorkflowsInputParametersFt014Fq980RzUserId>,
514    #[serde(
515        rename = "Ft014FQ980RZ__message_context",
516        default,
517        deserialize_with = "crate::de::opt_object",
518        skip_serializing_if = "Option::is_none"
519    )]
520    pub ft014_fq980_rz_message_context:
521        Option<AdminWorkflowsSearchResponseWorkflowsInputParametersFt014Fq980RzMessageContext>,
522    #[serde(
523        default,
524        deserialize_with = "crate::de::opt_object",
525        skip_serializing_if = "Option::is_none"
526    )]
527    pub interactivity: Option<AdminWorkflowsSearchResponseWorkflowsInputParametersInteractivity>,
528}
529
530#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
531pub struct AdminWorkflowsSearchResponseWorkflowsInputParametersFt014Fq980RzUserId {
532    #[serde(
533        default,
534        deserialize_with = "crate::de::opt_string",
535        skip_serializing_if = "Option::is_none"
536    )]
537    pub r#type: Option<String>,
538    #[serde(
539        default,
540        deserialize_with = "crate::de::opt_string",
541        skip_serializing_if = "Option::is_none"
542    )]
543    pub name: Option<String>,
544    #[serde(
545        default,
546        deserialize_with = "crate::de::opt_string",
547        skip_serializing_if = "Option::is_none"
548    )]
549    pub description: Option<String>,
550    #[serde(
551        default,
552        deserialize_with = "crate::de::opt_string",
553        skip_serializing_if = "Option::is_none"
554    )]
555    pub title: Option<String>,
556    #[serde(
557        default,
558        deserialize_with = "crate::de::opt_bool",
559        skip_serializing_if = "Option::is_none"
560    )]
561    pub is_required: Option<bool>,
562}
563
564#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
565pub struct AdminWorkflowsSearchResponseWorkflowsInputParametersFt014Fq980RzMessageContext {
566    #[serde(
567        default,
568        deserialize_with = "crate::de::opt_string",
569        skip_serializing_if = "Option::is_none"
570    )]
571    pub r#type: Option<String>,
572    #[serde(
573        default,
574        deserialize_with = "crate::de::opt_string",
575        skip_serializing_if = "Option::is_none"
576    )]
577    pub name: Option<String>,
578    #[serde(
579        default,
580        deserialize_with = "crate::de::opt_string",
581        skip_serializing_if = "Option::is_none"
582    )]
583    pub description: Option<String>,
584    #[serde(
585        default,
586        deserialize_with = "crate::de::opt_string",
587        skip_serializing_if = "Option::is_none"
588    )]
589    pub title: Option<String>,
590    #[serde(
591        default,
592        deserialize_with = "crate::de::opt_bool",
593        skip_serializing_if = "Option::is_none"
594    )]
595    pub is_required: Option<bool>,
596}
597
598#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
599pub struct AdminWorkflowsSearchResponseWorkflowsInputParametersInteractivity {
600    #[serde(
601        default,
602        deserialize_with = "crate::de::opt_string",
603        skip_serializing_if = "Option::is_none"
604    )]
605    pub r#type: Option<String>,
606    #[serde(
607        default,
608        deserialize_with = "crate::de::opt_string",
609        skip_serializing_if = "Option::is_none"
610    )]
611    pub name: Option<String>,
612    #[serde(
613        default,
614        deserialize_with = "crate::de::opt_string",
615        skip_serializing_if = "Option::is_none"
616    )]
617    pub title: Option<String>,
618    #[serde(
619        default,
620        deserialize_with = "crate::de::opt_bool",
621        skip_serializing_if = "Option::is_none"
622    )]
623    pub is_required: Option<bool>,
624}
625
626#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
627pub struct AdminWorkflowsSearchResponseWorkflowsSteps {
628    #[serde(
629        default,
630        deserialize_with = "crate::de::opt_string",
631        skip_serializing_if = "Option::is_none"
632    )]
633    pub id: Option<String>,
634    #[serde(
635        default,
636        deserialize_with = "crate::de::opt_string",
637        skip_serializing_if = "Option::is_none"
638    )]
639    pub function_id: Option<String>,
640    #[serde(
641        default,
642        deserialize_with = "crate::de::opt_object",
643        skip_serializing_if = "Option::is_none"
644    )]
645    pub inputs: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputs>,
646}
647
648#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
649pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputs {
650    #[serde(
651        default,
652        deserialize_with = "crate::de::opt_object",
653        skip_serializing_if = "Option::is_none"
654    )]
655    pub message: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsMessage>,
656    #[serde(
657        default,
658        deserialize_with = "crate::de::opt_object",
659        skip_serializing_if = "Option::is_none"
660    )]
661    pub message_context: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsMessageContext>,
662    #[serde(
663        default,
664        deserialize_with = "crate::de::opt_object",
665        skip_serializing_if = "Option::is_none"
666    )]
667    pub reply_broadcast: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsReplyBroadcast>,
668    #[serde(
669        default,
670        deserialize_with = "crate::de::opt_object",
671        skip_serializing_if = "Option::is_none"
672    )]
673    pub title: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsTitle>,
674    #[serde(
675        default,
676        deserialize_with = "crate::de::opt_object",
677        skip_serializing_if = "Option::is_none"
678    )]
679    pub fields: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsFields>,
680    #[serde(
681        default,
682        deserialize_with = "crate::de::opt_object",
683        skip_serializing_if = "Option::is_none"
684    )]
685    pub description: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsDescription>,
686    #[serde(
687        default,
688        deserialize_with = "crate::de::opt_object",
689        skip_serializing_if = "Option::is_none"
690    )]
691    pub submit_label: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsSubmitLabel>,
692    #[serde(
693        default,
694        deserialize_with = "crate::de::opt_object",
695        skip_serializing_if = "Option::is_none"
696    )]
697    pub interactivity: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsInteractivity>,
698    #[serde(
699        default,
700        deserialize_with = "crate::de::opt_object",
701        skip_serializing_if = "Option::is_none"
702    )]
703    pub vibe: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsVibe>,
704    #[serde(
705        default,
706        deserialize_with = "crate::de::opt_object",
707        skip_serializing_if = "Option::is_none"
708    )]
709    pub channel_id: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsChannelId>,
710}
711
712#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
713pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsMessage {
714    #[serde(default, skip_serializing_if = "Option::is_none")]
715    pub value: Option<serde_json::Value>,
716    #[serde(
717        default,
718        deserialize_with = "crate::de::opt_bool",
719        skip_serializing_if = "Option::is_none"
720    )]
721    pub locked: Option<bool>,
722}
723
724#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
725pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsMessageContext {
726    #[serde(
727        default,
728        deserialize_with = "crate::de::opt_string",
729        skip_serializing_if = "Option::is_none"
730    )]
731    pub value: Option<String>,
732    #[serde(
733        default,
734        deserialize_with = "crate::de::opt_bool",
735        skip_serializing_if = "Option::is_none"
736    )]
737    pub locked: Option<bool>,
738}
739
740#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
741pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsReplyBroadcast {
742    #[serde(
743        default,
744        deserialize_with = "crate::de::opt_string",
745        skip_serializing_if = "Option::is_none"
746    )]
747    pub value: Option<String>,
748    #[serde(
749        default,
750        deserialize_with = "crate::de::opt_bool",
751        skip_serializing_if = "Option::is_none"
752    )]
753    pub locked: Option<bool>,
754}
755
756#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
757pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsTitle {
758    #[serde(
759        default,
760        deserialize_with = "crate::de::opt_string",
761        skip_serializing_if = "Option::is_none"
762    )]
763    pub value: Option<String>,
764    #[serde(
765        default,
766        deserialize_with = "crate::de::opt_bool",
767        skip_serializing_if = "Option::is_none"
768    )]
769    pub locked: Option<bool>,
770}
771
772#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
773pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsFields {
774    #[serde(
775        default,
776        deserialize_with = "crate::de::opt_object",
777        skip_serializing_if = "Option::is_none"
778    )]
779    pub value: Option<AdminWorkflowsSearchResponseWorkflowsStepsInputsFieldsValue>,
780    #[serde(
781        default,
782        deserialize_with = "crate::de::opt_bool",
783        skip_serializing_if = "Option::is_none"
784    )]
785    pub locked: Option<bool>,
786}
787
788#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
789pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsFieldsValue {
790    #[serde(
791        default,
792        deserialize_with = "crate::de::vec",
793        skip_serializing_if = "Vec::is_empty"
794    )]
795    pub elements: Vec<AdminWorkflowsSearchResponseWorkflowsStepsInputsFieldsValueElements>,
796    #[serde(
797        default,
798        deserialize_with = "crate::de::vec",
799        skip_serializing_if = "Vec::is_empty"
800    )]
801    pub required: Vec<String>,
802}
803
804#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
805pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsFieldsValueElements {
806    #[serde(
807        default,
808        deserialize_with = "crate::de::opt_string",
809        skip_serializing_if = "Option::is_none"
810    )]
811    pub name: Option<String>,
812    #[serde(
813        default,
814        deserialize_with = "crate::de::opt_string",
815        skip_serializing_if = "Option::is_none"
816    )]
817    pub r#type: Option<String>,
818    #[serde(
819        default,
820        deserialize_with = "crate::de::opt_string",
821        skip_serializing_if = "Option::is_none"
822    )]
823    pub title: Option<String>,
824    #[serde(
825        default,
826        deserialize_with = "crate::de::opt_string",
827        skip_serializing_if = "Option::is_none"
828    )]
829    pub description: Option<String>,
830    #[serde(
831        default,
832        deserialize_with = "crate::de::opt_bool",
833        skip_serializing_if = "Option::is_none"
834    )]
835    pub long: Option<bool>,
836    #[serde(
837        default,
838        deserialize_with = "crate::de::vec",
839        skip_serializing_if = "Vec::is_empty"
840    )]
841    pub r#enum: Vec<String>,
842}
843
844#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
845pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsDescription {
846    #[serde(
847        default,
848        deserialize_with = "crate::de::opt_string",
849        skip_serializing_if = "Option::is_none"
850    )]
851    pub value: Option<String>,
852    #[serde(
853        default,
854        deserialize_with = "crate::de::opt_bool",
855        skip_serializing_if = "Option::is_none"
856    )]
857    pub locked: Option<bool>,
858}
859
860#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
861pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsSubmitLabel {
862    #[serde(
863        default,
864        deserialize_with = "crate::de::opt_string",
865        skip_serializing_if = "Option::is_none"
866    )]
867    pub value: Option<String>,
868    #[serde(
869        default,
870        deserialize_with = "crate::de::opt_bool",
871        skip_serializing_if = "Option::is_none"
872    )]
873    pub locked: Option<bool>,
874}
875
876#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
877pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsInteractivity {
878    #[serde(
879        default,
880        deserialize_with = "crate::de::opt_string",
881        skip_serializing_if = "Option::is_none"
882    )]
883    pub value: Option<String>,
884    #[serde(
885        default,
886        deserialize_with = "crate::de::opt_bool",
887        skip_serializing_if = "Option::is_none"
888    )]
889    pub locked: Option<bool>,
890}
891
892#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
893pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsVibe {
894    #[serde(
895        default,
896        deserialize_with = "crate::de::opt_string",
897        skip_serializing_if = "Option::is_none"
898    )]
899    pub value: Option<String>,
900    #[serde(
901        default,
902        deserialize_with = "crate::de::opt_bool",
903        skip_serializing_if = "Option::is_none"
904    )]
905    pub locked: Option<bool>,
906}
907
908#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
909pub struct AdminWorkflowsSearchResponseWorkflowsStepsInputsChannelId {
910    #[serde(
911        default,
912        deserialize_with = "crate::de::opt_string",
913        skip_serializing_if = "Option::is_none"
914    )]
915    pub value: Option<String>,
916    #[serde(
917        default,
918        deserialize_with = "crate::de::opt_bool",
919        skip_serializing_if = "Option::is_none"
920    )]
921    pub locked: Option<bool>,
922}
923
924#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
925pub struct AdminWorkflowsSearchResponseWorkflowsTriggerTypes {
926    #[serde(
927        default,
928        deserialize_with = "crate::de::opt_string",
929        skip_serializing_if = "Option::is_none"
930    )]
931    pub id: Option<String>,
932    #[serde(
933        default,
934        deserialize_with = "crate::de::opt_string",
935        skip_serializing_if = "Option::is_none"
936    )]
937    pub r#type: Option<String>,
938    #[serde(
939        default,
940        deserialize_with = "crate::de::opt_string",
941        skip_serializing_if = "Option::is_none"
942    )]
943    pub subtype: Option<String>,
944}
945
946/// Arguments for the Slack Web API method [`admin.workflows.triggers.types.permissions.lookup`](https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.lookup): List the permissions for using each trigger type
947///
948/// Send it with [`SlackClient::admin_workflows_triggers_types_permissions_lookup`].
949#[doc(alias = "admin.workflows.triggers.types.permissions.lookup")]
950#[derive(Debug, Clone, PartialEq, Serialize)]
951#[non_exhaustive]
952pub struct AdminWorkflowsTriggersTypesPermissionsLookupRequest {
953    /// The trigger type IDs for which to get the permissions.
954    #[serde(serialize_with = "crate::form::as_json")]
955    pub trigger_type_ids: Vec<String>,
956}
957
958impl AdminWorkflowsTriggersTypesPermissionsLookupRequest {
959    pub fn new(trigger_type_ids: Vec<String>) -> Self {
960        Self { trigger_type_ids }
961    }
962}
963
964impl SlackApiMethod for AdminWorkflowsTriggersTypesPermissionsLookupRequest {
965    const METHOD: &'static str = "admin.workflows.triggers.types.permissions.lookup";
966    type Response = AdminWorkflowsTriggersTypesPermissionsLookupResponse;
967}
968
969/// Successful response of the Slack Web API method [`admin.workflows.triggers.types.permissions.lookup`](https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.lookup).
970#[doc(alias = "admin.workflows.triggers.types.permissions.lookup")]
971#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
972pub struct AdminWorkflowsTriggersTypesPermissionsLookupResponse {
973    /// Fields returned by Slack. This method has no documented response example.
974    #[serde(flatten)]
975    pub extra: serde_json::Map<String, serde_json::Value>,
976    #[serde(
977        default,
978        deserialize_with = "crate::de::opt_object",
979        skip_serializing_if = "Option::is_none"
980    )]
981    pub response_metadata: Option<ResponseMetadata>,
982    #[serde(
983        default,
984        deserialize_with = "crate::de::opt_string",
985        skip_serializing_if = "Option::is_none"
986    )]
987    pub warning: Option<String>,
988}
989
990/// Arguments for the Slack Web API method [`admin.workflows.triggers.types.permissions.set`](https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.set): Set the permissions for using a trigger type
991///
992/// Send it with [`SlackClient::admin_workflows_triggers_types_permissions_set`].
993#[doc(alias = "admin.workflows.triggers.types.permissions.set")]
994#[derive(Debug, Clone, PartialEq, Serialize)]
995#[non_exhaustive]
996pub struct AdminWorkflowsTriggersTypesPermissionsSetRequest {
997    /// The trigger type ID for which to set the permissions
998    pub id: String,
999    /// The function visibility
1000    #[serde(skip_serializing_if = "Option::is_none")]
1001    pub visibility: Option<String>,
1002    /// List of user IDs to allow for named\_entities visibility
1003    #[serde(
1004        skip_serializing_if = "Option::is_none",
1005        serialize_with = "crate::form::as_json"
1006    )]
1007    pub user_ids: Option<Vec<String>>,
1008    #[serde(skip_serializing_if = "Option::is_none")]
1009    pub permissions: Option<serde_json::Value>,
1010}
1011
1012impl AdminWorkflowsTriggersTypesPermissionsSetRequest {
1013    pub fn new(id: impl Into<String>) -> Self {
1014        Self {
1015            id: id.into(),
1016            visibility: None,
1017            user_ids: None,
1018            permissions: None,
1019        }
1020    }
1021
1022    pub fn visibility(mut self, visibility: impl Into<String>) -> Self {
1023        self.visibility = Some(visibility.into());
1024        self
1025    }
1026
1027    pub fn user_ids(mut self, user_ids: Vec<String>) -> Self {
1028        self.user_ids = Some(user_ids);
1029        self
1030    }
1031
1032    pub fn permissions(mut self, permissions: serde_json::Value) -> Self {
1033        self.permissions = Some(permissions);
1034        self
1035    }
1036}
1037
1038impl SlackApiMethod for AdminWorkflowsTriggersTypesPermissionsSetRequest {
1039    const METHOD: &'static str = "admin.workflows.triggers.types.permissions.set";
1040    type Response = AdminWorkflowsTriggersTypesPermissionsSetResponse;
1041}
1042
1043/// Successful response of the Slack Web API method [`admin.workflows.triggers.types.permissions.set`](https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.set).
1044#[doc(alias = "admin.workflows.triggers.types.permissions.set")]
1045#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1046pub struct AdminWorkflowsTriggersTypesPermissionsSetResponse {
1047    /// Fields returned by Slack. This method has no documented response example.
1048    #[serde(flatten)]
1049    pub extra: serde_json::Map<String, serde_json::Value>,
1050    #[serde(
1051        default,
1052        deserialize_with = "crate::de::opt_object",
1053        skip_serializing_if = "Option::is_none"
1054    )]
1055    pub response_metadata: Option<ResponseMetadata>,
1056    #[serde(
1057        default,
1058        deserialize_with = "crate::de::opt_string",
1059        skip_serializing_if = "Option::is_none"
1060    )]
1061    pub warning: Option<String>,
1062}
1063
1064/// Arguments for the Slack Web API method [`admin.workflows.unpublish`](https://docs.slack.dev/reference/methods/admin.workflows.unpublish): Unpublish workflows within the team or enterprise
1065///
1066/// Send it with [`SlackClient::admin_workflows_unpublish`].
1067#[doc(alias = "admin.workflows.unpublish")]
1068#[derive(Debug, Clone, PartialEq, Serialize)]
1069#[non_exhaustive]
1070pub struct AdminWorkflowsUnpublishRequest {
1071    /// Array of workflow IDs to unpublish
1072    pub workflow_ids: Vec<String>,
1073}
1074
1075impl AdminWorkflowsUnpublishRequest {
1076    pub fn new(workflow_ids: Vec<String>) -> Self {
1077        Self { workflow_ids }
1078    }
1079}
1080
1081impl SlackApiMethod for AdminWorkflowsUnpublishRequest {
1082    const METHOD: &'static str = "admin.workflows.unpublish";
1083    type Response = AdminWorkflowsUnpublishResponse;
1084}
1085
1086/// Successful response of the Slack Web API method [`admin.workflows.unpublish`](https://docs.slack.dev/reference/methods/admin.workflows.unpublish).
1087#[doc(alias = "admin.workflows.unpublish")]
1088#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1089pub struct AdminWorkflowsUnpublishResponse {
1090    /// Fields returned by Slack. This method has no documented response example.
1091    #[serde(flatten)]
1092    pub extra: serde_json::Map<String, serde_json::Value>,
1093    #[serde(
1094        default,
1095        deserialize_with = "crate::de::opt_object",
1096        skip_serializing_if = "Option::is_none"
1097    )]
1098    pub response_metadata: Option<ResponseMetadata>,
1099    #[serde(
1100        default,
1101        deserialize_with = "crate::de::opt_string",
1102        skip_serializing_if = "Option::is_none"
1103    )]
1104    pub warning: Option<String>,
1105}
1106
1107impl SlackClient {
1108    /// Calls the Slack Web API method [`admin.workflows.collaborators.add`](https://docs.slack.dev/reference/methods/admin.workflows.collaborators.add): Add collaborators to workflows within the team or enterprise
1109    ///
1110    /// Required scopes:
1111    ///
1112    /// - user token: `admin.workflows:write`
1113    ///
1114    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1115    ///
1116    /// # Errors
1117    ///
1118    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1119    #[doc(alias = "admin.workflows.collaborators.add")]
1120    pub async fn admin_workflows_collaborators_add(
1121        &self,
1122        request: &AdminWorkflowsCollaboratorsAddRequest,
1123    ) -> Result<AdminWorkflowsCollaboratorsAddResponse, SlackError> {
1124        self.call(request).await
1125    }
1126
1127    /// Calls the Slack Web API method [`admin.workflows.collaborators.remove`](https://docs.slack.dev/reference/methods/admin.workflows.collaborators.remove): Remove collaborators from workflows within the team or enterprise
1128    ///
1129    /// Required scopes:
1130    ///
1131    /// - user token: `admin.workflows:write`
1132    ///
1133    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1134    ///
1135    /// # Errors
1136    ///
1137    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1138    #[doc(alias = "admin.workflows.collaborators.remove")]
1139    pub async fn admin_workflows_collaborators_remove(
1140        &self,
1141        request: &AdminWorkflowsCollaboratorsRemoveRequest,
1142    ) -> Result<AdminWorkflowsCollaboratorsRemoveResponse, SlackError> {
1143        self.call(request).await
1144    }
1145
1146    /// Calls the Slack Web API method [`admin.workflows.permissions.lookup`](https://docs.slack.dev/reference/methods/admin.workflows.permissions.lookup): Look up the permissions for a set of workflows
1147    ///
1148    /// Required scopes:
1149    ///
1150    /// - user token: `admin.workflows:read`
1151    ///
1152    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1153    ///
1154    /// # Errors
1155    ///
1156    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1157    #[doc(alias = "admin.workflows.permissions.lookup")]
1158    pub async fn admin_workflows_permissions_lookup(
1159        &self,
1160        request: &AdminWorkflowsPermissionsLookupRequest,
1161    ) -> Result<AdminWorkflowsPermissionsLookupResponse, SlackError> {
1162        self.call(request).await
1163    }
1164
1165    /// Calls the Slack Web API method [`admin.workflows.search`](https://docs.slack.dev/reference/methods/admin.workflows.search): Search workflows within the team or enterprise
1166    ///
1167    /// Required scopes:
1168    ///
1169    /// - user token: `admin.workflows:read`
1170    ///
1171    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1172    ///
1173    /// # Errors
1174    ///
1175    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1176    #[doc(alias = "admin.workflows.search")]
1177    pub async fn admin_workflows_search(
1178        &self,
1179        request: &AdminWorkflowsSearchRequest,
1180    ) -> Result<AdminWorkflowsSearchResponse, SlackError> {
1181        self.call(request).await
1182    }
1183
1184    /// Calls the Slack Web API method [`admin.workflows.triggers.types.permissions.lookup`](https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.lookup): List the permissions for using each trigger type
1185    ///
1186    /// Required scopes:
1187    ///
1188    /// - user token: `client`
1189    ///
1190    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1191    ///
1192    /// # Errors
1193    ///
1194    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1195    #[doc(alias = "admin.workflows.triggers.types.permissions.lookup")]
1196    pub async fn admin_workflows_triggers_types_permissions_lookup(
1197        &self,
1198        request: &AdminWorkflowsTriggersTypesPermissionsLookupRequest,
1199    ) -> Result<AdminWorkflowsTriggersTypesPermissionsLookupResponse, SlackError> {
1200        self.call(request).await
1201    }
1202
1203    /// Calls the Slack Web API method [`admin.workflows.triggers.types.permissions.set`](https://docs.slack.dev/reference/methods/admin.workflows.triggers.types.permissions.set): Set the permissions for using a trigger type
1204    ///
1205    /// Required scopes:
1206    ///
1207    /// - user token: `client`
1208    ///
1209    /// Rate limit: Tier 3 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1210    ///
1211    /// # Errors
1212    ///
1213    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1214    #[doc(alias = "admin.workflows.triggers.types.permissions.set")]
1215    pub async fn admin_workflows_triggers_types_permissions_set(
1216        &self,
1217        request: &AdminWorkflowsTriggersTypesPermissionsSetRequest,
1218    ) -> Result<AdminWorkflowsTriggersTypesPermissionsSetResponse, SlackError> {
1219        self.call(request).await
1220    }
1221
1222    /// Calls the Slack Web API method [`admin.workflows.unpublish`](https://docs.slack.dev/reference/methods/admin.workflows.unpublish): Unpublish workflows within the team or enterprise
1223    ///
1224    /// Required scopes:
1225    ///
1226    /// - user token: `admin.workflows:write`
1227    ///
1228    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
1229    ///
1230    /// # Errors
1231    ///
1232    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
1233    #[doc(alias = "admin.workflows.unpublish")]
1234    pub async fn admin_workflows_unpublish(
1235        &self,
1236        request: &AdminWorkflowsUnpublishRequest,
1237    ) -> Result<AdminWorkflowsUnpublishResponse, SlackError> {
1238        self.call(request).await
1239    }
1240}