slack-ruby-client 0.15.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (264) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -1
  3. data/.rubocop_todo.yml +75 -43
  4. data/.travis.yml +2 -4
  5. data/CHANGELOG.md +32 -0
  6. data/CONTRIBUTING.md +6 -13
  7. data/LICENSE.md +1 -1
  8. data/README.md +19 -36
  9. data/RELEASING.md +1 -1
  10. data/UPGRADING.md +56 -2
  11. data/bin/commands/admin_analytics.rb +16 -0
  12. data/bin/commands/admin_apps.rb +26 -2
  13. data/bin/commands/admin_apps_requests.rb +1 -0
  14. data/bin/commands/admin_auth_policy.rb +39 -0
  15. data/bin/commands/admin_barriers.rb +47 -0
  16. data/bin/commands/admin_conversations.rb +154 -2
  17. data/bin/commands/admin_conversations_ekm.rb +17 -0
  18. data/bin/commands/admin_conversations_restrictAccess.rb +3 -3
  19. data/bin/commands/admin_conversations_whitelist.rb +1 -1
  20. data/bin/commands/admin_emoji.rb +1 -1
  21. data/bin/commands/admin_teams.rb +1 -1
  22. data/bin/commands/admin_usergroups.rb +2 -2
  23. data/bin/commands/admin_users.rb +3 -2
  24. data/bin/commands/admin_users_session.rb +62 -0
  25. data/bin/commands/api.rb +0 -1
  26. data/bin/commands/apps_connections.rb +13 -0
  27. data/bin/commands/apps_event_authorizations.rb +16 -0
  28. data/bin/commands/apps_manifest.rb +51 -0
  29. data/bin/commands/auth_teams.rb +16 -0
  30. data/bin/commands/bots.rb +1 -0
  31. data/bin/commands/channels.rb +1 -155
  32. data/bin/commands/chat.rb +12 -7
  33. data/bin/commands/chat_scheduledMessages.rb +1 -0
  34. data/bin/commands/conversations.rb +71 -2
  35. data/bin/commands/dnd.rb +2 -0
  36. data/bin/commands/files.rb +6 -4
  37. data/bin/commands/files_remote.rb +2 -2
  38. data/bin/commands/groups.rb +1 -162
  39. data/bin/commands/im.rb +1 -63
  40. data/bin/commands/migration.rb +1 -0
  41. data/bin/commands/mpim.rb +1 -61
  42. data/bin/commands/oauth.rb +0 -13
  43. data/bin/commands/oauth_v2.rb +13 -1
  44. data/bin/commands/openid_connect.rb +27 -0
  45. data/bin/commands/pins.rb +2 -4
  46. data/bin/commands/reactions.rb +1 -0
  47. data/bin/commands/reminders.rb +6 -0
  48. data/bin/commands/rtm.rb +2 -2
  49. data/bin/commands/search.rb +4 -0
  50. data/bin/commands/stars.rb +7 -6
  51. data/bin/commands/team.rb +3 -0
  52. data/bin/commands/team_billing.rb +13 -0
  53. data/bin/commands/team_preferences.rb +13 -0
  54. data/bin/commands/tooling_tokens.rb +14 -0
  55. data/bin/commands/usergroups.rb +5 -0
  56. data/bin/commands/usergroups_users.rb +2 -0
  57. data/bin/commands/users.rb +4 -2
  58. data/bin/commands/users_profile.rb +5 -5
  59. data/bin/commands/views.rb +2 -2
  60. data/bin/commands/workflows.rb +38 -0
  61. data/bin/commands.rb +13 -9
  62. data/lib/slack/config.rb +1 -2
  63. data/lib/slack/events/request.rb +10 -4
  64. data/lib/slack/real_time/client.rb +6 -6
  65. data/lib/slack/real_time/concurrency/async.rb +6 -8
  66. data/lib/slack/real_time/concurrency.rb +0 -2
  67. data/lib/slack/real_time/config.rb +5 -14
  68. data/lib/slack/real_time/socket.rb +1 -2
  69. data/lib/slack/real_time/stores/base.rb +1 -6
  70. data/lib/slack/real_time/stores/starter.rb +6 -3
  71. data/lib/slack/real_time/stores/store.rb +5 -0
  72. data/lib/slack/version.rb +1 -1
  73. data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
  74. data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
  75. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  76. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
  77. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  78. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  79. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  80. data/lib/slack/web/api/endpoints/admin_conversations.rb +233 -3
  81. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  82. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +3 -3
  83. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +3 -3
  84. data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
  85. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  86. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  87. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  88. data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
  89. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  90. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  91. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  92. data/lib/slack/web/api/endpoints/admin_usergroups.rb +11 -11
  93. data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
  94. data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
  95. data/lib/slack/web/api/endpoints/api.rb +1 -3
  96. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  97. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  98. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  99. data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
  100. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  101. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  102. data/lib/slack/web/api/endpoints/bots.rb +3 -1
  103. data/lib/slack/web/api/endpoints/calls.rb +15 -15
  104. data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
  105. data/lib/slack/web/api/endpoints/channels.rb +0 -259
  106. data/lib/slack/web/api/endpoints/chat.rb +65 -55
  107. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +4 -2
  108. data/lib/slack/web/api/endpoints/conversations.rb +134 -24
  109. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  110. data/lib/slack/web/api/endpoints/dnd.rb +6 -3
  111. data/lib/slack/web/api/endpoints/files.rb +19 -15
  112. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  113. data/lib/slack/web/api/endpoints/files_remote.rb +22 -22
  114. data/lib/slack/web/api/endpoints/groups.rb +0 -269
  115. data/lib/slack/web/api/endpoints/im.rb +0 -107
  116. data/lib/slack/web/api/endpoints/migration.rb +4 -2
  117. data/lib/slack/web/api/endpoints/mpim.rb +0 -102
  118. data/lib/slack/web/api/endpoints/oauth.rb +5 -27
  119. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  120. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  121. data/lib/slack/web/api/endpoints/pins.rb +4 -9
  122. data/lib/slack/web/api/endpoints/reactions.rb +13 -11
  123. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  124. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  125. data/lib/slack/web/api/endpoints/search.rb +27 -13
  126. data/lib/slack/web/api/endpoints/stars.rb +11 -9
  127. data/lib/slack/web/api/endpoints/team.rb +11 -5
  128. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  129. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  130. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  131. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  132. data/lib/slack/web/api/endpoints/usergroups.rb +26 -16
  133. data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
  134. data/lib/slack/web/api/endpoints/users.rb +20 -18
  135. data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
  136. data/lib/slack/web/api/endpoints/views.rb +13 -13
  137. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  138. data/lib/slack/web/api/endpoints.rb +26 -20
  139. data/lib/slack/web/api/errors/server_error.rb +37 -0
  140. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  141. data/lib/slack/web/api/errors.rb +394 -10
  142. data/lib/slack/web/api/mixins/conversations.id.rb +1 -3
  143. data/lib/slack/web/api/mixins/ids.id.rb +2 -2
  144. data/lib/slack/web/api/mixins/users.id.rb +1 -3
  145. data/lib/slack/web/api/mixins.rb +0 -2
  146. data/lib/slack/web/api/patches/chat.1.patch +6 -8
  147. data/lib/slack/web/api/templates/endpoints.erb +1 -2
  148. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  149. data/lib/slack/web/config.rb +2 -0
  150. data/lib/slack/web/faraday/connection.rb +2 -2
  151. data/lib/slack/web/faraday/request.rb +2 -1
  152. data/lib/slack/web/faraday/response/raise_error.rb +12 -1
  153. data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
  154. data/lib/slack/web/pagination/cursor.rb +1 -5
  155. data/lib/slack-ruby-client.rb +2 -0
  156. data/lib/tasks/web.rake +11 -3
  157. data/slack-ruby-client.gemspec +2 -3
  158. data/spec/fixtures/slack/web/429_error.yml +50 -54
  159. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  160. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  161. data/spec/fixtures/slack/web/conversations_info.yml +167 -0
  162. data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
  163. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
  164. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
  165. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  166. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  167. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  168. data/spec/fixtures/slack/web/users_info.yml +153 -69
  169. data/spec/fixtures/slack/web/users_list.yml +102 -41
  170. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  171. data/spec/slack/events/request_spec.rb +13 -8
  172. data/spec/slack/real_time/client_spec.rb +35 -22
  173. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  174. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  175. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  176. data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
  177. data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
  178. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  179. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  180. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  181. data/spec/slack/slack_spec.rb +3 -1
  182. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  183. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
  184. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  185. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  186. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
  187. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +5 -5
  188. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
  189. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
  190. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
  191. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
  192. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
  193. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
  194. data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
  195. data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
  196. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  197. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  198. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  199. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
  200. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
  201. data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
  202. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  203. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  204. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  205. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  206. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  207. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  208. data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
  209. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
  210. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  211. data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
  212. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
  213. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  214. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  215. data/spec/slack/web/api/endpoints/team_billing_spec.rb +8 -0
  216. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
  217. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  218. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  219. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  220. data/spec/slack/web/api/error_spec.rb +5 -7
  221. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  222. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  223. data/spec/slack/web/api/mixins/conversations_spec.rb +11 -9
  224. data/spec/slack/web/api/mixins/users_spec.rb +1 -1
  225. data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
  226. data/spec/slack/web/client_spec.rb +112 -16
  227. data/spec/slack/web/faraday/request_spec.rb +80 -0
  228. data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
  229. data/spec/spec_helper.rb +1 -1
  230. data/spec/support/real_time/connected_client.rb +1 -7
  231. data/spec/support/vcr.rb +36 -1
  232. metadata +58 -155
  233. data/examples/hi_real_time/Gemfile +0 -6
  234. data/examples/hi_real_time/hi.gif +0 -0
  235. data/examples/hi_real_time/hi.rb +0 -41
  236. data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
  237. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  238. data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
  239. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
  240. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  241. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
  242. data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
  243. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
  244. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  245. data/lib/slack/web/api/mixins/channels.id.rb +0 -27
  246. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  247. data/lib/slack/web/api/mixins/groups.id.rb +0 -27
  248. data/spec/fixtures/slack/web/503_error.yml +0 -14
  249. data/spec/fixtures/slack/web/channels_info.yml +0 -139
  250. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  251. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
  252. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
  253. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +0 -32
  254. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  255. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  256. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -101
  257. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
  258. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
  259. data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
  260. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
  261. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
  262. data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
  263. data/spec/slack/web/api/mixins/channels_spec.rb +0 -43
  264. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -10,14 +10,13 @@ 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 = {})
