slack-ruby-client 0.14.4 → 0.14.5

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 (255) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +19 -11
  3. data/.rubocop_todo.yml +66 -47
  4. data/CHANGELOG.md +8 -0
  5. data/Dangerfile +1 -0
  6. data/Gemfile +1 -0
  7. data/README.md +16 -9
  8. data/Rakefile +1 -0
  9. data/bin/commands.rb +6 -0
  10. data/bin/commands/admin_apps.rb +27 -0
  11. data/bin/commands/admin_apps_requests.rb +16 -0
  12. data/bin/commands/admin_users_session.rb +3 -2
  13. data/bin/commands/api.rb +3 -2
  14. data/bin/commands/apps.rb +3 -2
  15. data/bin/commands/apps_permissions.rb +5 -4
  16. data/bin/commands/apps_permissions_resources.rb +3 -2
  17. data/bin/commands/apps_permissions_scopes.rb +3 -2
  18. data/bin/commands/apps_permissions_users.rb +5 -4
  19. data/bin/commands/auth.rb +5 -4
  20. data/bin/commands/bots.rb +3 -2
  21. data/bin/commands/channels.rb +31 -30
  22. data/bin/commands/chat.rb +19 -18
  23. data/bin/commands/chat_scheduledMessages.rb +3 -2
  24. data/bin/commands/conversations.rb +35 -34
  25. data/bin/commands/dialog.rb +3 -2
  26. data/bin/commands/dnd.rb +9 -8
  27. data/bin/commands/emoji.rb +3 -2
  28. data/bin/commands/files.rb +13 -12
  29. data/bin/commands/files_comments.rb +3 -2
  30. data/bin/commands/files_remote.rb +78 -0
  31. data/bin/commands/groups.rb +33 -32
  32. data/bin/commands/im.rb +13 -12
  33. data/bin/commands/migration.rb +3 -2
  34. data/bin/commands/mpim.rb +11 -10
  35. data/bin/commands/oauth.rb +5 -4
  36. data/bin/commands/oauth_v2.rb +17 -0
  37. data/bin/commands/pins.rb +7 -8
  38. data/bin/commands/reactions.rb +10 -11
  39. data/bin/commands/reminders.rb +11 -10
  40. data/bin/commands/rtm.rb +5 -4
  41. data/bin/commands/search.rb +7 -6
  42. data/bin/commands/stars.rb +7 -6
  43. data/bin/commands/team.rb +9 -8
  44. data/bin/commands/team_profile.rb +3 -2
  45. data/bin/commands/usergroups.rb +11 -10
  46. data/bin/commands/usergroups_users.rb +5 -4
  47. data/bin/commands/users.rb +21 -20
  48. data/bin/commands/users_admin.rb +1 -0
  49. data/bin/commands/users_prefs.rb +1 -0
  50. data/bin/commands/users_profile.rb +5 -4
  51. data/bin/commands/views.rb +48 -0
  52. data/bin/slack +1 -2
  53. data/examples/hi_real_time/Gemfile +1 -0
  54. data/examples/hi_real_time/hi.rb +7 -3
  55. data/examples/hi_real_time_and_web/Gemfile +1 -0
  56. data/examples/hi_real_time_and_web/hi.rb +7 -3
  57. data/examples/hi_real_time_async_async/Gemfile +1 -0
  58. data/examples/hi_real_time_async_async/hi.rb +6 -2
  59. data/examples/hi_real_time_async_celluloid/Gemfile +1 -0
  60. data/examples/hi_real_time_async_celluloid/hi.rb +7 -3
  61. data/examples/hi_real_time_async_eventmachine/Gemfile +1 -0
  62. data/examples/hi_real_time_async_eventmachine/hi.rb +7 -3
  63. data/examples/hi_web/Gemfile +1 -0
  64. data/examples/hi_web/hi.rb +1 -0
  65. data/examples/new_ticket/Gemfile +1 -0
  66. data/examples/new_ticket/new_ticket.rb +1 -0
  67. data/lib/slack-ruby-client.rb +3 -2
  68. data/lib/slack.rb +1 -0
  69. data/lib/slack/config.rb +1 -0
  70. data/lib/slack/events/config.rb +1 -0
  71. data/lib/slack/events/request.rb +3 -1
  72. data/lib/slack/logger.rb +6 -5
  73. data/lib/slack/messages/formatting.rb +1 -0
  74. data/lib/slack/messages/message.rb +1 -0
  75. data/lib/slack/real_time/api/message.rb +3 -1
  76. data/lib/slack/real_time/api/message_id.rb +1 -0
  77. data/lib/slack/real_time/api/ping.rb +5 -2
  78. data/lib/slack/real_time/api/typing.rb +3 -1
  79. data/lib/slack/real_time/client.rb +19 -12
  80. data/lib/slack/real_time/concurrency.rb +1 -0
  81. data/lib/slack/real_time/concurrency/async.rb +15 -7
  82. data/lib/slack/real_time/concurrency/celluloid.rb +9 -3
  83. data/lib/slack/real_time/concurrency/eventmachine.rb +7 -4
  84. data/lib/slack/real_time/config.rb +6 -1
  85. data/lib/slack/real_time/models.rb +1 -0
  86. data/lib/slack/real_time/models/base.rb +1 -0
  87. data/lib/slack/real_time/models/bot.rb +1 -0
  88. data/lib/slack/real_time/models/channel.rb +1 -0
  89. data/lib/slack/real_time/models/group.rb +1 -0
  90. data/lib/slack/real_time/models/im.rb +1 -0
  91. data/lib/slack/real_time/models/team.rb +1 -0
  92. data/lib/slack/real_time/models/user.rb +1 -0
  93. data/lib/slack/real_time/socket.rb +14 -11
  94. data/lib/slack/real_time/stores.rb +1 -0
  95. data/lib/slack/real_time/stores/base.rb +1 -0
  96. data/lib/slack/real_time/stores/starter.rb +1 -0
  97. data/lib/slack/real_time/stores/store.rb +16 -25
  98. data/lib/slack/version.rb +2 -1
  99. data/lib/slack/web/api/endpoints.rb +11 -0
  100. data/lib/slack/web/api/endpoints/admin_apps.rb +42 -0
  101. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +33 -0
  102. data/lib/slack/web/api/endpoints/admin_users_session.rb +2 -1
  103. data/lib/slack/web/api/endpoints/api.rb +2 -1
  104. data/lib/slack/web/api/endpoints/apps.rb +2 -1
  105. data/lib/slack/web/api/endpoints/apps_permissions.rb +3 -2
  106. data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +2 -1
  107. data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +2 -1
  108. data/lib/slack/web/api/endpoints/apps_permissions_users.rb +3 -2
  109. data/lib/slack/web/api/endpoints/auth.rb +3 -2
  110. data/lib/slack/web/api/endpoints/bots.rb +2 -1
  111. data/lib/slack/web/api/endpoints/channels.rb +16 -16
  112. data/lib/slack/web/api/endpoints/chat.rb +10 -9
  113. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -1
  114. data/lib/slack/web/api/endpoints/conversations.rb +18 -17
  115. data/lib/slack/web/api/endpoints/dialog.rb +2 -1
  116. data/lib/slack/web/api/endpoints/dnd.rb +5 -4
  117. data/lib/slack/web/api/endpoints/emoji.rb +2 -1
  118. data/lib/slack/web/api/endpoints/files.rb +7 -6
  119. data/lib/slack/web/api/endpoints/files_comments.rb +2 -1
  120. data/lib/slack/web/api/endpoints/files_remote.rb +127 -0
  121. data/lib/slack/web/api/endpoints/groups.rb +17 -22
  122. data/lib/slack/web/api/endpoints/im.rb +7 -8
  123. data/lib/slack/web/api/endpoints/migration.rb +2 -1
  124. data/lib/slack/web/api/endpoints/mpim.rb +6 -7
  125. data/lib/slack/web/api/endpoints/oauth.rb +3 -2
  126. data/lib/slack/web/api/endpoints/oauth_v2.rb +30 -0
  127. data/lib/slack/web/api/endpoints/pins.rb +5 -9
  128. data/lib/slack/web/api/endpoints/reactions.rb +9 -12
  129. data/lib/slack/web/api/endpoints/reminders.rb +6 -5
  130. data/lib/slack/web/api/endpoints/rtm.rb +3 -2
  131. data/lib/slack/web/api/endpoints/search.rb +4 -3
  132. data/lib/slack/web/api/endpoints/stars.rb +4 -5
  133. data/lib/slack/web/api/endpoints/team.rb +5 -5
  134. data/lib/slack/web/api/endpoints/team_profile.rb +2 -1
  135. data/lib/slack/web/api/endpoints/usergroups.rb +6 -5
  136. data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -2
  137. data/lib/slack/web/api/endpoints/users.rb +11 -16
  138. data/lib/slack/web/api/endpoints/users_admin.rb +1 -0
  139. data/lib/slack/web/api/endpoints/users_prefs.rb +1 -0
  140. data/lib/slack/web/api/endpoints/users_profile.rb +3 -2
  141. data/lib/slack/web/api/endpoints/views.rb +97 -0
  142. data/lib/slack/web/api/error.rb +1 -0
  143. data/lib/slack/web/api/errors/slack_error.rb +2 -1
  144. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -0
  145. data/lib/slack/web/api/mixins.rb +1 -0
  146. data/lib/slack/web/api/mixins/channels.id.rb +1 -0
  147. data/lib/slack/web/api/mixins/groups.id.rb +1 -0
  148. data/lib/slack/web/api/mixins/ids.id.rb +4 -1
  149. data/lib/slack/web/api/mixins/users.id.rb +1 -0
  150. data/lib/slack/web/api/mixins/users.search.rb +1 -0
  151. data/lib/slack/web/api/patches/views.1.view-json.patch +40 -0
  152. data/lib/slack/web/api/patches/views.1.views-published.patch +16 -0
  153. data/lib/slack/web/api/templates/command.erb +1 -0
  154. data/lib/slack/web/api/templates/commands.erb +1 -0
  155. data/lib/slack/web/api/templates/endpoints.erb +1 -0
  156. data/lib/slack/web/api/templates/method.erb +1 -0
  157. data/lib/slack/web/api/templates/method_spec.erb +1 -0
  158. data/lib/slack/web/client.rb +1 -0
  159. data/lib/slack/web/config.rb +1 -0
  160. data/lib/slack/web/faraday/connection.rb +1 -0
  161. data/lib/slack/web/faraday/request.rb +1 -0
  162. data/lib/slack/web/faraday/response/raise_error.rb +7 -6
  163. data/lib/slack/web/pagination/cursor.rb +1 -0
  164. data/lib/slack_ruby_client.rb +1 -0
  165. data/lib/tasks/git.rake +1 -0
  166. data/lib/tasks/real_time.rake +12 -4
  167. data/lib/tasks/update.rake +1 -0
  168. data/lib/tasks/web.rake +17 -6
  169. data/screenshots/create-app.png +0 -0
  170. data/slack-ruby-client.gemspec +4 -1
  171. data/spec/integration/integration_spec.rb +16 -17
  172. data/spec/slack/config_spec.rb +2 -0
  173. data/spec/slack/events/config_spec.rb +8 -4
  174. data/spec/slack/events/request_spec.rb +67 -37
  175. data/spec/slack/messages/formatting_spec.rb +25 -13
  176. data/spec/slack/real_time/api/message_spec.rb +6 -1
  177. data/spec/slack/real_time/api/ping_spec.rb +2 -0
  178. data/spec/slack/real_time/api/typing_spec.rb +5 -1
  179. data/spec/slack/real_time/client_spec.rb +137 -39
  180. data/spec/slack/real_time/concurrency/celluloid_spec.rb +11 -6
  181. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +9 -1
  182. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +2 -0
  183. data/spec/slack/real_time/event_handlers/bot_spec.rb +2 -1
  184. data/spec/slack/real_time/event_handlers/channel_spec.rb +9 -6
  185. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +2 -1
  186. data/spec/slack/real_time/event_handlers/group_spec.rb +5 -4
  187. data/spec/slack/real_time/event_handlers/im_spec.rb +4 -3
  188. data/spec/slack/real_time/event_handlers/team_spec.rb +3 -1
  189. data/spec/slack/real_time/event_handlers/user_spec.rb +1 -0
  190. data/spec/slack/real_time/rtm_connect_spec.rb +1 -0
  191. data/spec/slack/real_time/rtm_start_spec.rb +1 -0
  192. data/spec/slack/real_time/store_spec.rb +2 -1
  193. data/spec/slack/slack_spec.rb +37 -5
  194. data/spec/slack/version_spec.rb +2 -1
  195. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +8 -0
  196. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +8 -0
  197. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +1 -0
  198. data/spec/slack/web/api/endpoints/api_spec.rb +1 -0
  199. data/spec/slack/web/api/endpoints/apps_permissions_resources_spec.rb +1 -0
  200. data/spec/slack/web/api/endpoints/apps_permissions_scopes_spec.rb +1 -0
  201. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +1 -0
  202. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +1 -0
  203. data/spec/slack/web/api/endpoints/apps_spec.rb +1 -0
  204. data/spec/slack/web/api/endpoints/bots_spec.rb +1 -0
  205. data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +1 -0
  206. data/spec/slack/web/api/endpoints/conversations_spec.rb +1 -0
  207. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +5 -1
  208. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +2 -0
  209. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +80 -25
  210. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +12 -4
  211. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +2 -0
  212. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +6 -1
  213. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +95 -0
  214. data/spec/slack/web/api/endpoints/dnd_spec.rb +1 -0
  215. data/spec/slack/web/api/endpoints/emoji_spec.rb +1 -0
  216. data/spec/slack/web/api/endpoints/files_comments_spec.rb +1 -0
  217. data/spec/slack/web/api/endpoints/files_remote_spec.rb +24 -0
  218. data/spec/slack/web/api/endpoints/files_spec.rb +1 -0
  219. data/spec/slack/web/api/endpoints/im_spec.rb +1 -0
  220. data/spec/slack/web/api/endpoints/migration_spec.rb +1 -0
  221. data/spec/slack/web/api/endpoints/mpim_spec.rb +1 -0
  222. data/spec/slack/web/api/endpoints/oauth_spec.rb +1 -0
  223. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +13 -0
  224. data/spec/slack/web/api/endpoints/pins_spec.rb +5 -1
  225. data/spec/slack/web/api/endpoints/reactions_spec.rb +8 -1
  226. data/spec/slack/web/api/endpoints/reminders_spec.rb +1 -0
  227. data/spec/slack/web/api/endpoints/rtm_spec.rb +1 -0
  228. data/spec/slack/web/api/endpoints/search_spec.rb +1 -0
  229. data/spec/slack/web/api/endpoints/stars_spec.rb +1 -0
  230. data/spec/slack/web/api/endpoints/team_profile_spec.rb +1 -0
  231. data/spec/slack/web/api/endpoints/team_spec.rb +1 -0
  232. data/spec/slack/web/api/endpoints/usergroups_spec.rb +1 -0
  233. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +1 -0
  234. data/spec/slack/web/api/endpoints/users_admin_spec.rb +1 -0
  235. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +1 -0
  236. data/spec/slack/web/api/endpoints/users_profile_spec.rb +1 -0
  237. data/spec/slack/web/api/endpoints/views_spec.rb +29 -0
  238. data/spec/slack/web/api/error_spec.rb +4 -2
  239. data/spec/slack/web/api/errors/service_unavailable_spec.rb +6 -3
  240. data/spec/slack/web/api/errors/slack_error_spec.rb +4 -2
  241. data/spec/slack/web/api/mixins/channels_spec.rb +17 -7
  242. data/spec/slack/web/api/mixins/groups_spec.rb +17 -7
  243. data/spec/slack/web/api/mixins/users_spec.rb +17 -8
  244. data/spec/slack/web/api/pagination/cursor_spec.rb +40 -10
  245. data/spec/slack/web/client_spec.rb +45 -18
  246. data/spec/slack/web/faraday/response/raise_error_spec.rb +16 -5
  247. data/spec/spec_helper.rb +2 -1
  248. data/spec/support/queue_with_timeout.rb +1 -0
  249. data/spec/support/real_time/concurrency/mock.rb +1 -0
  250. data/spec/support/real_time/connected_client.rb +9 -3
  251. data/spec/support/real_time/event.rb +1 -0
  252. data/spec/support/token.rb +1 -0
  253. data/spec/support/vcr.rb +1 -0
  254. metadata +59 -7
  255. data/screenshots/register-bot.png +0 -0
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -24,7 +25,7 @@ module Slack
24
25
  end
