slack-ruby-client 1.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/workflows/integration_test.yml +45 -0
  4. data/.github/workflows/lint.yml +14 -0
  5. data/.github/workflows/pr_lint.yml +21 -0
  6. data/.github/workflows/test.yml +37 -0
  7. data/.gitignore +4 -3
  8. data/.rubocop.yml +6 -1
  9. data/.rubocop_todo.yml +88 -34
  10. data/.ruby-version +1 -0
  11. data/CHANGELOG.md +36 -0
  12. data/CONTRIBUTING.md +6 -5
  13. data/Gemfile +13 -1
  14. data/Gemfile.danger +6 -0
  15. data/README.md +78 -76
  16. data/RELEASING.md +2 -2
  17. data/SECURITY.md +9 -0
  18. data/UPGRADING.md +28 -0
  19. data/bin/commands/admin_analytics.rb +16 -10
  20. data/bin/commands/admin_apps.rb +48 -42
  21. data/bin/commands/admin_apps_approved.rb +17 -11
  22. data/bin/commands/admin_apps_requests.rb +28 -11
  23. data/bin/commands/admin_apps_restricted.rb +17 -11
  24. data/bin/commands/admin_audit_anomaly_allow.rb +29 -0
  25. data/bin/commands/admin_auth_policy.rb +37 -31
  26. data/bin/commands/admin_barriers.rb +44 -38
  27. data/bin/commands/admin_conversations.rb +221 -163
  28. data/bin/commands/admin_conversations_ekm.rb +17 -11
  29. data/bin/commands/admin_conversations_restrictAccess.rb +35 -29
  30. data/bin/commands/admin_emoji.rb +50 -44
  31. data/bin/commands/admin_inviteRequests.rb +34 -28
  32. data/bin/commands/admin_inviteRequests_approved.rb +16 -10
  33. data/bin/commands/admin_inviteRequests_denied.rb +16 -10
  34. data/bin/commands/admin_roles.rb +46 -0
  35. data/bin/commands/admin_teams.rb +26 -20
  36. data/bin/commands/admin_teams_admins.rb +16 -10
  37. data/bin/commands/admin_teams_owners.rb +16 -10
  38. data/bin/commands/admin_teams_settings.rb +59 -53
  39. data/bin/commands/admin_usergroups.rb +45 -39
  40. data/bin/commands/admin_users.rb +91 -85
  41. data/bin/commands/admin_users_session.rb +72 -66
  42. data/bin/commands/admin_users_unsupportedVersions.rb +21 -0
  43. data/bin/commands/api.rb +14 -8
  44. data/bin/commands/apps.rb +15 -9
  45. data/bin/commands/apps_connections.rb +13 -7
  46. data/bin/commands/apps_event_authorizations.rb +16 -10
  47. data/bin/commands/apps_manifest.rb +48 -41
  48. data/bin/commands/auth.rb +21 -15
  49. data/bin/commands/auth_teams.rb +16 -10
  50. data/bin/commands/bookmarks.rb +59 -0
  51. data/bin/commands/bots.rb +15 -9
  52. data/bin/commands/calls.rb +49 -43
  53. data/bin/commands/calls_participants.rb +24 -18
  54. data/bin/commands/chat.rb +150 -141
  55. data/bin/commands/chat_scheduledMessages.rb +19 -13
  56. data/bin/commands/conversations.rb +233 -225
  57. data/bin/commands/dialog.rb +15 -9
  58. data/bin/commands/dnd.rb +46 -40
  59. data/bin/commands/emoji.rb +14 -7
  60. data/bin/commands/files.rb +112 -83
  61. data/bin/commands/files_comments.rb +15 -9
  62. data/bin/commands/files_remote.rb +73 -67
  63. data/bin/commands/functions_workflows_steps.rb +22 -0
  64. data/bin/commands/functions_workflows_steps_responses.rb +22 -0
  65. data/bin/commands/migration.rb +16 -10
  66. data/bin/commands/oauth.rb +18 -12
  67. data/bin/commands/oauth_v2.rb +28 -22
  68. data/bin/commands/openid_connect.rb +26 -20
  69. data/bin/commands/pins.rb +33 -26
  70. data/bin/commands/reactions.rb +52 -46
  71. data/bin/commands/reminders.rb +53 -47
  72. data/bin/commands/rtm.rb +15 -24
  73. data/bin/commands/search.rb +43 -37
  74. data/bin/commands/stars.rb +38 -32
  75. data/bin/commands/team.rb +47 -38
  76. data/bin/commands/team_billing.rb +13 -7
  77. data/bin/commands/team_preferences.rb +13 -7
  78. data/bin/commands/team_profile.rb +14 -8
  79. data/bin/commands/tooling_tokens.rb +14 -8
  80. data/bin/commands/usergroups.rb +64 -58
  81. data/bin/commands/usergroups_users.rb +27 -21
  82. data/bin/commands/users.rb +111 -105
  83. data/bin/commands/users_admin.rb +28 -22
  84. data/bin/commands/users_prefs.rb +13 -7
  85. data/bin/commands/users_profile.rb +26 -20
  86. data/bin/commands/views.rb +47 -39
  87. data/bin/commands/workflows.rb +36 -30
  88. data/bin/slack +48 -43
  89. data/lib/slack/real_time/api/message.rb +3 -2
  90. data/lib/slack/real_time/api/templates/event_handler.erb +5 -1
  91. data/lib/slack/real_time/api/typing.rb +2 -1
  92. data/lib/slack/real_time/client.rb +10 -28
  93. data/lib/slack/real_time/config.rb +3 -3
  94. data/lib/slack/real_time/models/channel.rb +4 -0
  95. data/lib/slack/real_time/models/{group.rb → mpim.rb} +1 -1
  96. data/lib/slack/real_time/models.rb +2 -1
  97. data/lib/slack/real_time/stores/base.rb +25 -9
  98. data/lib/slack/real_time/stores/starter.rb +323 -309
  99. data/lib/slack/real_time/stores/store.rb +265 -198
  100. data/lib/slack/real_time/stores.rb +1 -7
  101. data/lib/slack/version.rb +1 -1
  102. data/lib/slack/web/api/endpoints/admin_analytics.rb +2 -2
  103. data/lib/slack/web/api/endpoints/admin_apps.rb +2 -2
  104. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +16 -0
  105. data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +34 -0
  106. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +7 -7
  107. data/lib/slack/web/api/endpoints/admin_barriers.rb +8 -8
  108. data/lib/slack/web/api/endpoints/admin_conversations.rb +110 -28
  109. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +6 -6
  110. data/lib/slack/web/api/endpoints/admin_emoji.rb +9 -9
  111. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +2 -2
  112. data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
  113. data/lib/slack/web/api/endpoints/admin_teams.rb +2 -2
  114. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +1 -1
  115. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +1 -1
  116. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +11 -11
  117. data/lib/slack/web/api/endpoints/admin_usergroups.rb +7 -7
  118. data/lib/slack/web/api/endpoints/admin_users.rb +16 -16
  119. data/lib/slack/web/api/endpoints/admin_users_session.rb +8 -8
  120. data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
  121. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  122. data/lib/slack/web/api/endpoints/apps_connections.rb +1 -1
  123. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +1 -1
  124. data/lib/slack/web/api/endpoints/apps_manifest.rb +8 -6
  125. data/lib/slack/web/api/endpoints/bookmarks.rb +88 -0
  126. data/lib/slack/web/api/endpoints/bots.rb +1 -1
  127. data/lib/slack/web/api/endpoints/calls.rb +5 -5
  128. data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
  129. data/lib/slack/web/api/endpoints/chat.rb +37 -31
  130. data/lib/slack/web/api/endpoints/conversations.rb +38 -34
  131. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  132. data/lib/slack/web/api/endpoints/dnd.rb +1 -1
  133. data/lib/slack/web/api/endpoints/emoji.rb +2 -0
  134. data/lib/slack/web/api/endpoints/files.rb +45 -10
  135. data/lib/slack/web/api/endpoints/files_comments.rb +2 -2
  136. data/lib/slack/web/api/endpoints/files_remote.rb +8 -8
  137. data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +28 -0
  138. data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +28 -0
  139. data/lib/slack/web/api/endpoints/migration.rb +1 -1
  140. data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
  141. data/lib/slack/web/api/endpoints/pins.rb +5 -3
  142. data/lib/slack/web/api/endpoints/reactions.rb +4 -4
  143. data/lib/slack/web/api/endpoints/reminders.rb +5 -5
  144. data/lib/slack/web/api/endpoints/rtm.rb +0 -23
  145. data/lib/slack/web/api/endpoints/search.rb +3 -3
  146. data/lib/slack/web/api/endpoints/team.rb +13 -1
  147. data/lib/slack/web/api/endpoints/tooling_tokens.rb +1 -1
  148. data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
  149. data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -3
  150. data/lib/slack/web/api/endpoints/users.rb +4 -4
  151. data/lib/slack/web/api/endpoints/users_admin.rb +2 -2
  152. data/lib/slack/web/api/endpoints/users_profile.rb +1 -1
  153. data/lib/slack/web/api/endpoints/views.rb +16 -11
  154. data/lib/slack/web/api/endpoints/workflows.rb +4 -4
  155. data/lib/slack/web/api/endpoints.rb +12 -0
  156. data/lib/slack/web/api/errors.rb +146 -8
  157. data/lib/slack/web/api/mixins/conversations.id.rb +1 -1
  158. data/lib/slack/web/api/mixins/users.id.rb +1 -1
  159. data/lib/slack/web/api/mixins/users.search.rb +2 -1
  160. data/lib/slack/web/api/patches/{chat.1.patch → chat.attachments-blocks.patch} +13 -14
  161. data/lib/slack/web/api/patches/{dialog.1.open-json-support.patch → dialog.encoded-json.patch} +4 -4
  162. data/lib/slack/web/api/patches/views.view-json.patch +55 -0
  163. data/lib/slack/web/api/templates/command.erb +18 -12
  164. data/lib/slack/web/api/templates/method.erb +1 -1
  165. data/lib/slack/web/config.rb +2 -2
  166. data/lib/slack/web/faraday/connection.rb +4 -4
  167. data/lib/slack/web/faraday/request.rb +2 -0
  168. data/lib/slack/web/faraday/response/raise_error.rb +2 -10
  169. data/lib/slack/web/faraday/response/wrap_error.rb +1 -1
  170. data/lib/slack-ruby-client.rb +2 -1
  171. data/lib/tasks/real_time.rake +44 -24
  172. data/lib/tasks/web.rake +9 -8
  173. data/slack-ruby-client.gemspec +5 -14
  174. data/spec/fixtures/slack/web/rtm_connect.yml +85 -1
  175. data/spec/integration/integration_spec.rb +1 -1
  176. data/spec/slack/events/config_spec.rb +2 -0
  177. data/spec/slack/events/request_spec.rb +5 -1
  178. data/spec/slack/messages/formatting_spec.rb +10 -0
  179. data/spec/slack/real_time/api/message_spec.rb +1 -1
  180. data/spec/slack/real_time/api/ping_spec.rb +1 -1
  181. data/spec/slack/real_time/api/typing_spec.rb +1 -1
  182. data/spec/slack/real_time/client_spec.rb +91 -127
  183. data/spec/slack/real_time/event_handlers/bot_spec.rb +19 -17
  184. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
  185. data/spec/slack/real_time/event_handlers/im_spec.rb +30 -27
  186. data/spec/slack/real_time/event_handlers/{group_spec.rb → private_channel_spec.rb} +35 -27
  187. data/spec/slack/real_time/event_handlers/{channel_spec.rb → public_channel_spec.rb} +27 -23
  188. data/spec/slack/real_time/event_handlers/team_spec.rb +7 -8
  189. data/spec/slack/real_time/event_handlers/user_spec.rb +6 -5
  190. data/spec/slack/real_time/stores/store_spec.rb +50 -0
  191. data/spec/slack/slack_spec.rb +5 -4
  192. data/spec/slack/version_spec.rb +1 -1
  193. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +5 -0
  194. data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +8 -0
  195. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +31 -0
  196. data/spec/slack/web/api/endpoints/admin_roles_spec.rb +30 -0
  197. data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
  198. data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
  199. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +45 -17
  200. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +6 -2
  201. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +33 -16
  202. data/spec/slack/web/api/endpoints/files_spec.rb +13 -0
  203. data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +13 -0
  204. data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +13 -0
  205. data/spec/slack/web/api/mixins/conversations_spec.rb +2 -0
  206. data/spec/slack/web/api/mixins/users_spec.rb +2 -0
  207. data/spec/slack/web/api/pagination/cursor_spec.rb +11 -7
  208. data/spec/slack/web/client_spec.rb +39 -11
  209. data/spec/slack/web/faraday/response/raise_error_spec.rb +1 -1
  210. data/spec/support/real_time/connected_client.rb +1 -1
  211. data/spec/support/real_time/loaded_client.rb +120 -0
  212. metadata +45 -197
  213. data/.travis.yml +0 -29
  214. data/bin/commands/admin_conversations_whitelist.rb +0 -37
  215. data/bin/commands/apps_permissions.rb +0 -23
  216. data/bin/commands/apps_permissions_resources.rb +0 -15
  217. data/bin/commands/apps_permissions_scopes.rb +0 -13
  218. data/bin/commands/apps_permissions_users.rb +0 -26
  219. data/bin/commands/channels.rb +0 -23
  220. data/bin/commands/groups.rb +0 -14
  221. data/bin/commands/im.rb +0 -6
  222. data/bin/commands/mpim.rb +0 -6
  223. data/bin/commands.rb +0 -66
  224. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +0 -64
  225. data/lib/slack/web/api/endpoints/apps_permissions.rb +0 -36
  226. data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +0 -31
  227. data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +0 -21
  228. data/lib/slack/web/api/endpoints/apps_permissions_users.rb +0 -50
  229. data/lib/slack/web/api/endpoints/channels.rb +0 -25
  230. data/lib/slack/web/api/endpoints/groups.rb +0 -13
  231. data/lib/slack/web/api/endpoints/im.rb +0 -13
  232. data/lib/slack/web/api/endpoints/mpim.rb +0 -13
  233. data/lib/slack/web/api/endpoints/presence.rb +0 -23
  234. data/lib/slack/web/api/patches/views.1.view-json.patch +0 -40
  235. data/lib/slack/web/api/patches/views.1.views-published.patch +0 -16
  236. data/lib/slack/web/api/templates/commands.erb +0 -6
  237. data/spec/fixtures/slack/web/rtm_start.yml +0 -815
  238. data/spec/slack/real_time/rtm_start_spec.rb +0 -14
  239. data/spec/slack/real_time/store_spec.rb +0 -12
