slack-ruby-client 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/workflows/integration_test.yml +19 -0
  4. data/.github/workflows/pr_lint.yml +1 -1
  5. data/.github/workflows/test.yml +1 -0
  6. data/CHANGELOG.md +9 -0
  7. data/README.md +18 -14
  8. data/SECURITY.md +9 -0
  9. data/bin/commands/admin_analytics.rb +16 -10
  10. data/bin/commands/admin_apps.rb +48 -42
  11. data/bin/commands/admin_apps_approved.rb +17 -11
  12. data/bin/commands/admin_apps_requests.rb +27 -21
  13. data/bin/commands/admin_apps_restricted.rb +17 -11
  14. data/bin/commands/admin_audit_anomaly_allow.rb +22 -16
  15. data/bin/commands/admin_auth_policy.rb +37 -31
  16. data/bin/commands/admin_barriers.rb +44 -38
  17. data/bin/commands/admin_conversations.rb +221 -165
  18. data/bin/commands/admin_conversations_ekm.rb +17 -11
  19. data/bin/commands/admin_conversations_restrictAccess.rb +35 -29
  20. data/bin/commands/admin_emoji.rb +50 -44
  21. data/bin/commands/admin_inviteRequests.rb +34 -28
  22. data/bin/commands/admin_inviteRequests_approved.rb +16 -10
  23. data/bin/commands/admin_inviteRequests_denied.rb +16 -10
  24. data/bin/commands/admin_roles.rb +46 -0
  25. data/bin/commands/admin_teams.rb +26 -20
  26. data/bin/commands/admin_teams_admins.rb +16 -10
  27. data/bin/commands/admin_teams_owners.rb +16 -10
  28. data/bin/commands/admin_teams_settings.rb +59 -53
  29. data/bin/commands/admin_usergroups.rb +45 -39
  30. data/bin/commands/admin_users.rb +91 -85
  31. data/bin/commands/admin_users_session.rb +72 -66
  32. data/bin/commands/admin_users_unsupportedVersions.rb +15 -9
  33. data/bin/commands/api.rb +14 -8
  34. data/bin/commands/apps.rb +15 -9
  35. data/bin/commands/apps_connections.rb +13 -7
  36. data/bin/commands/apps_event_authorizations.rb +16 -10
  37. data/bin/commands/apps_manifest.rb +48 -42
  38. data/bin/commands/auth.rb +21 -15
  39. data/bin/commands/auth_teams.rb +16 -10
  40. data/bin/commands/bookmarks.rb +50 -44
  41. data/bin/commands/bots.rb +15 -9
  42. data/bin/commands/calls.rb +49 -43
  43. data/bin/commands/calls_participants.rb +24 -18
  44. data/bin/commands/chat.rb +150 -144
  45. data/bin/commands/chat_scheduledMessages.rb +19 -13
  46. data/bin/commands/conversations.rb +233 -227
  47. data/bin/commands/dialog.rb +15 -9
  48. data/bin/commands/dnd.rb +46 -40
  49. data/bin/commands/emoji.rb +14 -7
  50. data/bin/commands/files.rb +110 -105
  51. data/bin/commands/files_comments.rb +15 -9
  52. data/bin/commands/files_remote.rb +73 -67
  53. data/bin/commands/functions_workflows_steps.rb +22 -0
  54. data/bin/commands/functions_workflows_steps_responses.rb +22 -0
  55. data/bin/commands/migration.rb +16 -10
  56. data/bin/commands/oauth.rb +18 -12
  57. data/bin/commands/oauth_v2.rb +28 -22
  58. data/bin/commands/openid_connect.rb +26 -20
  59. data/bin/commands/pins.rb +33 -26
  60. data/bin/commands/reactions.rb +52 -46
  61. data/bin/commands/reminders.rb +53 -47
  62. data/bin/commands/rtm.rb +15 -9
  63. data/bin/commands/search.rb +43 -37
  64. data/bin/commands/stars.rb +38 -32
  65. data/bin/commands/team.rb +47 -39
  66. data/bin/commands/team_billing.rb +13 -7
  67. data/bin/commands/team_preferences.rb +13 -7
  68. data/bin/commands/team_profile.rb +14 -8
  69. data/bin/commands/tooling_tokens.rb +14 -8
  70. data/bin/commands/usergroups.rb +64 -58
  71. data/bin/commands/usergroups_users.rb +27 -21
  72. data/bin/commands/users.rb +111 -105
  73. data/bin/commands/users_admin.rb +28 -22
  74. data/bin/commands/users_prefs.rb +13 -7
  75. data/bin/commands/users_profile.rb +26 -20
  76. data/bin/commands/views.rb +47 -41
  77. data/bin/commands/workflows.rb +36 -30
  78. data/bin/slack +48 -43
  79. data/lib/slack/version.rb +1 -1
  80. data/lib/slack/web/api/endpoints/admin_analytics.rb +1 -1
  81. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +1 -1
  82. data/lib/slack/web/api/endpoints/admin_conversations.rb +78 -0
  83. data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
  84. data/lib/slack/web/api/endpoints/chat.rb +2 -2
  85. data/lib/slack/web/api/endpoints/conversations.rb +1 -1
  86. data/lib/slack/web/api/endpoints/emoji.rb +2 -0
  87. data/lib/slack/web/api/endpoints/files.rb +0 -2
  88. data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +28 -0
  89. data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +28 -0
  90. data/lib/slack/web/api/endpoints/pins.rb +2 -0
  91. data/lib/slack/web/api/endpoints/team.rb +11 -1
  92. data/lib/slack/web/api/endpoints/usergroups.rb +1 -1
  93. data/lib/slack/web/api/endpoints/users_profile.rb +1 -1
  94. data/lib/slack/web/api/endpoints.rb +6 -0
  95. data/lib/slack/web/api/errors.rb +62 -0
  96. data/lib/slack/web/api/templates/command.erb +18 -12
  97. data/lib/tasks/web.rake +0 -6
  98. data/slack-ruby-client.gemspec +0 -1
  99. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +31 -0
  100. data/spec/slack/web/api/endpoints/admin_roles_spec.rb +30 -0
  101. data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +13 -0
  102. data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +13 -0
  103. metadata +13 -19
  104. data/bin/commands.rb +0 -69
  105. data/lib/slack/web/api/templates/commands.erb +0 -6
