slack-ruby-client 0.14.6 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (274) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +15 -3
  4. data/.rubocop_todo.yml +110 -38
  5. data/.travis.yml +2 -5
  6. data/CHANGELOG.md +42 -0
  7. data/CONTRIBUTING.md +19 -8
  8. data/Dangerfile +1 -1
  9. data/Gemfile +1 -2
  10. data/LICENSE.md +1 -1
  11. data/README.md +38 -36
  12. data/RELEASING.md +1 -1
  13. data/UPGRADING.md +62 -2
  14. data/bin/commands/admin_analytics.rb +16 -0
  15. data/bin/commands/admin_apps.rb +26 -2
  16. data/bin/commands/admin_apps_requests.rb +1 -0
  17. data/bin/commands/admin_auth_policy.rb +39 -0
  18. data/bin/commands/admin_barriers.rb +47 -0
  19. data/bin/commands/admin_conversations.rb +155 -3
  20. data/bin/commands/admin_conversations_ekm.rb +17 -0
  21. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  22. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  23. data/bin/commands/admin_emoji.rb +1 -1
  24. data/bin/commands/admin_teams.rb +1 -1
  25. data/bin/commands/admin_usergroups.rb +48 -0
  26. data/bin/commands/admin_users.rb +3 -2
  27. data/bin/commands/admin_users_session.rb +62 -0
  28. data/bin/commands/api.rb +0 -1
  29. data/bin/commands/apps_connections.rb +13 -0
  30. data/bin/commands/apps_event_authorizations.rb +16 -0
  31. data/bin/commands/apps_manifest.rb +51 -0
  32. data/bin/commands/auth_teams.rb +16 -0
  33. data/bin/commands/bots.rb +1 -0
  34. data/bin/commands/calls.rb +52 -0
  35. data/bin/commands/calls_participants.rb +25 -0
  36. data/bin/commands/channels.rb +1 -155
  37. data/bin/commands/chat.rb +17 -12
  38. data/bin/commands/chat_scheduledMessages.rb +1 -0
  39. data/bin/commands/conversations.rb +71 -3
  40. data/bin/commands/dnd.rb +2 -0
  41. data/bin/commands/files.rb +6 -4
  42. data/bin/commands/files_remote.rb +2 -2
  43. data/bin/commands/groups.rb +1 -162
  44. data/bin/commands/im.rb +1 -63
  45. data/bin/commands/migration.rb +1 -0
  46. data/bin/commands/mpim.rb +1 -61
  47. data/bin/commands/oauth.rb +0 -13
  48. data/bin/commands/oauth_v2.rb +13 -1
  49. data/bin/commands/openid_connect.rb +27 -0
  50. data/bin/commands/pins.rb +2 -4
  51. data/bin/commands/reactions.rb +1 -0
  52. data/bin/commands/reminders.rb +6 -0
  53. data/bin/commands/rtm.rb +2 -2
  54. data/bin/commands/search.rb +4 -0
  55. data/bin/commands/stars.rb +7 -6
  56. data/bin/commands/team.rb +3 -0
  57. data/bin/commands/team_billing.rb +13 -0
  58. data/bin/commands/team_preferences.rb +13 -0
  59. data/bin/commands/tooling_tokens.rb +14 -0
  60. data/bin/commands/usergroups.rb +5 -0
  61. data/bin/commands/usergroups_users.rb +2 -0
  62. data/bin/commands/users.rb +4 -2
  63. data/bin/commands/users_profile.rb +5 -5
  64. data/bin/commands/views.rb +2 -2
  65. data/bin/commands/workflows.rb +38 -0
  66. data/bin/commands.rb +17 -8
  67. data/lib/slack/config.rb +1 -2
  68. data/lib/slack/events/request.rb +10 -4
  69. data/lib/slack/messages/message.rb +0 -4
  70. data/lib/slack/real_time/client.rb +6 -6
  71. data/lib/slack/real_time/concurrency/async.rb +7 -11
  72. data/lib/slack/real_time/concurrency.rb +0 -2
  73. data/lib/slack/real_time/config.rb +5 -14
  74. data/lib/slack/real_time/models/base.rb +0 -4
  75. data/lib/slack/real_time/socket.rb +3 -4
  76. data/lib/slack/real_time/stores/base.rb +4 -7
  77. data/lib/slack/real_time/stores/starter.rb +6 -3
  78. data/lib/slack/real_time/stores/store.rb +5 -0
  79. data/lib/slack/version.rb +1 -1
  80. data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
  81. data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
  82. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  83. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
  84. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  85. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  86. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  87. data/lib/slack/web/api/endpoints/admin_conversations.rb +234 -4
  88. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  89. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  90. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  91. data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
  92. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  93. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  94. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  95. data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
  96. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  97. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  98. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  99. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  100. data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
  101. data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
  102. data/lib/slack/web/api/endpoints/api.rb +1 -3
  103. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  104. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  105. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  106. data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
  107. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  108. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  109. data/lib/slack/web/api/endpoints/bots.rb +3 -1
  110. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  111. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  112. data/lib/slack/web/api/endpoints/channels.rb +1 -245
  113. data/lib/slack/web/api/endpoints/chat.rb +76 -66
  114. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +5 -3
  115. data/lib/slack/web/api/endpoints/conversations.rb +149 -41
  116. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  117. data/lib/slack/web/api/endpoints/dnd.rb +6 -3
  118. data/lib/slack/web/api/endpoints/files.rb +21 -17
  119. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  120. data/lib/slack/web/api/endpoints/files_remote.rb +23 -23
  121. data/lib/slack/web/api/endpoints/groups.rb +0 -253
  122. data/lib/slack/web/api/endpoints/im.rb +0 -101
  123. data/lib/slack/web/api/endpoints/migration.rb +4 -2
  124. data/lib/slack/web/api/endpoints/mpim.rb +0 -96
  125. data/lib/slack/web/api/endpoints/oauth.rb +5 -30
  126. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  127. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  128. data/lib/slack/web/api/endpoints/pins.rb +7 -12
  129. data/lib/slack/web/api/endpoints/reactions.rb +16 -14
  130. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  131. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  132. data/lib/slack/web/api/endpoints/search.rb +27 -13
  133. data/lib/slack/web/api/endpoints/stars.rb +13 -11
  134. data/lib/slack/web/api/endpoints/team.rb +11 -5
  135. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  136. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  137. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  138. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  139. data/lib/slack/web/api/endpoints/usergroups.rb +26 -16
  140. data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
  141. data/lib/slack/web/api/endpoints/users.rb +20 -18
  142. data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
  143. data/lib/slack/web/api/endpoints/views.rb +13 -13
  144. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  145. data/lib/slack/web/api/endpoints.rb +35 -18
  146. data/lib/slack/web/api/errors/server_error.rb +37 -0
  147. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  148. data/lib/slack/web/api/errors.rb +486 -12
  149. data/lib/slack/web/api/mixins/{channels.id.rb → conversations.id.rb} +3 -5
  150. data/lib/slack/web/api/mixins/ids.id.rb +3 -5
  151. data/lib/slack/web/api/mixins/users.id.rb +1 -3
  152. data/lib/slack/web/api/mixins.rb +1 -2
  153. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +25 -24
  154. data/lib/slack/web/api/templates/endpoints.erb +1 -2
  155. data/lib/slack/web/api/templates/method.erb +4 -1
  156. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  157. data/lib/slack/web/config.rb +2 -0
  158. data/lib/slack/web/faraday/connection.rb +23 -20
  159. data/lib/slack/web/faraday/request.rb +2 -1
  160. data/lib/slack/web/faraday/response/raise_error.rb +12 -1
  161. data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
  162. data/lib/slack/web/pagination/cursor.rb +3 -7
  163. data/lib/slack-ruby-client.rb +4 -4
  164. data/lib/tasks/web.rake +11 -3
  165. data/slack-ruby-client.gemspec +6 -7
  166. data/spec/fixtures/slack/web/429_error.yml +50 -54
  167. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  168. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  169. data/spec/fixtures/slack/web/conversations_info.yml +167 -0
  170. data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
  171. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
  172. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
  173. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  174. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  175. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  176. data/spec/fixtures/slack/web/users_info.yml +153 -69
  177. data/spec/fixtures/slack/web/users_list.yml +102 -41
  178. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  179. data/spec/slack/events/request_spec.rb +13 -8
  180. data/spec/slack/real_time/client_spec.rb +35 -22
  181. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  182. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  183. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  184. data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
  185. data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
  186. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  187. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  188. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  189. data/spec/slack/slack_spec.rb +3 -1
  190. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  191. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
  192. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  193. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  194. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
  195. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  196. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
  197. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
  198. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
  199. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
  200. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  201. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
  202. data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
  203. data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
  204. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  205. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  206. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  207. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
  208. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  209. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  210. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  211. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  212. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  213. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  214. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  215. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  216. data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
  217. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -22
  218. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  219. data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
  220. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
  221. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  222. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  223. data/spec/slack/web/api/endpoints/team_billing_spec.rb +8 -0
  224. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
  225. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  226. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  227. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  228. data/spec/slack/web/api/error_spec.rb +5 -7
  229. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  230. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  231. data/spec/slack/web/api/mixins/{channels_spec.rb → conversations_spec.rb} +8 -8
  232. data/spec/slack/web/api/mixins/users_spec.rb +1 -1
  233. data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
  234. data/spec/slack/web/client_spec.rb +123 -1
  235. data/spec/slack/web/faraday/request_spec.rb +80 -0
  236. data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
  237. data/spec/spec_helper.rb +1 -1
  238. data/spec/support/real_time/connected_client.rb +1 -7
  239. data/spec/support/vcr.rb +36 -1
  240. metadata +95 -173
  241. data/examples/hi_real_time/Gemfile +0 -6
  242. data/examples/hi_real_time/hi.gif +0 -0
  243. data/examples/hi_real_time/hi.rb +0 -41
  244. data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
  245. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  246. data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
  247. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
  248. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  249. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
  250. data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
  251. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
  252. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  253. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  254. data/lib/slack/web/api/mixins/groups.id.rb +0 -27
  255. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  256. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  257. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  258. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  259. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
  260. data/spec/fixtures/slack/web/503_error.yml +0 -14
  261. data/spec/fixtures/slack/web/channels_info.yml +0 -46
  262. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  263. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
  264. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
  265. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  266. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  267. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -101
  268. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
  269. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
  270. data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
  271. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
  272. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
  273. data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
  274. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -9,17 +9,17 @@ module Slack