@@ -1,64 +1,70 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AdminTeamsSettings methods.'
5
- command 'admin_teams_settings' do |g|
6
- g.desc 'Fetch information about settings in a workspace'
7
- g.long_desc %( Fetch information about settings in a workspace )
8
- g.command 'info' do |c|
9
- c.flag 'team_id', desc: '.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.admin_teams_settings_info(options))
12
- end
13
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AdminTeamsSettings methods.'
8
+ command 'admin_teams_settings' do |g|
9
+ g.desc 'Fetch information about settings in a workspace'
10
+ g.long_desc %( Fetch information about settings in a workspace )
11
+ g.command 'info' do |c|
12
+ c.flag 'team_id', desc: '.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump(@client.admin_teams_settings_info(options))
15
+ end
16
+ end
14
17
 
15
- g.desc 'Set the default channels of a workspace.'
16
- g.long_desc %( Set the default channels of a workspace. )
17
- g.command 'setDefaultChannels' do |c|
18
- c.flag 'channel_ids', desc: 'An array of channel IDs.'
19
- c.flag 'team_id', desc: 'ID for the workspace to set the default channel for.'
20
- c.action do |_global_options, options, _args|
21
- puts JSON.dump($client.admin_teams_settings_setDefaultChannels(options))
22
- end
23
- end
18
+ g.desc 'Set the default channels of a workspace.'
19
+ g.long_desc %( Set the default channels of a workspace. )
20
+ g.command 'setDefaultChannels' do |c|
21
+ c.flag 'channel_ids', desc: 'An array of channel IDs.'
22
+ c.flag 'team_id', desc: 'ID for the workspace to set the default channel for.'
23
+ c.action do |_global_options, options, _args|
24
+ puts JSON.dump(@client.admin_teams_settings_setDefaultChannels(options))
25
+ end
26
+ end
24
27
 
