slack-ruby-client 0.16.0 → 1.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 (234) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/danger.yml +19 -0
  3. data/.github/workflows/integtest.yml +25 -0
  4. data/.github/workflows/rubocop.yml +13 -0
  5. data/.github/workflows/test.yml +34 -0
  6. data/.gitignore +5 -3
  7. data/.rubocop.yml +6 -0
  8. data/.rubocop_todo.yml +137 -43
  9. data/CHANGELOG.md +34 -3
  10. data/CONTRIBUTING.md +4 -4
  11. data/Gemfile +18 -1
  12. data/Gemfile.danger +6 -0
  13. data/LICENSE.md +1 -1
  14. data/README.md +13 -12
  15. data/RELEASING.md +1 -1
  16. data/UPGRADING.md +42 -0
  17. data/bin/commands/admin_analytics.rb +2 -1
  18. data/bin/commands/admin_apps.rb +11 -0
  19. data/bin/commands/admin_apps_requests.rb +12 -0
  20. data/bin/commands/admin_auth_policy.rb +39 -0
  21. data/bin/commands/admin_conversations.rb +2 -1
  22. data/bin/commands/admin_conversations_restrictAccess.rb +1 -1
  23. data/bin/commands/admin_emoji.rb +2 -2
  24. data/bin/commands/admin_teams.rb +1 -1
  25. data/bin/commands/admin_users.rb +1 -0
  26. data/bin/commands/admin_users_session.rb +40 -0
  27. data/bin/commands/admin_users_unsupportedVersions.rb +15 -0
  28. data/bin/commands/apps_manifest.rb +52 -0
  29. data/bin/commands/bookmarks.rb +52 -0
  30. data/bin/commands/channels.rb +0 -157
  31. data/bin/commands/chat.rb +14 -9
  32. data/bin/commands/conversations.rb +61 -4
  33. data/bin/commands/dnd.rb +3 -1
  34. data/bin/commands/files.rb +2 -1
  35. data/bin/commands/groups.rb +0 -163
  36. data/bin/commands/im.rb +0 -62
  37. data/bin/commands/mpim.rb +0 -60
  38. data/bin/commands/oauth.rb +0 -13
  39. data/bin/commands/oauth_v2.rb +13 -1
  40. data/bin/commands/openid_connect.rb +27 -0
  41. data/bin/commands/pins.rb +2 -2
  42. data/bin/commands/reminders.rb +6 -0
  43. data/bin/commands/rtm.rb +2 -2
  44. data/bin/commands/search.rb +2 -1
  45. data/bin/commands/stars.rb +7 -6
  46. data/bin/commands/team.rb +1 -0
  47. data/bin/commands/team_billing.rb +13 -0
  48. data/bin/commands/team_preferences.rb +13 -0
  49. data/bin/commands/tooling_tokens.rb +14 -0
  50. data/bin/commands/usergroups.rb +1 -1
  51. data/bin/commands/users.rb +1 -1
  52. data/bin/commands/views.rb +1 -1
  53. data/bin/commands.rb +8 -9
  54. data/lib/slack/config.rb +1 -2
  55. data/lib/slack/events/request.rb +5 -3
  56. data/lib/slack/real_time/client.rb +6 -7
  57. data/lib/slack/real_time/concurrency/async.rb +6 -8
  58. data/lib/slack/real_time/config.rb +3 -13
  59. data/lib/slack/real_time/socket.rb +1 -2
  60. data/lib/slack/real_time/stores/base.rb +1 -6
  61. data/lib/slack/real_time/stores/starter.rb +6 -3
  62. data/lib/slack/real_time/stores/store.rb +5 -0
  63. data/lib/slack/version.rb +1 -1
  64. data/lib/slack/web/api/endpoints/admin_analytics.rb +5 -3
  65. data/lib/slack/web/api/endpoints/admin_apps.rb +21 -5
  66. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  67. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +20 -2
  68. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  69. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  70. data/lib/slack/web/api/endpoints/admin_barriers.rb +6 -6
  71. data/lib/slack/web/api/endpoints/admin_conversations.rb +28 -26
  72. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +4 -4
  73. data/lib/slack/web/api/endpoints/admin_emoji.rb +11 -11
  74. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  75. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  76. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  77. data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
  78. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  79. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  80. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  81. data/lib/slack/web/api/endpoints/admin_usergroups.rb +10 -10
  82. data/lib/slack/web/api/endpoints/admin_users.rb +20 -18
  83. data/lib/slack/web/api/endpoints/admin_users_session.rb +65 -9
  84. data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
  85. data/lib/slack/web/api/endpoints/api.rb +1 -1
  86. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  87. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +3 -3
  88. data/lib/slack/web/api/endpoints/apps_manifest.rb +77 -0
  89. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  90. data/lib/slack/web/api/endpoints/auth_teams.rb +3 -3
  91. data/lib/slack/web/api/endpoints/bookmarks.rb +86 -0
  92. data/lib/slack/web/api/endpoints/bots.rb +2 -2
  93. data/lib/slack/web/api/endpoints/calls.rb +15 -15
  94. data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
  95. data/lib/slack/web/api/endpoints/channels.rb +0 -265
  96. data/lib/slack/web/api/endpoints/chat.rb +67 -57
  97. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -3
  98. data/lib/slack/web/api/endpoints/conversations.rb +117 -27
  99. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  100. data/lib/slack/web/api/endpoints/dnd.rb +6 -3
  101. data/lib/slack/web/api/endpoints/files.rb +16 -14
  102. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  103. data/lib/slack/web/api/endpoints/files_remote.rb +20 -20
  104. data/lib/slack/web/api/endpoints/groups.rb +0 -273
  105. data/lib/slack/web/api/endpoints/im.rb +0 -107
  106. data/lib/slack/web/api/endpoints/migration.rb +3 -3
  107. data/lib/slack/web/api/endpoints/mpim.rb +0 -102
  108. data/lib/slack/web/api/endpoints/oauth.rb +5 -27
  109. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  110. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  111. data/lib/slack/web/api/endpoints/pins.rb +4 -4
  112. data/lib/slack/web/api/endpoints/reactions.rb +12 -12
  113. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  114. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  115. data/lib/slack/web/api/endpoints/search.rb +24 -16
  116. data/lib/slack/web/api/endpoints/stars.rb +11 -9
  117. data/lib/slack/web/api/endpoints/team.rb +10 -8
  118. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  119. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  120. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  121. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  122. data/lib/slack/web/api/endpoints/usergroups.rb +19 -19
  123. data/lib/slack/web/api/endpoints/usergroups_users.rb +7 -7
  124. data/lib/slack/web/api/endpoints/users.rb +16 -16
  125. data/lib/slack/web/api/endpoints/users_profile.rb +4 -4
  126. data/lib/slack/web/api/endpoints/views.rb +12 -12
  127. data/lib/slack/web/api/endpoints/workflows.rb +9 -9
  128. data/lib/slack/web/api/endpoints.rb +16 -20
  129. data/lib/slack/web/api/errors/server_error.rb +37 -0
  130. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  131. data/lib/slack/web/api/errors.rb +232 -16
  132. data/lib/slack/web/api/mixins.rb +0 -2
  133. data/lib/slack/web/api/patches/chat.1.patch +7 -9
  134. data/lib/slack/web/api/templates/endpoints.erb +0 -2
  135. data/lib/slack/web/faraday/connection.rb +5 -5
  136. data/lib/slack/web/faraday/request.rb +4 -1
  137. data/lib/slack/web/faraday/response/raise_error.rb +2 -14
  138. data/lib/slack/web/faraday/response/wrap_error.rb +11 -5
  139. data/lib/slack/web/pagination/cursor.rb +1 -5
  140. data/lib/slack-ruby-client.rb +3 -2
  141. data/lib/tasks/real_time.rake +1 -3
  142. data/lib/tasks/web.rake +4 -0
  143. data/slack-ruby-client.gemspec +5 -14
  144. data/spec/fixtures/slack/web/429_error.yml +50 -54
  145. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  146. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  147. data/spec/fixtures/slack/web/conversations_info.yml +167 -0
  148. data/spec/fixtures/slack/web/conversations_setTopic.yml +42 -27
  149. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +89 -59
  150. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +131 -86
  151. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  152. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  153. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  154. data/spec/fixtures/slack/web/users_info.yml +153 -69
  155. data/spec/fixtures/slack/web/users_list.yml +102 -41
  156. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  157. data/spec/integration/integration_spec.rb +1 -1
  158. data/spec/slack/events/request_spec.rb +7 -6
  159. data/spec/slack/real_time/client_spec.rb +37 -39
  160. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  161. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  162. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  163. data/spec/slack/real_time/event_handlers/channel_spec.rb +9 -9
  164. data/spec/slack/real_time/event_handlers/group_spec.rb +2 -2
  165. data/spec/slack/real_time/event_handlers/im_spec.rb +7 -7
  166. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  167. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  168. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  169. data/spec/slack/real_time/store_spec.rb +2 -2
  170. data/spec/slack/slack_spec.rb +7 -5
  171. data/spec/slack/version_spec.rb +1 -1
  172. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +5 -0
  173. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
  174. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  175. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +9 -9
  176. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +1 -1
  177. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
  178. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +22 -2
  179. data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
  180. data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
  181. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  182. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  183. data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
  184. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
  185. data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
  186. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  187. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +28 -16
  188. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  189. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +4 -2
  190. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  191. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +22 -14
  192. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  193. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  194. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  195. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
  196. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  197. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → openid_connect_spec.rb} +1 -1
  198. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  199. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  200. data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → team_billing_spec.rb} +1 -1
  201. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
  202. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  203. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  204. data/spec/slack/web/api/error_spec.rb +5 -7
  205. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  206. data/spec/slack/web/api/mixins/conversations_list_spec.rb +1 -1
  207. data/spec/slack/web/api/pagination/cursor_spec.rb +8 -10
  208. data/spec/slack/web/client_spec.rb +46 -32
  209. data/spec/slack/web/faraday/request_spec.rb +80 -0
  210. data/spec/slack/web/faraday/response/raise_error_spec.rb +2 -1
  211. data/spec/spec_helper.rb +1 -1
  212. data/spec/support/real_time/connected_client.rb +2 -8
  213. data/spec/support/vcr.rb +33 -2
  214. metadata +50 -297
  215. data/.travis.yml +0 -28
  216. data/lib/slack/web/api/errors/internal_error.rb +0 -14
  217. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  218. data/lib/slack/web/api/mixins/channels.id.rb +0 -25
  219. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  220. data/lib/slack/web/api/mixins/groups.id.rb +0 -25
  221. data/spec/fixtures/slack/web/503_error.yml +0 -14
  222. data/spec/fixtures/slack/web/channels_info.yml +0 -139
  223. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  224. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +0 -32
  225. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  226. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  227. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -109
  228. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
  229. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
  230. data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
  231. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
  232. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
  233. data/spec/slack/web/api/mixins/channels_spec.rb +0 -43
  234. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -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 OpenidConnect
