slack-ruby-client 0.14.6 → 1.0.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 (274) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +15 -3
  4. data/.rubocop_todo.yml +110 -38
  5. data/.travis.yml +2 -5
  6. data/CHANGELOG.md +42 -0
  7. data/CONTRIBUTING.md +19 -8
  8. data/Dangerfile +1 -1
  9. data/Gemfile +1 -2
  10. data/LICENSE.md +1 -1
  11. data/README.md +38 -36
  12. data/RELEASING.md +1 -1
  13. data/UPGRADING.md +62 -2
  14. data/bin/commands/admin_analytics.rb +16 -0
  15. data/bin/commands/admin_apps.rb +26 -2
  16. data/bin/commands/admin_apps_requests.rb +1 -0
  17. data/bin/commands/admin_auth_policy.rb +39 -0
  18. data/bin/commands/admin_barriers.rb +47 -0
  19. data/bin/commands/admin_conversations.rb +155 -3
  20. data/bin/commands/admin_conversations_ekm.rb +17 -0
  21. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  22. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  23. data/bin/commands/admin_emoji.rb +1 -1
  24. data/bin/commands/admin_teams.rb +1 -1
  25. data/bin/commands/admin_usergroups.rb +48 -0
  26. data/bin/commands/admin_users.rb +3 -2
  27. data/bin/commands/admin_users_session.rb +62 -0
  28. data/bin/commands/api.rb +0 -1
  29. data/bin/commands/apps_connections.rb +13 -0
  30. data/bin/commands/apps_event_authorizations.rb +16 -0
  31. data/bin/commands/apps_manifest.rb +51 -0
  32. data/bin/commands/auth_teams.rb +16 -0
  33. data/bin/commands/bots.rb +1 -0
  34. data/bin/commands/calls.rb +52 -0
  35. data/bin/commands/calls_participants.rb +25 -0
  36. data/bin/commands/channels.rb +1 -155
  37. data/bin/commands/chat.rb +17 -12
  38. data/bin/commands/chat_scheduledMessages.rb +1 -0
  39. data/bin/commands/conversations.rb +71 -3
  40. data/bin/commands/dnd.rb +2 -0
  41. data/bin/commands/files.rb +6 -4
  42. data/bin/commands/files_remote.rb +2 -2
  43. data/bin/commands/groups.rb +1 -162
  44. data/bin/commands/im.rb +1 -63
  45. data/bin/commands/migration.rb +1 -0
  46. data/bin/commands/mpim.rb +1 -61
  47. data/bin/commands/oauth.rb +0 -13
  48. data/bin/commands/oauth_v2.rb +13 -1
  49. data/bin/commands/openid_connect.rb +27 -0
  50. data/bin/commands/pins.rb +2 -4
  51. data/bin/commands/reactions.rb +1 -0
  52. data/bin/commands/reminders.rb +6 -0
  53. data/bin/commands/rtm.rb +2 -2
  54. data/bin/commands/search.rb +4 -0
  55. data/bin/commands/stars.rb +7 -6
  56. data/bin/commands/team.rb +3 -0
  57. data/bin/commands/team_billing.rb +13 -0
  58. data/bin/commands/team_preferences.rb +13 -0
  59. data/bin/commands/tooling_tokens.rb +14 -0
  60. data/bin/commands/usergroups.rb +5 -0
  61. data/bin/commands/usergroups_users.rb +2 -0
  62. data/bin/commands/users.rb +4 -2
  63. data/bin/commands/users_profile.rb +5 -5
  64. data/bin/commands/views.rb +2 -2
  65. data/bin/commands/workflows.rb +38 -0
  66. data/bin/commands.rb +17 -8
  67. data/lib/slack/config.rb +1 -2
  68. data/lib/slack/events/request.rb +10 -4
  69. data/lib/slack/messages/message.rb +0 -4
  70. data/lib/slack/real_time/client.rb +6 -6
  71. data/lib/slack/real_time/concurrency/async.rb +7 -11
  72. data/lib/slack/real_time/concurrency.rb +0 -2
  73. data/lib/slack/real_time/config.rb +5 -14
  74. data/lib/slack/real_time/models/base.rb +0 -4
  75. data/lib/slack/real_time/socket.rb +3 -4
  76. data/lib/slack/real_time/stores/base.rb +4 -7
  77. data/lib/slack/real_time/stores/starter.rb +6 -3
  78. data/lib/slack/real_time/stores/store.rb +5 -0
  79. data/lib/slack/version.rb +1 -1
  80. data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
  81. data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
  82. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  83. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
  84. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  85. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  86. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  87. data/lib/slack/web/api/endpoints/admin_conversations.rb +234 -4
  88. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  89. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  90. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  91. data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
  92. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  93. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  94. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  95. data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
  96. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  97. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  98. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  99. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  100. data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
  101. data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
  102. data/lib/slack/web/api/endpoints/api.rb +1 -3
  103. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  104. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  105. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  106. data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
  107. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  108. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  109. data/lib/slack/web/api/endpoints/bots.rb +3 -1
  110. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  111. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  112. data/lib/slack/web/api/endpoints/channels.rb +1 -245
  113. data/lib/slack/web/api/endpoints/chat.rb +76 -66
  114. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +5 -3
  115. data/lib/slack/web/api/endpoints/conversations.rb +149 -41
  116. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  117. data/lib/slack/web/api/endpoints/dnd.rb +6 -3
  118. data/lib/slack/web/api/endpoints/files.rb +21 -17
  119. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  120. data/lib/slack/web/api/endpoints/files_remote.rb +23 -23
  121. data/lib/slack/web/api/endpoints/groups.rb +0 -253
  122. data/lib/slack/web/api/endpoints/im.rb +0 -101
  123. data/lib/slack/web/api/endpoints/migration.rb +4 -2
  124. data/lib/slack/web/api/endpoints/mpim.rb +0 -96
  125. data/lib/slack/web/api/endpoints/oauth.rb +5 -30
  126. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  127. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  128. data/lib/slack/web/api/endpoints/pins.rb +7 -12
  129. data/lib/slack/web/api/endpoints/reactions.rb +16 -14
  130. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  131. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  132. data/lib/slack/web/api/endpoints/search.rb +27 -13
  133. data/lib/slack/web/api/endpoints/stars.rb +13 -11
  134. data/lib/slack/web/api/endpoints/team.rb +11 -5
  135. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  136. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  137. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  138. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  139. data/lib/slack/web/api/endpoints/usergroups.rb +26 -16
  140. data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
  141. data/lib/slack/web/api/endpoints/users.rb +20 -18
  142. data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
  143. data/lib/slack/web/api/endpoints/views.rb +13 -13
  144. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  145. data/lib/slack/web/api/endpoints.rb +35 -18
  146. data/lib/slack/web/api/errors/server_error.rb +37 -0
  147. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  148. data/lib/slack/web/api/errors.rb +486 -12
  149. data/lib/slack/web/api/mixins/{channels.id.rb → conversations.id.rb} +3 -5
  150. data/lib/slack/web/api/mixins/ids.id.rb +3 -5
  151. data/lib/slack/web/api/mixins/users.id.rb +1 -3
  152. data/lib/slack/web/api/mixins.rb +1 -2
  153. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +25 -24
  154. data/lib/slack/web/api/templates/endpoints.erb +1 -2
  155. data/lib/slack/web/api/templates/method.erb +4 -1
  156. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  157. data/lib/slack/web/config.rb +2 -0
  158. data/lib/slack/web/faraday/connection.rb +23 -20
  159. data/lib/slack/web/faraday/request.rb +2 -1
  160. data/lib/slack/web/faraday/response/raise_error.rb +12 -1
  161. data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
  162. data/lib/slack/web/pagination/cursor.rb +3 -7
  163. data/lib/slack-ruby-client.rb +4 -4
  164. data/lib/tasks/web.rake +11 -3
  165. data/slack-ruby-client.gemspec +6 -7
  166. data/spec/fixtures/slack/web/429_error.yml +50 -54
  167. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  168. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  169. data/spec/fixtures/slack/web/conversations_info.yml +167 -0
  170. data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
  171. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
  172. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
  173. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  174. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  175. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  176. data/spec/fixtures/slack/web/users_info.yml +153 -69
  177. data/spec/fixtures/slack/web/users_list.yml +102 -41
  178. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  179. data/spec/slack/events/request_spec.rb +13 -8
  180. data/spec/slack/real_time/client_spec.rb +35 -22
  181. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  182. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  183. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  184. data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
  185. data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
  186. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  187. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  188. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  189. data/spec/slack/slack_spec.rb +3 -1
  190. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  191. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
  192. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  193. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  194. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
  195. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  196. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
  197. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
  198. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
  199. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
  200. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  201. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
  202. data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
  203. data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
  204. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  205. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  206. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  207. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
  208. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  209. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  210. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  211. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  212. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  213. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  214. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  215. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  216. data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
  217. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -22
  218. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  219. data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
  220. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
  221. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  222. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  223. data/spec/slack/web/api/endpoints/team_billing_spec.rb +8 -0
  224. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
  225. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  226. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  227. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  228. data/spec/slack/web/api/error_spec.rb +5 -7
  229. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  230. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  231. data/spec/slack/web/api/mixins/{channels_spec.rb → conversations_spec.rb} +8 -8
  232. data/spec/slack/web/api/mixins/users_spec.rb +1 -1
  233. data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
  234. data/spec/slack/web/client_spec.rb +123 -1
  235. data/spec/slack/web/faraday/request_spec.rb +80 -0
  236. data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
  237. data/spec/spec_helper.rb +1 -1
  238. data/spec/support/real_time/connected_client.rb +1 -7
  239. data/spec/support/vcr.rb +36 -1
  240. metadata +95 -173
  241. data/examples/hi_real_time/Gemfile +0 -6
  242. data/examples/hi_real_time/hi.gif +0 -0
  243. data/examples/hi_real_time/hi.rb +0 -41
  244. data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
  245. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  246. data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
  247. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
  248. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  249. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
  250. data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
  251. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
  252. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  253. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  254. data/lib/slack/web/api/mixins/groups.id.rb +0 -27
  255. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  256. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  257. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  258. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  259. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
  260. data/spec/fixtures/slack/web/503_error.yml +0 -14
  261. data/spec/fixtures/slack/web/channels_info.yml +0 -46
  262. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  263. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
  264. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
  265. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  266. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  267. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -101
  268. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
  269. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
  270. data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
  271. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
  272. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
  273. data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
  274. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -6,14 +6,76 @@ module Slack
