slack-ruby-client 0.17.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -0
  3. data/.rubocop_todo.yml +65 -31
  4. data/.travis.yml +1 -0
  5. data/CHANGELOG.md +10 -0
  6. data/CONTRIBUTING.md +3 -3
  7. data/README.md +5 -5
  8. data/RELEASING.md +1 -1
  9. data/UPGRADING.md +42 -0
  10. data/bin/commands/admin_apps.rb +11 -0
  11. data/bin/commands/admin_apps_requests.rb +1 -0
  12. data/bin/commands/admin_auth_policy.rb +39 -0
  13. data/bin/commands/admin_conversations.rb +10 -0
  14. data/bin/commands/admin_conversations_restrictAccess.rb +1 -1
  15. data/bin/commands/admin_users.rb +1 -0
  16. data/bin/commands/admin_users_session.rb +40 -0
  17. data/bin/commands/apps_manifest.rb +51 -0
  18. data/bin/commands/chat.rb +9 -6
  19. data/bin/commands/conversations.rb +59 -2
  20. data/bin/commands/dnd.rb +1 -1
  21. data/bin/commands/files.rb +2 -1
  22. data/bin/commands/oauth.rb +0 -13
  23. data/bin/commands/oauth_v2.rb +13 -1
  24. data/bin/commands/openid_connect.rb +27 -0
  25. data/bin/commands/pins.rb +2 -2
  26. data/bin/commands/reminders.rb +6 -0
  27. data/bin/commands/rtm.rb +2 -2
  28. data/bin/commands/search.rb +2 -1
  29. data/bin/commands/stars.rb +7 -6
  30. data/bin/commands/team_billing.rb +13 -0
  31. data/bin/commands/team_preferences.rb +13 -0
  32. data/bin/commands/tooling_tokens.rb +14 -0
  33. data/bin/commands/usergroups.rb +1 -1
  34. data/bin/commands/users.rb +1 -1
  35. data/bin/commands/views.rb +1 -1
  36. data/bin/commands.rb +6 -8
  37. data/lib/slack/config.rb +1 -2
  38. data/lib/slack/events/request.rb +3 -1
  39. data/lib/slack/real_time/client.rb +4 -5
  40. data/lib/slack/real_time/concurrency/async.rb +6 -8
  41. data/lib/slack/real_time/socket.rb +1 -2
  42. data/lib/slack/real_time/stores/base.rb +1 -6
  43. data/lib/slack/real_time/stores/starter.rb +6 -3
  44. data/lib/slack/real_time/stores/store.rb +5 -0
  45. data/lib/slack/version.rb +1 -1
  46. data/lib/slack/web/api/endpoints/admin_analytics.rb +3 -3
  47. data/lib/slack/web/api/endpoints/admin_apps.rb +21 -5
  48. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  49. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
  50. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  51. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  52. data/lib/slack/web/api/endpoints/admin_barriers.rb +6 -6
  53. data/lib/slack/web/api/endpoints/admin_conversations.rb +38 -24
  54. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +4 -4
  55. data/lib/slack/web/api/endpoints/admin_emoji.rb +9 -9
  56. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  57. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  58. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  59. data/lib/slack/web/api/endpoints/admin_teams.rb +6 -6
  60. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  61. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  62. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  63. data/lib/slack/web/api/endpoints/admin_usergroups.rb +10 -10
  64. data/lib/slack/web/api/endpoints/admin_users.rb +20 -18
  65. data/lib/slack/web/api/endpoints/admin_users_session.rb +65 -9
  66. data/lib/slack/web/api/endpoints/api.rb +1 -1
  67. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  68. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +3 -3
  69. data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
  70. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  71. data/lib/slack/web/api/endpoints/auth_teams.rb +3 -3
  72. data/lib/slack/web/api/endpoints/bots.rb +2 -2
  73. data/lib/slack/web/api/endpoints/calls.rb +15 -15
  74. data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
  75. data/lib/slack/web/api/endpoints/chat.rb +60 -54
  76. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -3
  77. data/lib/slack/web/api/endpoints/conversations.rb +115 -25
  78. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  79. data/lib/slack/web/api/endpoints/dnd.rb +4 -5
  80. data/lib/slack/web/api/endpoints/files.rb +16 -14
  81. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  82. data/lib/slack/web/api/endpoints/files_remote.rb +20 -20
  83. data/lib/slack/web/api/endpoints/migration.rb +3 -3
  84. data/lib/slack/web/api/endpoints/oauth.rb +5 -27
  85. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  86. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  87. data/lib/slack/web/api/endpoints/pins.rb +4 -4
  88. data/lib/slack/web/api/endpoints/reactions.rb +12 -12
  89. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  90. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  91. data/lib/slack/web/api/endpoints/search.rb +24 -16
  92. data/lib/slack/web/api/endpoints/stars.rb +11 -9
  93. data/lib/slack/web/api/endpoints/team.rb +8 -8
  94. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  95. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  96. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  97. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  98. data/lib/slack/web/api/endpoints/usergroups.rb +19 -19
  99. data/lib/slack/web/api/endpoints/usergroups_users.rb +7 -7
  100. data/lib/slack/web/api/endpoints/users.rb +16 -16
  101. data/lib/slack/web/api/endpoints/users_profile.rb +4 -4
  102. data/lib/slack/web/api/endpoints/views.rb +12 -12
  103. data/lib/slack/web/api/endpoints/workflows.rb +9 -9
  104. data/lib/slack/web/api/endpoints.rb +12 -18
  105. data/lib/slack/web/api/errors/server_error.rb +37 -0
  106. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  107. data/lib/slack/web/api/errors.rb +200 -8
  108. data/lib/slack/web/api/mixins.rb +0 -2
  109. data/lib/slack/web/api/patches/chat.1.patch +1 -2
  110. data/lib/slack/web/api/templates/endpoints.erb +0 -2
  111. data/lib/slack/web/faraday/request.rb +2 -1
  112. data/lib/slack/web/faraday/response/raise_error.rb +1 -1
  113. data/lib/slack/web/faraday/response/wrap_error.rb +2 -2
  114. data/lib/slack/web/pagination/cursor.rb +1 -5
  115. data/lib/slack-ruby-client.rb +1 -1
  116. data/slack-ruby-client.gemspec +2 -3
  117. data/spec/fixtures/slack/web/429_error.yml +50 -54
  118. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  119. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  120. data/spec/fixtures/slack/web/conversations_info.yml +133 -9
  121. data/spec/fixtures/slack/web/conversations_setTopic.yml +42 -27
  122. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +89 -59
  123. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +131 -86
  124. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  125. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  126. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  127. data/spec/fixtures/slack/web/users_info.yml +153 -69
  128. data/spec/fixtures/slack/web/users_list.yml +102 -41
  129. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  130. data/spec/slack/real_time/client_spec.rb +17 -21
  131. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  132. data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
  133. data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
  134. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  135. data/spec/slack/slack_spec.rb +3 -1
  136. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
  137. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  138. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +14 -9
  139. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +1 -1
  140. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
  141. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +22 -2
  142. data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
  143. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  144. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  145. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
  146. data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
  147. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  148. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +1 -1
  149. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  150. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  151. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  152. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  153. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
  154. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  155. data/spec/slack/web/api/endpoints/{im_spec.rb → openid_connect_spec.rb} +1 -1
  156. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  157. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  158. data/spec/slack/web/api/endpoints/{mpim_spec.rb → team_billing_spec.rb} +1 -1
  159. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → team_preferences_spec.rb} +1 -1
  160. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  161. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  162. data/spec/slack/web/api/error_spec.rb +5 -7
  163. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  164. data/spec/slack/web/api/mixins/conversations_list_spec.rb +1 -1
  165. data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
  166. data/spec/slack/web/client_spec.rb +7 -6
  167. data/spec/slack/web/faraday/request_spec.rb +80 -0
  168. data/spec/slack/web/faraday/response/raise_error_spec.rb +1 -0
  169. data/spec/spec_helper.rb +1 -1
  170. data/spec/support/real_time/connected_client.rb +1 -7
  171. data/spec/support/vcr.rb +33 -2
  172. metadata +28 -144
  173. data/lib/slack/web/api/errors/internal_error.rb +0 -14
  174. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  175. data/lib/slack/web/api/mixins/channels.id.rb +0 -25
  176. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  177. data/lib/slack/web/api/mixins/groups.id.rb +0 -25
  178. data/spec/fixtures/slack/web/503_error.yml +0 -14
  179. data/spec/fixtures/slack/web/channels_info.yml +0 -139
  180. data/spec/slack/web/api/endpoints/apps_permissions_resources_spec.rb +0 -8
  181. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  182. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  183. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -109
  184. data/spec/slack/web/api/mixins/channels_spec.rb +0 -43
  185. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