9
+ #
10
+ # Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack.
11
+ #
12
+ # @option options [string] :client_id
13
+ # Issued when you created your application.
14
+ # @option options [string] :client_secret
15
+ # Issued when you created your application.
16
+ # @option options [string] :code
17
+ # The code param returned via the OAuth callback.
18
+ # @option options [string] :grant_type
19
+ # The grant_type param as described in the OAuth spec.
20
+ # @option options [string] :redirect_uri
21
+ # This must match the originally submitted URI (if one was sent).
22
+ # @option options [string] :refresh_token
23
+ # The refresh_token param as described in the OAuth spec.
24
+ # @see https://api.slack.com/methods/openid.connect.token
25
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/openid.connect/openid.connect.token.json
26
+ def openid_connect_token(options = {})
27
+ post('openid.connect.token', options)
28
+ end
29
+
30
+ #
31
+ # Get the identity of a user who has authorized Sign in with Slack.
32
+ #
33
+ # @see https://api.slack.com/methods/openid.connect.userInfo
34
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/openid.connect/openid.connect.userInfo.json
35
+ def openid_connect_userInfo(options = {})
36
+ post('openid.connect.userInfo', options)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -10,9 +10,9 @@ module Slack
10
10
  # Pins an item to a channel.
11
11
  #