25
- g.desc 'Set the description of a given workspace.'
26
- g.long_desc %( Set the description of a given workspace. )
27
- g.command 'setDescription' do |c|
28
- c.flag 'description', desc: 'The new description for the workspace.'
29
- c.flag 'team_id', desc: 'ID for the workspace to set the description for.'
30
- c.action do |_global_options, options, _args|
31
- puts JSON.dump($client.admin_teams_settings_setDescription(options))
32
- end
33
- end
28
+ g.desc 'Set the description of a given workspace.'
29
+ g.long_desc %( Set the description of a given workspace. )
30
+ g.command 'setDescription' do |c|
31
+ c.flag 'description', desc: 'The new description for the workspace.'
32
+ c.flag 'team_id', desc: 'ID for the workspace to set the description for.'
33
+ c.action do |_global_options, options, _args|
34
+ puts JSON.dump(@client.admin_teams_settings_setDescription(options))
35
+ end
36
+ end
34
37
 
35
- g.desc 'An API method that allows admins to set the discoverability of a given workspace'
36
- g.long_desc %( An API method that allows admins to set the discoverability of a given workspace )
37
- g.command 'setDiscoverability' do |c|
38
- c.flag 'discoverability', desc: "This workspace's discovery setting. It must be set to one of open, invite_only, closed, or unlisted."
39
- c.flag 'team_id', desc: 'The ID of the workspace to set discoverability on.'
40
- c.action do |_global_options, options, _args|
41
- puts JSON.dump($client.admin_teams_settings_setDiscoverability(options))
42
- end
43
- end
38
+ g.desc 'An API method that allows admins to set the discoverability of a given workspace'
39
+ g.long_desc %( An API method that allows admins to set the discoverability of a given workspace )
40
+ g.command 'setDiscoverability' do |c|
41
+ c.flag 'discoverability', desc: "This workspace's discovery setting. It must be set to one of open, invite_only, closed, or unlisted."
42
+ c.flag 'team_id', desc: 'The ID of the workspace to set discoverability on.'
43
+ c.action do |_global_options, options, _args|
44
+ puts JSON.dump(@client.admin_teams_settings_setDiscoverability(options))
45
+ end
46
+ end
44
47
 