@@ -9,17 +9,17 @@ module Slack
9
9
  #
10
10
  # Adds a file from a remote service
11
11
  #
12
- # @option options [Object] :external_id
12
+ # @option options [string] :external_id
13
13
  # Creator defined GUID for the file.
14
- # @option options [Object] :external_url
14
+ # @option options [string] :external_url
15
15
  # URL of the remote file.
16
- # @option options [Object] :title
16
+ # @option options [string] :title
17
17
  # Title of the file being shared.
18
- # @option options [Object] :filetype
18
+ # @option options [string] :filetype
19
19
  # type of file.
20
- # @option options [Object] :indexable_file_contents
20
+ # @option options [string] :indexable_file_contents
21
21
  # A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file.
22
- # @option options [Object] :preview_image
22
+ # @option options [string] :preview_image
23
23
  # Preview of the document via multipart/form-data.
24
24
  # @see https://api.slack.com/methods/files.remote.add
25
25
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.add.json
@@ -33,7 +33,7 @@ module Slack
33
33
  #
34
34
  # Retrieve information about a remote file added to Slack
35
35
  #
36
- # @option options [Object] :external_id
36
+ # @option options [string] :external_id
37
37
  # Creator defined GUID for the file.
38
38
  # @option options [file] :file
39
39
  # Specify a file by providing its ID.