6
6
  module Api
7
7
  module Endpoints
8
8
  module AdminUsersSession
9
+ #
10
+ # Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users.
11
+ #
12
+ # @option options [array] :user_ids
13
+ # The IDs of users you'd like to clear session settings for.
14
+ # @see https://api.slack.com/methods/admin.users.session.clearSettings
15
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.clearSettings.json
16
+ def admin_users_session_clearSettings(options = {})
17
+ throw ArgumentError.new('Required arguments :user_ids missing') if options[:user_ids].nil?
18
+ post('admin.users.session.clearSettings', options)
19
+ end
20
+
21
+ #
22
+ # Get user-specific session settings—the session duration and what happens when the client closes—given a list of users.
23
+ #
24
+ # @option options [array] :user_ids
25
+ # 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.
26
+ # @see https://api.slack.com/methods/admin.users.session.getSettings
27
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.getSettings.json
28
+ def admin_users_session_getSettings(options = {})
29
+ throw ArgumentError.new('Required arguments :user_ids missing') if options[:user_ids].nil?
30
+ post('admin.users.session.getSettings', options)
31
+ end
32
+
33
+ #
34
+ # Revoke a single session for a user. The user will be forced to login to Slack.
35
+ #
36
+ # @option options [integer] :session_id
37
+ # ID of the session to invalidate.
38
+ # @option options [string] :team_id
39
+ # ID of the workspace that the session belongs to.
40
+ # @see https://api.slack.com/methods/admin.users.session.invalidate
41
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.invalidate.json
42
+ def admin_users_session_invalidate(options = {})
43
+ throw ArgumentError.new('Required arguments :session_id missing') if options[:session_id].nil?
44
+ throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
45
+ post('admin.users.session.invalidate', options)
46
+ end
47
+
48
+ #
49
+ # List active user sessions for an organization
50
+ #
51
+ # @option options [string] :cursor
52
+ # Set cursor to next_cursor returned by the previous call to list items in the next page.
53
+ # @option options [integer] :limit
54
+ # The maximum number of items to return. Must be between 1 - 1000 both inclusive.
55
+ # @option options [string] :team_id
56
+ # 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.
57
+ # @option options [string] :user_id
58
+ # 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.
59
+ # @see https://api.slack.com/methods/admin.users.session.list
60
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.list.json
61
+ def admin_users_session_list(options = {})
62
+ if block_given?
63
+ Pagination::Cursor.new(self, :admin_users_session_list, options).each do |page|
64
+ yield page
65
+ end
66
+ else
67
+ post('admin.users.session.list', options)
68
+ end
69
+ end
70
+
9
71
  #