19
19
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
20
- throw ArgumentError.new('Required arguments :timestamp missing') if options[:timestamp].nil?
21
20
  options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
22
21
  post('pins.add', options)
23
22
  end
@@ -40,11 +39,7 @@ module Slack
40
39
  #
41
40
  # @option options [channel] :channel
42
41
  # Channel where the item is pinned to.
43
- # @option options [file] :file
44
- # File to un-pin.
45
- # @option options [Object] :file_comment
46
- # File comment to un-pin.
47
- # @option options [Object] :timestamp
42
+ # @option options [string] :timestamp
48
43
  # Timestamp of the message to un-pin.
49
44
  # @see https://api.slack.com/methods/pins.remove
50
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,12 +48,14 @@ 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 [string] :team_id
58
+ # encoded team id to list reactions in, required if org token is used.
57
59
  # @option options [user] :user
58
60
  # Show reactions made by this user. Defaults to the authed user.
59
61
  # @see https://api.slack.com/methods/reactions.list
@@ -72,15 +74,15 @@ module Slack
72
74
  #
73
75
  # Removes a reaction from an item.
74
76
  #
75
- # @option options [Object] :name
77
+ # @option options [string] :name
76
78
  # Reaction (emoji) name.
77
79
  # @option options [channel] :channel
78
80
  # Channel where the message to remove reaction from was posted.