@@ -48,13 +48,13 @@ module Slack
48
48
  #
49
49
  # @option options [channel] :channel
50
50
  # Filter files appearing in a specific channel, indicated by its ID.
51
- # @option options [Object] :cursor
51
+ # @option options [string] :cursor
52
52
  # Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
53
- # @option options [Object] :limit
53
+ # @option options [integer] :limit
54
54
  # The maximum number of items to return.
55
- # @option options [Object] :ts_from
55
+ # @option options [string] :ts_from
56
56
  # Filter files created after this timestamp (inclusive).
57
- # @option options [Object] :ts_to
57
+ # @option options [string] :ts_to
58
58
  # Filter files created before this timestamp (inclusive).
59
59
  # @see https://api.slack.com/methods/files.remote.list
60
60
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.list.json
@@ -72,7 +72,7 @@ module Slack
72
72
  #
73
73
  # Remove a remote file.
74
74
  #
75
- # @option options [Object] :external_id
75
+ # @option options [string] :external_id
76
76
  # Creator defined GUID for the file.
77
77
  # @option options [file] :file
78
78
  # Specify a file by providing its ID.
@@ -85,9 +85,9 @@ module Slack
85
85
  #
86
86
  # Share a remote file into a channel.
87
87
  #
88
- # @option options [Object] :channels
88
+ # @option options [string] :channels
89
89
  # Comma-separated list of channel IDs where the file will be shared.
90
- # @option options [Object] :external_id
90
+ # @option options [string] :external_id
91
91
  # The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or file or both are required.
92
92
  # @option options [file] :file
93
93
  # Specify a file registered with Slack by providing its ID. Either this field or external_id or both are required.
@@ -101,19 +101,19 @@ module Slack
101
101
  #
102
102
  # Updates an existing remote file.
103
103
  #
104
- # @option options [Object] :external_id
104
+ # @option options [string] :external_id
105
105
  # Creator defined GUID for the file.
106
- # @option options [Object] :external_url
106
+ # @option options [string] :external_url
107
107
  # URL of the remote file.
108
108
  # @option options [file] :file
109
109
  # Specify a file by providing its ID.
110
- # @option options [Object] :filetype
110
+ # @option options [string] :filetype
111
111
  # type of file.
112
- # @option options [Object] :indexable_file_contents
112
+ # @option options [string] :indexable_file_contents
113
113
  # File containing contents that can be used to improve searchability for the remote file.
114
- # @option options [Object] :preview_image
114
+ # @option options [string] :preview_image
115
115
  # Preview of the document via multipart/form-data.