10
72
  # Wipes all valid sessions on all devices for a given user
11
73
  #
12
- # @option options [Object] :user_id
74
+ # @option options [string] :user_id
13
75
  # The ID of the user to wipe sessions for.
14
- # @option options [Object] :mobile_only
76
+ # @option options [boolean] :mobile_only
15
77
  # Only expire mobile sessions (default: false).
16
- # @option options [Object] :web_only
78
+ # @option options [boolean] :web_only
17
79
  # Only expire web sessions (default: false).
18
80
  # @see https://api.slack.com/methods/admin.users.session.reset
19
81
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.reset.json
@@ -21,6 +83,38 @@ module Slack
21
83
  throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
22
84
  post('admin.users.session.reset', options)
23
85
  end
86
+
87
+ #
88
+ # Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users
89
+ #
90
+ # @option options [array] :user_ids
91
+ # The ID of the user to wipe sessions for.
92
+ # @option options [boolean] :mobile_only
93
+ # Only expire mobile sessions (default: false).
94
+ # @option options [boolean] :web_only
95
+ # Only expire web sessions (default: false).
96
+ # @see https://api.slack.com/methods/admin.users.session.resetBulk
97
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.resetBulk.json
98
+ def admin_users_session_resetBulk(options = {})
99
+ throw ArgumentError.new('Required arguments :user_ids missing') if options[:user_ids].nil?
100
+ post('admin.users.session.resetBulk', options)
101
+ end
102
+
103
+ #
104
+ # Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users.
105
+ #
106
+ # @option options [array] :user_ids
107
+ # The list of user IDs to apply the session settings for.
108
+ # @option options [boolean] :desktop_app_browser_quit
109
+ # Terminate the session when the client—either the desktop app or a browser window—is closed.
110
+ # @option options [integer] :duration
111
+ # 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).
112
+ # @see https://api.slack.com/methods/admin.users.session.setSettings
113
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.setSettings.json
114
+ def admin_users_session_setSettings(options = {})
115
+ throw ArgumentError.new('Required arguments :user_ids missing') if options[:user_ids].nil?
116
+ post('admin.users.session.setSettings', options)
117
+ end
24
118
  end