45
- g.desc 'Sets the icon of a workspace.'
46
- g.long_desc %( Sets the icon of a workspace. )
47
- g.command 'setIcon' do |c|
48
- c.flag 'image_url', desc: 'Image URL for the icon.'
49
- c.flag 'team_id', desc: 'ID for the workspace to set the icon for.'
50
- c.action do |_global_options, options, _args|
51
- puts JSON.dump($client.admin_teams_settings_setIcon(options))
52
- end
53
- end
48
+ g.desc 'Sets the icon of a workspace.'
49
+ g.long_desc %( Sets the icon of a workspace. )
50
+ g.command 'setIcon' do |c|
51
+ c.flag 'image_url', desc: 'Image URL for the icon.'
52
+ c.flag 'team_id', desc: 'ID for the workspace to set the icon for.'
53
+ c.action do |_global_options, options, _args|
54
+ puts JSON.dump(@client.admin_teams_settings_setIcon(options))
55
+ end
56
+ end
54
57
 
55
- g.desc 'Set the name of a given workspace.'
56
- g.long_desc %( Set the name of a given workspace. )
57
- g.command 'setName' do |c|
58
- c.flag 'name', desc: 'The new name of the workspace.'
59
- c.flag 'team_id', desc: 'ID for the workspace to set the name for.'
60
- c.action do |_global_options, options, _args|
61
- puts JSON.dump($client.admin_teams_settings_setName(options))
58
+ g.desc 'Set the name of a given workspace.'
59
+ g.long_desc %( Set the name of a given workspace. )
60
+ g.command 'setName' do |c|
61
+ c.flag 'name', desc: 'The new name of the workspace.'
62
+ c.flag 'team_id', desc: 'ID for the workspace to set the name for.'
63
+ c.action do |_global_options, options, _args|
64
+ puts JSON.dump(@client.admin_teams_settings_setName(options))
65
+ end
66
+ end
67
+ end
62
68
  end
63
69
  end
64
70
  end
@@ -1,48 +1,54 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AdminUsergroups methods.'
5
- command 'admin_usergroups' do |g|
6
- g.desc 'Add up to one hundred default channels to an IDP group.'
7
- g.long_desc %( Add up to one hundred default channels to an IDP group. )
8
- g.command 'addChannels' do |c|
9
- c.flag 'channel_ids', desc: 'Comma separated string of channel IDs.'
10
- c.flag 'usergroup_id', desc: 'ID of the IDP group to add default channels for.'
11
- c.flag 'team_id', desc: 'The workspace to add default channels in.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.admin_usergroups_addChannels(options))
14
- end
15
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AdminUsergroups methods.'
8
+ command 'admin_usergroups' do |g|
9
+ g.desc 'Add up to one hundred default channels to an IDP group.'
10
+ g.long_desc %( Add up to one hundred default channels to an IDP group. )
11
+ g.command 'addChannels' do |c|
12
+ c.flag 'channel_ids', desc: 'Comma separated string of channel IDs.'
13
+ c.flag 'usergroup_id', desc: 'ID of the IDP group to add default channels for.'
14
+ c.flag 'team_id', desc: 'The workspace to add default channels in.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.admin_usergroups_addChannels(options))
17
+ end
18
+ end
16
19
 