25
26
 
26
27
  #
27
- # This method deletes a message from a channel.
28
+ # Deletes a message.
28
29
  #
29
30
  # @option options [channel] :channel
30
31
  # Channel containing the message to be deleted.
@@ -42,7 +43,7 @@ module Slack
42
43
  end
43
44
 
44
45
  #
45
- # This method deletes a pending scheduled message before it is sent.
46
+ # Deletes a pending scheduled message from the queue.
46
47
  #
47
48
  # @option options [channel] :channel
48
49
  # The channel the scheduled_message is posting to.
@@ -60,7 +61,7 @@ module Slack
60
61
  end
61
62
 
62
63
  #
63
- # Easily exchange a message timestamp and a channel ID for a friendly HTTP-based permalink to that message. Handles message threads and all conversation types.
64
+ # Retrieve a permalink URL for a specific extant message
64
65
  #
65
66
  # @option options [channel] :channel
66
67
  # The ID of the conversation or channel containing the message.
@@ -76,7 +77,7 @@ module Slack
76
77
  end
77
78
 
78
79
  #
79
- # This method sends a me message to a channel from the calling user.
80
+ # Share a me message into a channel.
80
81
  #
81
82
  # @option options [channel] :channel
82
83
  # Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.
@@ -91,7 +92,7 @@ module Slack
91
92
  end