@@ -1,40 +1,46 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Stars methods.'
5
- command 'stars' do |g|
6
- g.desc 'Save an item for later. Formerly known as _adding a star_.'
7
- g.long_desc %( Save an item for later. Formerly known as _adding a star_. )
8
- g.command 'add' do |c|
9
- c.flag 'channel', desc: 'Channel to add star to, or channel where the message to add star to was posted (used with timestamp).'
10
- c.flag 'file', desc: 'File to add star to.'
11
- c.flag 'file_comment', desc: 'File comment to add star to.'
12
- c.flag 'timestamp', desc: 'Timestamp of the message to add star to.'
13
- c.action do |_global_options, options, _args|
14
- puts JSON.dump($client.stars_add(options))
15
- end
16
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Stars methods.'
8
+ command 'stars' do |g|
9
+ g.desc 'Save an item for later. Formerly known as _adding a star_.'
10
+ g.long_desc %( Save an item for later. Formerly known as _adding a star_. )
11
+ g.command 'add' do |c|
12
+ c.flag 'channel', desc: 'Channel to add star to, or channel where the message to add star to was posted (used with timestamp).'
13
+ c.flag 'file', desc: 'File to add star to.'
14
+ c.flag 'file_comment', desc: 'File comment to add star to.'
15
+ c.flag 'timestamp', desc: 'Timestamp of the message to add star to.'
16
+ c.action do |_global_options, options, _args|
17
+ puts JSON.dump(@client.stars_add(options))
18
+ end
19
+ end
17
20
 