17
- g.desc 'Associate one or more default workspaces with an organization-wide IDP group.'
18
- g.long_desc %( Associate one or more default workspaces with an organization-wide IDP group. )
19
- g.command 'addTeams' do |c|
20
- c.flag 'team_ids', desc: 'A comma separated list of encoded team (workspace) IDs. Each workspace MUST belong to the organization associated with the token.'
21
- c.flag 'usergroup_id', desc: 'An encoded usergroup (IDP Group) ID.'
22
- c.flag 'auto_provision', desc: 'When true, this method automatically creates new workspace accounts for the IDP group members.'
23
- c.action do |_global_options, options, _args|
24
- puts JSON.dump($client.admin_usergroups_addTeams(options))
25
- end
26
- end
20
+ g.desc 'Associate one or more default workspaces with an organization-wide IDP group.'
21
+ g.long_desc %( Associate one or more default workspaces with an organization-wide IDP group. )
22
+ g.command 'addTeams' do |c|
23
+ c.flag 'team_ids', desc: 'A comma separated list of encoded team (workspace) IDs. Each workspace MUST belong to the organization associated with the token.'
24
+ c.flag 'usergroup_id', desc: 'An encoded usergroup (IDP Group) ID.'
25
+ c.flag 'auto_provision', desc: 'When true, this method automatically creates new workspace accounts for the IDP group members.'
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump(@client.admin_usergroups_addTeams(options))
28
+ end
29
+ end
27
30
 
28
- g.desc 'List the channels linked to an org-level IDP group (user group).'
29
- g.long_desc %( List the channels linked to an org-level IDP group (user group). )
30
- g.command 'listChannels' do |c|
31
- c.flag 'usergroup_id', desc: 'ID of the IDP group to list default channels for.'
32
- c.flag 'include_num_members', desc: 'Flag to include or exclude the count of members per channel.'
33
- c.flag 'team_id', desc: 'ID of the the workspace.'
34
- c.action do |_global_options, options, _args|
35
- puts JSON.dump($client.admin_usergroups_listChannels(options))
36
- end
37
- end
31
+ g.desc 'List the channels linked to an org-level IDP group (user group).'
32
+ g.long_desc %( List the channels linked to an org-level IDP group (user group). )
33
+ g.command 'listChannels' do |c|
34
+ c.flag 'usergroup_id', desc: 'ID of the IDP group to list default channels for.'
35
+ c.flag 'include_num_members', desc: 'Flag to include or exclude the count of members per channel.'
36
+ c.flag 'team_id', desc: 'ID of the the workspace.'
37
+ c.action do |_global_options, options, _args|
38
+ puts JSON.dump(@client.admin_usergroups_listChannels(options))
39
+ end
40
+ end
38
41
 
39
- g.desc 'Remove one or more default channels from an org-level IDP group (user group).'
40
- g.long_desc %( Remove one or more default channels from an org-level IDP group (user group). )
41
- g.command 'removeChannels' do |c|
42
- c.flag 'channel_ids', desc: 'Comma-separated string of channel IDs.'
43
- c.flag 'usergroup_id', desc: 'ID of the IDP Group.'
44
- c.action do |_global_options, options, _args|
45
- puts JSON.dump($client.admin_usergroups_removeChannels(options))
42
+ g.desc 'Remove one or more default channels from an org-level IDP group (user group).'
43
+ g.long_desc %( Remove one or more default channels from an org-level IDP group (user group). )
44
+ g.command 'removeChannels' do |c|
45
+ c.flag 'channel_ids', desc: 'Comma-separated string of channel IDs.'
46
+ c.flag 'usergroup_id', desc: 'ID of the IDP Group.'
47
+ c.action do |_global_options, options, _args|
48
+ puts JSON.dump(@client.admin_usergroups_removeChannels(options))
49
+ end
50
+ end
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -1,98 +1,104 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AdminUsers methods.'
5
- command 'admin_users' do |g|
6
- g.desc 'Add an Enterprise user to a workspace.'
7
- g.long_desc %( Add an Enterprise user to a workspace. )
8
- g.command 'assign' do |c|
9
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
10
- c.flag 'user_id', desc: 'The ID of the user to add to the workspace.'
11
- c.flag 'channel_ids', desc: 'Comma separated values of channel IDs to add user in the new workspace.'
12
- c.flag 'is_restricted', desc: 'True if user should be added to the workspace as a guest.'
13
- c.flag 'is_ultra_restricted', desc: 'True if user should be added to the workspace as a single-channel guest.'
14
- c.action do |_global_options, options, _args|
15
- puts JSON.dump($client.admin_users_assign(options))
16
- end
17
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AdminUsers methods.'
8
+ command 'admin_users' do |g|
9
+ g.desc 'Add an Enterprise user to a workspace.'
10
+ g.long_desc %( Add an Enterprise user to a workspace. )
11
+ g.command 'assign' do |c|
12
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
13
+ c.flag 'user_id', desc: 'The ID of the user to add to the workspace.'
14
+ c.flag 'channel_ids', desc: 'Comma separated values of channel IDs to add user in the new workspace.'
15
+ c.flag 'is_restricted', desc: 'True if user should be added to the workspace as a guest.'
16
+ c.flag 'is_ultra_restricted', desc: 'True if user should be added to the workspace as a single-channel guest.'
17
+ c.action do |_global_options, options, _args|
18
+ puts JSON.dump(@client.admin_users_assign(options))
19
+ end
20
+ end
18
21
 