92
93
 
93
94
  #
94
- # This method posts an ephemeral message, which is visible only to the assigned user in a specific public channel, private channel, or private conversation.
95
+ # Sends an ephemeral message to a user in a channel.
95
96
  #
96
97
  # @option options [Object] :attachments
97
98
  # A JSON-based array of structured attachments, presented as a URL-encoded string.
@@ -140,7 +141,7 @@ module Slack
140
141
  end
141
142
 
142
143
  #
143
- # This method posts a message to a public channel, private channel, or direct message/IM channel.
144
+ # Sends a message to a channel.
144
145
  #
145
146
  # @option options [channel] :channel
146
147
  # Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.
@@ -193,7 +194,7 @@ module Slack
193
194
  end
194
195
 
195
196
  #
196
- # This method schedules a message for delivery to a public channel, private channel, or direct message/IM channel at a specified time in the future.
197
+ # Schedules a message to be sent to a channel.
197
198
  #
198
199
  # @option options [channel] :channel
199
200
  # Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.
@@ -229,7 +230,7 @@ module Slack
229
230
  end
230
231
 
231
232
  #
232
- # This method attaches Slack app unfurl behavior to a specified and relevant message. A user token is required as this method does not support bot user tokens.
233
+ # Provide custom unfurl behavior for user-posted URLs
233
234
  #