79
81
  # @option options [file] :file
80
82
  # File to remove reaction from.
81
- # @option options [Object] :file_comment
83
+ # @option options [string] :file_comment
82
84
  # File comment to remove reaction from.
83
- # @option options [Object] :timestamp
85
+ # @option options [string] :timestamp
84
86
  # Timestamp of the message to remove reaction from.
85
87
  # @see https://api.slack.com/methods/reactions.remove
86
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,14 +9,16 @@ 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 [string] :team_id
21
+ # encoded team id to search in, required if org token is used.
20
22
  # @see https://api.slack.com/methods/search.all
21
23
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.all.json
22
24
  def search_all(options = {})
@@ -27,14 +29,16 @@ module Slack
27
29
  #
28
30
  # Searches for files matching a query.
29
31
  #
30
- # @option options [Object] :query
32
+ # @option options [string] :query
31
33
  # Search query.
32
- # @option options [Object] :highlight
34
+ # @option options [boolean] :highlight
33
35
  # Pass a value of true to enable query highlight markers (see below).
34
- # @option options [Object] :sort
36
+ # @option options [string] :sort
35
37
  # Return matches sorted by either score or timestamp.
36
- # @option options [Object] :sort_dir
38
+ # @option options [string] :sort_dir
37
39
  # Change sort direction to ascending (asc) or descending (desc).