18
- g.desc "List a user's saved items, formerly known as _stars_."
19
- g.long_desc %( List a user's saved items, formerly known as _stars_. )
20
- g.command 'list' do |c|
21
- c.flag 'cursor', desc: "Parameter for pagination. 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. See pagination for more details."
22
- c.flag 'limit', desc: "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."
23
- c.flag 'team_id', desc: 'encoded team id to list stars in, required if org token is used.'
24
- c.action do |_global_options, options, _args|
25
- puts JSON.dump($client.stars_list(options))
26
- end
27
- end
21
+ g.desc "List a user's saved items, formerly known as _stars_."
22
+ g.long_desc %( List a user's saved items, formerly known as _stars_. )
23
+ g.command 'list' do |c|
24
+ c.flag 'cursor', desc: "Parameter for pagination. 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. See pagination for more details."
25
+ c.flag 'limit', desc: "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."
26
+ c.flag 'team_id', desc: 'encoded team id to list stars in, required if org token is used.'
27
+ c.action do |_global_options, options, _args|
28
+ puts JSON.dump(@client.stars_list(options))
29
+ end
30
+ end
28
31
 
29
- g.desc 'Removes a saved item (star) from an item.'
30
- g.long_desc %( Removes a saved item (star) from an item. )
31
- g.command 'remove' do |c|
32
- c.flag 'channel', desc: 'Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).'
33
- c.flag 'file', desc: 'File to remove star from.'
34
- c.flag 'file_comment', desc: 'File comment to remove star from.'
35
- c.flag 'timestamp', desc: 'Timestamp of the message to remove star from.'
36
- c.action do |_global_options, options, _args|
37
- puts JSON.dump($client.stars_remove(options))
32
+ g.desc 'Removes a saved item (star) from an item.'
33
+ g.long_desc %( Removes a saved item (star) from an item. )
34
+ g.command 'remove' do |c|
35
+ c.flag 'channel', desc: 'Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).'
36
+ c.flag 'file', desc: 'File to remove star from.'
37
+ c.flag 'file_comment', desc: 'File comment to remove star from.'
38
+ c.flag 'timestamp', desc: 'Timestamp of the message to remove star from.'
39
+ c.action do |_global_options, options, _args|
40
+ puts JSON.dump(@client.stars_remove(options))
41
+ end
42
+ end
43
+ end
38
44
  end
39
45
  end
40
46
  end
data/bin/commands/team.rb CHANGED
@@ -1,48 +1,56 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Team methods.'
5
- command 'team' do |g|
6
- g.desc 'Gets the access logs for the current team.'
7
- g.long_desc %( Gets the access logs for the current team. )
8
- g.command 'accessLogs' do |c|
9
- c.flag 'before', desc: 'End of time range of logs to include in results (inclusive).'
10
- c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.team_accessLogs(options))
13
- end
14
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Team methods.'
8
+ command 'team' do |g|
9
+ g.desc 'Gets the access logs for the current team.'
10
+ g.long_desc %( Gets the access logs for the current team. )
11
+ g.command 'accessLogs' do |c|
12
+ c.flag 'before', desc: 'End of time range of logs to include in results (inclusive).'
13
+ c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.team_accessLogs(options))
16
+ end
17
+ end
15
18
 
16
- g.desc 'Gets billable users information for the current team.'
17
- g.long_desc %( Gets billable users information for the current team. )
18
- g.command 'billableInfo' do |c|
19
- c.flag 'team_id', desc: 'encoded team id to get the billable information from, required if org token is used.'
20
- c.flag 'user', desc: 'A user to retrieve the billable information for. Defaults to all users.'
21
- c.action do |_global_options, options, _args|
22
- puts JSON.dump($client.team_billableInfo(options))
23
- end
24
- end
19
+ g.desc 'Gets billable users information for the current team.'
20
+ g.long_desc %( Gets billable users information for the current team. )
21
+ g.command 'billableInfo' do |c|
22
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by previous call, to indicate from where you want to list next page of users list. Default value fetches the first page.'
23
+ c.flag 'limit', desc: 'The maximum number of items to return.'
24
+ c.flag 'team_id', desc: 'encoded team id to get the billable information from, required if org token is used.'
25
+ c.flag 'user', desc: 'A user to retrieve the billable information for. Defaults to all users.'
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump(@client.team_billableInfo(options))
28
+ end
29
+ end
25
30
 
26
- g.desc 'Gets information about the current team.'
27
- g.long_desc %( Gets information about the current team. )
28
- g.command 'info' do |c|
29
- c.flag 'domain', desc: 'Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself.'
30
- c.flag 'team', desc: 'Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.'
31
- c.action do |_global_options, options, _args|
32
- puts JSON.dump($client.team_info(options))
33
- end
34
- end
31
+ g.desc 'Gets information about the current team.'
32
+ g.long_desc %( Gets information about the current team. )
33
+ g.command 'info' do |c|
34
+ c.flag 'domain', desc: 'Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself.'
35
+ c.flag 'team', desc: 'Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.'
36
+ c.action do |_global_options, options, _args|
37
+ puts JSON.dump(@client.team_info(options))
38
+ end
39
+ end
35
40
 