19
- g.desc 'Invite a user to a workspace.'
20
- g.long_desc %( Invite a user to a workspace. )
21
- g.command 'invite' do |c|
22
- c.flag 'channel_ids', desc: 'A comma-separated list of channel_ids for this user to join. At least one channel is required.'
23
- c.flag 'email', desc: 'The email address of the person to invite.'
24
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
25
- c.flag 'custom_message', desc: 'An optional message to send to the user in the invite email.'
26
- c.flag 'email_password_policy_enabled', desc: 'Allow invited user to sign in via email and password. Only available for Enterprise Grid teams via admin invite.'
27
- c.flag 'guest_expiration_ts', desc: 'Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.'
28
- c.flag 'is_restricted', desc: 'Is this user a multi-channel guest user? (default: false).'
29
- c.flag 'is_ultra_restricted', desc: 'Is this user a single channel guest user? (default: false).'
30
- c.flag 'real_name', desc: 'Full name of the user.'
31
- c.flag 'resend', desc: 'Allow this invite to be resent in the future if a user has not signed up yet. (default: false).'
32
- c.action do |_global_options, options, _args|
33
- puts JSON.dump($client.admin_users_invite(options))
34
- end
35
- end
22
+ g.desc 'Invite a user to a workspace.'
23
+ g.long_desc %( Invite a user to a workspace. )
24
+ g.command 'invite' do |c|
25
+ c.flag 'channel_ids', desc: 'A comma-separated list of channel_ids for this user to join. At least one channel is required.'
26
+ c.flag 'email', desc: 'The email address of the person to invite.'
27
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
28
+ c.flag 'custom_message', desc: 'An optional message to send to the user in the invite email.'
29
+ c.flag 'email_password_policy_enabled', desc: 'Allow invited user to sign in via email and password. Only available for Enterprise Grid teams via admin invite.'
30
+ c.flag 'guest_expiration_ts', desc: 'Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.'
31
+ c.flag 'is_restricted', desc: 'Is this user a multi-channel guest user? (default: false).'
32
+ c.flag 'is_ultra_restricted', desc: 'Is this user a single channel guest user? (default: false).'
33
+ c.flag 'real_name', desc: 'Full name of the user.'
34
+ c.flag 'resend', desc: 'Allow this invite to be resent in the future if a user has not signed up yet. (default: false).'
35
+ c.action do |_global_options, options, _args|
36
+ puts JSON.dump(@client.admin_users_invite(options))
37
+ end
38
+ end
36
39
 
37
- g.desc 'List users on a workspace'
38
- g.long_desc %( List users on a workspace )
39
- g.command 'list' do |c|
40
- c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
41
- c.flag 'limit', desc: 'Limit for how many users to be retrieved per page.'
42
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
43
- c.action do |_global_options, options, _args|
44
- puts JSON.dump($client.admin_users_list(options))
45
- end
46
- end
40
+ g.desc 'List users on a workspace'
41
+ g.long_desc %( List users on a workspace )
42
+ g.command 'list' do |c|
43
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
44
+ c.flag 'limit', desc: 'Limit for how many users to be retrieved per page.'
45
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace. The team_id is required if you use an org-level token.'
46
+ c.action do |_global_options, options, _args|
47
+ puts JSON.dump(@client.admin_users_list(options))
48
+ end
49
+ end
47
50
 
48
- g.desc 'Remove a user from a workspace.'
49
- g.long_desc %( Remove a user from a workspace. )
50
- g.command 'remove' do |c|
51
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
52
- c.flag 'user_id', desc: 'The ID of the user to remove.'
53
- c.action do |_global_options, options, _args|
54
- puts JSON.dump($client.admin_users_remove(options))
55
- end
56
- end
51
+ g.desc 'Remove a user from a workspace.'
52
+ g.long_desc %( Remove a user from a workspace. )
53
+ g.command 'remove' do |c|
54
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
55
+ c.flag 'user_id', desc: 'The ID of the user to remove.'
56
+ c.action do |_global_options, options, _args|
57
+ puts JSON.dump(@client.admin_users_remove(options))
58
+ end
59
+ end
57
60
 
58
- g.desc 'Set an existing guest, regular user, or owner to be an admin user.'
59
- g.long_desc %( Set an existing guest, regular user, or owner to be an admin user. )
60
- g.command 'setAdmin' do |c|
61
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
62
- c.flag 'user_id', desc: 'The ID of the user to designate as an admin.'
63
- c.action do |_global_options, options, _args|
64
- puts JSON.dump($client.admin_users_setAdmin(options))
65
- end
66
- end
61
+ g.desc 'Set an existing guest, regular user, or owner to be an admin user.'
62
+ g.long_desc %( Set an existing guest, regular user, or owner to be an admin user. )
63
+ g.command 'setAdmin' do |c|
64
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
65
+ c.flag 'user_id', desc: 'The ID of the user to designate as an admin.'
66
+ c.action do |_global_options, options, _args|
67
+ puts JSON.dump(@client.admin_users_setAdmin(options))
68
+ end
69
+ end
67
70
 
68
- g.desc 'Set an expiration for a guest user'
69
- g.long_desc %( Set an expiration for a guest user )
70
- g.command 'setExpiration' do |c|
71
- c.flag 'expiration_ts', desc: 'Timestamp when guest account should be disabled.'
72
- c.flag 'user_id', desc: 'The ID of the user to set an expiration for.'
73
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
74
- c.action do |_global_options, options, _args|
75
- puts JSON.dump($client.admin_users_setExpiration(options))
76
- end
77
- end
71
+ g.desc 'Set an expiration for a guest user'
72
+ g.long_desc %( Set an expiration for a guest user )
73
+ g.command 'setExpiration' do |c|
74
+ c.flag 'expiration_ts', desc: 'Timestamp when guest account should be disabled.'
75
+ c.flag 'user_id', desc: 'The ID of the user to set an expiration for.'
76
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
77
+ c.action do |_global_options, options, _args|
78
+ puts JSON.dump(@client.admin_users_setExpiration(options))
79
+ end
80
+ end
78
81
 