9
9
  #
10
10
  # Adds a file from a remote service
11
11
  #
12
- # @option options [Object] :external_id
12
+ # @option options [string] :external_id
13
13
  # Creator defined GUID for the file.
14
- # @option options [Object] :external_url
14
+ # @option options [string] :external_url
15
15
  # URL of the remote file.
16
- # @option options [Object] :title
16
+ # @option options [string] :title
17
17
  # Title of the file being shared.
18
- # @option options [Object] :filetype
18
+ # @option options [string] :filetype
19
19
  # type of file.
20
- # @option options [Object] :indexable_file_contents
20
+ # @option options [string] :indexable_file_contents
21
21
  # A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file.
22
- # @option options [Object] :preview_image
22
+ # @option options [string] :preview_image
23
23
  # Preview of the document via multipart/form-data.
24
24
  # @see https://api.slack.com/methods/files.remote.add
25
25
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.add.json
@@ -33,7 +33,7 @@ module Slack
33
33
  #
34
34
  # Retrieve information about a remote file added to Slack
35
35
  #
36
- # @option options [Object] :external_id
36
+ # @option options [string] :external_id
37
37
  # Creator defined GUID for the file.
38
38
  # @option options [file] :file
39
39
  # Specify a file by providing its ID.
@@ -48,18 +48,18 @@ module Slack
48
48
  #
