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,16 +9,18 @@ module Slack
9
9
  #
10
10
  # Create a User Group
11
11
  #
12
- # @option options [Object] :name
12
+ # @option options [string] :name
13
13
  # A name for the User Group. Must be unique among User Groups.
14
- # @option options [Object] :channels
14
+ # @option options [array] :channels
15
15
  # A comma separated string of encoded channel IDs for which the User Group uses as a default.
16
- # @option options [Object] :description
16
+ # @option options [string] :description
17
17
  # A short description of the User Group.
18
- # @option options [Object] :handle
18
+ # @option options [string] :handle
19
19
  # A mention handle. Must be unique among channels, users and User Groups.
20
- # @option options [Object] :include_count
20
+ # @option options [boolean] :include_count
21
21
  # Include the number of users in each User Group.
22
+ # @option options [string] :team_id
23
+ # Encoded team id where the user group has to be created, required if org token is used.
22
24
  # @see https://api.slack.com/methods/usergroups.create
23
25
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.create.json
24
26
  def usergroups_create(options = {})
@@ -31,8 +33,10 @@ module Slack
31
33
  #
32
34
  # @option options [Object] :usergroup
33
35
  # The encoded ID of the User Group to disable.
34
- # @option options [Object] :include_count
36
+ # @option options [boolean] :include_count
35
37
  # Include the number of users in the User Group.
38
+ # @option options [Object] :team_id
39
+ # Encoded team id where the user group is, required if org token is used.
36
40
  # @see https://api.slack.com/methods/usergroups.disable
37
41
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.disable.json
38
42
  def usergroups_disable(options = {})
@@ -43,10 +47,12 @@ module Slack
43
47
  #
44
48
  # Enable a User Group
45
49
  #
46
- # @option options [Object] :usergroup
50
+ # @option options [string] :usergroup
47
51
  # The encoded ID of the User Group to enable.
48
- # @option options [Object] :include_count
52
+ # @option options [boolean] :include_count
49
53
  # Include the number of users in the User Group.
54
+ # @option options [string] :team_id
55
+ # Encoded team id where the user group is, required if org token is used.
50
56
  # @see https://api.slack.com/methods/usergroups.enable
51
57
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.enable.json
52
58
  def usergroups_enable(options = {})
@@ -57,12 +63,14 @@ module Slack
57
63
  #
58
64
  # List all User Groups for a team
59
65
  #
60
- # @option options [Object] :include_count
66
+ # @option options [boolean] :include_count
61
67
  # Include the number of users in each User Group.
62
- # @option options [Object] :include_disabled
68
+ # @option options [boolean] :include_disabled
63
69
  # Include disabled User Groups.
64
- # @option options [Object] :include_users
70
+ # @option options [boolean] :include_users
65
71
  # Include the list of users for each User Group.
72
+ # @option options [string] :team_id
73
+ # encoded team id to list user groups in, required if org token is used.
66
74
  # @see https://api.slack.com/methods/usergroups.list
67
75
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json
68
76
  def usergroups_list(options = {})
@@ -74,16 +82,18 @@ module Slack
74
82
  #
75
83
  # @option options [Object] :usergroup
76
84
  # The encoded ID of the User Group to update.
77
- # @option options [Object] :channels
85
+ # @option options [array] :channels
78
86
  # A comma separated string of encoded channel IDs for which the User Group uses as a default.
79
- # @option options [Object] :description
87
+ # @option options [string] :description
80
88
  # A short description of the User Group.
81
- # @option options [Object] :handle
89
+ # @option options [string] :handle
82
90
  # A mention handle. Must be unique among channels, users and User Groups.
83
- # @option options [Object] :include_count
91
+ # @option options [boolean] :include_count
84
92
  # Include the number of users in the User Group.
85
- # @option options [Object] :name
93
+ # @option options [string] :name
86
94
  # A name for the User Group. Must be unique among User Groups.
95
+ # @option options [Object] :team_id
96
+ # encoded team id where the user group exists, required if org token is used.
87
97
  # @see https://api.slack.com/methods/usergroups.update