116
- # @option options [Object] :title
116
+ # @option options [string] :title
117
117
  # Title of the file being shared.
118
118
  # @see https://api.slack.com/methods/files.remote.update
119
119
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.update.json
@@ -9,11 +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] :team_id
14
+ # @option options [string] :team_id
15
15
  # Specify team_id starts with T in case of Org Token.
16
- # @option options [Object] :to_old
16
+ # @option options [boolean] :to_old
17
17
  # Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.
18
18
  # @see https://api.slack.com/methods/migration.exchange
19
19
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/migration/migration.exchange.json
@@ -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
@@ -10,9 +10,9 @@ module Slack
10
10
  # Pins an item to a channel.
11
11
  #
12
12
  # @option options [channel] :channel
13
- # Channel to pin the item in.
14
- # @option options [Object] :timestamp
15
- # Timestamp of the message to pin.
13
+ # Channel to pin the messsage to. You must also include a timestamp when pinning messages.
14
+ # @option options [string] :timestamp
15
+ # Timestamp of the message to pin. You must also include the channel.
16
16
  # @see https://api.slack.com/methods/pins.add
17
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.add.json
18
18
  def pins_add(options = {})
@@ -39,7 +39,7 @@ module Slack
39
39
  #
40
40
  # @option options [channel] :channel
41
41
  # Channel where the item is pinned to.
42
- # @option options [Object] :timestamp
42
+ # @option options [string] :timestamp
43
43
  # Timestamp of the message to un-pin.
44
44
  # @see https://api.slack.com/methods/pins.remove
45
45
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.remove.json
@@ -11,9 +11,9 @@ module Slack
11
11
  #
12
12
  # @option options [channel] :channel
13
13
  # Channel where the message to add reaction to was posted.
14
- # @option options [Object] :name
14
+ # @option options [string] :name
15
15
  # Reaction (emoji) name.
16
- # @option options [Object] :timestamp
16
+ # @option options [string] :timestamp
17
17
  # Timestamp of the message to add reaction to.
18
18
  # @see https://api.slack.com/methods/reactions.add
19
19
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.add.json
@@ -32,11 +32,11 @@ module Slack
32
32
  # Channel where the message to get reactions for was posted.
33
33
  # @option options [file] :file
34
34
  # File to get reactions for.
35
- # @option options [Object] :file_comment
35
+ # @option options [string] :file_comment
36
36
  # File comment to get reactions for.
37
- # @option options [Object] :full
37
+ # @option options [boolean] :full
38
38
  # If true always return the complete reaction list.
39
- # @option options [Object] :timestamp
39
+ # @option options [string] :timestamp
40
40
  # Timestamp of the message to get reactions for.
41
41
  # @see https://api.slack.com/methods/reactions.get
42
42
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.get.json
@@ -48,13 +48,13 @@ module Slack
48
48
  #
49
49
  # Lists reactions made by a user.
50
50
  #
51
- # @option options [Object] :cursor
51
+ # @option options [string] :cursor
52
52
  # Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See pagination for more details.
53
- # @option options [Object] :full
53
+ # @option options [boolean] :full
54
54
  # If true always return the complete reaction list.
55
- # @option options [Object] :limit
55
+ # @option options [integer] :limit
56
56
  # The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.
57
- # @option options [Object] :team_id
57
+ # @option options [string] :team_id
58
58
  # encoded team id to list reactions in, required if org token is used.
59
59
  # @option options [user] :user
60
60
  # Show reactions made by this user. Defaults to the authed user.
@@ -74,15 +74,15 @@ module Slack
74
74
  #
75
75
  # Removes a reaction from an item.
76
76
  #
77
- # @option options [Object] :name
77
+ # @option options [string] :name
78
78
  # Reaction (emoji) name.
79
79
  # @option options [channel] :channel
80
80
  # Channel where the message to remove reaction from was posted.
81
81
  # @option options [file] :file
82
82
  # File to remove reaction from.
83
- # @option options [Object] :file_comment
83
+ # @option options [string] :file_comment
84
84
  # File comment to remove reaction from.
85
- # @option options [Object] :timestamp
85
+ # @option options [string] :timestamp
86
86
  # Timestamp of the message to remove reaction from.
87
87
  # @see https://api.slack.com/methods/reactions.remove