49
49
  # @option options [channel] :channel
50
50
  # Filter files appearing in a specific channel, indicated by its ID.
51
- # @option options [Object] :cursor
51
+ # @option options [string] :cursor
52
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
53
+ # @option options [integer] :limit
54
54
  # The maximum number of items to return.
55
- # @option options [Object] :ts_from
55
+ # @option options [string] :ts_from
56
56
  # Filter files created after this timestamp (inclusive).
57
- # @option options [Object] :ts_to
57
+ # @option options [string] :ts_to
58
58
  # Filter files created before this timestamp (inclusive).
59
59
  # @see https://api.slack.com/methods/files.remote.list
60
60
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.list.json
61
61
  def files_remote_list(options = {})
62
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
62
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
63
63
  if block_given?
64
64
  Pagination::Cursor.new(self, :files_remote_list, options).each do |page|
65
65
  yield page
@@ -72,7 +72,7 @@ module Slack
72
72
  #
73
73
  # Remove a remote file.
74
74
  #
75
- # @option options [Object] :external_id
75
+ # @option options [string] :external_id
76
76
  # Creator defined GUID for the file.
77
77
  # @option options [file] :file
78
78
  # Specify a file by providing its ID.
@@ -85,12 +85,12 @@ module Slack
85
85
  #