12
12
  # @option options [channel] :channel
13
- # Channel to pin the item in.
14
- # @option options [Object] :timestamp
15
- # Timestamp of the message to pin.
13
+ # Channel to pin the messsage to. You must also include a timestamp when pinning messages.
14
+ # @option options [string] :timestamp
15
+ # Timestamp of the message to pin. You must also include the channel.
16
16
  # @see https://api.slack.com/methods/pins.add
17
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.add.json
18
18
  def pins_add(options = {})
@@ -39,7 +39,7 @@ module Slack
39
39
  #
40
40
  # @option options [channel] :channel
41
41
  # Channel where the item is pinned to.
42
- # @option options [Object] :timestamp
42
+ # @option options [string] :timestamp
43
43
  # Timestamp of the message to un-pin.
44
44
  # @see https://api.slack.com/methods/pins.remove
45
45
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.remove.json
@@ -11,9 +11,9 @@ module Slack
11
11
  #
12
12
  # @option options [channel] :channel
13
13
  # Channel where the message to add reaction to was posted.
14
- # @option options [Object] :name
14
+ # @option options [string] :name
15
15
  # Reaction (emoji) name.
16
- # @option options [Object] :timestamp
16
+ # @option options [string] :timestamp
17
17
  # Timestamp of the message to add reaction to.