36
- g.desc 'Gets the integration logs for the current team.'
37
- g.long_desc %( Gets the integration logs for the current team. )
38
- g.command 'integrationLogs' do |c|
39
- c.flag 'app_id', desc: 'Filter logs to this Slack app. Defaults to all logs.'
40
- c.flag 'change_type', desc: 'Filter logs with this change type. Defaults to all logs.'
41
- c.flag 'service_id', desc: 'Filter logs to this service. Defaults to all logs.'
42
- c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.'
43
- c.flag 'user', desc: "Filter logs generated by this user's actions. Defaults to all logs."
44
- c.action do |_global_options, options, _args|
45
- puts JSON.dump($client.team_integrationLogs(options))
41
+ g.desc 'Gets the integration logs for the current team.'
42
+ g.long_desc %( Gets the integration logs for the current team. )
43
+ g.command 'integrationLogs' do |c|
44
+ c.flag 'app_id', desc: 'Filter logs to this Slack app. Defaults to all logs.'
45
+ c.flag 'change_type', desc: 'Filter logs with this change type. Defaults to all logs.'
46
+ c.flag 'service_id', desc: 'Filter logs to this service. Defaults to all logs.'
47
+ c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.'
48
+ c.flag 'user', desc: "Filter logs generated by this user's actions. Defaults to all logs."
49
+ c.action do |_global_options, options, _args|
50
+ puts JSON.dump(@client.team_integrationLogs(options))
51
+ end
52
+ end
53
+ end
46
54
  end
47
55
  end
48
56
  end