88
98
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.update.json
89
99
  def usergroups_update(options = {})
@@ -9,10 +9,12 @@ module Slack
9
9
  #
10
10
  # List all users in a User Group
11
11
  #
12
- # @option options [Object] :usergroup
12
+ # @option options [string] :usergroup
13
13
  # The encoded ID of the User Group to update.
14
- # @option options [Object] :include_disabled
14
+ # @option options [boolean] :include_disabled
15
15
  # Allow results that involve disabled User Groups.
16
+ # @option options [string] :team_id
17
+ # encoded team id where the user group exists, required if org token is used.
16
18
  # @see https://api.slack.com/methods/usergroups.users.list
17
19
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.list.json
18
20
  def usergroups_users_list(options = {})
@@ -23,12 +25,14 @@ module Slack
23
25
  #
24
26
  # Update the list of users for a User Group
25
27
  #
26
- # @option options [Object] :usergroup
28
+ # @option options [string] :usergroup
27
29
  # The encoded ID of the User Group to update.
28
- # @option options [Object] :users
30
+ # @option options [array] :users
29
31
  # A comma separated string of encoded user IDs that represent the entire list of users for the User Group.
30
- # @option options [Object] :include_count
32
+ # @option options [boolean] :include_count
31
33
  # Include the number of users in the User Group.
34
+ # @option options [string] :team_id
35
+ # encoded team id where the user group exists, required if org token is used.
32
36
  # @see https://api.slack.com/methods/usergroups.users.update
33
37
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.update.json
34
38
  def usergroups_users_update(options = {})
@@ -9,13 +9,15 @@ module Slack
9
9
  #
10
10
  # List conversations the calling user may access.
11
11
  #
12
- # @option options [Object] :cursor
12
+ # @option options [string] :cursor
13
13
  # 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.
14
- # @option options [Object] :exclude_archived
14
+ # @option options [boolean] :exclude_archived
15
15
  # Set to true to exclude archived channels from the list.
16
- # @option options [Object] :limit
16
+ # @option options [number] :limit
17
17
  # 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. Must be an integer no larger than 1000.
18
- # @option options [Object] :types
18
+ # @option options [string] :team_id
19
+ # encoded team id to list conversations in, required if org token is used.
20
+ # @option options [string] :types
19
21
  # Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
20
22
  # @option options [user] :user
21
23
  # Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership.
@@ -49,7 +51,6 @@ module Slack
49
51
  # @see https://api.slack.com/methods/users.getPresence
50
52
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.getPresence.json
51
53
  def users_getPresence(options = {})
52
- throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
53
54
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
54
55
  post('users.getPresence', options)
55
56
  end
@@ -68,7 +69,7 @@ module Slack
68
69
  #
69
70
  # @option options [user] :user
70
71
  # User to get info on.
71
- # @option options [Object] :include_locale
72
+ # @option options [boolean] :include_locale
72
73
  # Set this to true to receive the locale for this user. Defaults to false.
73
74
  # @see https://api.slack.com/methods/users.info
74
75
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.info.json
@@ -81,12 +82,14 @@ module Slack
81
82
  #
82
83
  # Lists all users in a Slack team.
83
84
  #
84
- # @option options [Object] :cursor
85
+ # @option options [string] :cursor
85
86
  # 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.
86
- # @option options [Object] :include_locale
87
+ # @option options [boolean] :include_locale
87
88
  # Set this to true to receive the locale for users. Defaults to false.
88
- # @option options [Object] :limit
89
- # 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.
89
+ # @option options [number] :limit
90
+ # 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. Providing no limit value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience limit_required or HTTP 500 errors.
91
+ # @option options [string] :team_id
92
+ # encoded team id to list users in, required if org token is used.
90
93
  # @see https://api.slack.com/methods/users.list
91
94
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.list.json
92
95
  def users_list(options = {})
@@ -102,7 +105,7 @@ module Slack
102
105
  #
103
106
  # Find a user with an email address.
104
107
  #