18
18
  # @see https://api.slack.com/methods/reactions.add
19
19
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.add.json
@@ -32,11 +32,11 @@ module Slack
32
32
  # Channel where the message to get reactions for was posted.
33
33
  # @option options [file] :file
34
34
  # File to get reactions for.
35
- # @option options [Object] :file_comment
35
+ # @option options [string] :file_comment
36
36
  # File comment to get reactions for.
37
- # @option options [Object] :full
37
+ # @option options [boolean] :full
38
38
  # If true always return the complete reaction list.
39
- # @option options [Object] :timestamp
39
+ # @option options [string] :timestamp
40
40
  # Timestamp of the message to get reactions for.
41
41
  # @see https://api.slack.com/methods/reactions.get
42
42
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.get.json
@@ -48,13 +48,13 @@ module Slack
48
48
  #
49
49
  # Lists reactions made by a user.
50
50
  #
51
- # @option options [Object] :cursor
51
+ # @option options [string] :cursor
52
52
  # Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See pagination for more details.
53
- # @option options [Object] :full
53
+ # @option options [boolean] :full
54
54
  # If true always return the complete reaction list.
55
- # @option options [Object] :limit
55
+ # @option options [integer] :limit
56
56
  # The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.
57
- # @option options [Object] :team_id
57
+ # @option options [string] :team_id
58
58
  # encoded team id to list reactions in, required if org token is used.
59
59
  # @option options [user] :user
60
60
  # Show reactions made by this user. Defaults to the authed user.
@@ -74,15 +74,15 @@ module Slack
74
74
  #
75
75
  # Removes a reaction from an item.
76
76
  #
77
- # @option options [Object] :name
77
+ # @option options [string] :name
78
78
  # Reaction (emoji) name.
79
79
  # @option options [channel] :channel
80
80
  # Channel where the message to remove reaction from was posted.
81
81
  # @option options [file] :file
82
82
  # File to remove reaction from.
83
- # @option options [Object] :file_comment
83
+ # @option options [string] :file_comment
84
84
  # File comment to remove reaction from.
85
- # @option options [Object] :timestamp
85
+ # @option options [string] :timestamp
86
86
  # Timestamp of the message to remove reaction from.
87
87
  # @see https://api.slack.com/methods/reactions.remove
88
88
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.remove.json
@@ -9,10 +9,14 @@ module Slack
9
9
  #
10
10
  # Creates a reminder.
11
11
  #
12
- # @option options [Object] :text
12
+ # @option options [string] :text
13
13
  # The content of the reminder.
14
- # @option options [Object] :time
14
+ # @option options [string] :time
15
15
  # When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").
16
+ # @option options [object] :recurrence
17
+ # Specify the repeating behavior of a reminder. Available options: daily, weekly, monthly, or yearly. If weekly, may further specify the days of the week.
18
+ # @option options [string] :team_id
19
+ # Encoded team id, required if org token is used.
16
20
  # @option options [user] :user
17
21
  # The user who will receive the reminder. If no user is specified, the reminder will go to user who created it.
18
22
  # @see https://api.slack.com/methods/reminders.add
@@ -27,8 +31,10 @@ module Slack
27
31
  #
28
32
  # Marks a reminder as complete.
29
33
  #
30
- # @option options [Object] :reminder
34
+ # @option options [string] :reminder
31
35
  # The ID of the reminder to be marked as complete.
36
+ # @option options [string] :team_id
37
+ # Encoded team id, required if org token is used.
32
38
  # @see https://api.slack.com/methods/reminders.complete
33
39
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.complete.json
34
40
  def reminders_complete(options = {})
@@ -39,8 +45,10 @@ module Slack
39
45
  #
40
46
  # Deletes a reminder.
41
47
  #
42
- # @option options [Object] :reminder
48
+ # @option options [string] :reminder
43
49
  # The ID of the reminder.