25
119
  end
26
120
  end
@@ -9,10 +9,8 @@ module Slack
9
9
  #
10
10
  # Checks API calling code.
11
11
  #
12
- # @option options [Object] :error
12
+ # @option options [string] :error
13
13
  # Error response to return.
14
- # @option options [Object] :foo
15
- # example property to return.
16
14
  # @see https://api.slack.com/methods/api.test
17
15
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/api/api.test.json
18
16
  def api_test(options = {})
@@ -9,9 +9,9 @@ module Slack
9
9
  #
10
10
  # Uninstalls your app from a workspace.
11
11
  #
12
- # @option options [Object] :client_id
12
+ # @option options [string] :client_id
13
13
  # Issued when you created your application.
14
- # @option options [Object] :client_secret
14
+ # @option options [string] :client_secret
15
15
  # Issued when you created your application.
16
16
  # @see https://api.slack.com/methods/apps.uninstall
17
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps/apps.uninstall.json
@@ -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 Web
6
+ module Api
7
+ module Endpoints
8
+ module AppsConnections
9
+ #
10
+ # Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over,
11
+ #
12
+ # @see https://api.slack.com/methods/apps.connections.open
13
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.connections/apps.connections.open.json
14
+ def apps_connections_open(options = {})
15
+ post('apps.connections.open', options)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module AppsEventAuthorizations
9
+ #
10
+ # Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.
11
+ #
12
+ # @option options [string] :event_context
13
+ # .
14
+ # @option options [string] :cursor
15
+ # .
16
+ # @option options [integer] :limit
17
+ # .
18
+ # @see https://api.slack.com/methods/apps.event.authorizations.list
19
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.event.authorizations/apps.event.authorizations.list.json
20
+ def apps_event_authorizations_list(options = {})
21
+ throw ArgumentError.new('Required arguments :event_context missing') if options[:event_context].nil?
22
+ if block_given?
23
+ Pagination::Cursor.new(self, :apps_event_authorizations_list, options).each do |page|
24
+ yield page
25
+ end
26
+ else
27
+ post('apps.event.authorizations.list', options)
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module AppsManifest
9
+ #
10
+ # Create an app from an app manifest.
11
+ #
12
+ # @option options [manifest object as string] :manifest
13
+ # A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one.
14
+ # @see https://api.slack.com/methods/apps.manifest.create
15
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.create.json
16
+ def apps_manifest_create(options = {})
17
+ throw ArgumentError.new('Required arguments :manifest missing') if options[:manifest].nil?
18
+ post('apps.manifest.create', options)
19
+ end
20
+
21
+ #
22
+ # Permanently deletes an app created through app manifests
23
+ #
24
+ # @option options [Object] :app_id
25
+ # The ID of the app you want to delete.
26
+ # @see https://api.slack.com/methods/apps.manifest.delete
27
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.delete.json
28
+ def apps_manifest_delete(options = {})
29
+ throw ArgumentError.new('Required arguments :app_id missing') if options[:app_id].nil?
30
+ post('apps.manifest.delete', options)
31
+ end
32
+
33
+ #
34
+ # Export an app manifest from an existing app
35
+ #
36
+ # @option options [Object] :app_id
37
+ # The ID of the app whose configuration you want to export as a manifest.
38
+ # @see https://api.slack.com/methods/apps.manifest.export
39
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.export.json
40
+ def apps_manifest_export(options = {})
41
+ throw ArgumentError.new('Required arguments :app_id missing') if options[:app_id].nil?
42
+ post('apps.manifest.export', options)
43
+ end
44
+
45
+ #
46
+ # Update an app from an app manifest
47
+ #
48
+ # @option options [Object] :app_id
49
+ # The ID of the app whose configuration you want to update.
50
+ # @option options [manifest object as string] :manifest
51
+ # 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.
52
+ # @see https://api.slack.com/methods/apps.manifest.update
53
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.update.json
54
+ def apps_manifest_update(options = {})
55
+ throw ArgumentError.new('Required arguments :app_id missing') if options[:app_id].nil?
56
+ throw ArgumentError.new('Required arguments :manifest missing') if options[:manifest].nil?
57
+ post('apps.manifest.update', options)
58
+ end
59
+
60
+ #
61
+ # Validate an app manifest
62
+ #
63
+ # @option options [manifest object as string] :manifest
64
+ # The manifest to be validated. Will be validated against the app manifest schema - read our guide.
65
+ # @see https://api.slack.com/methods/apps.manifest.validate
66
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.validate.json
67
+ def apps_manifest_validate(options = {})
68
+ throw ArgumentError.new('Required arguments :manifest missing') if options[:manifest].nil?
69
+ post('apps.manifest.validate', options)
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -9,7 +9,7 @@ module Slack
9
9
  #
