slack-ruby-client 1.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
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
data/bin/commands/apps.rb CHANGED
@@ -1,15 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Apps methods.'
5
- command 'apps' do |g|
6
- g.desc 'Uninstalls your app from a workspace.'
7
- g.long_desc %( Uninstalls your app from a workspace. )
8
- g.command 'uninstall' do |c|
9
- c.flag 'client_id', desc: 'Issued when you created your application.'
10
- c.flag 'client_secret', desc: 'Issued when you created your application.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.apps_uninstall(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Apps methods.'
8
+ command 'apps' do |g|
9
+ g.desc 'Uninstalls your app from a workspace.'
10
+ g.long_desc %( Uninstalls your app from a workspace. )
11
+ g.command 'uninstall' do |c|
12
+ c.flag 'client_id', desc: 'Issued when you created your application.'
13
+ c.flag 'client_secret', desc: 'Issued when you created your application.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.apps_uninstall(options))
16
+ end
17
+ end
18
+ end
13
19
  end
14
20
  end
15
21
  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 'AppsConnections methods.'
5
- command 'apps_connections' do |g|
6
- g.desc 'Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over,'
7
- g.long_desc %( Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over, )
8
- g.command 'open' do |c|
9
- c.action do |_global_options, options, _args|
10
- puts JSON.dump($client.apps_connections_open(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AppsConnections methods.'
8
+ command 'apps_connections' do |g|
9
+ g.desc 'Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over.'
10
+ g.long_desc %( Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over. )
11
+ g.command 'open' do |c|
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump(@client.apps_connections_open(options))
14
+ end
15
+ end
16
+ end
11
17
  end
12
18
  end
13
19
  end
@@ -1,16 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AppsEventAuthorizations methods.'
5
- command 'apps_event_authorizations' do |g|
6
- g.desc 'Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.'
7
- g.long_desc %( Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to. )
8
- g.command 'list' do |c|
9
- c.flag 'event_context', desc: '.'
10
- c.flag 'cursor', desc: '.'
11
- c.flag 'limit', desc: '.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.apps_event_authorizations_list(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AppsEventAuthorizations methods.'
8
+ command 'apps_event_authorizations' do |g|
9
+ g.desc 'Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.'
10
+ g.long_desc %( Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to. )
11
+ g.command 'list' do |c|
12
+ c.flag 'event_context', desc: '.'
13
+ c.flag 'cursor', desc: '.'
14
+ c.flag 'limit', desc: '.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.apps_event_authorizations_list(options))
17
+ end
18
+ end
19
+ end
14
20
  end
15
21
  end
16
22
  end
@@ -1,51 +1,58 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AppsManifest methods.'
5
- command 'apps_manifest' do |g|
6
- g.desc 'Create an app from an app manifest.'
7
- g.long_desc %( Create an app from an app manifest. )
8
- g.command 'create' do |c|
9
- c.flag 'manifest', desc: 'A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.apps_manifest_create(options))
12
- end
13
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AppsManifest methods.'
8
+ command 'apps_manifest' do |g|
9
+ g.desc 'Create an app from an app manifest.'
10
+ g.long_desc %( Create an app from an app manifest. )
11
+ g.command 'create' do |c|
12
+ c.flag 'manifest', desc: 'A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump(@client.apps_manifest_create(options))
15
+ end
16
+ end
14
17
 
15
- g.desc 'Permanently deletes an app created through app manifests'
16
- g.long_desc %( Permanently deletes an app created through app manifests )
17
- g.command 'delete' do |c|
18
- c.flag 'app_id', desc: 'The ID of the app you want to delete.'
19
- c.action do |_global_options, options, _args|
20
- puts JSON.dump($client.apps_manifest_delete(options))
21
- end
22
- end
18
+ g.desc 'Permanently deletes an app created through app manifests'
19
+ g.long_desc %( Permanently deletes an app created through app manifests )
20
+ g.command 'delete' do |c|
21
+ c.flag 'app_id', desc: 'The ID of the app you want to delete.'
22
+ c.action do |_global_options, options, _args|
23
+ puts JSON.dump(@client.apps_manifest_delete(options))
24
+ end
25
+ end
23
26
 
24
- g.desc 'Export an app manifest from an existing app'
25
- g.long_desc %( Export an app manifest from an existing app )
26
- g.command 'export' do |c|
27
- c.flag 'app_id', desc: 'The ID of the app whose configuration you want to export as a manifest.'
28
- c.action do |_global_options, options, _args|
29
- puts JSON.dump($client.apps_manifest_export(options))
30
- end
31
- end
27
+ g.desc 'Export an app manifest from an existing app'
28
+ g.long_desc %( Export an app manifest from an existing app )
29
+ g.command 'export' do |c|
30
+ c.flag 'app_id', desc: 'The ID of the app whose configuration you want to export as a manifest.'
31
+ c.action do |_global_options, options, _args|
32
+ puts JSON.dump(@client.apps_manifest_export(options))
33
+ end
34
+ end
32
35
 
33
- g.desc 'Update an app from an app manifest'
34
- g.long_desc %( Update an app from an app manifest )
35
- g.command 'update' do |c|
36
- c.flag 'app_id', desc: 'The ID of the app whose configuration you want to update.'
37
- c.flag 'manifest', desc: 'A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one. As this method entirely replaces any previous configuration, manifest must contain both unmodified and modified fields.'
38
- c.action do |_global_options, options, _args|
39
- puts JSON.dump($client.apps_manifest_update(options))
40
- end
41
- end
36
+ g.desc 'Update an app from an app manifest'
37
+ g.long_desc %( Update an app from an app manifest )
38
+ g.command 'update' do |c|
39
+ c.flag 'app_id', desc: 'The ID of the app whose configuration you want to update.'
40
+ c.flag 'manifest', desc: 'A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one. As this method entirely replaces any previous configuration, manifest must contain both unmodified and modified fields.'
41
+ c.action do |_global_options, options, _args|
42
+ puts JSON.dump(@client.apps_manifest_update(options))
43
+ end
44
+ end
42
45
 
43
- g.desc 'Validate an app manifest'
44
- g.long_desc %( Validate an app manifest )
45
- g.command 'validate' do |c|
46
- c.flag 'manifest', desc: 'The manifest to be validated. Will be validated against the app manifest schema - read our guide.'
47
- c.action do |_global_options, options, _args|
48
- puts JSON.dump($client.apps_manifest_validate(options))
46
+ g.desc 'Validate an app manifest'
47
+ g.long_desc %( Validate an app manifest )
48
+ g.command 'validate' do |c|
49
+ c.flag 'manifest', desc: 'The manifest to be validated. Will be validated against the app manifest schema - read our guide.'
50
+ c.flag 'app_id', desc: 'The ID of the app whose configuration you want to validate.'
51
+ c.action do |_global_options, options, _args|
52
+ puts JSON.dump(@client.apps_manifest_validate(options))
53
+ end
54
+ end
55
+ end
49
56
  end
50
57
  end
51
58
  end
data/bin/commands/auth.rb CHANGED
@@ -1,22 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Auth methods.'
5
- command 'auth' do |g|
6
- g.desc 'Revokes a token.'
7
- g.long_desc %( Revokes a token. )
8
- g.command 'revoke' do |c|
9
- c.flag 'test', desc: 'Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.auth_revoke(options))
12
- end
13
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Auth methods.'
8
+ command 'auth' do |g|
9
+ g.desc 'Revokes a token.'
10
+ g.long_desc %( Revokes a token. )
11
+ g.command 'revoke' do |c|
12
+ c.flag 'test', desc: 'Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump(@client.auth_revoke(options))
15
+ end
16
+ end
14
17
 
15
- g.desc 'Checks authentication & identity.'
16
- g.long_desc %( Checks authentication & identity. )
17
- g.command 'test' do |c|
18
- c.action do |_global_options, options, _args|
19
- puts JSON.dump($client.auth_test(options))
18
+ g.desc 'Checks authentication & identity.'
19
+ g.long_desc %( Checks authentication & identity. )
20
+ g.command 'test' do |c|
21
+ c.action do |_global_options, options, _args|
22
+ puts JSON.dump(@client.auth_test(options))
23
+ end
24
+ end
25
+ end
20
26
  end
21
27
  end
22
28
  end
@@ -1,16 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AuthTeams methods.'
5
- command 'auth_teams' do |g|
6
- g.desc 'List the workspaces a token can access.'
7
- g.long_desc %( List the workspaces a token can access. )
8
- g.command 'list' do |c|
9
- c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
10
- c.flag 'include_icon', desc: 'Whether to return icon paths for each workspace. An icon path represents a URI pointing to the image signifying the workspace.'
11
- c.flag 'limit', desc: 'The maximum number of workspaces to return. Must be a positive integer no larger than 1000.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.auth_teams_list(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'AuthTeams methods.'
8
+ command 'auth_teams' do |g|
9
+ g.desc 'List the workspaces a token can access.'
10
+ g.long_desc %( List the workspaces a token can access. )
11
+ g.command 'list' do |c|
12
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
13
+ c.flag 'include_icon', desc: 'Whether to return icon paths for each workspace. An icon path represents a URI pointing to the image signifying the workspace.'
14
+ c.flag 'limit', desc: 'The maximum number of workspaces to return. Must be a positive integer no larger than 1000.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.auth_teams_list(options))
17
+ end
18
+ end
19
+ end
14
20
  end
15
21
  end
16
22
  end
@@ -0,0 +1,59 @@
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 'Bookmarks methods.'
8
+ command 'bookmarks' do |g|
9
+ g.desc 'Add bookmark to a channel.'
10
+ g.long_desc %( Add bookmark to a channel. )
11
+ g.command 'add' do |c|
12
+ c.flag 'channel_id', desc: 'Channel to add bookmark in.'
13
+ c.flag 'title', desc: 'Title for the bookmark.'
14
+ c.flag 'type', desc: 'Type of the bookmark i.e link.'
15
+ c.flag 'emoji', desc: 'Emoji tag to apply to the link.'
16
+ c.flag 'entity_id', desc: 'ID of the entity being bookmarked. Only applies to message and file types.'
17
+ c.flag 'link', desc: 'Link to bookmark.'
18
+ c.flag 'parent_id', desc: "Id of this bookmark's parent."
19
+ c.action do |_global_options, options, _args|
20
+ puts JSON.dump(@client.bookmarks_add(options))
21
+ end
22
+ end
23
+
24
+ g.desc 'Edit bookmark.'
25
+ g.long_desc %( Edit bookmark. )
26
+ g.command 'edit' do |c|
27
+ c.flag 'bookmark_id', desc: 'Bookmark to update.'
28
+ c.flag 'channel_id', desc: 'Channel to update bookmark in.'
29
+ c.flag 'emoji', desc: 'Emoji tag to apply to the link.'
30
+ c.flag 'link', desc: 'Link to bookmark.'
31
+ c.flag 'title', desc: 'Title for the bookmark.'
32
+ c.action do |_global_options, options, _args|
33
+ puts JSON.dump(@client.bookmarks_edit(options))
34
+ end
35
+ end
36
+
37
+ g.desc 'List bookmark for the channel.'
38
+ g.long_desc %( List bookmark for the channel. )
39
+ g.command 'list' do |c|
40
+ c.flag 'channel_id', desc: 'Channel to list bookmarks in.'
41
+ c.action do |_global_options, options, _args|
42
+ puts JSON.dump(@client.bookmarks_list(options))
43
+ end
44
+ end
45
+
46
+ g.desc 'Remove bookmark from the channel.'
47
+ g.long_desc %( Remove bookmark from the channel. )
48
+ g.command 'remove' do |c|
49
+ c.flag 'bookmark_id', desc: 'Bookmark to remove.'
50
+ c.flag 'channel_id', desc: 'Channel to remove bookmark.'
51
+ c.flag 'quip_section_id', desc: 'Quip section ID to unbookmark.'
52
+ c.action do |_global_options, options, _args|
53
+ puts JSON.dump(@client.bookmarks_remove(options))
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
data/bin/commands/bots.rb CHANGED
@@ -1,15 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Bots methods.'
5
- command 'bots' do |g|
6
- g.desc 'Gets information about a bot user.'
7
- g.long_desc %( Gets information about a bot user. )
8
- g.command 'info' do |c|
9
- c.flag 'bot', desc: 'Bot user to get info on.'
10
- c.flag 'team_id', desc: 'encoded team id or enterprise id where the bot exists, required if org token is used.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.bots_info(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Bots methods.'
8
+ command 'bots' do |g|
9
+ g.desc 'Gets information about a bot user.'
10
+ g.long_desc %( Gets information about a bot user. )
11
+ g.command 'info' do |c|
12
+ c.flag 'bot', desc: 'Bot user to get info on.'
13
+ c.flag 'team_id', desc: 'encoded team id or enterprise id where the bot exists, required if org token is used.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.bots_info(options))
16
+ end
17
+ end
18
+ end
13
19
  end
14
20
  end
15
21
  end
@@ -1,52 +1,58 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Calls methods.'
5
- command 'calls' do |g|
6
- g.desc 'Registers a new Call.'
7
- g.long_desc %( Registers a new Call. )
8
- g.command 'add' do |c|
9
- c.flag 'external_unique_id', desc: 'An ID supplied by the 3rd-party Call provider. It must be unique across all Calls from that service.'
10
- c.flag 'join_url', desc: 'The URL required for a client to join the Call.'
11
- c.flag 'created_by', desc: 'The valid Slack user ID of the user who created this Call. When this method is called with a user token, the created_by field is optional and defaults to the authed user of the token. Otherwise, the field is required.'
12
- c.flag 'date_start', desc: 'Call start time in UTC UNIX timestamp format.'
13
- c.flag 'desktop_app_join_url', desc: 'When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.'
14
- c.flag 'external_display_id', desc: 'An optional, human-readable ID supplied by the 3rd-party Call provider. If supplied, this ID will be displayed in the Call object.'
15
- c.flag 'title', desc: 'The name of the Call.'
16
- c.flag 'users', desc: 'The list of users to register as participants in the Call. Read more on how to specify users here.'
17
- c.action do |_global_options, options, _args|
18
- puts JSON.dump($client.calls_add(options))
19
- end
20
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Calls methods.'
8
+ command 'calls' do |g|
9
+ g.desc 'Registers a new Call.'
10
+ g.long_desc %( Registers a new Call. )
11
+ g.command 'add' do |c|
12
+ c.flag 'external_unique_id', desc: 'An ID supplied by the 3rd-party Call provider. It must be unique across all Calls from that service.'
13
+ c.flag 'join_url', desc: 'The URL required for a client to join the Call.'
14
+ c.flag 'created_by', desc: 'The valid Slack user ID of the user who created this Call. When this method is called with a user token, the created_by field is optional and defaults to the authed user of the token. Otherwise, the field is required.'
15
+ c.flag 'date_start', desc: 'Call start time in UTC UNIX timestamp format.'
16
+ c.flag 'desktop_app_join_url', desc: 'When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.'
17
+ c.flag 'external_display_id', desc: 'An optional, human-readable ID supplied by the 3rd-party Call provider. If supplied, this ID will be displayed in the Call object.'
18
+ c.flag 'title', desc: 'The name of the Call.'
19
+ c.flag 'users', desc: 'The list of users to register as participants in the Call. Read more on how to specify users here.'
20
+ c.action do |_global_options, options, _args|
21
+ puts JSON.dump(@client.calls_add(options))
22
+ end
23
+ end
21
24
 
22
- g.desc 'Ends a Call.'
23
- g.long_desc %( Ends a Call. )
24
- g.command 'end' do |c|
25
- c.flag 'id', desc: 'id returned when registering the call using the calls.add method.'
26
- c.flag 'duration', desc: 'Call duration in seconds.'
27
- c.action do |_global_options, options, _args|
28
- puts JSON.dump($client.calls_end(options))
29
- end
30
- end
25
+ g.desc 'Ends a Call.'
26
+ g.long_desc %( Ends a Call. )
27
+ g.command 'end' do |c|
28
+ c.flag 'id', desc: 'id returned when registering the call using the calls.add method.'
29
+ c.flag 'duration', desc: 'Call duration in seconds.'
30
+ c.action do |_global_options, options, _args|
31
+ puts JSON.dump(@client.calls_end(options))
32
+ end
33
+ end
31
34
 
32
- g.desc 'Returns information about a Call.'
33
- g.long_desc %( Returns information about a Call. )
34
- g.command 'info' do |c|
35
- c.flag 'id', desc: 'id of the Call returned by the calls.add method.'
36
- c.action do |_global_options, options, _args|
37
- puts JSON.dump($client.calls_info(options))
38
- end
39
- end
35
+ g.desc 'Returns information about a Call.'
36
+ g.long_desc %( Returns information about a Call. )
37
+ g.command 'info' do |c|
38
+ c.flag 'id', desc: 'id of the Call returned by the calls.add method.'
39
+ c.action do |_global_options, options, _args|
40
+ puts JSON.dump(@client.calls_info(options))
41
+ end
42
+ end
40
43
 
41
- g.desc 'Updates information about a Call.'
42
- g.long_desc %( Updates information about a Call. )
43
- g.command 'update' do |c|
44
- c.flag 'id', desc: 'id returned by the calls.add method.'
45
- c.flag 'desktop_app_join_url', desc: 'When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.'
46
- c.flag 'join_url', desc: 'The URL required for a client to join the Call.'
47
- c.flag 'title', desc: 'The name of the Call.'
48
- c.action do |_global_options, options, _args|
49
- puts JSON.dump($client.calls_update(options))
44
+ g.desc 'Updates information about a Call.'
45
+ g.long_desc %( Updates information about a Call. )
46
+ g.command 'update' do |c|
47
+ c.flag 'id', desc: 'id returned by the calls.add method.'
48
+ c.flag 'desktop_app_join_url', desc: 'When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.'
49
+ c.flag 'join_url', desc: 'The URL required for a client to join the Call.'
50
+ c.flag 'title', desc: 'The name of the Call.'
51
+ c.action do |_global_options, options, _args|
52
+ puts JSON.dump(@client.calls_update(options))
53
+ end
54
+ end
55
+ end
50
56
  end
51
57
  end
52
58
  end
@@ -1,25 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'CallsParticipants methods.'
5
- command 'calls_participants' do |g|
6
- g.desc 'Registers new participants added to a Call.'
7
- g.long_desc %( Registers new participants added to a Call. )
8
- g.command 'add' do |c|
9
- c.flag 'id', desc: 'id returned by the calls.add method.'
10
- c.flag 'users', desc: 'The list of users to add as participants in the Call. Read more on how to specify users here.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.calls_participants_add(options))
13
- end
14
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'CallsParticipants methods.'
8
+ command 'calls_participants' do |g|
9
+ g.desc 'Registers new participants added to a Call.'
10
+ g.long_desc %( Registers new participants added to a Call. )
11
+ g.command 'add' do |c|
12
+ c.flag 'id', desc: 'id returned by the calls.add method.'
13
+ c.flag 'users', desc: 'The list of users to add as participants in the Call. Read more on how to specify users here.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.calls_participants_add(options))
16
+ end
17
+ end
15
18
 
16
- g.desc 'Registers participants removed from a Call.'
17
- g.long_desc %( Registers participants removed from a Call. )
18
- g.command 'remove' do |c|
19
- c.flag 'id', desc: 'id returned by the calls.add method.'
20
- c.flag 'users', desc: 'The list of users to remove as participants in the Call. Read more on how to specify users here.'
21
- c.action do |_global_options, options, _args|
22
- puts JSON.dump($client.calls_participants_remove(options))
19
+ g.desc 'Registers participants removed from a Call.'
20
+ g.long_desc %( Registers participants removed from a Call. )
21
+ g.command 'remove' do |c|
22
+ c.flag 'id', desc: 'id returned by the calls.add method.'
23
+ c.flag 'users', desc: 'The list of users to remove as participants in the Call. Read more on how to specify users here.'
24
+ c.action do |_global_options, options, _args|
25
+ puts JSON.dump(@client.calls_participants_remove(options))
26
+ end
27
+ end
28
+ end
23
29
  end
24
30
  end
25
31
  end