50
+ # @option options [string] :team_id
51
+ # Encoded team id, required if org token is used.
44
52
  # @see https://api.slack.com/methods/reminders.delete
45
53
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.delete.json
46
54
  def reminders_delete(options = {})
@@ -51,8 +59,10 @@ module Slack
51
59
  #
52
60
  # Gets information about a reminder.
53
61
  #
54
- # @option options [Object] :reminder
62
+ # @option options [string] :reminder
55
63
  # The ID of the reminder.
64
+ # @option options [string] :team_id
65
+ # Encoded team id, required if org token is passed.
56
66
  # @see https://api.slack.com/methods/reminders.info
57
67
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.info.json
58
68
  def reminders_info(options = {})
@@ -63,6 +73,8 @@ module Slack
63
73
  #
64
74
  # Lists all reminders created by or for a given user.
65
75
  #
76
+ # @option options [string] :team_id
77
+ # Encoded team id, required if org token is passed.
66
78
  # @see https://api.slack.com/methods/reminders.list
67
79
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.list.json
68
80
  def reminders_list(options = {})
@@ -9,9 +9,9 @@ module Slack
9
9
  #
10
10
  # Starts a Real Time Messaging session.
11
11
  #
12
- # @option options [Object] :batch_presence_aware
12
+ # @option options [boolean] :batch_presence_aware
13
13
  # Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence.
14
- # @option options [Object] :presence_sub
14
+ # @option options [boolean] :presence_sub
15
15
  # Only deliver presence events when requested by subscription. See presence subscriptions.
16
16
  # @see https://api.slack.com/methods/rtm.connect
17
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/rtm/rtm.connect.json
@@ -20,21 +20,21 @@ module Slack
20
20
  end
21
21
 
22
22
  #
23
- # Starts a Real Time Messaging session.
23
+ # Deprecated: Starts a Real Time Messaging session. Use rtm.connect instead.
24
24
  #
25
- # @option options [Object] :batch_presence_aware
25
+ # @option options [boolean] :batch_presence_aware
26
26
  # Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence.
27
- # @option options [Object] :include_locale
27
+ # @option options [boolean] :include_locale
28
28
  # Set this to true to receive the locale for users and channels. Defaults to false.
29
- # @option options [Object] :mpim_aware
29
+ # @option options [boolean] :mpim_aware
30
30
  # Returns MPIMs to the client in the API response.
31
- # @option options [Object] :no_latest
31
+ # @option options [boolean] :no_latest
32
32
  # Exclude latest timestamps for channels, groups, mpims, and ims. Automatically sets no_unreads to 1.
33
- # @option options [Object] :no_unreads
33
+ # @option options [boolean] :no_unreads
34
34
  # Skip unread counts for each channel (improves performance).
35
- # @option options [Object] :presence_sub
35
+ # @option options [boolean] :presence_sub
36
36
  # Only deliver presence events when requested by subscription. See presence subscriptions.
37
- # @option options [Object] :simple_latest
37
+ # @option options [boolean] :simple_latest
38
38
  # Return timestamp only for latest message object of each channel (improves performance).
39
39
  # @see https://api.slack.com/methods/rtm.start
40
40
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/rtm/rtm.start.json
@@ -9,15 +9,15 @@ module Slack
9
9
  #
10
10
  # Searches for messages and files matching a query.
11
11
  #
12
- # @option options [Object] :query
12
+ # @option options [string] :query
13
13
  # Search query. May contains booleans, etc.
14
- # @option options [Object] :highlight
14
+ # @option options [boolean] :highlight
15
15
  # Pass a value of true to enable query highlight markers (see below).
16
- # @option options [Object] :sort
16
+ # @option options [string] :sort
17
17
  # Return matches sorted by either score or timestamp.
18
- # @option options [Object] :sort_dir
18
+ # @option options [string] :sort_dir
19
19
  # Change sort direction to ascending (asc) or descending (desc).
20
- # @option options [Object] :team_id
20
+ # @option options [string] :team_id
21
21
  # encoded team id to search in, required if org token is used.
22
22
  # @see https://api.slack.com/methods/search.all
23
23
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.all.json
@@ -29,15 +29,15 @@ module Slack
29
29
  #
30
30
  # Searches for files matching a query.
31
31
  #
32
- # @option options [Object] :query
32
+ # @option options [string] :query
33
33
  # Search query.
34
- # @option options [Object] :highlight
34
+ # @option options [boolean] :highlight
35
35
  # Pass a value of true to enable query highlight markers (see below).