79
- g.desc 'Set an existing guest, regular user, or admin user to be a workspace owner.'
80
- g.long_desc %( Set an existing guest, regular user, or admin user to be a workspace owner. )
81
- g.command 'setOwner' do |c|
82
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
83
- c.flag 'user_id', desc: 'Id of the user to promote to owner.'
84
- c.action do |_global_options, options, _args|
85
- puts JSON.dump($client.admin_users_setOwner(options))
86
- end
87
- end
82
+ g.desc 'Set an existing guest, regular user, or admin user to be a workspace owner.'
83
+ g.long_desc %( Set an existing guest, regular user, or admin user to be a workspace owner. )
84
+ g.command 'setOwner' do |c|
85
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
86
+ c.flag 'user_id', desc: 'Id of the user to promote to owner.'
87
+ c.action do |_global_options, options, _args|
88
+ puts JSON.dump(@client.admin_users_setOwner(options))
89
+ end
90
+ end
88
91
 
89
- g.desc 'Set an existing guest user, admin user, or owner to be a regular user.'
90
- g.long_desc %( Set an existing guest user, admin user, or owner to be a regular user. )
91
- g.command 'setRegular' do |c|
92
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
93
- c.flag 'user_id', desc: 'The ID of the user to designate as a regular user.'
94
- c.action do |_global_options, options, _args|
95
- puts JSON.dump($client.admin_users_setRegular(options))
92
+ g.desc 'Set an existing guest user, admin user, or owner to be a regular user.'
93
+ g.long_desc %( Set an existing guest user, admin user, or owner to be a regular user. )
94
+ g.command 'setRegular' do |c|
95
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
96
+ c.flag 'user_id', desc: 'The ID of the user to designate as a regular user.'
97
+ c.action do |_global_options, options, _args|
98
+ puts JSON.dump(@client.admin_users_setRegular(options))
99
+ end
100
+ end
101
+ end
96
102
  end
97
103
  end
98
104
  end
@@ -1,78 +1,84 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AdminUsersSession methods.'
5
- command 'admin_users_session' do |g|
6
- g.desc 'Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users.'
7
- g.long_desc %( Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users. )
8
- g.command 'clearSettings' do |c|
9
- c.flag 'user_ids', desc: "The IDs of users you'd like to clear session settings for."
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.admin_users_session_clearSettings(options))
12
- end
13
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AdminUsersSession methods.'
8
+ command 'admin_users_session' do |g|
9
+ g.desc 'Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users.'
10
+ g.long_desc %( Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users. )
11
+ g.command 'clearSettings' do |c|
12
+ c.flag 'user_ids', desc: "The IDs of users you'd like to clear session settings for."
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump(@client.admin_users_session_clearSettings(options))
15
+ end
16
+ end
14
17
 
15
- g.desc 'Get user-specific session settings—the session duration and what happens when the client closes—given a list of users.'
16
- g.long_desc %( Get user-specific session settings—the session duration and what happens when the client closes—given a list of users. )
17
- g.command 'getSettings' do |c|
18
- c.flag 'user_ids', desc: "The IDs of users you'd like to fetch session settings for. Note: if a user does not have any active sessions, they will not be returned in the response."
19
- c.action do |_global_options, options, _args|
20
- puts JSON.dump($client.admin_users_session_getSettings(options))
21
- end
22
- end
18
+ g.desc 'Get user-specific session settings—the session duration and what happens when the client closes—given a list of users.'
19
+ g.long_desc %( Get user-specific session settings—the session duration and what happens when the client closes—given a list of users. )
20
+ g.command 'getSettings' do |c|
21
+ c.flag 'user_ids', desc: "The IDs of users you'd like to fetch session settings for. Note: if a user does not have any active sessions, they will not be returned in the response."
22
+ c.action do |_global_options, options, _args|
23
+ puts JSON.dump(@client.admin_users_session_getSettings(options))
24
+ end
25
+ end
23
26
 
24
- g.desc 'Revoke a single session for a user. The user will be forced to login to Slack.'
25
- g.long_desc %( Revoke a single session for a user. The user will be forced to login to Slack. )
26
- g.command 'invalidate' do |c|
27
- c.flag 'session_id', desc: 'ID of the session to invalidate.'
28
- c.flag 'team_id', desc: 'ID of the workspace that the session belongs to.'
29
- c.action do |_global_options, options, _args|
30
- puts JSON.dump($client.admin_users_session_invalidate(options))
31
- end
32
- end
27
+ g.desc 'Revoke a single session for a user. The user will be forced to login to Slack.'
28
+ g.long_desc %( Revoke a single session for a user. The user will be forced to login to Slack. )
29
+ g.command 'invalidate' do |c|
30
+ c.flag 'session_id', desc: 'ID of the session to invalidate.'
31
+ c.flag 'team_id', desc: 'ID of the workspace that the session belongs to.'
32
+ c.action do |_global_options, options, _args|
33
+ puts JSON.dump(@client.admin_users_session_invalidate(options))
34
+ end
35
+ end
33
36
 
34
- g.desc 'List active user sessions for an organization'
35
- g.long_desc %( List active user sessions for an organization )
36
- g.command 'list' do |c|
37
- c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
38
- c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
39
- c.flag 'team_id', desc: "The ID of the workspace you'd like active sessions for. If you pass a team_id, you'll need to pass a user_id as well."
40
- c.flag 'user_id', desc: "The ID of user you'd like active sessions for. If you pass a user_id, you'll need to pass a team_id as well."
41
- c.action do |_global_options, options, _args|
42
- puts JSON.dump($client.admin_users_session_list(options))
43
- end
44
- end
37
+ g.desc 'List active user sessions for an organization'
38
+ g.long_desc %( List active user sessions for an organization )
39
+ g.command 'list' do |c|
40
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
41
+ c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
42
+ c.flag 'team_id', desc: "The ID of the workspace you'd like active sessions for. If you pass a team_id, you'll need to pass a user_id as well."
43
+ c.flag 'user_id', desc: "The ID of user you'd like active sessions for. If you pass a user_id, you'll need to pass a team_id as well."
44
+ c.action do |_global_options, options, _args|
45
+ puts JSON.dump(@client.admin_users_session_list(options))
46
+ end
47
+ end
45
48
 