105
- # @option options [Object] :email
108
+ # @option options [string] :email
106
109
  # An email address belonging to a user in the workspace.
107
110
  # @see https://api.slack.com/methods/users.lookupByEmail
108
111
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.lookupByEmail.json
@@ -123,25 +126,24 @@ module Slack
123
126
  #
124
127
  # Set the user profile photo
125
128
  #
126
- # @option options [Object] :image
127
- # File contents via multipart/form-data.
128
- # @option options [Object] :crop_w
129
+ # @option options [string] :crop_w
129
130
  # Width/height of crop box (always square).
130
- # @option options [Object] :crop_x
131
+ # @option options [string] :crop_x
131
132
  # X coordinate of top-left corner of crop box.
132
- # @option options [Object] :crop_y
133
+ # @option options [string] :crop_y
133
134
  # Y coordinate of top-left corner of crop box.
135
+ # @option options [string] :image
136
+ # File contents via multipart/form-data.
134
137
  # @see https://api.slack.com/methods/users.setPhoto
135
138
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setPhoto.json
136
139
  def users_setPhoto(options = {})
137
- throw ArgumentError.new('Required arguments :image missing') if options[:image].nil?
138
140
  post('users.setPhoto', options)
139
141
  end
140
142
 
141
143
  #
142
144
  # Manually sets user presence.
143
145
  #
144
- # @option options [Object] :presence
146
+ # @option options [string] :presence
145
147
  # Either auto or away.
146
148
  # @see https://api.slack.com/methods/users.setPresence
147
149
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setPresence.json
@@ -7,10 +7,10 @@ module Slack
7
7
  module Endpoints
8
8
  module UsersProfile
9
9
  #
10
- # Retrieves a user's profile information.
10
+ # Retrieve a user's profile information, including their custom status.
11
11
  #
12
- # @option options [Object] :include_labels
13
- # Include labels for each ID in custom profile fields.
12
+ # @option options [boolean] :include_labels
13
+ # Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended.
14
14
  # @option options [user] :user
15
15
  # User to retrieve profile info for.
16
16
  # @see https://api.slack.com/methods/users.profile.get
@@ -21,15 +21,15 @@ module Slack
21
21
  end
22
22
 
23
23
  #
24
- # Set the profile information for a user.
24
+ # Set a user's profile information, including custom status.
25
25
  #
26
- # @option options [Object] :name
26
+ # @option options [string] :name
27
27
  # Name of a single key to set. Usable only if profile is not passed.
28
- # @option options [Object] :profile
28
+ # @option options [string] :profile
29
29
  # Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters.
30
30
  # @option options [user] :user
31
31
  # ID of user to change. This argument may only be specified by team admins on paid teams.
32
- # @option options [Object] :value
32
+ # @option options [string] :value
33
33
  # Value to set a single key to. Usable only if profile is not passed.
34
34
  # @see https://api.slack.com/methods/users.profile.set
35
35
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users.profile/users.profile.set.json
@@ -9,9 +9,9 @@ module Slack
9
9
  #
10
10
  # Open a view for a user.
11
11
  #
12
- # @option options [Object] :trigger_id
12
+ # @option options [string] :trigger_id
13
13
  # Exchange a trigger to post to the user.
14
- # @option options [Object] :view
14
+ # @option options [view as string] :view
15
15
  # A view payload. This must be a JSON-encoded string.
16
16
  # @see https://api.slack.com/methods/views.open
17
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.open.json
@@ -29,11 +29,11 @@ module Slack
29
29
  #
30
30
  # Publish a static view for a User.
31
31
  #
32
- # @option options [Object] :user_id
32
+ # @option options [string] :user_id
33
33
  # id of the user you want publish a view to.
34
- # @option options [Object] :view
34
+ # @option options [view as string] :view
35
35
  # A view payload. This must be a JSON-encoded string.
36
- # @option options [Object] :hash
36
+ # @option options [string] :hash
37
37
  # A string that represents view state to protect against possible race conditions.
38
38
  # @see https://api.slack.com/methods/views.publish
39
39
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.publish.json
@@ -51,9 +51,9 @@ module Slack
51
51
  #