36
- # @option options [Object] :sort
36
+ # @option options [string] :sort
37
37
  # Return matches sorted by either score or timestamp.
38
- # @option options [Object] :sort_dir
38
+ # @option options [string] :sort_dir
39
39
  # Change sort direction to ascending (asc) or descending (desc).
40
- # @option options [Object] :team_id
40
+ # @option options [string] :team_id
41
41
  # encoded team id to search in, required if org token is used.
42
42
  # @see https://api.slack.com/methods/search.files
43
43
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.files.json
@@ -49,21 +49,29 @@ module Slack
49
49
  #
50
50
  # Searches for messages matching a query.
51
51
  #
52
- # @option options [Object] :query
52
+ # @option options [string] :query
53
53
  # Search query.
54
- # @option options [Object] :highlight
54
+ # @option options [string] :cursor
55
+ # Use this when getting results with cursormark pagination. For first call send * for subsequent calls, send the value of next_cursor returned in the previous call's results.
56
+ # @option options [boolean] :highlight
55
57
  # Pass a value of true to enable query highlight markers (see below).
56
- # @option options [Object] :sort
58
+ # @option options [string] :sort
57
59
  # Return matches sorted by either score or timestamp.
58
- # @option options [Object] :sort_dir
60
+ # @option options [string] :sort_dir
59
61
  # Change sort direction to ascending (asc) or descending (desc).
60
- # @option options [Object] :team_id
62
+ # @option options [string] :team_id
61
63
  # encoded team id to search in, required if org token is used.
62
64
  # @see https://api.slack.com/methods/search.messages
63
65
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.messages.json
64
66
  def search_messages(options = {})
65
67
  throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
66
- post('search.messages', options)
68
+ if block_given?
69
+ Pagination::Cursor.new(self, :search_messages, options).each do |page|
70
+ yield page
71
+ end
72
+ else
73
+ post('search.messages', options)
74
+ end
67
75
  end
68
76
  end
69
77
  end
@@ -7,15 +7,15 @@ module Slack
7
7
  module Endpoints
8
8
  module Stars
9
9
  #
10
- # Adds a star to an item.
10
+ # Save an item for later. Formerly known as _adding a star_.
11
11
  #
12
12
  # @option options [channel] :channel
13
13
  # Channel to add star to, or channel where the message to add star to was posted (used with timestamp).
14
14
  # @option options [file] :file
15
15
  # File to add star to.
16
- # @option options [Object] :file_comment
16
+ # @option options [string] :file_comment
17
17
  # File comment to add star to.
18
- # @option options [Object] :timestamp
18
+ # @option options [string] :timestamp
19
19
  # Timestamp of the message to add star to.
20
20
  # @see https://api.slack.com/methods/stars.add
21
21
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.add.json
@@ -25,12 +25,14 @@ module Slack
25
25
  end
26
26
 
27
27
  #
28
- # Lists stars for a user.
28
+ # List a user's saved items, formerly known as _stars_.
29
29
  #
30
- # @option options [Object] :cursor
30
+ # @option options [string] :cursor
31
31
  # Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See pagination for more details.
32
- # @option options [Object] :limit
32
+ # @option options [integer] :limit
33
33
  # The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.
34
+ # @option options [string] :team_id
35
+ # encoded team id to list stars in, required if org token is used.
34
36
  # @see https://api.slack.com/methods/stars.list
35
37
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.list.json
36
38
  def stars_list(options = {})
@@ -44,15 +46,15 @@ module Slack
44
46
  end
45
47
 
46
48
  #
47
- # Removes a star from an item.
49
+ # Removes a saved item (star) from an item.
48
50
  #
49
51
  # @option options [channel] :channel
50
52
  # Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).
51
53
  # @option options [file] :file
52
54
  # File to remove star from.
53
- # @option options [Object] :file_comment
55
+ # @option options [string] :file_comment
54
56
  # File comment to remove star from.
55
- # @option options [Object] :timestamp
57
+ # @option options [string] :timestamp
56
58
  # Timestamp of the message to remove star from.
57
59
  # @see https://api.slack.com/methods/stars.remove
58
60
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.remove.json
@@ -9,9 +9,9 @@ module Slack
9
9
  #
10
10
  # Gets the access logs for the current team.
11
11
  #
12
- # @option options [Object] :before
12
+ # @option options [string] :before
13
13
  # End of time range of logs to include in results (inclusive).