46
- g.desc 'Wipes all valid sessions on all devices for a given user'
47
- g.long_desc %( Wipes all valid sessions on all devices for a given user )
48
- g.command 'reset' do |c|
49
- c.flag 'user_id', desc: 'The ID of the user to wipe sessions for.'
50
- c.flag 'mobile_only', desc: 'Only expire mobile sessions (default: false).'
51
- c.flag 'web_only', desc: 'Only expire web sessions (default: false).'
52
- c.action do |_global_options, options, _args|
53
- puts JSON.dump($client.admin_users_session_reset(options))
54
- end
55
- end
49
+ g.desc 'Wipes all valid sessions on all devices for a given user'
50
+ g.long_desc %( Wipes all valid sessions on all devices for a given user )
51
+ g.command 'reset' do |c|
52
+ c.flag 'user_id', desc: 'The ID of the user to wipe sessions for.'
53
+ c.flag 'mobile_only', desc: 'Only expire mobile sessions (default: false).'
54
+ c.flag 'web_only', desc: 'Only expire web sessions (default: false).'
55
+ c.action do |_global_options, options, _args|
56
+ puts JSON.dump(@client.admin_users_session_reset(options))
57
+ end
58
+ end
56
59
 
57
- g.desc 'Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users'
58
- g.long_desc %( Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users )
59
- g.command 'resetBulk' do |c|
60
- c.flag 'user_ids', desc: 'The ID of the user to wipe sessions for.'
61
- c.flag 'mobile_only', desc: 'Only expire mobile sessions (default: false).'
62
- c.flag 'web_only', desc: 'Only expire web sessions (default: false).'
63
- c.action do |_global_options, options, _args|
64
- puts JSON.dump($client.admin_users_session_resetBulk(options))
65
- end
66
- end
60
+ g.desc 'Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users'
61
+ g.long_desc %( Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users )
62
+ g.command 'resetBulk' do |c|
63
+ c.flag 'user_ids', desc: 'The ID of the user to wipe sessions for.'
64
+ c.flag 'mobile_only', desc: 'Only expire mobile sessions (default: false).'
65
+ c.flag 'web_only', desc: 'Only expire web sessions (default: false).'
66
+ c.action do |_global_options, options, _args|
67
+ puts JSON.dump(@client.admin_users_session_resetBulk(options))
68
+ end
69
+ end
67
70
 
68
- g.desc 'Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users.'
69
- g.long_desc %( Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users. )
70
- g.command 'setSettings' do |c|
71
- c.flag 'user_ids', desc: 'The list of user IDs to apply the session settings for.'
72
- c.flag 'desktop_app_browser_quit', desc: 'Terminate the session when the client—either the desktop app or a browser window—is closed.'
73
- c.flag 'duration', desc: "The session duration, in seconds. The minimum value is 28800, which represents 8 hours; the max value is 315569520 or 10 years (that's a long Slack session)."
74
- c.action do |_global_options, options, _args|
75
- puts JSON.dump($client.admin_users_session_setSettings(options))
71
+ g.desc 'Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users.'
72
+ g.long_desc %( Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users. )
73
+ g.command 'setSettings' do |c|
74
+ c.flag 'user_ids', desc: 'The list of up to 1,000 user IDs to apply the session settings for.'
75
+ c.flag 'desktop_app_browser_quit', desc: 'Terminate the session when the client—either the desktop app or a browser window—is closed.'
76
+ c.flag 'duration', desc: "The session duration, in seconds. The minimum value is 28800, which represents 8 hours; the max value is 315569520 or 10 years (that's a long Slack session)."
77
+ c.action do |_global_options, options, _args|
78
+ puts JSON.dump(@client.admin_users_session_setSettings(options))
79
+ end
80
+ end
81
+ end
76
82
  end
77
83
  end
78
84
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AdminUsersUnsupportedversions methods.'
8
+ command 'admin_users_unsupportedVersions' do |g|
9
+ g.desc 'Ask Slackbot to send you an export listing all workspace members using unsupported software, presented as a zipped CSV file.'
10
+ g.long_desc %( Ask Slackbot to send you an export listing all workspace members using unsupported software, presented as a zipped CSV file. )
11
+ g.command 'export' do |c|
12
+ c.flag 'date_end_of_support', desc: 'Unix timestamp of the date of past or upcoming end of support cycles. If not provided will include all announced end of support cycles.'
13
+ c.flag 'date_sessions_started', desc: 'Unix timestamp of a date to start looking for user sessions. If not provided will start six months ago.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.admin_users_unsupportedVersions_export(options))
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
data/bin/commands/api.rb CHANGED
@@ -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 'Api methods.'
5
- command 'api' do |g|
6
- g.desc 'Checks API calling code.'
7
- g.long_desc %( Checks API calling code. )
8
- g.command 'test' do |c|
9
- c.flag 'error', desc: 'Error response to return.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.api_test(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Api methods.'
8
+ command 'api' do |g|
9
+ g.desc 'Checks API calling code.'
10
+ g.long_desc %( Checks API calling code. )
11
+ g.command 'test' do |c|
12
+ c.flag 'error', desc: 'Error response to return.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump(@client.api_test(options))
15
+ end
16
+ end
17
+ end
12
18
  end
13
19
  end
14
20
  end