52
52
  # Push a view onto the stack of a root view.
53
53
  #
54
- # @option options [Object] :trigger_id
54
+ # @option options [string] :trigger_id
55
55
  # Exchange a trigger to post to the user.
56
- # @option options [Object] :view
56
+ # @option options [view as string] :view
57
57
  # A view payload. This must be a JSON-encoded string.
58
58
  # @see https://api.slack.com/methods/views.push
59
59
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.push.json
@@ -71,14 +71,14 @@ module Slack
71
71
  #
72
72
  # Update an existing view.
73
73
  #
74
- # @option options [Object] :view
75
- # A view payload This must be a JSON-encoded string.
76
- # @option options [Object] :external_id
74
+ # @option options [view as string] :view
75
+ # A view object. This must be a JSON-encoded string.
76
+ # @option options [string] :external_id
77
77
  # A unique identifier of the view set by the developer. Must be unique for all views on a team. Max length of 255 characters. Either view_id or external_id is required.
78
- # @option options [Object] :hash
79
- # A string that represents view state to protect against possible race conditions.
80
- # @option options [Object] :view_id
78
+ # @option options [string] :view_id
81
79
  # A unique identifier of the view to be updated. Either view_id or external_id is required.
80
+ # @option options [string] :hash
81
+ # A string that represents view state to protect against possible race conditions.
82
82
  # @see https://api.slack.com/methods/views.update
83
83
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.update.json
84
84
  def views_update(options = {})
@@ -0,0 +1,61 @@
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 Workflows
9
+ #
10
+ # Indicate that an app's step in a workflow completed execution.
11
+ #
12
+ # @option options [string] :workflow_step_execute_id
13
+ # Context identifier that maps to the correct workflow step execution.
14
+ # @option options [object] :outputs
15
+ # Key-value object of outputs from your step. Keys of this object reflect the configured key properties of your outputs array from your workflow_step object.
16
+ # @see https://api.slack.com/methods/workflows.stepCompleted
17
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows/workflows.stepCompleted.json
18
+ def workflows_stepCompleted(options = {})
19
+ throw ArgumentError.new('Required arguments :workflow_step_execute_id missing') if options[:workflow_step_execute_id].nil?
20
+ post('workflows.stepCompleted', options)
21
+ end
22
+
23
+ #
24
+ # Indicate that an app's step in a workflow failed to execute.
25
+ #
26
+ # @option options [object] :error
27
+ # A JSON-based object with a message property that should contain a human readable error message.
28
+ # @option options [string] :workflow_step_execute_id
29
+ # Context identifier that maps to the correct workflow step execution.
30
+ # @see https://api.slack.com/methods/workflows.stepFailed
31
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows/workflows.stepFailed.json
32
+ def workflows_stepFailed(options = {})
33
+ throw ArgumentError.new('Required arguments :error missing') if options[:error].nil?
34
+ throw ArgumentError.new('Required arguments :workflow_step_execute_id missing') if options[:workflow_step_execute_id].nil?
35
+ post('workflows.stepFailed', options)
36
+ end
37
+
38
+ #
39
+ # Update the configuration for a workflow step.
40
+ #
41
+ # @option options [string] :workflow_step_edit_id
42
+ # A context identifier provided with view_submission payloads used to call back to workflows.updateStep.
43
+ # @option options [object] :inputs
44
+ # A JSON key-value map of inputs required from a user during configuration. This is the data your app expects to receive when the workflow step starts. Please note: the embedded variable format is set and replaced by the workflow system. You cannot create custom variables that will be replaced at runtime. Read more about variables in workflow steps here.
45
+ # @option options [array] :outputs
46
+ # An JSON array of output objects used during step execution. This is the data your app agrees to provide when your workflow step was executed.
47
+ # @option options [string] :step_image_url
48
+ # An optional field that can be used to override app image that is shown in the Workflow Builder.
49
+ # @option options [string] :step_name
50
+ # An optional field that can be used to override the step name that is shown in the Workflow Builder.
51
+ # @see https://api.slack.com/methods/workflows.updateStep
52
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/workflows/workflows.updateStep.json
53
+ def workflows_updateStep(options = {})
54
+ throw ArgumentError.new('Required arguments :workflow_step_edit_id missing') if options[:workflow_step_edit_id].nil?
55
+ post('workflows.updateStep', options)
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -1,11 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
+ require_relative 'endpoints/admin_analytics'
4
5
  require_relative 'endpoints/admin_apps'