234
235
  # @option options [channel] :channel
235
236
  # Channel ID of the message.
@@ -254,7 +255,7 @@ module Slack
254
255
  end
255
256
 
256
257
  #
257
- # This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently.
258
+ # Updates a message.
258
259
  #
259
260
  # @option options [channel] :channel
260
261
  # Channel containing the message to be updated.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -6,7 +7,7 @@ module Slack
6
7
  module Endpoints
7
8
  module ChatScheduledmessages
8
9
  #
9
- # This method returns a list of pending scheduled messages.
10
+ # Returns a list of scheduled messages.
10
11
  #
11
12
  # @option options [channel] :channel
12
13
  # The channel of the scheduled messages.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -6,7 +7,7 @@ module Slack
6
7
  module Endpoints
7
8
  module Conversations
8
9
  #
9
- # This method archives a conversation. Not all types of conversations can be archived.
10
+ # Archives a conversation.
10
11
  #
11
12
  # @option options [channel] :channel
12
13
  # ID of conversation to archive.
@@ -19,7 +20,7 @@ module Slack
19
20
  end
20
21
 
21
22
  #
22
- # This Conversations API method closes direct messages, multi-person or 1:1 or otherwise.
23
+ # Closes a direct message or multi-person direct message.
23
24
  #
24
25
  # @option options [channel] :channel