40
+ # @option options [string] :team_id
41
+ # encoded team id to search in, required if org token is used.
38
42
  # @see https://api.slack.com/methods/search.files
39
43
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.files.json
40
44
  def search_files(options = {})
@@ -45,19 +49,29 @@ module Slack
45
49
  #
46
50
  # Searches for messages matching a query.
47
51
  #
48
- # @option options [Object] :query
52
+ # @option options [string] :query
49
53
  # Search query.
50
- # @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
51
57
  # Pass a value of true to enable query highlight markers (see below).
52
- # @option options [Object] :sort
58
+ # @option options [string] :sort
53
59
  # Return matches sorted by either score or timestamp.
54
- # @option options [Object] :sort_dir
60
+ # @option options [string] :sort_dir
55
61
  # Change sort direction to ascending (asc) or descending (desc).
62
+ # @option options [string] :team_id
63
+ # encoded team id to search in, required if org token is used.
56
64
  # @see https://api.slack.com/methods/search.messages
57
65
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.messages.json
58
66
  def search_messages(options = {})
59
67
  throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
60
- 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
61
75
  end
62
76
  end
63
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,8 +9,10 @@ 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 [string] :team_id
15
+ # encoded team id to get logs from, required if org token is used.
14
16
  # @see https://api.slack.com/methods/team.accessLogs
15
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.accessLogs.json
16
18
  def team_accessLogs(options = {})
@@ -20,6 +22,8 @@ module Slack
20
22
  #
21
23
  # Gets billable users information for the current team.
22
24
  #
25
+ # @option options [string] :team_id
26
+ # encoded team id to get the billable information from, required if org token is used.
23
27
  # @option options [user] :user
24
28
  # A user to retrieve the billable information for. Defaults to all users.
25
29
  # @see https://api.slack.com/methods/team.billableInfo
@@ -32,7 +36,7 @@ module Slack
32
36
  #
33
37
  # Gets information about the current team.
34
38
  #
35
- # @option options [Object] :team
39
+ # @option options [string] :team
36
40
  # 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.
37
41
  # @see https://api.slack.com/methods/team.info
38
42
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.info.json
@@ -43,12 +47,14 @@ module Slack
43
47
  #
44
48
  # Gets the integration logs for the current team.
45
49
  #
46
- # @option options [Object] :app_id
50
+ # @option options [string] :app_id
47
51
  # Filter logs to this Slack app. Defaults to all logs.
48
- # @option options [Object] :change_type
52
+ # @option options [string] :change_type
49
53
  # Filter logs with this change type. Defaults to all logs.
50
- # @option options [Object] :service_id
54
+ # @option options [string] :service_id
51
55
  # Filter logs to this service. Defaults to all logs.
56
+ # @option options [string] :team_id
57
+ # encoded team id to get logs from, required if org token is used.
52
58
  # @option options [user] :user
53
59
  # Filter logs generated by this user's actions. Defaults to all logs.
54
60
  # @see https://api.slack.com/methods/team.integrationLogs
@@ -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,16 +9,18 @@ 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 [string] :team_id
23
+ # Encoded team id where the user group has to be created, required if org token is used.
22
24
  # @see https://api.slack.com/methods/usergroups.create
23
25
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.create.json
24
26
  def usergroups_create(options = {})
