slack-ruby-client 0.15.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -6,275 +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
- logger.warn('groups.archive: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.archive.')
20
- post('groups.archive', options)
21
- end
22
-
23
- #
24
- # Creates a private channel.
25
- #
26
- # @option options [Object] :name
27
- # Name of private channel to create.
28
- # @option options [Object] :validate
29
- # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
30
- # @see https://api.slack.com/methods/groups.create
31
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.create.json
32
- def groups_create(options = {})
33
- throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
34
- logger.warn('groups.create: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.create.')
35
- post('groups.create', options)
36
- end
37
-
38
- #
39
- # Clones and archives a private channel.
40
- #
41
- # @option options [group] :channel
42
- # Private channel to clone and archive.
43
- # @see https://api.slack.com/methods/groups.createChild
44
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.createChild.json
45
- def groups_createChild(options = {})
46
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
47
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
48
- logger.warn('groups.createChild: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
49
- post('groups.createChild', options)
50
- end
51
-
52
- #
53
- # Fetches history of messages and events from a private channel.
54
- #
55
- # @option options [group] :channel
56
- # Private channel to fetch history for.
57
- # @option options [Object] :inclusive
58
- # Include messages with latest or oldest timestamp in results.
59
- # @option options [timestamp] :latest
60
- # End of time range of messages to include in results.
61
- # @option options [timestamp] :oldest
62
- # Start of time range of messages to include in results.
63
- # @option options [Object] :unreads
64
- # Include unread_count_display in the output?.
65
- # @see https://api.slack.com/methods/groups.history
66
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.history.json
67
- def groups_history(options = {})
68
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
69
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
70
- logger.warn('groups.history: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.history.')
71
- post('groups.history', options)
72
- end
73
-
74
- #
75
- # Gets information about a private channel.
76
- #
77
- # @option options [group] :channel
78
- # Private channel to get info on.
79
- # @option options [Object] :include_locale
80
- # Set this to true to receive the locale for this group. Defaults to false.
81
- # @see https://api.slack.com/methods/groups.info
82
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.info.json
83
- def groups_info(options = {})
84
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
85
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
86
- logger.warn('groups.info: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.info.')
87
- post('groups.info', options)
88
- end
89
-
90
- #
91
- # Invites a user to a private channel.
92
- #
93
- # @option options [group] :channel
94
- # Private channel to invite user to.
95
- # @option options [user] :user
96
- # User to invite.
97
- # @see https://api.slack.com/methods/groups.invite
98
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.invite.json
99
- def groups_invite(options = {})
100
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
101
- throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
102
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
103
- options = options.merge(user: users_id(options)['user']['id']) if options[:user]
104
- logger.warn('groups.invite: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.invite.')
105
- post('groups.invite', options)
106
- end
107
-
108
- #
109
- # Removes a user from a private channel.
110
- #
111
- # @option options [group] :channel
112
- # Private channel to remove user from.
113
- # @option options [user] :user
114
- # User to remove from private channel.
115
- # @see https://api.slack.com/methods/groups.kick
116
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.kick.json
117
- def groups_kick(options = {})
118
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
119
- throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
120
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
121
- options = options.merge(user: users_id(options)['user']['id']) if options[:user]
122
- logger.warn('groups.kick: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.kick.')
123
- post('groups.kick', options)
124
- end
125
-
126
- #
127
- # Leaves a private channel.
128
- #
129
- # @option options [group] :channel
130
- # Private channel to leave.
131
- # @see https://api.slack.com/methods/groups.leave
132
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.leave.json
133
- def groups_leave(options = {})
134
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
135
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
136
- logger.warn('groups.leave: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.leave.')
137
- post('groups.leave', options)
138
- end
139
-
140
- #
141
- # Lists private channels that the calling user has access to.
142
- #
143
- # @option options [Object] :cursor
144
- # 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.
145
- # @option options [Object] :exclude_archived
146
- # Don't return archived private channels.
147
- # @option options [Object] :exclude_members
148
- # Exclude the members from each group.
149
- # @option options [Object] :limit
150
- # 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.
151
- # @see https://api.slack.com/methods/groups.list
152
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.list.json
153
- def groups_list(options = {})
154
- logger.warn('groups.list: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.list, users.conversations.')
155
- if block_given?
156
- Pagination::Cursor.new(self, :groups_list, options).each do |page|
157
- yield page
158
- end
159
- else
160
- post('groups.list', options)
161
- end
162
- end
163
-
164
- #
165
- # Sets the read cursor in a private channel.
166
- #
167
- # @option options [group] :channel
168
- # Private channel to set reading cursor in.
169
- # @option options [timestamp] :ts
170
- # Timestamp of the most recently seen message.
171
- # @see https://api.slack.com/methods/groups.mark
172
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.mark.json
173
- def groups_mark(options = {})
174
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
175
- throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
176
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
177
- logger.warn('groups.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
178
- post('groups.mark', options)
179
- end
180
-
181
- #
182
- # Opens a private channel.
183
- #
184
- # @option options [group] :channel
185
- # Private channel to open.
186
- # @see https://api.slack.com/methods/groups.open
187
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.open.json
188
- def groups_open(options = {})
189
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
190
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
191
- logger.warn('groups.open: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
192
- post('groups.open', options)
193
- end
194
-
195
- #
196
- # Renames a private channel.
197
- #
198
- # @option options [group] :channel
199
- # Private channel to rename.
200
- # @option options [Object] :name
201
- # New name for private channel.
202
- # @option options [Object] :validate
203
- # Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
204
- # @see https://api.slack.com/methods/groups.rename
205
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.rename.json
206
- def groups_rename(options = {})
207
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
208
- throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
209
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
210
- logger.warn('groups.rename: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.rename.')
211
- post('groups.rename', options)
212
- end
213
-
214
- #
215
- # Retrieve a thread of messages posted to a private channel
216
- #
217
- # @option options [group] :channel
218
- # Private channel to fetch thread from.
219
- # @option options [Object] :thread_ts
220
- # Unique identifier of a thread's parent message.
221
- # @see https://api.slack.com/methods/groups.replies
222
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.replies.json
223
- def groups_replies(options = {})
224
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
225
- throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
226
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
227
- logger.warn('groups.replies: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.replies.')
228
- post('groups.replies', options)
229
- end
230
-
231
- #
232
- # Sets the purpose for a private channel.
233
- #
234
- # @option options [group] :channel
235
- # Private channel to set the purpose of.
236
- # @option options [Object] :purpose
237
- # The new purpose.
238
- # @see https://api.slack.com/methods/groups.setPurpose
239
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.setPurpose.json
240
- def groups_setPurpose(options = {})
241
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
242
- throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
243
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
244
- logger.warn('groups.setPurpose: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.setPurpose.')
245
- post('groups.setPurpose', options)
246
- end
247
-
248
- #
249
- # Sets the topic for a private channel.
250
- #
251
- # @option options [group] :channel
252
- # Private channel to set the topic of.
253
- # @option options [Object] :topic
254
- # The new topic.
255
- # @see https://api.slack.com/methods/groups.setTopic
256
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.setTopic.json
257
- def groups_setTopic(options = {})
258
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
259
- throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
260
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
261
- logger.warn('groups.setTopic: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.setTopic.')
262
- post('groups.setTopic', options)
263
- end
264
-
265
- #
266
- # Unarchives a private channel.
267
- #
268
- # @option options [group] :channel
269
- # Private channel to unarchive.
270
- # @see https://api.slack.com/methods/groups.unarchive
271
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.unarchive.json
272
- def groups_unarchive(options = {})
273
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
274
- options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
275
- logger.warn('groups.unarchive: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.unarchive.')
276
- post('groups.unarchive', options)
277
- end
278
9
  end
279
10
  end
280
11
  end
@@ -6,113 +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: conversations_id(options)['channel']['id']) if options[:channel]
19
- logger.warn('im.close: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.close.')
20
- post('im.close', options)
21
- end
22
-
23
- #
24
- # Fetches history of messages and events from direct message channel.
25
- #
26
- # @option options [im] :channel
27
- # Direct message channel to fetch history for.
28
- # @option options [Object] :inclusive
29
- # Include messages with latest or oldest timestamp in results.
30
- # @option options [timestamp] :latest
31
- # End of time range of messages to include in results.
32
- # @option options [timestamp] :oldest
33
- # Start of time range of messages to include in results.
34
- # @option options [Object] :unreads
35
- # Include unread_count_display in the output?.
36
- # @see https://api.slack.com/methods/im.history
37
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.history.json
38
- def im_history(options = {})
39
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
40
- options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
41
- logger.warn('im.history: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.history.')
42
- post('im.history', options)
43
- end
44
-
45
- #
46
- # Lists direct message channels for the calling user.
47
- #
48
- # @option options [Object] :cursor
49
- # 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.
50
- # @option options [Object] :limit
51
- # 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.
52
- # @see https://api.slack.com/methods/im.list
53
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.list.json
54
- def im_list(options = {})
55
- logger.warn('im.list: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.list, users.conversations.')
56
- if block_given?
57
- Pagination::Cursor.new(self, :im_list, options).each do |page|
58
- yield page
59
- end
60
- else
61
- post('im.list', options)
62
- end
63
- end
64
-
65
- #
66
- # Sets the read cursor in a direct message channel.
67
- #
68
- # @option options [im] :channel
69
- # Direct message channel to set reading cursor in.
70
- # @option options [timestamp] :ts
71
- # Timestamp of the most recently seen message.
72
- # @see https://api.slack.com/methods/im.mark
73
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.mark.json
74
- def im_mark(options = {})
75
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
76
- throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
77
- options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
78
- logger.warn('im.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
79
- post('im.mark', options)
80
- end
81
-
82
- #
83
- # Opens a direct message channel.
84
- #
85
- # @option options [user] :user
86
- # User to open a direct message channel with.
87
- # @option options [Object] :include_locale
88
- # Set this to true to receive the locale for this im. Defaults to false.
89
- # @option options [Object] :return_im
90
- # Boolean, indicates you want the full IM channel definition in the response.
91
- # @see https://api.slack.com/methods/im.open
92
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.open.json
93
- def im_open(options = {})
94
- throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
95
- options = options.merge(user: users_id(options)['user']['id']) if options[:user]
96
- logger.warn('im.open: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.open.')
97
- post('im.open', options)
98
- end
99
-
100
- #
101
- # Retrieve a thread of messages posted to a direct message conversation
102
- #
103
- # @option options [im] :channel
104
- # Direct message channel to fetch thread from.
105
- # @option options [Object] :thread_ts
106
- # Unique identifier of a thread's parent message.
107
- # @see https://api.slack.com/methods/im.replies
108
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.replies.json
109
- def im_replies(options = {})
110
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
111
- throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
112
- options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
113
- logger.warn('im.replies: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.replies.')
114
- post('im.replies', options)
115
- end
116
9
  end
117
10
  end
118
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,108 +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: conversations_id(options)['channel']['id']) if options[:channel]
19
- logger.warn('mpim.close: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.close.')
20
- post('mpim.close', options)
21
- end
22
-
23
- #
24
- # Fetches history of messages and events from a multiparty direct message.
25
- #
26
- # @option options [channel] :channel
27
- # Multiparty direct message to fetch history for.
28
- # @option options [Object] :inclusive
29
- # Include messages with latest or oldest timestamp in results.
30
- # @option options [timestamp] :latest
31
- # End of time range of messages to include in results.
32
- # @option options [timestamp] :oldest
33
- # Start of time range of messages to include in results.
34
- # @option options [Object] :unreads
35
- # Include unread_count_display in the output?.
36
- # @see https://api.slack.com/methods/mpim.history
37
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.history.json
38
- def mpim_history(options = {})
39
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
40
- options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
41
- logger.warn('mpim.history: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.history.')
42
- post('mpim.history', options)
43
- end
44
-
45
- #
46
- # Lists multiparty direct message channels for the calling user.
47
- #
48
- # @option options [Object] :cursor
49
- # 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.
50
- # @option options [Object] :limit
51
- # 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.
52
- # @see https://api.slack.com/methods/mpim.list
53
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.list.json
54
- def mpim_list(options = {})
55
- logger.warn('mpim.list: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.list, users.conversations.')
56
- if block_given?
57
- Pagination::Cursor.new(self, :mpim_list, options).each do |page|
58
- yield page
59
- end
60
- else
61
- post('mpim.list', options)
62
- end
63
- end
64
-
65
- #
66
- # Sets the read cursor in a multiparty direct message channel.
67
- #
68
- # @option options [channel] :channel
69
- # multiparty direct message channel to set reading cursor in.
70
- # @option options [timestamp] :ts
71
- # Timestamp of the most recently seen message.
72
- # @see https://api.slack.com/methods/mpim.mark
73
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.mark.json
74
- def mpim_mark(options = {})
75
- throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
76
- throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
77
- options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
78
- logger.warn('mpim.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
79
- post('mpim.mark', options)
80
- end
81
-
82
- #
83
- # This method opens a multiparty direct message.
84
- #
85
- # @option options [Object] :users
86
- # Comma separated lists of users. The ordering of the users is preserved whenever a MPIM group is returned.
87
- # @see https://api.slack.com/methods/mpim.open
88
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.open.json
89
- def mpim_open(options = {})
90
- throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
91
- logger.warn('mpim.open: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.open.')
92
- post('mpim.open', options)
93
- end
94
-
95
- #
96
- # Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.
97
- #
98
- # @option options [channel] :channel
99
- # Multiparty 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/mpim.replies
103
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.replies.json
104
- def mpim_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: conversations_id(options)['channel']['id']) if options[:channel]
108
- logger.warn('mpim.replies: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.replies.')
109
- post('mpim.replies', options)
110
- end
111
9
  end
112
10
  end
113
11
  end
@@ -9,43 +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
25
  post('oauth.access', options)
26
26
  end
27
-
28
- #
29
- # Exchanges a temporary OAuth verifier code for a workspace token.
30
- #
31
- # @option options [Object] :client_id
32
- # Issued when you created your application.
33
- # @option options [Object] :client_secret
34
- # Issued when you created your application.
35
- # @option options [Object] :code
36
- # The code param returned via the OAuth callback.
37
- # @option options [Object] :redirect_uri
38
- # This must match the originally submitted URI (if one was sent).
39
- # @option options [Object] :single_channel
40
- # Request the user to add your app only to a single channel.
41
- # @see https://api.slack.com/methods/oauth.token
42
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth/oauth.token.json
43
- def oauth_token(options = {})
44
- throw ArgumentError.new('Required arguments :client_id missing') if options[:client_id].nil?
45
- throw ArgumentError.new('Required arguments :client_secret missing') if options[:client_secret].nil?
46
- throw ArgumentError.new('Required arguments :code missing') if options[:code].nil?
47
- post('oauth.token', options)
48
- end
49
27
  end
50
28
  end
51
29
  end
@@ -9,20 +9,38 @@ module Slack
9
9
  #
10
10
  # Exchanges a temporary OAuth verifier code for an access token.
11
11
  #
12
- # @option options [Object] :code
13
- # The code param returned via the OAuth callback.
14
- # @option options [Object] :client_id
12
+ # @option options [string] :client_id
15
13
  # Issued when you created your application.
16
- # @option options [Object] :client_secret
14
+ # @option options [string] :client_secret
17
15
  # Issued when you created your application.
18
- # @option options [Object] :redirect_uri
16
+ # @option options [string] :code
17
+ # The code param returned via the OAuth callback.
18
+ # @option options [string] :grant_type
19
+ # The grant_type param as described in the OAuth spec.
20
+ # @option options [string] :redirect_uri
19
21
  # This must match the originally submitted URI (if one was sent).
22
+ # @option options [string] :refresh_token
23
+ # The refresh_token param as described in the OAuth spec.
20
24
  # @see https://api.slack.com/methods/oauth.v2.access
21
25
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth.v2/oauth.v2.access.json
22
26
  def oauth_v2_access(options = {})
23
- throw ArgumentError.new('Required arguments :code missing') if options[:code].nil?
24
27
  post('oauth.v2.access', options)
25
28
  end
29
+
30
+ #
31
+ # Exchanges a legacy access token for a new expiring access token and refresh token
32
+ #
33
+ # @option options [string] :client_id
34
+ # Issued when you created your application.
35
+ # @option options [string] :client_secret
36
+ # Issued when you created your application.
37
+ # @see https://api.slack.com/methods/oauth.v2.exchange
38
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth.v2/oauth.v2.exchange.json
39
+ def oauth_v2_exchange(options = {})
40
+ throw ArgumentError.new('Required arguments :client_id missing') if options[:client_id].nil?
41
+ throw ArgumentError.new('Required arguments :client_secret missing') if options[:client_secret].nil?
42
+ post('oauth.v2.exchange', options)
43
+ end
26
44
  end
27
45
  end
28
46
  end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module OpenidConnect
9
+ #
10
+ # Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack.
11
+ #
12
+ # @option options [string] :client_id
13
+ # Issued when you created your application.
14
+ # @option options [string] :client_secret
15
+ # Issued when you created your application.
16
+ # @option options [string] :code
17
+ # The code param returned via the OAuth callback.
18
+ # @option options [string] :grant_type
19
+ # The grant_type param as described in the OAuth spec.
20
+ # @option options [string] :redirect_uri
21
+ # This must match the originally submitted URI (if one was sent).
22
+ # @option options [string] :refresh_token
23
+ # The refresh_token param as described in the OAuth spec.
24
+ # @see https://api.slack.com/methods/openid.connect.token
25
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/openid.connect/openid.connect.token.json
26
+ def openid_connect_token(options = {})
27
+ post('openid.connect.token', options)
28
+ end
29
+
30
+ #
31
+ # Get the identity of a user who has authorized Sign in with Slack.
32
+ #
33
+ # @see https://api.slack.com/methods/openid.connect.userInfo
34
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/openid.connect/openid.connect.userInfo.json
35
+ def openid_connect_userInfo(options = {})
36
+ post('openid.connect.userInfo', options)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end