25
26
  # Conversation to close.
@@ -32,7 +33,7 @@ module Slack
32
33
  end
33
34
 
34
35
  #
35
- # Create a public or private channel using this Conversations API method.
36
+ # Initiates a public or private channel-based conversation
36
37
  #
37
38
  # @option options [Object] :name
38
39
  # Name of the public or private channel to create.
@@ -48,7 +49,7 @@ module Slack
48
49
  end
49
50
 
50
51
  #
51
- # This method returns a portion of message events from the specified conversation.
52
+ # Fetches a conversation's history of messages and events.
52
53
  #
53
54
  # @option options [channel] :channel
54
55
  # Conversation ID to fetch history for.
@@ -77,7 +78,7 @@ module Slack
77
78
  end
78
79
 
79
80
  #
80
- # This Conversations API method returns information about a workspace conversation.
81
+ # Retrieve information about a conversation.
81
82
  #
82
83
  # @option options [channel] :channel
83
84
  # Conversation ID to learn more about.
@@ -94,7 +95,7 @@ module Slack
94
95
  end
95
96
 
96
97
  #
97
- # This Conversations API method invites 1-30 users to a public or private channel. The calling user must be a member of the channel.
98
+ # Invites users to a channel.
98
99
  #
99
100
  # @option options [channel] :channel