@@ -31,8 +33,10 @@ module Slack
31
33
  #
32
34
  # @option options [Object] :usergroup
33
35
  # The encoded ID of the User Group to disable.
34
- # @option options [Object] :include_count
36
+ # @option options [boolean] :include_count
35
37
  # Include the number of users in the User Group.
38
+ # @option options [Object] :team_id
39
+ # Encoded team id where the user group is, required if org token is used.
36
40
  # @see https://api.slack.com/methods/usergroups.disable
37
41
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.disable.json
38
42
  def usergroups_disable(options = {})
@@ -43,10 +47,12 @@ module Slack
43
47
  #
44
48
  # Enable a User Group
45
49
  #
46
- # @option options [Object] :usergroup
50
+ # @option options [string] :usergroup
47
51
  # The encoded ID of the User Group to enable.
48
- # @option options [Object] :include_count
52
+ # @option options [boolean] :include_count
49
53
  # Include the number of users in the User Group.
54
+ # @option options [string] :team_id
55
+ # Encoded team id where the user group is, required if org token is used.
50
56
  # @see https://api.slack.com/methods/usergroups.enable
51
57
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.enable.json
52
58
  def usergroups_enable(options = {})
@@ -57,12 +63,14 @@ module Slack
57
63
  #
58
64
  # List all User Groups for a team
59
65
  #
60
- # @option options [Object] :include_count
66
+ # @option options [boolean] :include_count
61
67
  # Include the number of users in each User Group.
62
- # @option options [Object] :include_disabled
68
+ # @option options [boolean] :include_disabled
63
69
  # Include disabled User Groups.
64
- # @option options [Object] :include_users
70
+ # @option options [boolean] :include_users
65
71
  # Include the list of users for each User Group.
72
+ # @option options [string] :team_id
73
+ # encoded team id to list user groups in, required if org token is used.
66
74
  # @see https://api.slack.com/methods/usergroups.list
67
75
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json
68
76
  def usergroups_list(options = {})
@@ -74,16 +82,18 @@ module Slack
74
82
  #
75
83
  # @option options [Object] :usergroup
76
84
  # The encoded ID of the User Group to update.
77
- # @option options [Object] :channels
85
+ # @option options [array] :channels
78
86
  # A comma separated string of encoded channel IDs for which the User Group uses as a default.
79
- # @option options [Object] :description
87
+ # @option options [string] :description
80
88
  # A short description of the User Group.
81
- # @option options [Object] :handle
89
+ # @option options [string] :handle
82
90
  # A mention handle. Must be unique among channels, users and User Groups.
83
- # @option options [Object] :include_count
91
+ # @option options [boolean] :include_count
84
92
  # Include the number of users in the User Group.
85
- # @option options [Object] :name
93
+ # @option options [string] :name
86
94
  # A name for the User Group. Must be unique among User Groups.
95
+ # @option options [Object] :team_id
96
+ # encoded team id where the user group exists, required if org token is used.
87
97
  # @see https://api.slack.com/methods/usergroups.update
88
98
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.update.json
89
99
  def usergroups_update(options = {})
@@ -9,10 +9,12 @@ 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 [string] :team_id
17
+ # encoded team id where the user group exists, required if org token is used.
16
18
  # @see https://api.slack.com/methods/usergroups.users.list
17
19
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.list.json
18
20
  def usergroups_users_list(options = {})
@@ -23,12 +25,14 @@ module Slack
23
25
  #
24
26
  # Update the list of users for a User Group
25
27
  #
26
- # @option options [Object] :usergroup
28
+ # @option options [string] :usergroup
27
29
  # The encoded ID of the User Group to update.
28
- # @option options [Object] :users
30
+ # @option options [array] :users
29
31
  # A comma separated string of encoded user IDs that represent the entire list of users for the User Group.
30
- # @option options [Object] :include_count
32
+ # @option options [boolean] :include_count
31
33
  # Include the number of users in the User Group.
34
+ # @option options [string] :team_id
35
+ # encoded team id where the user group exists, required if org token is used.
32
36
  # @see https://api.slack.com/methods/usergroups.users.update
33
37
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.update.json
34
38
  def usergroups_users_update(options = {})