10
10
  # Revokes a token.
11
11
  #
12
- # @option options [Object] :test
12
+ # @option options [boolean] :test
13
13
  # Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked.
14
14
  # @see https://api.slack.com/methods/auth.revoke
15
15
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/auth/auth.revoke.json
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module AuthTeams
9
+ #
10
+ # List the workspaces a token can access.
11
+ #
12
+ # @option options [string] :cursor
13
+ # Set cursor to next_cursor returned by the previous call to list items in the next page.
14
+ # @option options [boolean] :include_icon
15
+ # Whether to return icon paths for each workspace. An icon path represents a URI pointing to the image signifying the workspace.
16
+ # @option options [integer] :limit
17
+ # The maximum number of workspaces to return. Must be a positive integer no larger than 1000.
18
+ # @see https://api.slack.com/methods/auth.teams.list
19
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/auth.teams/auth.teams.list.json
20
+ def auth_teams_list(options = {})
21
+ if block_given?
22
+ Pagination::Cursor.new(self, :auth_teams_list, options).each do |page|
23
+ yield page
24
+ end
25
+ else
26
+ post('auth.teams.list', options)
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -9,8 +9,10 @@ module Slack
9
9
  #
10
10
  # Gets information about a bot user.
11
11
  #
12
- # @option options [Object] :bot
12
+ # @option options [user] :bot
13
13
  # Bot user to get info on.