5
6
  require_relative 'endpoints/admin_apps_approved'
6
7
  require_relative 'endpoints/admin_apps_requests'
7
8
  require_relative 'endpoints/admin_apps_restricted'
9
+ require_relative 'endpoints/admin_auth_policy'
10
+ require_relative 'endpoints/admin_barriers'
8
11
  require_relative 'endpoints/admin_conversations'
12
+ require_relative 'endpoints/admin_conversations_ekm'
13
+ require_relative 'endpoints/admin_conversations_restrictAccess'
9
14
  require_relative 'endpoints/admin_emoji'
10
15
  require_relative 'endpoints/admin_inviteRequests'
11
16
  require_relative 'endpoints/admin_inviteRequests_approved'
@@ -14,17 +19,19 @@ require_relative 'endpoints/admin_teams'
14
19
  require_relative 'endpoints/admin_teams_admins'
15
20
  require_relative 'endpoints/admin_teams_owners'
16
21
  require_relative 'endpoints/admin_teams_settings'
22
+ require_relative 'endpoints/admin_usergroups'
17
23
  require_relative 'endpoints/admin_users'
18
24
  require_relative 'endpoints/admin_users_session'
19
25
  require_relative 'endpoints/api'
20
26
  require_relative 'endpoints/apps'
21
- require_relative 'endpoints/apps_permissions'
22
- require_relative 'endpoints/apps_permissions_resources'
23
- require_relative 'endpoints/apps_permissions_scopes'
24
- require_relative 'endpoints/apps_permissions_users'
27
+ require_relative 'endpoints/apps_connections'
28
+ require_relative 'endpoints/apps_event_authorizations'
29
+ require_relative 'endpoints/apps_manifest'
25
30
  require_relative 'endpoints/auth'
31
+ require_relative 'endpoints/auth_teams'
26
32
  require_relative 'endpoints/bots'
27
- require_relative 'endpoints/channels'
33
+ require_relative 'endpoints/calls'
34
+ require_relative 'endpoints/calls_participants'
28
35
  require_relative 'endpoints/chat'
29
36
  require_relative 'endpoints/chat_scheduledMessages'
30
37
  require_relative 'endpoints/conversations'
@@ -34,12 +41,10 @@ require_relative 'endpoints/emoji'
34
41
  require_relative 'endpoints/files'
35
42
  require_relative 'endpoints/files_comments'
36
43
  require_relative 'endpoints/files_remote'
37
- require_relative 'endpoints/groups'
38
- require_relative 'endpoints/im'
39
44
  require_relative 'endpoints/migration'
40
- require_relative 'endpoints/mpim'
41
45
  require_relative 'endpoints/oauth'
42
46
  require_relative 'endpoints/oauth_v2'
47
+ require_relative 'endpoints/openid_connect'
43
48
  require_relative 'endpoints/pins'
44
49
  require_relative 'endpoints/reactions'
45
50
  require_relative 'endpoints/reminders'
@@ -47,7 +52,10 @@ require_relative 'endpoints/rtm'
47
52
  require_relative 'endpoints/search'
48
53
  require_relative 'endpoints/stars'
49
54
  require_relative 'endpoints/team'
55
+ require_relative 'endpoints/team_billing'
56
+ require_relative 'endpoints/team_preferences'
50
57
  require_relative 'endpoints/team_profile'
58
+ require_relative 'endpoints/tooling_tokens'
51
59
  require_relative 'endpoints/usergroups'
52
60
  require_relative 'endpoints/usergroups_users'
53
61
  require_relative 'endpoints/users'
