Skip to main content

slack_web_api/api/
usergroups.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 [`usergroups.create`](https://docs.slack.dev/reference/methods/usergroups.create): Create a User Group.
12///
13/// Send it with [`SlackClient::usergroups_create`].
14#[doc(alias = "usergroups.create")]
15#[derive(Debug, Clone, PartialEq, Serialize)]
16#[non_exhaustive]
17pub struct UsergroupsCreateRequest {
18    /// A name for the User Group. Must be unique among User Groups.
19    pub name: String,
20    /// A comma separated string of encoded channel IDs for which the User Group uses as a default.
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub channels: Option<Vec<String>>,
23    /// A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    pub additional_channels: Option<Vec<String>>,
26    /// A short description of the User Group.
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub description: Option<String>,
29    /// A mention handle. Must be unique among channels, users and User Groups.
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub handle: Option<String>,
32    /// Include the number of users in each User Group.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub include_count: Option<bool>,
35    /// Encoded team id where the user group has to be created, required if org token is used.
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub team_id: Option<String>,
38    /// Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added.
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub enable_section: Option<bool>,
41}
42
43impl UsergroupsCreateRequest {
44    pub fn new(name: impl Into<String>) -> Self {
45        Self {
46            name: name.into(),
47            channels: None,
48            additional_channels: None,
49            description: None,
50            handle: None,
51            include_count: None,
52            team_id: None,
53            enable_section: None,
54        }
55    }
56
57    pub fn channels(mut self, channels: Vec<String>) -> Self {
58        self.channels = Some(channels);
59        self
60    }
61
62    pub fn additional_channels(mut self, additional_channels: Vec<String>) -> Self {
63        self.additional_channels = Some(additional_channels);
64        self
65    }
66
67    pub fn description(mut self, description: impl Into<String>) -> Self {
68        self.description = Some(description.into());
69        self
70    }
71
72    pub fn handle(mut self, handle: impl Into<String>) -> Self {
73        self.handle = Some(handle.into());
74        self
75    }
76
77    pub fn include_count(mut self, include_count: bool) -> Self {
78        self.include_count = Some(include_count);
79        self
80    }
81
82    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
83        self.team_id = Some(team_id.into());
84        self
85    }
86
87    pub fn enable_section(mut self, enable_section: bool) -> Self {
88        self.enable_section = Some(enable_section);
89        self
90    }
91}
92
93impl SlackApiMethod for UsergroupsCreateRequest {
94    const METHOD: &'static str = "usergroups.create";
95    type Response = UsergroupsCreateResponse;
96}
97
98/// Successful response of the Slack Web API method [`usergroups.create`](https://docs.slack.dev/reference/methods/usergroups.create).
99#[doc(alias = "usergroups.create")]
100#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
101pub struct UsergroupsCreateResponse {
102    #[serde(
103        default,
104        deserialize_with = "crate::de::opt_object",
105        skip_serializing_if = "Option::is_none"
106    )]
107    pub usergroup: Option<Usergroup>,
108    #[serde(
109        default,
110        deserialize_with = "crate::de::opt_object",
111        skip_serializing_if = "Option::is_none"
112    )]
113    pub response_metadata: Option<ResponseMetadata>,
114    #[serde(
115        default,
116        deserialize_with = "crate::de::opt_string",
117        skip_serializing_if = "Option::is_none"
118    )]
119    pub warning: Option<String>,
120}
121
122/// Arguments for the Slack Web API method [`usergroups.disable`](https://docs.slack.dev/reference/methods/usergroups.disable): Disable an existing User Group.
123///
124/// Send it with [`SlackClient::usergroups_disable`].
125#[doc(alias = "usergroups.disable")]
126#[derive(Debug, Clone, PartialEq, Serialize)]
127#[non_exhaustive]
128pub struct UsergroupsDisableRequest {
129    /// The encoded ID of the User Group to disable.
130    pub usergroup: String,
131    /// Include the number of users in the User Group.
132    #[serde(skip_serializing_if = "Option::is_none")]
133    pub include_count: Option<bool>,
134    /// Encoded target team id where the user group is, required if org token is used.
135    #[serde(skip_serializing_if = "Option::is_none")]
136    pub team_id: Option<String>,
137}
138
139impl UsergroupsDisableRequest {
140    pub fn new(usergroup: impl Into<String>) -> Self {
141        Self {
142            usergroup: usergroup.into(),
143            include_count: None,
144            team_id: None,
145        }
146    }
147
148    pub fn include_count(mut self, include_count: bool) -> Self {
149        self.include_count = Some(include_count);
150        self
151    }
152
153    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
154        self.team_id = Some(team_id.into());
155        self
156    }
157}
158
159impl SlackApiMethod for UsergroupsDisableRequest {
160    const METHOD: &'static str = "usergroups.disable";
161    type Response = UsergroupsDisableResponse;
162}
163
164/// Successful response of the Slack Web API method [`usergroups.disable`](https://docs.slack.dev/reference/methods/usergroups.disable).
165#[doc(alias = "usergroups.disable")]
166#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
167pub struct UsergroupsDisableResponse {
168    #[serde(
169        default,
170        deserialize_with = "crate::de::opt_object",
171        skip_serializing_if = "Option::is_none"
172    )]
173    pub usergroup: Option<Usergroup>,
174    #[serde(
175        default,
176        deserialize_with = "crate::de::opt_object",
177        skip_serializing_if = "Option::is_none"
178    )]
179    pub response_metadata: Option<ResponseMetadata>,
180    #[serde(
181        default,
182        deserialize_with = "crate::de::opt_string",
183        skip_serializing_if = "Option::is_none"
184    )]
185    pub warning: Option<String>,
186}
187
188/// Arguments for the Slack Web API method [`usergroups.enable`](https://docs.slack.dev/reference/methods/usergroups.enable): Enable a User Group.
189///
190/// Send it with [`SlackClient::usergroups_enable`].
191#[doc(alias = "usergroups.enable")]
192#[derive(Debug, Clone, PartialEq, Serialize)]
193#[non_exhaustive]
194pub struct UsergroupsEnableRequest {
195    /// The encoded ID of the User Group to enable.
196    pub usergroup: String,
197    /// Include the number of users in the User Group.
198    #[serde(skip_serializing_if = "Option::is_none")]
199    pub include_count: Option<bool>,
200    /// Encoded team id where the user group is, required if org token is used.
201    #[serde(skip_serializing_if = "Option::is_none")]
202    pub team_id: Option<String>,
203}
204
205impl UsergroupsEnableRequest {
206    pub fn new(usergroup: impl Into<String>) -> Self {
207        Self {
208            usergroup: usergroup.into(),
209            include_count: None,
210            team_id: None,
211        }
212    }
213
214    pub fn include_count(mut self, include_count: bool) -> Self {
215        self.include_count = Some(include_count);
216        self
217    }
218
219    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
220        self.team_id = Some(team_id.into());
221        self
222    }
223}
224
225impl SlackApiMethod for UsergroupsEnableRequest {
226    const METHOD: &'static str = "usergroups.enable";
227    type Response = UsergroupsEnableResponse;
228}
229
230/// Successful response of the Slack Web API method [`usergroups.enable`](https://docs.slack.dev/reference/methods/usergroups.enable).
231#[doc(alias = "usergroups.enable")]
232#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
233pub struct UsergroupsEnableResponse {
234    #[serde(
235        default,
236        deserialize_with = "crate::de::opt_object",
237        skip_serializing_if = "Option::is_none"
238    )]
239    pub usergroup: Option<Usergroup>,
240    #[serde(
241        default,
242        deserialize_with = "crate::de::opt_object",
243        skip_serializing_if = "Option::is_none"
244    )]
245    pub response_metadata: Option<ResponseMetadata>,
246    #[serde(
247        default,
248        deserialize_with = "crate::de::opt_string",
249        skip_serializing_if = "Option::is_none"
250    )]
251    pub warning: Option<String>,
252}
253
254/// Arguments for the Slack Web API method [`usergroups.list`](https://docs.slack.dev/reference/methods/usergroups.list): List all User Groups for a team.
255///
256/// Send it with [`SlackClient::usergroups_list`].
257#[doc(alias = "usergroups.list")]
258#[derive(Debug, Clone, PartialEq, Serialize, Default)]
259#[non_exhaustive]
260pub struct UsergroupsListRequest {
261    /// Include the number of users in each User Group.
262    #[serde(skip_serializing_if = "Option::is_none")]
263    pub include_count: Option<bool>,
264    /// Include results for disabled User Groups.
265    #[serde(skip_serializing_if = "Option::is_none")]
266    pub include_disabled: Option<bool>,
267    /// Include the list of users for each User Group.
268    #[serde(skip_serializing_if = "Option::is_none")]
269    pub include_users: Option<bool>,
270    /// The user group's encoded team ID. Required if org token is used.
271    #[serde(skip_serializing_if = "Option::is_none")]
272    pub team_id: Option<String>,
273}
274
275impl UsergroupsListRequest {
276    pub fn new() -> Self {
277        Self {
278            include_count: None,
279            include_disabled: None,
280            include_users: None,
281            team_id: None,
282        }
283    }
284
285    pub fn include_count(mut self, include_count: bool) -> Self {
286        self.include_count = Some(include_count);
287        self
288    }
289
290    pub fn include_disabled(mut self, include_disabled: bool) -> Self {
291        self.include_disabled = Some(include_disabled);
292        self
293    }
294
295    pub fn include_users(mut self, include_users: bool) -> Self {
296        self.include_users = Some(include_users);
297        self
298    }
299
300    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
301        self.team_id = Some(team_id.into());
302        self
303    }
304}
305
306impl SlackApiMethod for UsergroupsListRequest {
307    const METHOD: &'static str = "usergroups.list";
308    type Response = UsergroupsListResponse;
309}
310
311/// Successful response of the Slack Web API method [`usergroups.list`](https://docs.slack.dev/reference/methods/usergroups.list).
312#[doc(alias = "usergroups.list")]
313#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
314pub struct UsergroupsListResponse {
315    #[serde(
316        default,
317        deserialize_with = "crate::de::vec",
318        skip_serializing_if = "Vec::is_empty"
319    )]
320    pub usergroups: Vec<Usergroup>,
321    #[serde(
322        default,
323        deserialize_with = "crate::de::opt_object",
324        skip_serializing_if = "Option::is_none"
325    )]
326    pub response_metadata: Option<ResponseMetadata>,
327    #[serde(
328        default,
329        deserialize_with = "crate::de::opt_string",
330        skip_serializing_if = "Option::is_none"
331    )]
332    pub warning: Option<String>,
333}
334
335/// Arguments for the Slack Web API method [`usergroups.update`](https://docs.slack.dev/reference/methods/usergroups.update): Update an existing User Group.
336///
337/// Send it with [`SlackClient::usergroups_update`].
338#[doc(alias = "usergroups.update")]
339#[derive(Debug, Clone, PartialEq, Serialize)]
340#[non_exhaustive]
341pub struct UsergroupsUpdateRequest {
342    /// The encoded ID of the User Group to update.
343    pub usergroup: String,
344    /// A comma separated string of encoded channel IDs for which the User Group uses as a default.
345    #[serde(skip_serializing_if = "Option::is_none")]
346    pub channels: Option<Vec<String>>,
347    /// A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.
348    #[serde(skip_serializing_if = "Option::is_none")]
349    pub additional_channels: Option<Vec<String>>,
350    /// A short description of the User Group.
351    #[serde(skip_serializing_if = "Option::is_none")]
352    pub description: Option<String>,
353    /// A mention handle. Must be unique among channels, users and User Groups.
354    #[serde(skip_serializing_if = "Option::is_none")]
355    pub handle: Option<String>,
356    /// Include the number of users in the User Group.
357    #[serde(skip_serializing_if = "Option::is_none")]
358    pub include_count: Option<bool>,
359    /// A name for the User Group. Must be unique among User Groups.
360    #[serde(skip_serializing_if = "Option::is_none")]
361    pub name: Option<String>,
362    /// encoded team id where the user group exists, required if org token is used
363    #[serde(skip_serializing_if = "Option::is_none")]
364    pub team_id: Option<String>,
365    /// Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added.
366    #[serde(skip_serializing_if = "Option::is_none")]
367    pub enable_section: Option<bool>,
368}
369
370impl UsergroupsUpdateRequest {
371    pub fn new(usergroup: impl Into<String>) -> Self {
372        Self {
373            usergroup: usergroup.into(),
374            channels: None,
375            additional_channels: None,
376            description: None,
377            handle: None,
378            include_count: None,
379            name: None,
380            team_id: None,
381            enable_section: None,
382        }
383    }
384
385    pub fn channels(mut self, channels: Vec<String>) -> Self {
386        self.channels = Some(channels);
387        self
388    }
389
390    pub fn additional_channels(mut self, additional_channels: Vec<String>) -> Self {
391        self.additional_channels = Some(additional_channels);
392        self
393    }
394
395    pub fn description(mut self, description: impl Into<String>) -> Self {
396        self.description = Some(description.into());
397        self
398    }
399
400    pub fn handle(mut self, handle: impl Into<String>) -> Self {
401        self.handle = Some(handle.into());
402        self
403    }
404
405    pub fn include_count(mut self, include_count: bool) -> Self {
406        self.include_count = Some(include_count);
407        self
408    }
409
410    pub fn name(mut self, name: impl Into<String>) -> Self {
411        self.name = Some(name.into());
412        self
413    }
414
415    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
416        self.team_id = Some(team_id.into());
417        self
418    }
419
420    pub fn enable_section(mut self, enable_section: bool) -> Self {
421        self.enable_section = Some(enable_section);
422        self
423    }
424}
425
426impl SlackApiMethod for UsergroupsUpdateRequest {
427    const METHOD: &'static str = "usergroups.update";
428    type Response = UsergroupsUpdateResponse;
429}
430
431/// Successful response of the Slack Web API method [`usergroups.update`](https://docs.slack.dev/reference/methods/usergroups.update).
432#[doc(alias = "usergroups.update")]
433#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
434pub struct UsergroupsUpdateResponse {
435    #[serde(
436        default,
437        deserialize_with = "crate::de::opt_object",
438        skip_serializing_if = "Option::is_none"
439    )]
440    pub usergroup: Option<Usergroup>,
441    #[serde(
442        default,
443        deserialize_with = "crate::de::opt_object",
444        skip_serializing_if = "Option::is_none"
445    )]
446    pub response_metadata: Option<ResponseMetadata>,
447    #[serde(
448        default,
449        deserialize_with = "crate::de::opt_string",
450        skip_serializing_if = "Option::is_none"
451    )]
452    pub warning: Option<String>,
453}
454
455/// Arguments for the Slack Web API method [`usergroups.users.list`](https://docs.slack.dev/reference/methods/usergroups.users.list): List all users in a User Group.
456///
457/// Send it with [`SlackClient::usergroups_users_list`].
458#[doc(alias = "usergroups.users.list")]
459#[derive(Debug, Clone, PartialEq, Serialize)]
460#[non_exhaustive]
461pub struct UsergroupsUsersListRequest {
462    /// The encoded ID of the User Group.
463    pub usergroup: String,
464    /// Include results for disabled User Groups.
465    #[serde(skip_serializing_if = "Option::is_none")]
466    pub include_disabled: Option<bool>,
467    /// The user group's encoded team ID. Required if org token is used.
468    #[serde(skip_serializing_if = "Option::is_none")]
469    pub team_id: Option<String>,
470}
471
472impl UsergroupsUsersListRequest {
473    pub fn new(usergroup: impl Into<String>) -> Self {
474        Self {
475            usergroup: usergroup.into(),
476            include_disabled: None,
477            team_id: None,
478        }
479    }
480
481    pub fn include_disabled(mut self, include_disabled: bool) -> Self {
482        self.include_disabled = Some(include_disabled);
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
492impl SlackApiMethod for UsergroupsUsersListRequest {
493    const METHOD: &'static str = "usergroups.users.list";
494    type Response = UsergroupsUsersListResponse;
495}
496
497/// Successful response of the Slack Web API method [`usergroups.users.list`](https://docs.slack.dev/reference/methods/usergroups.users.list).
498#[doc(alias = "usergroups.users.list")]
499#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
500pub struct UsergroupsUsersListResponse {
501    #[serde(
502        default,
503        deserialize_with = "crate::de::vec",
504        skip_serializing_if = "Vec::is_empty"
505    )]
506    pub users: Vec<String>,
507    #[serde(
508        default,
509        deserialize_with = "crate::de::opt_object",
510        skip_serializing_if = "Option::is_none"
511    )]
512    pub response_metadata: Option<ResponseMetadata>,
513    #[serde(
514        default,
515        deserialize_with = "crate::de::opt_string",
516        skip_serializing_if = "Option::is_none"
517    )]
518    pub warning: Option<String>,
519}
520
521/// Arguments for the Slack Web API method [`usergroups.users.update`](https://docs.slack.dev/reference/methods/usergroups.users.update): Update the list of users for a user group.
522///
523/// Send it with [`SlackClient::usergroups_users_update`].
524#[doc(alias = "usergroups.users.update")]
525#[derive(Debug, Clone, PartialEq, Serialize)]
526#[non_exhaustive]
527pub struct UsergroupsUsersUpdateRequest {
528    /// The encoded ID of the user group to update.
529    pub usergroup: String,
530    /// A comma separated string of encoded user IDs that represent the entire list of users for the user group.
531    pub users: Vec<String>,
532    /// Include the number of users in the user group.
533    #[serde(skip_serializing_if = "Option::is_none")]
534    pub include_count: Option<bool>,
535    /// encoded team id where the user group exists, required if org token is used
536    #[serde(skip_serializing_if = "Option::is_none")]
537    pub team_id: Option<String>,
538    /// A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.
539    #[serde(skip_serializing_if = "Option::is_none")]
540    pub additional_channels: Option<Vec<String>>,
541    /// Boolean to identify if the API is getting called when a shared section is getting shared
542    #[serde(skip_serializing_if = "Option::is_none")]
543    pub is_shared: Option<bool>,
544}
545
546impl UsergroupsUsersUpdateRequest {
547    pub fn new(usergroup: impl Into<String>, users: Vec<String>) -> Self {
548        Self {
549            usergroup: usergroup.into(),
550            users,
551            include_count: None,
552            team_id: None,
553            additional_channels: None,
554            is_shared: None,
555        }
556    }
557
558    pub fn include_count(mut self, include_count: bool) -> Self {
559        self.include_count = Some(include_count);
560        self
561    }
562
563    pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
564        self.team_id = Some(team_id.into());
565        self
566    }
567
568    pub fn additional_channels(mut self, additional_channels: Vec<String>) -> Self {
569        self.additional_channels = Some(additional_channels);
570        self
571    }
572
573    pub fn is_shared(mut self, is_shared: bool) -> Self {
574        self.is_shared = Some(is_shared);
575        self
576    }
577}
578
579impl SlackApiMethod for UsergroupsUsersUpdateRequest {
580    const METHOD: &'static str = "usergroups.users.update";
581    type Response = UsergroupsUsersUpdateResponse;
582}
583
584/// Successful response of the Slack Web API method [`usergroups.users.update`](https://docs.slack.dev/reference/methods/usergroups.users.update).
585#[doc(alias = "usergroups.users.update")]
586#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
587pub struct UsergroupsUsersUpdateResponse {
588    #[serde(
589        default,
590        deserialize_with = "crate::de::opt_object",
591        skip_serializing_if = "Option::is_none"
592    )]
593    pub usergroup: Option<Usergroup>,
594    #[serde(
595        default,
596        deserialize_with = "crate::de::opt_object",
597        skip_serializing_if = "Option::is_none"
598    )]
599    pub response_metadata: Option<ResponseMetadata>,
600    #[serde(
601        default,
602        deserialize_with = "crate::de::opt_string",
603        skip_serializing_if = "Option::is_none"
604    )]
605    pub warning: Option<String>,
606}
607
608impl SlackClient {
609    /// Calls the Slack Web API method [`usergroups.create`](https://docs.slack.dev/reference/methods/usergroups.create): Create a User Group.
610    ///
611    /// Required scopes:
612    ///
613    /// - bot token: `usergroups:write`
614    /// - user token: `usergroups:write`
615    ///
616    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
617    ///
618    /// # Errors
619    ///
620    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
621    #[doc(alias = "usergroups.create")]
622    pub async fn usergroups_create(
623        &self,
624        request: &UsergroupsCreateRequest,
625    ) -> Result<UsergroupsCreateResponse, SlackError> {
626        self.call(request).await
627    }
628
629    /// Calls the Slack Web API method [`usergroups.disable`](https://docs.slack.dev/reference/methods/usergroups.disable): Disable an existing User Group.
630    ///
631    /// Required scopes:
632    ///
633    /// - bot token: `usergroups:write`
634    /// - user token: `usergroups:write`
635    ///
636    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
637    ///
638    /// # Errors
639    ///
640    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
641    #[doc(alias = "usergroups.disable")]
642    pub async fn usergroups_disable(
643        &self,
644        request: &UsergroupsDisableRequest,
645    ) -> Result<UsergroupsDisableResponse, SlackError> {
646        self.call(request).await
647    }
648
649    /// Calls the Slack Web API method [`usergroups.enable`](https://docs.slack.dev/reference/methods/usergroups.enable): Enable a User Group.
650    ///
651    /// Required scopes:
652    ///
653    /// - bot token: `usergroups:write`
654    /// - user token: `usergroups:write`
655    ///
656    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
657    ///
658    /// # Errors
659    ///
660    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
661    #[doc(alias = "usergroups.enable")]
662    pub async fn usergroups_enable(
663        &self,
664        request: &UsergroupsEnableRequest,
665    ) -> Result<UsergroupsEnableResponse, SlackError> {
666        self.call(request).await
667    }
668
669    /// Calls the Slack Web API method [`usergroups.list`](https://docs.slack.dev/reference/methods/usergroups.list): List all User Groups for a team.
670    ///
671    /// Required scopes:
672    ///
673    /// - bot token: `usergroups:read`
674    /// - user token: `usergroups:read`
675    ///
676    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
677    ///
678    /// # Errors
679    ///
680    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
681    #[doc(alias = "usergroups.list")]
682    pub async fn usergroups_list(
683        &self,
684        request: &UsergroupsListRequest,
685    ) -> Result<UsergroupsListResponse, SlackError> {
686        self.call(request).await
687    }
688
689    /// Calls the Slack Web API method [`usergroups.update`](https://docs.slack.dev/reference/methods/usergroups.update): Update an existing User Group.
690    ///
691    /// Required scopes:
692    ///
693    /// - bot token: `usergroups:write`
694    /// - user token: `usergroups:write`
695    ///
696    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
697    ///
698    /// # Errors
699    ///
700    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
701    #[doc(alias = "usergroups.update")]
702    pub async fn usergroups_update(
703        &self,
704        request: &UsergroupsUpdateRequest,
705    ) -> Result<UsergroupsUpdateResponse, SlackError> {
706        self.call(request).await
707    }
708
709    /// Calls the Slack Web API method [`usergroups.users.list`](https://docs.slack.dev/reference/methods/usergroups.users.list): List all users in a User Group.
710    ///
711    /// Required scopes:
712    ///
713    /// - bot token: `usergroups:read`
714    /// - user token: `usergroups:read`
715    ///
716    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
717    ///
718    /// # Errors
719    ///
720    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
721    #[doc(alias = "usergroups.users.list")]
722    pub async fn usergroups_users_list(
723        &self,
724        request: &UsergroupsUsersListRequest,
725    ) -> Result<UsergroupsUsersListResponse, SlackError> {
726        self.call(request).await
727    }
728
729    /// Calls the Slack Web API method [`usergroups.users.update`](https://docs.slack.dev/reference/methods/usergroups.users.update): Update the list of users for a user group.
730    ///
731    /// Required scopes:
732    ///
733    /// - bot token: `usergroups:write`
734    /// - user token: `usergroups:write`
735    ///
736    /// Rate limit: Tier 2 (<https://docs.slack.dev/apis/web-api/rate-limits>).
737    ///
738    /// # Errors
739    ///
740    /// Returns [`SlackError::Api`] when Slack answers `"ok": false`; see [`SlackClient::call`] for the other cases.
741    #[doc(alias = "usergroups.users.update")]
742    pub async fn usergroups_users_update(
743        &self,
744        request: &UsergroupsUsersUpdateRequest,
745    ) -> Result<UsergroupsUsersUpdateResponse, SlackError> {
746        self.call(request).await
747    }
748}