86
86
  # Share a remote file into a channel.
87
87
  #
88
- # @option options [Object] :channels
88
+ # @option options [string] :channels
89
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.
90
+ # @option options [string] :external_id
91
+ # The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or file or both are required.
92
92
  # @option options [file] :file
93
- # Specify a file by providing its ID.
93
+ # Specify a file registered with Slack by providing its ID. Either this field or external_id or both are required.
94
94
  # @see https://api.slack.com/methods/files.remote.share
95
95
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.share.json
96
96
  def files_remote_share(options = {})
@@ -101,19 +101,19 @@ module Slack
101
101
  #
102
102
  # Updates an existing remote file.
103
103
  #
104
- # @option options [Object] :external_id
104
+ # @option options [string] :external_id
105
105
  # Creator defined GUID for the file.
106
- # @option options [Object] :external_url
106
+ # @option options [string] :external_url
107
107
  # URL of the remote file.
108
108
  # @option options [file] :file
109
109
  # Specify a file by providing its ID.
110
- # @option options [Object] :filetype
110
+ # @option options [string] :filetype
111
111
  # type of file.
112
- # @option options [Object] :indexable_file_contents
112
+ # @option options [string] :indexable_file_contents
113
113
  # File containing contents that can be used to improve searchability for the remote file.
114
- # @option options [Object] :preview_image
114
+ # @option options [string] :preview_image
115
115
  # Preview of the document via multipart/form-data.
116
- # @option options [Object] :title
116
+ # @option options [string] :title
117
117
  # Title of the file being shared.
118
118
  # @see https://api.slack.com/methods/files.remote.update
119
119
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.update.json
@@ -6,259 +6,6 @@ module Slack
6
6
  module Api
7
7
  module Endpoints
8
8
  module Groups