100
101
  # The ID of the public or private channel to invite user(s) to.
@@ -110,7 +111,7 @@ module Slack
110
111
  end
111
112
 
112
113
  #
113
- # This Conversations API method joins a user to an existing conversation.
114
+ # Joins an existing conversation.
114
115
  #
115
116
  # @option options [channel] :channel
116
117
  # ID of conversation to join.
@@ -123,7 +124,7 @@ module Slack
123
124
  end
124
125
 
125
126
  #
126
- # This Conversations API method allows a user to remove another member from a channel.
127
+ # Removes a user from a conversation.
127
128
  #
128
129
  # @option options [channel] :channel
129
130
  # ID of conversation to remove user from.
@@ -140,7 +141,7 @@ module Slack
140
141
  end
141
142
 
142
143
  #
143
- # This Conversations API method makes like a tree and leaves a conversation.
144
+ # Leaves a conversation.
144
145
  #
145
146
  # @option options [channel] :channel
146
147
  # Conversation to leave.
@@ -153,7 +154,7 @@ module Slack
153
154
  end
154
155
 
155
156
  #
156
- # This Conversations API method returns a list of all channel-like conversations in a workspace. The "channels" returned depend on what the calling token has access to and the directives placed in the types parameter.
157
+ # Lists all channels in a Slack team.
157
158
  #
158
159
  # @option options [Object] :cursor
159
160
  # Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
@@ -176,7 +177,7 @@ module Slack
176
177
  end
177
178
 
178
179
  #
179
- # This Conversations API method returns a paginated list of members party to a conversation.
180
+ # Retrieve members of a conversation.
180
181
  #
181
182
  # @option options [channel] :channel
182
183
  # ID of the conversation to retrieve members for.
@@ -199,7 +200,7 @@ module Slack
199
200
  end
200
201
 
201
202
  #
202
- # This Conversations API method opens a multi-person direct message or just a 1:1 direct message.
203
+ # Opens or resumes a direct message or multi-person direct message.
203
204
  #
204
205
  # @option options [channel] :channel
205
206
  # Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead.
@@ -215,7 +216,7 @@ module Slack
215
216
  end
216
217
 
217
218
  #
218
- # This method renames a conversation. Some types of conversations cannot be renamed.
219
+ # Renames a conversation.
219
220
  #
220
221
  # @option options [channel] :channel
221
222
  # ID of conversation to rename.
@@ -231,7 +232,7 @@ module Slack
231
232
  end
232
233
 
233
234
  #
234
- # This Conversations API method returns an entire thread (a message plus all the messages in reply to it), while conversations.history method returns only parent messages.
235
+ # Retrieve a thread of messages posted to a conversation
235
236
  #
236
237
  # @option options [channel] :channel
237
238
  # Conversation ID to fetch thread from.
@@ -263,7 +264,7 @@ module Slack
263
264
  end
264
265
 
265
266
  #
266
- # This method is used to change the purpose of a conversation. The calling user must be a member of the conversation. Not all conversation types may have a purpose set.
267
+ # Sets the purpose for a conversation.
267
268
  #
268
269
  # @option options [channel] :channel
269
270
  # Conversation to set the purpose of.
@@ -279,7 +280,7 @@ module Slack
279
280
  end
280
281
 
281
282
  #
282
- # This method is used to change the topic of a conversation. The calling user must be a member of the conversation. Not all conversation types support a new topic.
283
+ # Sets the topic for a conversation.
283
284
  #
284
285
  # @option options [channel] :channel
285
286
  # Conversation to set the topic of.
@@ -295,7 +296,7 @@ module Slack
295
296
  end
296
297
 
297
298
  #
298
- # This method unarchives a conversation. The calling user is added to the conversation.
299
+ # Reverses conversation archival.
299
300
  #
300
301
  # @option options [channel] :channel
301
302
  # ID of conversation to unarchive.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -6,7 +7,7 @@ module Slack