14
- # @option options [Object] :team_id
14
+ # @option options [string] :team_id
15
15
  # encoded team id to get logs from, required if org token is used.
16
16
  # @see https://api.slack.com/methods/team.accessLogs
17
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.accessLogs.json
@@ -22,7 +22,7 @@ module Slack
22
22
  #
23
23
  # Gets billable users information for the current team.
24
24
  #
25
- # @option options [Object] :team_id
25
+ # @option options [string] :team_id
26
26
  # encoded team id to get the billable information from, required if org token is used.
27
27
  # @option options [user] :user
28
28
  # A user to retrieve the billable information for. Defaults to all users.
@@ -36,7 +36,9 @@ module Slack
36
36
  #
37
37
  # Gets information about the current team.
38
38
  #
39
- # @option options [Object] :team
39
+ # @option options [string] :domain
40
+ # Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself.
41
+ # @option options [string] :team
40
42
  # Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.
41
43
  # @see https://api.slack.com/methods/team.info
42
44
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.info.json
@@ -47,13 +49,13 @@ module Slack
47
49
  #
48
50
  # Gets the integration logs for the current team.
49
51
  #
50
- # @option options [Object] :app_id
52
+ # @option options [string] :app_id
51
53
  # Filter logs to this Slack app. Defaults to all logs.
52
- # @option options [Object] :change_type
54
+ # @option options [string] :change_type
53
55
  # Filter logs with this change type. Defaults to all logs.
54
- # @option options [Object] :service_id
56
+ # @option options [string] :service_id
55
57
  # Filter logs to this service. Defaults to all logs.
56
- # @option options [Object] :team_id
58
+ # @option options [string] :team_id
57
59
  # encoded team id to get logs from, required if org token is used.
58
60
  # @option options [user] :user
59
61
  # Filter logs generated by this user's actions. Defaults to all logs.
@@ -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 TeamBilling
9
+ #
10
+ # Reads a workspace's billing plan information.
11
+ #
12
+ # @see https://api.slack.com/methods/team.billing.info
13
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.billing/team.billing.info.json
14
+ def team_billing_info(options = {})
15
+ post('team.billing.info', options)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ 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 Web
6
+ module Api
7
+ module Endpoints
8
+ module TeamPreferences
9
+ #
10
+ # Retrieve a list of a workspace's team preferences.
11
+ #
12
+ # @see https://api.slack.com/methods/team.preferences.list
13
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.preferences/team.preferences.list.json
14
+ def team_preferences_list(options = {})
15
+ post('team.preferences.list', options)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -9,7 +9,7 @@ module Slack
9
9
  #
10
10
  # Retrieve a team's profile.
11
11
  #
12
- # @option options [Object] :visibility
12
+ # @option options [string] :visibility
13
13
  # Filter by visibility.
14
14
  # @see https://api.slack.com/methods/team.profile.get
15
15
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.profile/team.profile.get.json
@@ -0,0 +1,24 @@
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 ToolingTokens
9
+ #
10
+ # Exchanges a refresh token for a new app configuration token.
11
+ #
12
+ # @option options [string] :refresh_token
13
+ # The xoxe refresh token that was issued along with the old app configuration token.
14
+ # @see https://api.slack.com/methods/tooling.tokens.rotate
15
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/tooling.tokens/tooling.tokens.rotate.json
16
+ def tooling_tokens_rotate(options = {})
17
+ throw ArgumentError.new('Required arguments :refresh_token missing') if options[:refresh_token].nil?
18
+ post('tooling.tokens.rotate', options)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -9,17 +9,17 @@ module Slack
9
9
  #
10
10
  # Create a User Group
11
11
  #
12
- # @option options [Object] :name
12
+ # @option options [string] :name
13
13
  # A name for the User Group. Must be unique among User Groups.
14
- # @option options [Object] :channels
14
+ # @option options [array] :channels
15
15
  # A comma separated string of encoded channel IDs for which the User Group uses as a default.
16
- # @option options [Object] :description
16
+ # @option options [string] :description
17
17
  # A short description of the User Group.
18
- # @option options [Object] :handle
18
+ # @option options [string] :handle
19
19
  # A mention handle. Must be unique among channels, users and User Groups.
20
- # @option options [Object] :include_count
20
+ # @option options [boolean] :include_count
21
21
  # Include the number of users in each User Group.
22
- # @option options [Object] :team_id
22
+ # @option options [string] :team_id
23
23
  # Encoded team id where the user group has to be created, required if org token is used.