9
- #
10
- # Archives a private channel.
11
- #
12
- # @option options [group] :channel
13
- # Private channel to archive.
14
- # @see https://api.slack.com/methods/groups.archive
15
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.archive.json
16
- def groups_archive(options = {})
17
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
18
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
19
- post('groups.archive', options)
20
- end
21
-
22
- #
23
- # Creates a private channel.
24
- #
25
- # @option options [Object] :name
26
- # Name of private channel to create.
27
- # @option options [Object] :validate
28
- # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
29
- # @see https://api.slack.com/methods/groups.create
30
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.create.json
31
- def groups_create(options = {})
32
- throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
33
- post('groups.create', options)
34
- end
35
-
36
- #
37
- # Clones and archives a private channel.
38
- #
39
- # @option options [group] :channel
40
- # Private channel to clone and archive.
41
- # @see https://api.slack.com/methods/groups.createChild
42
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.createChild.json
43
- def groups_createChild(options = {})
44
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
45
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
46
- post('groups.createChild', options)
47
- end
48
-
49
- #
50
- # Fetches history of messages and events from a private channel.
51
- #
52
- # @option options [group] :channel
53
- # Private channel to fetch history for.
54
- # @option options [Object] :inclusive
55
- # Include messages with latest or oldest timestamp in results.
56
- # @option options [timestamp] :latest
57
- # End of time range of messages to include in results.
58
- # @option options [timestamp] :oldest
59
- # Start of time range of messages to include in results.
60
- # @option options [Object] :unreads
61
- # Include unread_count_display in the output?.
62
- # @see https://api.slack.com/methods/groups.history
63
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.history.json
64
- def groups_history(options = {})
65
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
66
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
67
- post('groups.history', options)
68
- end
69
-
70
- #
71
- # Gets information about a private channel.
72
- #
73
- # @option options [group] :channel
74
- # Private channel to get info on.
75
- # @option options [Object] :include_locale
76
- # Set this to true to receive the locale for this group. Defaults to false.
77
- # @see https://api.slack.com/methods/groups.info
78
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.info.json
79
- def groups_info(options = {})
80
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
81
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
82
- post('groups.info', options)
83
- end
84
-
85
- #
86
- # Invites a user to a private channel.
87
- #
88
- # @option options [group] :channel
89
- # Private channel to invite user to.
90
- # @option options [user] :user
91
- # User to invite.
92
- # @see https://api.slack.com/methods/groups.invite
93
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.invite.json
94
- def groups_invite(options = {})
95
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
96
- throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
97
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
98
- options = options.merge(user: users_id(options)['user']['id']) if options[:user]
99
- post('groups.invite', options)
100
- end
101
-
102
- #
103
- # Removes a user from a private channel.
104
- #
105
- # @option options [group] :channel
106
- # Private channel to remove user from.
107
- # @option options [user] :user
108
- # User to remove from private channel.
109
- # @see https://api.slack.com/methods/groups.kick
110
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.kick.json
111
- def groups_kick(options = {})
112
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
113
- throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
114
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
115
- options = options.merge(user: users_id(options)['user']['id']) if options[:user]
116
- post('groups.kick', options)
117
- end
118
-
119
- #
120
- # Leaves a private channel.
121
- #
122
- # @option options [group] :channel
123
- # Private channel to leave.
124
- # @see https://api.slack.com/methods/groups.leave
125
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.leave.json
126
- def groups_leave(options = {})
127
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
128
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
129
- post('groups.leave', options)
130
- end
131
-
132
- #
133
- # Lists private channels that the calling user has access to.
134
- #
135
- # @option options [Object] :cursor
136
- # 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.
137
- # @option options [Object] :exclude_archived
138
- # Don't return archived private channels.
139
- # @option options [Object] :exclude_members
140
- # Exclude the members from each group.
141
- # @option options [Object] :limit
142
- # 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.
143
- # @see https://api.slack.com/methods/groups.list
144
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.list.json
145
- def groups_list(options = {})
146
- if block_given?
147
- Pagination::Cursor.new(self, :groups_list, options).each do |page|
148
- yield page
149
- end
150
- else
151
- post('groups.list', options)
152
- end
153
- end
154
-
155
- #
156
- # Sets the read cursor in a private channel.
157
- #
158
- # @option options [group] :channel
159
- # Private channel to set reading cursor in.
160
- # @option options [timestamp] :ts
161
- # Timestamp of the most recently seen message.
162
- # @see https://api.slack.com/methods/groups.mark
163
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.mark.json
164
- def groups_mark(options = {})
165
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
166
- throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
167
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
168
- post('groups.mark', options)
169
- end
170
-
171
- #
172
- # Opens a private channel.
173
- #
174
- # @option options [group] :channel
175
- # Private channel to open.
176
- # @see https://api.slack.com/methods/groups.open
177
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.open.json
178
- def groups_open(options = {})
179
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
180
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
181
- post('groups.open', options)
182
- end
183
-
184
- #
185
- # Renames a private channel.
186
- #
187
- # @option options [group] :channel
188
- # Private channel to rename.
189
- # @option options [Object] :name
190
- # New name for private channel.
191
- # @option options [Object] :validate
192
- # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
193
- # @see https://api.slack.com/methods/groups.rename
194
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.rename.json
195
- def groups_rename(options = {})
196
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
197
- throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
198
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
199
- post('groups.rename', options)
200
- end
201
-
202
- #
203
- # Retrieve a thread of messages posted to a private channel
204
- #
205
- # @option options [group] :channel
206
- # Private channel to fetch thread from.
207
- # @option options [Object] :thread_ts
208
- # Unique identifier of a thread's parent message.
209
- # @see https://api.slack.com/methods/groups.replies
210
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.replies.json
211
- def groups_replies(options = {})
212
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
213
- throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
214
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
215
- post('groups.replies', options)
216
- end
217
-
218
- #
219
- # Sets the purpose for a private channel.
220
- #
221
- # @option options [group] :channel
222
- # Private channel to set the purpose of.
223
- # @option options [Object] :purpose
224
- # The new purpose.
225
- # @see https://api.slack.com/methods/groups.setPurpose
226
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.setPurpose.json
227
- def groups_setPurpose(options = {})
228
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
229
- throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
230
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
231
- post('groups.setPurpose', options)
232
- end
233
-
234
- #
235
- # Sets the topic for a private channel.
236
- #
237
- # @option options [group] :channel
238
- # Private channel to set the topic of.
239
- # @option options [Object] :topic
240
- # The new topic.
241
- # @see https://api.slack.com/methods/groups.setTopic
242
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.setTopic.json
243
- def groups_setTopic(options = {})
244
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
245
- throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
246
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
247
- post('groups.setTopic', options)
248
- end
249
-
250
- #
251
- # Unarchives a private channel.
252
- #
253
- # @option options [group] :channel
254
- # Private channel to unarchive.
255
- # @see https://api.slack.com/methods/groups.unarchive
256
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.unarchive.json
257
- def groups_unarchive(options = {})
258
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
259
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
260
- post('groups.unarchive', options)
261
- end
262
9
  end