6
7
  module Endpoints
7
8
  module Dialog
8
9
  #
9
- # Open a dialog with a user by exchanging a trigger_id received from another interaction. See the dialogs documentation to learn how to obtain triggers define form elements.
10
+ # Open a dialog with a user
10
11
  #
11
12
  # @option options [Object] :dialog
12
13
  # The dialog definition. This must be a JSON-encoded string.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -6,7 +7,7 @@ module Slack
6
7
  module Endpoints
7
8
  module Dnd
8
9
  #
9
- # Ends the user's currently scheduled Do Not Disturb session immediately.
10
+ # Ends the current user's Do Not Disturb session immediately.
10
11
  #
11
12
  # @see https://api.slack.com/methods/dnd.endDnd
12
13
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/dnd/dnd.endDnd.json
@@ -24,7 +25,7 @@ module Slack
24
25
  end
25
26
 
26
27
  #
27
- # Provides information about a user's current Do Not Disturb settings.
28
+ # Retrieves a user's current Do Not Disturb status.
28
29
  #
29
30
  # @option options [user] :user
30
31
  # User to fetch status for (defaults to current user).
@@ -36,7 +37,7 @@ module Slack
36
37
  end
37
38
 
38
39
  #
39
- # Adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration.
40
+ # Turns on Do Not Disturb mode for the current user, or changes its duration.
40
41
  #
41
42
  # @option options [Object] :num_minutes
42
43
  # Number of minutes, from now, to snooze until.
@@ -48,7 +49,7 @@ module Slack
48
49
  end
49
50
 
50
51
  #
51
- # Provides information about the current Do Not Disturb settings for a list of users in a Slack team.
52
+ # Retrieves the Do Not Disturb status for up to 50 users on a team.
52
53
  #
53
54
  # @option options [Object] :users
54
55
  # Comma-separated list of users to fetch Do Not Disturb status for.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -6,7 +7,7 @@ module Slack
6
7
  module Endpoints
7
8
  module Emoji
8
9
  #
9
- # This method lists the custom emoji for a team.
10
+ # Lists custom emoji for a team.
10
11
  #
11
12
  # @see https://api.slack.com/methods/emoji.list
12
13
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/emoji/emoji.list.json
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -6,7 +7,7 @@ module Slack
6
7
  module Endpoints
7
8
  module Files
8
9
  #
9
- # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments.
10
+ # Deletes a file.
10
11
  #
11
12
  # @option options [file] :file
12
13
  # ID of file to delete.
@@ -35,7 +36,7 @@ module Slack
35
36
  end
36
37
 
37
38
  #
38
- # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments.
39
+ # Gets information about a team file.
39
40
  #
40
41
  # @option options [file] :file
41
42
  # Specify a file by providing its ID.
@@ -57,7 +58,7 @@ module Slack
57
58
  end
58
59
 
59
60
  #
60
- # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments.
61
+ # Lists & filters team files.
61
62
  #
62
63
  # @option options [channel] :channel
63
64
  # Filter files appearing in a specific channel, indicated by its ID.
@@ -78,7 +79,7 @@ module Slack
78
79
  end
79
80
 
80
81
  #
81
- # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments.
82
+ # Revokes public/external sharing access for a file
82
83
  #
83
84
  # @option options [file] :file
84
85
  # File to revoke.
@@ -106,7 +107,7 @@ module Slack
106
107
  end
107
108
 
108
109
  #
109
- # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments.
110
+ # Enables a file for public/external sharing.
110
111
  #
111
112
  # @option options [file] :file
112
113
  # File to share.
@@ -118,7 +119,7 @@ module Slack
118
119
  end
119
120
 
120
121
  #
121
- # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments.
122
+ # Uploads or creates a file.
122
123
  #
123
124
  # @option options [Object] :channels
124
125
  # Comma-separated list of channel names or IDs where the file will be shared.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -6,7 +7,7 @@ module Slack
6
7
  module Endpoints
7
8
  module FilesComments
8
9
  #
9
- # A new file commenting experience arrived on July 23, 2018. Learn more about what's new and the migration path for apps already working with files and file comments.
10
+ # Deletes an existing comment on a file.
10
11
  #
11
12
  # @option options [file] :file
12
13
  # File to delete a comment from.