88
88
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.remove.json
@@ -9,10 +9,14 @@ module Slack
9
9
  #
10
10
  # Creates a reminder.
11
11
  #
12
- # @option options [Object] :text
12
+ # @option options [string] :text
13
13
  # The content of the reminder.
14
- # @option options [Object] :time
14
+ # @option options [string] :time
15
15
  # When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday").
16
+ # @option options [object] :recurrence
17
+ # Specify the repeating behavior of a reminder. Available options: daily, weekly, monthly, or yearly. If weekly, may further specify the days of the week.
18
+ # @option options [string] :team_id
19
+ # Encoded team id, required if org token is used.
16
20
  # @option options [user] :user
17
21
  # The user who will receive the reminder. If no user is specified, the reminder will go to user who created it.
18
22
  # @see https://api.slack.com/methods/reminders.add
@@ -27,8 +31,10 @@ module Slack
27
31
  #
28
32
  # Marks a reminder as complete.
29
33
  #
30
- # @option options [Object] :reminder
34
+ # @option options [string] :reminder
31
35
  # The ID of the reminder to be marked as complete.
36
+ # @option options [string] :team_id
37
+ # Encoded team id, required if org token is used.
32
38
  # @see https://api.slack.com/methods/reminders.complete
33
39
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.complete.json
34
40
  def reminders_complete(options = {})
@@ -39,8 +45,10 @@ module Slack
39
45
  #
40
46
  # Deletes a reminder.
41
47
  #
42
- # @option options [Object] :reminder
48
+ # @option options [string] :reminder
43
49
  # The ID of the reminder.
50
+ # @option options [string] :team_id
51
+ # Encoded team id, required if org token is used.
44
52
  # @see https://api.slack.com/methods/reminders.delete
45
53
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.delete.json
46
54
  def reminders_delete(options = {})
@@ -51,8 +59,10 @@ module Slack
51
59
  #
52
60
  # Gets information about a reminder.
53
61
  #
54
- # @option options [Object] :reminder
62
+ # @option options [string] :reminder
55
63
  # The ID of the reminder.
64
+ # @option options [string] :team_id
65
+ # Encoded team id, required if org token is passed.
56
66
  # @see https://api.slack.com/methods/reminders.info
57
67
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.info.json
58
68
  def reminders_info(options = {})
@@ -63,6 +73,8 @@ module Slack
63
73
  #
64
74
  # Lists all reminders created by or for a given user.
65
75
  #
76
+ # @option options [string] :team_id
77
+ # Encoded team id, required if org token is passed.
66
78
  # @see https://api.slack.com/methods/reminders.list
67
79
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.list.json
68
80
  def reminders_list(options = {})
@@ -9,9 +9,9 @@ module Slack
9
9
  #
10
10
  # Starts a Real Time Messaging session.
11
11
  #
12
- # @option options [Object] :batch_presence_aware
12
+ # @option options [boolean] :batch_presence_aware
13
13
  # Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence.
14
- # @option options [Object] :presence_sub
14
+ # @option options [boolean] :presence_sub
15
15
  # Only deliver presence events when requested by subscription. See presence subscriptions.
16
16
  # @see https://api.slack.com/methods/rtm.connect
17
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/rtm/rtm.connect.json
@@ -20,21 +20,21 @@ module Slack
20
20
  end
21
21
 
22
22
  #
23
- # Starts a Real Time Messaging session.
23
+ # Deprecated: Starts a Real Time Messaging session. Use rtm.connect instead.
24
24
  #
25
- # @option options [Object] :batch_presence_aware
25
+ # @option options [boolean] :batch_presence_aware
26
26
  # Batch presence deliveries via subscription. Enabling changes the shape of presence_change events. See batch presence.
27
- # @option options [Object] :include_locale
27
+ # @option options [boolean] :include_locale
28
28
  # Set this to true to receive the locale for users and channels. Defaults to false.
29
- # @option options [Object] :mpim_aware
29
+ # @option options [boolean] :mpim_aware
30
30
  # Returns MPIMs to the client in the API response.
31
- # @option options [Object] :no_latest
31
+ # @option options [boolean] :no_latest
32
32
  # Exclude latest timestamps for channels, groups, mpims, and ims. Automatically sets no_unreads to 1.