263
10
  end
264
11
  end
@@ -6,107 +6,6 @@ module Slack
6
6
  module Api
7
7
  module Endpoints
8
8
  module Im
9
- #
10
- # Close a direct message channel.
11
- #
12
- # @option options [im] :channel
13
- # Direct message channel to close.
14
- # @see https://api.slack.com/methods/im.close
15
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.close.json
16
- def im_close(options = {})
17
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
18
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
19
- post('im.close', options)
20
- end
21
-
22
- #
23
- # Fetches history of messages and events from direct message channel.
24
- #
25
- # @option options [im] :channel
26
- # Direct message channel to fetch history for.
27
- # @option options [Object] :inclusive
28
- # Include messages with latest or oldest timestamp in results.
29
- # @option options [timestamp] :latest
30
- # End of time range of messages to include in results.
31
- # @option options [timestamp] :oldest
32
- # Start of time range of messages to include in results.
33
- # @option options [Object] :unreads
34
- # Include unread_count_display in the output?.
35
- # @see https://api.slack.com/methods/im.history
36
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.history.json
37
- def im_history(options = {})
38
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
39
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
40
- post('im.history', options)
41
- end
42
-
43
- #
44
- # Lists direct message channels for the calling user.
45
- #
46
- # @option options [Object] :cursor
47
- # 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.
48
- # @option options [Object] :limit
49
- # The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
50
- # @see https://api.slack.com/methods/im.list
51
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.list.json
52
- def im_list(options = {})
53
- if block_given?
54
- Pagination::Cursor.new(self, :im_list, options).each do |page|
55
- yield page
56
- end
57
- else
58
- post('im.list', options)
59
- end
60
- end
61
-
62
- #
63
- # Sets the read cursor in a direct message channel.
64
- #
65
- # @option options [im] :channel
66
- # Direct message channel to set reading cursor in.
67
- # @option options [timestamp] :ts
68
- # Timestamp of the most recently seen message.
69
- # @see https://api.slack.com/methods/im.mark
70
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.mark.json
71
- def im_mark(options = {})
72
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
73
- throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
74
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
75
- post('im.mark', options)
76
- end
77
-
78
- #
79
- # Opens a direct message channel.
80
- #
81
- # @option options [user] :user
82
- # User to open a direct message channel with.
83
- # @option options [Object] :include_locale
84
- # Set this to true to receive the locale for this im. Defaults to false.
85
- # @option options [Object] :return_im
86
- # Boolean, indicates you want the full IM channel definition in the response.
87
- # @see https://api.slack.com/methods/im.open
88
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.open.json
89
- def im_open(options = {})
90
- throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
91
- options = options.merge(user: users_id(options)['user']['id']) if options[:user]
92
- post('im.open', options)
93
- end
94
-
95
- #
96
- # Retrieve a thread of messages posted to a direct message conversation
97
- #
98
- # @option options [im] :channel
99
- # Direct message channel to fetch thread from.
100
- # @option options [Object] :thread_ts
101
- # Unique identifier of a thread's parent message.
102
- # @see https://api.slack.com/methods/im.replies
103
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.replies.json
104
- def im_replies(options = {})
105
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
106
- throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
107
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
108
- post('im.replies', options)
109
- end
110
9
  end