24
24
  # @see https://api.slack.com/methods/usergroups.create
25
25
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.create.json
@@ -33,7 +33,7 @@ module Slack
33
33
  #
34
34
  # @option options [Object] :usergroup
35
35
  # The encoded ID of the User Group to disable.
36
- # @option options [Object] :include_count
36
+ # @option options [boolean] :include_count
37
37
  # Include the number of users in the User Group.
38
38
  # @option options [Object] :team_id
39
39
  # Encoded team id where the user group is, required if org token is used.
@@ -47,11 +47,11 @@ module Slack
47
47
  #
48
48
  # Enable a User Group
49
49
  #
50
- # @option options [Object] :usergroup
50
+ # @option options [string] :usergroup
51
51
  # The encoded ID of the User Group to enable.
52
- # @option options [Object] :include_count
52
+ # @option options [boolean] :include_count
53
53
  # Include the number of users in the User Group.
54
- # @option options [Object] :team_id
54
+ # @option options [string] :team_id
55
55
  # Encoded team id where the user group is, required if org token is used.
56
56
  # @see https://api.slack.com/methods/usergroups.enable
57
57
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.enable.json
@@ -63,13 +63,13 @@ module Slack
63
63
  #
64
64
  # List all User Groups for a team
65
65
  #
66
- # @option options [Object] :include_count
66
+ # @option options [boolean] :include_count
67
67
  # Include the number of users in each User Group.
68
- # @option options [Object] :include_disabled
68
+ # @option options [boolean] :include_disabled
69
69
  # Include disabled User Groups.
70
- # @option options [Object] :include_users
70
+ # @option options [boolean] :include_users
71
71
  # Include the list of users for each User Group.
72
- # @option options [Object] :team_id
72
+ # @option options [string] :team_id
73
73
  # encoded team id to list user groups in, required if org token is used.
74
74
  # @see https://api.slack.com/methods/usergroups.list
75
75
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json
@@ -82,15 +82,15 @@ module Slack
82
82
  #
83
83
  # @option options [Object] :usergroup
84
84
  # The encoded ID of the User Group to update.
85
- # @option options [Object] :channels
85
+ # @option options [array] :channels
86
86
  # A comma separated string of encoded channel IDs for which the User Group uses as a default.
87
- # @option options [Object] :description
87
+ # @option options [string] :description
88
88
  # A short description of the User Group.
89
- # @option options [Object] :handle
89
+ # @option options [string] :handle
90
90
  # A mention handle. Must be unique among channels, users and User Groups.
91
- # @option options [Object] :include_count
91
+ # @option options [boolean] :include_count
92
92
  # Include the number of users in the User Group.
93
- # @option options [Object] :name
93
+ # @option options [string] :name
94
94
  # A name for the User Group. Must be unique among User Groups.
95
95
  # @option options [Object] :team_id
96
96
  # encoded team id where the user group exists, required if org token is used.
@@ -9,11 +9,11 @@ module Slack
9
9
  #
10
10
  # List all users in a User Group
11
11
  #
12
- # @option options [Object] :usergroup
12
+ # @option options [string] :usergroup
13
13
  # The encoded ID of the User Group to update.
14
- # @option options [Object] :include_disabled
14
+ # @option options [boolean] :include_disabled
15
15
  # Allow results that involve disabled User Groups.
16
- # @option options [Object] :team_id
16
+ # @option options [string] :team_id
17
17
  # encoded team id where the user group exists, required if org token is used.
18
18
  # @see https://api.slack.com/methods/usergroups.users.list
19
19
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.list.json
@@ -25,13 +25,13 @@ module Slack
25
25
  #
26
26
  # Update the list of users for a User Group
27
27
  #
28
- # @option options [Object] :usergroup
28
+ # @option options [string] :usergroup
29
29
  # The encoded ID of the User Group to update.
30
- # @option options [Object] :users
30
+ # @option options [array] :users
31
31
  # A comma separated string of encoded user IDs that represent the entire list of users for the User Group.
32
- # @option options [Object] :include_count
32
+ # @option options [boolean] :include_count
33
33
  # Include the number of users in the User Group.
34
- # @option options [Object] :team_id
34
+ # @option options [string] :team_id
35
35
  # encoded team id where the user group exists, required if org token is used.
36
36
  # @see https://api.slack.com/methods/usergroups.users.update
37
37
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.update.json