@@ -0,0 +1,127 @@
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 FilesRemote
9
+ #
10
+ # Adds a file from a remote service
11
+ #
12
+ # @option options [Object] :external_id
13
+ # Creator defined GUID for the file.
14
+ # @option options [Object] :external_url
15
+ # URL of the remote file.
16
+ # @option options [Object] :title
17
+ # Title of the file being shared.
18
+ # @option options [Object] :filetype
19
+ # type of file.
20
+ # @option options [Object] :indexable_file_contents
21
+ # File containing contents that can be used to improve searchability for the remote file.
22
+ # @option options [Object] :preview_image
23
+ # Preview of the document via multipart/form-data.
24
+ # @see https://api.slack.com/methods/files.remote.add
25
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.add.json
26
+ def files_remote_add(options = {})
27
+ throw ArgumentError.new('Required arguments :external_id missing') if options[:external_id].nil?
28
+ throw ArgumentError.new('Required arguments :external_url missing') if options[:external_url].nil?
29
+ throw ArgumentError.new('Required arguments :title missing') if options[:title].nil?
30
+ post('files.remote.add', options)
31
+ end
32
+
33
+ #
34
+ # Retrieve information about a remote file added to Slack
35
+ #
36
+ # @option options [Object] :external_id
37
+ # Creator defined GUID for the file.
38
+ # @option options [file] :file
39
+ # Specify a file by providing its ID.
40
+ # @see https://api.slack.com/methods/files.remote.info
41
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.info.json
42
+ def files_remote_info(options = {})
43
+ post('files.remote.info', options)
44
+ end
45
+
46
+ #
47
+ # Retrieve information about a remote file added to Slack
48
+ #
49
+ # @option options [channel] :channel
50
+ # Filter files appearing in a specific channel, indicated by its ID.
51
+ # @option options [Object] :cursor
52
+ # Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
53
+ # @option options [Object] :limit
54
+ # The maximum number of items to return.
55
+ # @option options [Object] :ts_from
56
+ # Filter files created after this timestamp (inclusive).
57
+ # @option options [Object] :ts_to
58
+ # Filter files created before this timestamp (inclusive).
59
+ # @see https://api.slack.com/methods/files.remote.list
60
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.list.json
61
+ def files_remote_list(options = {})
62
+ options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
63
+ if block_given?
64
+ Pagination::Cursor.new(self, :files_remote_list, options).each do |page|
65
+ yield page
66
+ end
67
+ else
68
+ post('files.remote.list', options)
69
+ end
70
+ end
71
+
72
+ #
73
+ # Remove a remote file.
74
+ #
75
+ # @option options [Object] :external_id
76
+ # Creator defined GUID for the file.
77
+ # @option options [file] :file
78
+ # Specify a file by providing its ID.
79
+ # @see https://api.slack.com/methods/files.remote.remove
80
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.remove.json
81
+ def files_remote_remove(options = {})
82
+ post('files.remote.remove', options)
83
+ end
84
+
85
+ #
86
+ # Share a remote file into a channel.
87
+ #
88
+ # @option options [Object] :channels
89
+ # Comma-separated list of channel IDs where the file will be shared.
90
+ # @option options [Object] :external_id
91
+ # Creator defined GUID for the file.
92
+ # @option options [file] :file
93
+ # Specify a file by providing its ID.
94
+ # @see https://api.slack.com/methods/files.remote.share
95
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.share.json
96
+ def files_remote_share(options = {})
97
+ throw ArgumentError.new('Required arguments :channels missing') if options[:channels].nil?
98
+ post('files.remote.share', options)
99
+ end
100
+
101
+ #
102
+ # Updates an existing remote file.
103
+ #
104
+ # @option options [Object] :external_id
105
+ # Creator defined GUID for the file.
106
+ # @option options [Object] :external_url
107
+ # URL of the remote file.
108
+ # @option options [file] :file
109
+ # Specify a file by providing its ID.
110
+ # @option options [Object] :filetype
111
+ # type of file.
112
+ # @option options [Object] :indexable_file_contents
113
+ # File containing contents that can be used to improve searchability for the remote file.
114
+ # @option options [Object] :preview_image
115
+ # Preview of the document via multipart/form-data.
116
+ # @option options [Object] :title
117
+ # Title of the file being shared.
118
+ # @see https://api.slack.com/methods/files.remote.update
119
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.update.json
120
+ def files_remote_update(options = {})
121
+ post('files.remote.update', options)
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end