111
10
  end
112
11
  end
@@ -9,9 +9,11 @@ module Slack
9
9
  #
10
10
  # For Enterprise Grid workspaces, map local user IDs to global user IDs
11
11
  #
12
- # @option options [Object] :users
12
+ # @option options [array] :users
13
13
  # A comma-separated list of user ids, up to 400 per request.
14
- # @option options [Object] :to_old
14
+ # @option options [string] :team_id
15
+ # Specify team_id starts with T in case of Org Token.
16
+ # @option options [boolean] :to_old
15
17
  # Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.
16
18
  # @see https://api.slack.com/methods/migration.exchange
17
19
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/migration/migration.exchange.json
@@ -6,102 +6,6 @@ module Slack
6
6
  module Api
7
7
  module Endpoints
8
8
  module Mpim
9
- #
10
- # Closes a multiparty direct message channel.
11
- #
12
- # @option options [channel] :channel
13
- # MPIM to close.
14
- # @see https://api.slack.com/methods/mpim.close
15
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.close.json
16
- def mpim_close(options = {})
17
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
18
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
19
- post('mpim.close', options)
20
- end
21
-
22
- #
23
- # Fetches history of messages and events from a multiparty direct message.
24
- #
25
- # @option options [channel] :channel
26
- # Multiparty direct message to fetch history for.
27
- # @option options [Object] :inclusive
28
- # Include messages with latest or oldest timestamp in results.
29
- # @option options [timestamp] :latest
30
- # End of time range of messages to include in results.
31
- # @option options [timestamp] :oldest
32
- # Start of time range of messages to include in results.
33
- # @option options [Object] :unreads
34
- # Include unread_count_display in the output?.
35
- # @see https://api.slack.com/methods/mpim.history
36
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.history.json
37
- def mpim_history(options = {})
38
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
39
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
40
- post('mpim.history', options)
41
- end
42
-
43
- #
44
- # Lists multiparty direct message channels for the calling user.
45
- #
46
- # @option options [Object] :cursor
47
- # 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.
48
- # @option options [Object] :limit
49
- # 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.
50
- # @see https://api.slack.com/methods/mpim.list
51
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.list.json
52
- def mpim_list(options = {})
53
- if block_given?
54
- Pagination::Cursor.new(self, :mpim_list, options).each do |page|
55
- yield page
56
- end
57
- else
58
- post('mpim.list', options)
59
- end
60
- end
61
-
62
- #
63
- # Sets the read cursor in a multiparty direct message channel.
64
- #
65
- # @option options [channel] :channel
66
- # multiparty direct message channel to set reading cursor in.
67
- # @option options [timestamp] :ts
68
- # Timestamp of the most recently seen message.
69
- # @see https://api.slack.com/methods/mpim.mark
70
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.mark.json
71
- def mpim_mark(options = {})
72
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
73
- throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
74
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
75
- post('mpim.mark', options)
76
- end
77
-
78
- #
79
- # This method opens a multiparty direct message.
80
- #
81
- # @option options [Object] :users
82
- # Comma separated lists of users. The ordering of the users is preserved whenever a MPIM group is returned.
83
- # @see https://api.slack.com/methods/mpim.open
84
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.open.json
85
- def mpim_open(options = {})
86
- throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
87
- post('mpim.open', options)
88
- end
89
-
90
- #
91
- # Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.
92
- #
93
- # @option options [channel] :channel
94
- # Multiparty direct message channel to fetch thread from.
95
- # @option options [Object] :thread_ts
96
- # Unique identifier of a thread's parent message.
97
- # @see https://api.slack.com/methods/mpim.replies
98
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.replies.json
99
- def mpim_replies(options = {})
100
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
101
- throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
102
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
103
- post('mpim.replies', options)
104
- end
105
9
  end