@@ -55,20 +63,25 @@ require_relative 'endpoints/users_admin'
55
63
  require_relative 'endpoints/users_prefs'
56
64
  require_relative 'endpoints/users_profile'
57
65
  require_relative 'endpoints/views'
66
+ require_relative 'endpoints/workflows'
58
67
 
59
68
  module Slack
60
69
  module Web
61
70
  module Api
62
71
  module Endpoints
63
- include Slack::Web::Api::Mixins::Channels
72
+ include Slack::Web::Api::Mixins::Conversations
64
73
  include Slack::Web::Api::Mixins::Users
65
- include Slack::Web::Api::Mixins::Groups
66
74
 
75
+ include AdminAnalytics
67
76
  include AdminApps
68
77
  include AdminAppsApproved
69
78
  include AdminAppsRequests
70
79
  include AdminAppsRestricted
80
+ include AdminAuthPolicy
81
+ include AdminBarriers
71
82
  include AdminConversations
83
+ include AdminConversationsEkm
84
+ include AdminConversationsRestrictaccess
72
85
  include AdminEmoji
73
86
  include AdminInviterequests
74
87
  include AdminInviterequestsApproved
@@ -77,17 +90,19 @@ module Slack
77
90
  include AdminTeamsAdmins
78
91
  include AdminTeamsOwners
79
92
  include AdminTeamsSettings
93
+ include AdminUsergroups
80
94
  include AdminUsers
81
95
  include AdminUsersSession
82
96
  include Api
83
97
  include Apps
84
- include AppsPermissions
85
- include AppsPermissionsResources
86
- include AppsPermissionsScopes
87
- include AppsPermissionsUsers
98
+ include AppsConnections
99
+ include AppsEventAuthorizations
100
+ include AppsManifest
88
101
  include Auth
102
+ include AuthTeams
89
103
  include Bots
90
- include Channels
104
+ include Calls
105
+ include CallsParticipants
91
106
  include Chat
92
107
  include ChatScheduledmessages
93
108
  include Conversations
@@ -97,12 +112,10 @@ module Slack
97
112
  include Files
98
113
  include FilesComments
99
114
  include FilesRemote
100
- include Groups
101
- include Im
102
115
  include Migration
103
- include Mpim
104
116
  include Oauth
105
117
  include OauthV2
118
+ include OpenidConnect
106
119
  include Pins
107
120
  include Reactions
108
121
  include Reminders
@@ -110,7 +123,10 @@ module Slack
110
123
  include Search
111
124
  include Stars
112
125
  include Team
126
+ include TeamBilling
127
+ include TeamPreferences
113
128
  include TeamProfile
129
+ include ToolingTokens
114
130
  include Usergroups
115
131
  include UsergroupsUsers
116
132
  include Users
@@ -118,6 +134,7 @@ module Slack
118
134
  include UsersPrefs
119
135
  include UsersProfile
120
136
  include Views
137
+ include Workflows
121
138
  end
122
139
  end
123
140
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ module Slack
3
+ module Web
4
+ module Api
5
+ module Errors
6
+ class ServerError < ::Faraday::Error
7
+ attr_reader :response
8
+
9
+ def initialize(message, response)
10
+ @response = response
11
+ super message
12
+ end
13
+ end
14
+
15
+ class ParsingError < ServerError
16
+ def initialize(response)
17
+ super('parsing_error', response)
18
+ end
19
+ end
20
+
21
+ class HttpRequestError < ServerError; end
22
+
23
+ class TimeoutError < HttpRequestError
24
+ def initialize(response)
25
+ super('timeout_error', response)
26
+ end
27
+ end
28
+
29
+ class UnavailableError < HttpRequestError
30
+ def initialize(response)
31
+ super('unavailable_error', response)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -8,10 +8,7 @@ module Slack
8
8
 
9
9
  def initialize(response)
10
10
  @response = response
11
- end
12
-
13
- def message
14
- "Retry after #{retry_after} seconds"
11
+ super "Retry after #{retry_after} seconds"
15
12
  end
16
13
 
17
14
  def retry_after