33
- # @option options [Object] :no_unreads
33
+ # @option options [boolean] :no_unreads
34
34
  # Skip unread counts for each channel (improves performance).
35
- # @option options [Object] :presence_sub
35
+ # @option options [boolean] :presence_sub
36
36
  # Only deliver presence events when requested by subscription. See presence subscriptions.
37
- # @option options [Object] :simple_latest
37
+ # @option options [boolean] :simple_latest
38
38
  # Return timestamp only for latest message object of each channel (improves performance).
39
39
  # @see https://api.slack.com/methods/rtm.start
40
40
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/rtm/rtm.start.json
@@ -9,15 +9,15 @@ module Slack
9
9
  #
10
10
  # Searches for messages and files matching a query.
11
11
  #
12
- # @option options [Object] :query
12
+ # @option options [string] :query
13
13
  # Search query. May contains booleans, etc.
14
- # @option options [Object] :highlight
14
+ # @option options [boolean] :highlight
15
15
  # Pass a value of true to enable query highlight markers (see below).
16
- # @option options [Object] :sort
16
+ # @option options [string] :sort
17
17
  # Return matches sorted by either score or timestamp.
18
- # @option options [Object] :sort_dir
18
+ # @option options [string] :sort_dir
19
19
  # Change sort direction to ascending (asc) or descending (desc).
20
- # @option options [Object] :team_id
20
+ # @option options [string] :team_id
21
21
  # encoded team id to search in, required if org token is used.
22
22
  # @see https://api.slack.com/methods/search.all
23
23
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.all.json
@@ -29,15 +29,15 @@ module Slack
29
29
  #
30
30
  # Searches for files matching a query.
31
31
  #
32
- # @option options [Object] :query
32
+ # @option options [string] :query
33
33
  # Search query.
34
- # @option options [Object] :highlight
34
+ # @option options [boolean] :highlight
35
35
  # Pass a value of true to enable query highlight markers (see below).
36
- # @option options [Object] :sort
36
+ # @option options [string] :sort
37
37
  # Return matches sorted by either score or timestamp.
38
- # @option options [Object] :sort_dir
38
+ # @option options [string] :sort_dir
39
39
  # Change sort direction to ascending (asc) or descending (desc).
40
- # @option options [Object] :team_id
40
+ # @option options [string] :team_id
41
41
  # encoded team id to search in, required if org token is used.
42
42
  # @see https://api.slack.com/methods/search.files
43
43
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.files.json
@@ -49,21 +49,29 @@ module Slack
49
49
  #
50
50
  # Searches for messages matching a query.
51
51
  #
52
- # @option options [Object] :query
52
+ # @option options [string] :query
53
53
  # Search query.
54
- # @option options [Object] :highlight
54
+ # @option options [string] :cursor
55
+ # Use this when getting results with cursormark pagination. For first call send * for subsequent calls, send the value of next_cursor returned in the previous call's results.
56
+ # @option options [boolean] :highlight
55
57
  # Pass a value of true to enable query highlight markers (see below).
56
- # @option options [Object] :sort
58
+ # @option options [string] :sort
57
59
  # Return matches sorted by either score or timestamp.
58
- # @option options [Object] :sort_dir
60
+ # @option options [string] :sort_dir
59
61
  # Change sort direction to ascending (asc) or descending (desc).
60
- # @option options [Object] :team_id
62
+ # @option options [string] :team_id
61
63
  # encoded team id to search in, required if org token is used.
62
64
  # @see https://api.slack.com/methods/search.messages
63
65
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.messages.json
64
66
  def search_messages(options = {})
65
67
  throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
66
- post('search.messages', options)
68
+ if block_given?
69
+ Pagination::Cursor.new(self, :search_messages, options).each do |page|
70
+ yield page
71
+ end
72
+ else
73
+ post('search.messages', options)
74
+ end
67
75
  end
68
76
  end
69
77
  end
@@ -7,15 +7,15 @@ module Slack
7
7
  module Endpoints
8
8
  module Stars
9
9
  #
10
- # Adds a star to an item.
10
+ # Save an item for later. Formerly known as _adding a star_.
11
11
  #
12
12
  # @option options [channel] :channel
13
13
  # Channel to add star to, or channel where the message to add star to was posted (used with timestamp).