106
10
  end
107
11
  end
@@ -9,46 +9,21 @@ module Slack
9
9
  #
10
10
  # Exchanges a temporary OAuth verifier code for an access token.
11
11
  #
12
- # @option options [Object] :client_id
12
+ # @option options [string] :client_id
13
13
  # Issued when you created your application.
14
- # @option options [Object] :client_secret
14
+ # @option options [string] :client_secret
15
15
  # Issued when you created your application.
16
- # @option options [Object] :code
16
+ # @option options [string] :code
17
17
  # The code param returned via the OAuth callback.
18
- # @option options [Object] :redirect_uri
18
+ # @option options [string] :redirect_uri
19
19
  # This must match the originally submitted URI (if one was sent).
20
- # @option options [Object] :single_channel
20
+ # @option options [boolean] :single_channel
21
21
  # Request the user to add your app only to a single channel. Only valid with a legacy workspace app.
22
22
  # @see https://api.slack.com/methods/oauth.access
23
23
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth/oauth.access.json
24
24
  def oauth_access(options = {})
25
- throw ArgumentError.new('Required arguments :client_id missing') if options[:client_id].nil?
26
- throw ArgumentError.new('Required arguments :client_secret missing') if options[:client_secret].nil?
27
- throw ArgumentError.new('Required arguments :code missing') if options[:code].nil?
28
25
  post('oauth.access', options)
29
26
  end
30
-
31
- #
32
- # Exchanges a temporary OAuth verifier code for a workspace token.
33
- #
34
- # @option options [Object] :client_id
35
- # Issued when you created your application.
36
- # @option options [Object] :client_secret
37
- # Issued when you created your application.
38
- # @option options [Object] :code
39
- # The code param returned via the OAuth callback.
40
- # @option options [Object] :redirect_uri
41
- # This must match the originally submitted URI (if one was sent).
42
- # @option options [Object] :single_channel
43
- # Request the user to add your app only to a single channel.
44
- # @see https://api.slack.com/methods/oauth.token
45
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth/oauth.token.json
46
- def oauth_token(options = {})
47
- throw ArgumentError.new('Required arguments :client_id missing') if options[:client_id].nil?
48
- throw ArgumentError.new('Required arguments :client_secret missing') if options[:client_secret].nil?
49
- throw ArgumentError.new('Required arguments :code missing') if options[:code].nil?
50
- post('oauth.token', options)
51
- end
52
27
  end
53
28
  end
54
29
  end