14
+ # @option options [team] :team_id
15
+ # encoded team id or enterprise id where the bot exists, required if org token is used.
14
16
  # @see https://api.slack.com/methods/bots.info
15
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/bots/bots.info.json
16
18
  def bots_info(options = {})
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module Calls
9
+ #
10
+ # Registers a new Call.
11
+ #
12
+ # @option options [string] :external_unique_id
13
+ # An ID supplied by the 3rd-party Call provider. It must be unique across all Calls from that service.
14
+ # @option options [string] :join_url
15
+ # The URL required for a client to join the Call.
16
+ # @option options [string] :created_by
17
+ # 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.
18
+ # @option options [integer] :date_start
19
+ # Call start time in UTC UNIX timestamp format.
20
+ # @option options [string] :desktop_app_join_url
21
+ # When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.
22
+ # @option options [string] :external_display_id
23
+ # An optional, human-readable ID supplied by the 3rd-party Call provider. If supplied, this ID will be displayed in the Call object.
24
+ # @option options [string] :title
25
+ # The name of the Call.
26
+ # @option options [array] :users
27
+ # The list of users to register as participants in the Call. Read more on how to specify users here.
28
+ # @see https://api.slack.com/methods/calls.add
29
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls/calls.add.json
30
+ def calls_add(options = {})
31
+ throw ArgumentError.new('Required arguments :external_unique_id missing') if options[:external_unique_id].nil?
32
+ throw ArgumentError.new('Required arguments :join_url missing') if options[:join_url].nil?
33
+ post('calls.add', options)
34
+ end
35
+
36
+ #
37
+ # Ends a Call.
38
+ #
39
+ # @option options [string] :id
40
+ # id returned when registering the call using the calls.add method.
41
+ # @option options [integer] :duration
42
+ # Call duration in seconds.
43
+ # @see https://api.slack.com/methods/calls.end
44
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls/calls.end.json
45
+ def calls_end(options = {})
46
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
47
+ post('calls.end', options)
48
+ end
49
+
50
+ #
51
+ # Returns information about a Call.
52
+ #
53
+ # @option options [string] :id
54
+ # id of the Call returned by the calls.add method.
55
+ # @see https://api.slack.com/methods/calls.info
56
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls/calls.info.json
57
+ def calls_info(options = {})
58
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
59
+ post('calls.info', options)
60
+ end
61
+
62
+ #
63
+ # Updates information about a Call.
64
+ #
65
+ # @option options [string] :id
66
+ # id returned by the calls.add method.
67
+ # @option options [string] :desktop_app_join_url
68
+ # When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.
69
+ # @option options [string] :join_url
70
+ # The URL required for a client to join the Call.
71
+ # @option options [string] :title
72
+ # The name of the Call.
73
+ # @see https://api.slack.com/methods/calls.update
74
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls/calls.update.json
75
+ def calls_update(options = {})
76
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
77
+ post('calls.update', options)
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module CallsParticipants
9
+ #
10
+ # Registers new participants added to a Call.
11
+ #
12
+ # @option options [string] :id
13
+ # id returned by the calls.add method.
14
+ # @option options [array] :users
15
+ # The list of users to add as participants in the Call. Read more on how to specify users here.
16
+ # @see https://api.slack.com/methods/calls.participants.add
17
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls.participants/calls.participants.add.json
18
+ def calls_participants_add(options = {})
19
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
20
+ throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
21
+ post('calls.participants.add', options)
22
+ end
23
+
24
+ #
25
+ # Registers participants removed from a Call.
26
+ #
27
+ # @option options [string] :id
28
+ # id returned by the calls.add method.
29
+ # @option options [array] :users
30
+ # The list of users to remove as participants in the Call. Read more on how to specify users here.
31
+ # @see https://api.slack.com/methods/calls.participants.remove
32
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls.participants/calls.participants.remove.json
33
+ def calls_participants_remove(options = {})
34
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
35
+ throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
36
+ post('calls.participants.remove', options)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end