14
14
  # @option options [file] :file
15
15
  # File to add star to.
16
- # @option options [Object] :file_comment
16
+ # @option options [string] :file_comment
17
17
  # File comment to add star to.
18
- # @option options [Object] :timestamp
18
+ # @option options [string] :timestamp
19
19
  # Timestamp of the message to add star to.
20
20
  # @see https://api.slack.com/methods/stars.add
21
21
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.add.json
@@ -25,12 +25,14 @@ module Slack
25
25
  end
26
26
 
27
27
  #
28
- # Lists stars for a user.
28
+ # List a user's saved items, formerly known as _stars_.
29
29
  #
30
- # @option options [Object] :cursor
30
+ # @option options [string] :cursor
31
31
  # Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See pagination for more details.
32
- # @option options [Object] :limit
32
+ # @option options [integer] :limit
33
33
  # The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.
34
+ # @option options [string] :team_id
35
+ # encoded team id to list stars in, required if org token is used.
34
36
  # @see https://api.slack.com/methods/stars.list
35
37
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.list.json
36
38
  def stars_list(options = {})
@@ -44,15 +46,15 @@ module Slack
44
46
  end
45
47
 
46
48
  #
47
- # Removes a star from an item.
49
+ # Removes a saved item (star) from an item.
48
50
  #
49
51
  # @option options [channel] :channel
50
52
  # Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).
51
53
  # @option options [file] :file
52
54
  # File to remove star from.
53
- # @option options [Object] :file_comment
55
+ # @option options [string] :file_comment
54
56
  # File comment to remove star from.
55
- # @option options [Object] :timestamp
57
+ # @option options [string] :timestamp
56
58
  # Timestamp of the message to remove star from.
57
59
  # @see https://api.slack.com/methods/stars.remove
58
60
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.remove.json
@@ -9,9 +9,9 @@ module Slack
9
9
  #
10
10
  # Gets the access logs for the current team.
11
11
  #
12
- # @option options [Object] :before
12
+ # @option options [string] :before
13
13
  # End of time range of logs to include in results (inclusive).
14
- # @option options [Object] :team_id
14
+ # @option options [string] :team_id
15
15
  # encoded team id to get logs from, required if org token is used.
16
16
  # @see https://api.slack.com/methods/team.accessLogs
17
17
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.accessLogs.json
@@ -22,7 +22,7 @@ module Slack
22
22
  #
23
23
  # Gets billable users information for the current team.
24
24
  #
25
- # @option options [Object] :team_id
25
+ # @option options [string] :team_id
26
26
  # encoded team id to get the billable information from, required if org token is used.
27
27
  # @option options [user] :user
28
28
  # A user to retrieve the billable information for. Defaults to all users.
@@ -36,7 +36,7 @@ module Slack
36
36
  #
37
37
  # Gets information about the current team.
38
38
  #
39
- # @option options [Object] :team
39
+ # @option options [string] :team
40
40
  # Team to get info on, if omitted, will return information about the current team. Will only return team that the authenticated token is allowed to see through external shared channels.
41
41
  # @see https://api.slack.com/methods/team.info
42
42
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.info.json
@@ -47,13 +47,13 @@ module Slack
47
47
  #
48
48
  # Gets the integration logs for the current team.
49
49
  #
50
- # @option options [Object] :app_id
50
+ # @option options [string] :app_id
51
51
  # Filter logs to this Slack app. Defaults to all logs.
52
- # @option options [Object] :change_type
52
+ # @option options [string] :change_type
53
53
  # Filter logs with this change type. Defaults to all logs.
54
- # @option options [Object] :service_id
54
+ # @option options [string] :service_id
55
55
  # Filter logs to this service. Defaults to all logs.
56
- # @option options [Object] :team_id
56
+ # @option options [string] :team_id
57
57
  # encoded team id to get logs from, required if org token is used.
58
58
  # @option options [user] :user
59
59
  # Filter logs generated by this user's actions. Defaults to all logs.
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module TeamBilling
9
+ #
10
+ # Reads a workspace's billing plan information.
11
+ #
12
+ # @see https://api.slack.com/methods/team.billing.info
13
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.billing/team.billing.info.json
14
+ def team_billing_info(options = {})
15
+ post('team.billing.info', options)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end