@@ -1,13 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'TeamBilling methods.'
5
- command 'team_billing' do |g|
6
- g.desc "Reads a workspace's billing plan information."
7
- g.long_desc %( Reads a workspace's billing plan information. )
8
- g.command 'info' do |c|
9
- c.action do |_global_options, options, _args|
10
- puts JSON.dump($client.team_billing_info(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'TeamBilling methods.'
8
+ command 'team_billing' do |g|
9
+ g.desc "Reads a workspace's billing plan information."
10
+ g.long_desc %( Reads a workspace's billing plan information. )
11
+ g.command 'info' do |c|
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump(@client.team_billing_info(options))
14
+ end
15
+ end
16
+ end
11
17
  end
12
18
  end
13
19
  end
@@ -1,13 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'TeamPreferences methods.'
5
- command 'team_preferences' do |g|
6
- g.desc "Retrieve a list of a workspace's team preferences."
7
- g.long_desc %( Retrieve a list of a workspace's team preferences. )
8
- g.command 'list' do |c|
9
- c.action do |_global_options, options, _args|
10
- puts JSON.dump($client.team_preferences_list(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'TeamPreferences methods.'
8
+ command 'team_preferences' do |g|
9
+ g.desc "Retrieve a list of a workspace's team preferences."
10
+ g.long_desc %( Retrieve a list of a workspace's team preferences. )
11
+ g.command 'list' do |c|
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump(@client.team_preferences_list(options))
14
+ end
15
+ end
16
+ end
11
17
  end
12
18
  end
13
19
  end
@@ -1,14 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'TeamProfile methods.'
5
- command 'team_profile' do |g|
6
- g.desc "Retrieve a team's profile."
7
- g.long_desc %( Retrieve a team's profile. )
8
- g.command 'get' do |c|
9
- c.flag 'visibility', desc: 'Filter by visibility.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.team_profile_get(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'TeamProfile methods.'
8
+ command 'team_profile' do |g|
9
+ g.desc "Retrieve a team's profile."
10
+ g.long_desc %( Retrieve a team's profile. )
11
+ g.command 'get' do |c|
12
+ c.flag 'visibility', desc: 'Filter by visibility.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump(@client.team_profile_get(options))
15
+ end
16
+ end
17
+ end
12
18
  end
13
19
  end
14
20
  end
@@ -1,14 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'ToolingTokens methods.'
5
- command 'tooling_tokens' do |g|
6
- g.desc 'Exchanges a refresh token for a new app configuration token.'
7
- g.long_desc %( Exchanges a refresh token for a new app configuration token. )
8
- g.command 'rotate' do |c|
9
- c.flag 'refresh_token', desc: 'The xoxe refresh token that was issued along with the old app configuration token.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.tooling_tokens_rotate(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'ToolingTokens methods.'
8
+ command 'tooling_tokens' do |g|
9
+ g.desc 'Exchanges a refresh token for a new app configuration token.'
10
+ g.long_desc %( Exchanges a refresh token for a new app configuration token. )
11
+ g.command 'rotate' do |c|
12
+ c.flag 'refresh_token', desc: 'The xoxe refresh token that was issued along with the old app configuration token.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump(@client.tooling_tokens_rotate(options))
15
+ end
16
+ end
17
+ end
12
18
  end
13
19
  end
14
20
  end
@@ -1,68 +1,74 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Usergroups methods.'
5
- command 'usergroups' do |g|
6
- g.desc 'Create a User Group'
7
- g.long_desc %( Create a User Group )
8
- g.command 'create' do |c|
9
- c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.'
10
- c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.'
11
- c.flag 'description', desc: 'A short description of the User Group.'
12
- c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.'
13
- c.flag 'include_count', desc: 'Include the number of users in each User Group.'
14
- c.flag 'team_id', desc: 'Encoded team id where the user group has to be created, required if org token is used.'
15
- c.action do |_global_options, options, _args|
16
- puts JSON.dump($client.usergroups_create(options))
17
- end
18
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Usergroups methods.'
8
+ command 'usergroups' do |g|
9
+ g.desc 'Create a User Group'
10
+ g.long_desc %( Create a User Group )
11
+ g.command 'create' do |c|
12
+ c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.'
13
+ c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.'
14
+ c.flag 'description', desc: 'A short description of the User Group.'
15
+ c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.'
16
+ c.flag 'include_count', desc: 'Include the number of users in each User Group.'
17
+ c.flag 'team_id', desc: 'Encoded team id where the user group has to be created, required if org token is used.'
18
+ c.action do |_global_options, options, _args|
19
+ puts JSON.dump(@client.usergroups_create(options))
20
+ end
21
+ end
19
22
 
20
- g.desc 'Disable an existing User Group'
21
- g.long_desc %( Disable an existing User Group )
22
- g.command 'disable' do |c|
23
- c.flag 'usergroup', desc: 'The encoded ID of the User Group to disable.'
24
- c.flag 'include_count', desc: 'Include the number of users in the User Group.'
25
- c.flag 'team_id', desc: 'Encoded team id where the user group is, required if org token is used.'
26
- c.action do |_global_options, options, _args|
27
- puts JSON.dump($client.usergroups_disable(options))
28
- end
29
- end
23
+ g.desc 'Disable an existing User Group'
24
+ g.long_desc %( Disable an existing User Group )
25
+ g.command 'disable' do |c|
26
+ c.flag 'usergroup', desc: 'The encoded ID of the User Group to disable.'
27
+ c.flag 'include_count', desc: 'Include the number of users in the User Group.'
28
+ c.flag 'team_id', desc: 'Encoded target team id where the user group is, required if org token is used.'
29
+ c.action do |_global_options, options, _args|
30
+ puts JSON.dump(@client.usergroups_disable(options))
31
+ end
32
+ end
30
33
 
31
- g.desc 'Enable a User Group'
32
- g.long_desc %( Enable a User Group )
33
- g.command 'enable' do |c|
34
- c.flag 'usergroup', desc: 'The encoded ID of the User Group to enable.'
35
- c.flag 'include_count', desc: 'Include the number of users in the User Group.'
36
- c.flag 'team_id', desc: 'Encoded team id where the user group is, required if org token is used.'
37
- c.action do |_global_options, options, _args|
38
- puts JSON.dump($client.usergroups_enable(options))
39
- end
40
- end
34
+ g.desc 'Enable a User Group'
35
+ g.long_desc %( Enable a User Group )
36
+ g.command 'enable' do |c|
37
+ c.flag 'usergroup', desc: 'The encoded ID of the User Group to enable.'
38
+ c.flag 'include_count', desc: 'Include the number of users in the User Group.'
39
+ c.flag 'team_id', desc: 'Encoded team id where the user group is, required if org token is used.'
40
+ c.action do |_global_options, options, _args|
41
+ puts JSON.dump(@client.usergroups_enable(options))
42
+ end
43
+ end
41
44
 
42
- g.desc 'List all User Groups for a team'
43
- g.long_desc %( List all User Groups for a team )
44
- g.command 'list' do |c|
45
- c.flag 'include_count', desc: 'Include the number of users in each User Group.'
46
- c.flag 'include_disabled', desc: 'Include disabled User Groups.'
47
- c.flag 'include_users', desc: 'Include the list of users for each User Group.'
48
- c.flag 'team_id', desc: 'encoded team id to list user groups in, required if org token is used.'
49
- c.action do |_global_options, options, _args|
50
- puts JSON.dump($client.usergroups_list(options))
51
- end
52
- end
45
+ g.desc 'List all User Groups for a team'
46
+ g.long_desc %( List all User Groups for a team )
47
+ g.command 'list' do |c|
48
+ c.flag 'include_count', desc: 'Include the number of users in each User Group.'
49
+ c.flag 'include_disabled', desc: 'Include disabled User Groups.'
50
+ c.flag 'include_users', desc: 'Include the list of users for each User Group.'
51
+ c.flag 'team_id', desc: 'encoded team id to list user groups in, required if org token is used.'
52
+ c.action do |_global_options, options, _args|
53
+ puts JSON.dump(@client.usergroups_list(options))
54
+ end
55
+ end
53
56
 
54
- g.desc 'Update an existing User Group'
55
- g.long_desc %( Update an existing User Group )
56
- g.command 'update' do |c|
57
- c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
58
- c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.'
59
- c.flag 'description', desc: 'A short description of the User Group.'
60
- c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.'
61
- c.flag 'include_count', desc: 'Include the number of users in the User Group.'
62
- c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.'
63
- c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
64
- c.action do |_global_options, options, _args|
65
- puts JSON.dump($client.usergroups_update(options))
57
+ g.desc 'Update an existing User Group'
58
+ g.long_desc %( Update an existing User Group )
59
+ g.command 'update' do |c|
60
+ c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
61
+ c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.'
62
+ c.flag 'description', desc: 'A short description of the User Group.'
63
+ c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.'
64
+ c.flag 'include_count', desc: 'Include the number of users in the User Group.'
65
+ c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.'
66
+ c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
67
+ c.action do |_global_options, options, _args|
68
+ puts JSON.dump(@client.usergroups_update(options))
69
+ end
70
+ end
71
+ end
66
72
  end
67
73
  end
68
74
  end
@@ -1,28 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'UsergroupsUsers methods.'
5
- command 'usergroups_users' do |g|
6
- g.desc 'List all users in a User Group'
7
- g.long_desc %( List all users in a User Group )
8
- g.command 'list' do |c|
9
- c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
10
- c.flag 'include_disabled', desc: 'Allow results that involve disabled User Groups.'
11
- c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.usergroups_users_list(options))
14
- end
15
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'UsergroupsUsers methods.'
8
+ command 'usergroups_users' do |g|
9
+ g.desc 'List all users in a User Group'
10
+ g.long_desc %( List all users in a User Group )
11
+ g.command 'list' do |c|
12
+ c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
13
+ c.flag 'include_disabled', desc: 'Allow results that involve disabled User Groups.'
14
+ c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.usergroups_users_list(options))
17
+ end
18
+ end
16
19
 
17
- g.desc 'Update the list of users for a User Group'
18
- g.long_desc %( Update the list of users for a User Group )
19
- g.command 'update' do |c|
20
- c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
21
- c.flag 'users', desc: 'A comma separated string of encoded user IDs that represent the entire list of users for the User Group.'
22
- c.flag 'include_count', desc: 'Include the number of users in the User Group.'
23
- c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
24
- c.action do |_global_options, options, _args|
25
- puts JSON.dump($client.usergroups_users_update(options))
20
+ g.desc 'Update the list of users for a User Group'
21
+ g.long_desc %( Update the list of users for a User Group )
22
+ g.command 'update' do |c|
23
+ c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
24
+ c.flag 'users', desc: 'A comma separated string of encoded user IDs that represent the entire list of users for the User Group.'
25
+ c.flag 'include_count', desc: 'Include the number of users in the User Group.'
26
+ c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
27
+ c.action do |_global_options, options, _args|
28
+ puts JSON.dump(@client.usergroups_users_update(options))
29
+ end
30
+ end
31
+ end
26
32
  end
27
33
  end
28
34
  end