slack-ruby-client 0.14.5 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.rubocop.yml +11 -3
- data/.rubocop_todo.yml +61 -23
- data/.travis.yml +1 -5
- data/CHANGELOG.md +43 -4
- data/CONTRIBUTING.md +17 -6
- data/Dangerfile +1 -1
- data/Gemfile +1 -2
- data/LICENSE.md +1 -1
- data/README.md +86 -52
- data/UPGRADING.md +20 -2
- data/bin/commands.rb +23 -0
- data/bin/commands/admin_analytics.rb +16 -0
- data/bin/commands/admin_apps.rb +15 -2
- data/bin/commands/admin_apps_approved.rb +17 -0
- data/bin/commands/admin_apps_restricted.rb +17 -0
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +159 -0
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
- data/bin/commands/admin_conversations_whitelist.rb +37 -0
- data/bin/commands/admin_emoji.rb +54 -0
- data/bin/commands/admin_inviteRequests.rb +36 -0
- data/bin/commands/admin_inviteRequests_approved.rb +16 -0
- data/bin/commands/admin_inviteRequests_denied.rb +16 -0
- data/bin/commands/admin_teams.rb +27 -0
- data/bin/commands/admin_teams_admins.rb +16 -0
- data/bin/commands/admin_teams_owners.rb +16 -0
- data/bin/commands/admin_teams_settings.rb +64 -0
- data/bin/commands/admin_usergroups.rb +48 -0
- data/bin/commands/admin_users.rb +97 -0
- data/bin/commands/admin_users_session.rb +22 -0
- data/bin/commands/api.rb +0 -1
- data/bin/commands/apps_connections.rb +13 -0
- data/bin/commands/apps_event_authorizations.rb +16 -0
- data/bin/commands/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +1 -0
- data/bin/commands/calls.rb +52 -0
- data/bin/commands/calls_participants.rb +25 -0
- data/bin/commands/channels.rb +1 -155
- data/bin/commands/chat.rb +14 -12
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +15 -4
- data/bin/commands/dnd.rb +3 -1
- data/bin/commands/files.rb +7 -5
- data/bin/commands/files_remote.rb +3 -3
- data/bin/commands/groups.rb +1 -162
- data/bin/commands/im.rb +1 -63
- data/bin/commands/migration.rb +1 -0
- data/bin/commands/mpim.rb +1 -61
- data/bin/commands/oauth.rb +1 -1
- data/bin/commands/pins.rb +0 -2
- data/bin/commands/reactions.rb +1 -0
- data/bin/commands/search.rb +4 -1
- data/bin/commands/team.rb +3 -0
- data/bin/commands/usergroups.rb +6 -1
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users.rb +5 -3
- data/bin/commands/users_profile.rb +5 -5
- data/bin/commands/views.rb +1 -1
- data/bin/commands/workflows.rb +38 -0
- data/lib/slack-ruby-client.rb +5 -4
- data/lib/slack/events/request.rb +7 -3
- data/lib/slack/messages/message.rb +0 -4
- data/lib/slack/real_time/client.rb +2 -1
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/concurrency/async.rb +1 -3
- data/lib/slack/real_time/config.rb +5 -14
- data/lib/slack/real_time/models/base.rb +0 -4
- data/lib/slack/real_time/socket.rb +2 -2
- data/lib/slack/real_time/stores/base.rb +3 -1
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +47 -0
- data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +22 -2
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +246 -0
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +161 -0
- data/lib/slack/web/api/endpoints/admin_users_session.rb +38 -0
- data/lib/slack/web/api/endpoints/api.rb +0 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +2 -0
- data/lib/slack/web/api/endpoints/calls.rb +83 -0
- data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
- data/lib/slack/web/api/endpoints/channels.rb +1 -245
- data/lib/slack/web/api/endpoints/chat.rb +23 -19
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -1
- data/lib/slack/web/api/endpoints/conversations.rb +37 -19
- data/lib/slack/web/api/endpoints/dnd.rb +4 -0
- data/lib/slack/web/api/endpoints/files.rb +8 -4
- data/lib/slack/web/api/endpoints/files_remote.rb +4 -4
- data/lib/slack/web/api/endpoints/groups.rb +0 -253
- data/lib/slack/web/api/endpoints/im.rb +0 -101
- data/lib/slack/web/api/endpoints/migration.rb +2 -0
- data/lib/slack/web/api/endpoints/mpim.rb +0 -96
- data/lib/slack/web/api/endpoints/oauth.rb +1 -4
- data/lib/slack/web/api/endpoints/pins.rb +3 -8
- data/lib/slack/web/api/endpoints/reactions.rb +5 -3
- data/lib/slack/web/api/endpoints/search.rb +6 -0
- data/lib/slack/web/api/endpoints/stars.rb +2 -2
- data/lib/slack/web/api/endpoints/team.rb +6 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
- data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
- data/lib/slack/web/api/endpoints/users.rb +7 -5
- data/lib/slack/web/api/endpoints/users_profile.rb +3 -3
- data/lib/slack/web/api/endpoints/views.rb +1 -1
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/errors.rb +848 -0
- data/lib/slack/web/api/errors/internal_error.rb +14 -0
- data/lib/slack/web/api/errors/slack_error.rb +12 -0
- data/lib/slack/web/api/mixins.rb +1 -0
- data/lib/slack/web/api/mixins/channels.id.rb +1 -3
- data/lib/slack/web/api/mixins/conversations.id.rb +25 -0
- data/lib/slack/web/api/mixins/groups.id.rb +1 -3
- data/lib/slack/web/api/mixins/ids.id.rb +3 -5
- data/lib/slack/web/api/mixins/users.id.rb +1 -3
- data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +26 -24
- data/lib/slack/web/api/templates/endpoints.erb +1 -0
- data/lib/slack/web/api/templates/errors.erb +20 -0
- data/lib/slack/web/api/templates/method.erb +4 -1
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/client.rb +1 -1
- data/lib/slack/web/config.rb +2 -0
- data/lib/slack/web/faraday/connection.rb +23 -20
- data/lib/slack/web/faraday/response/raise_error.rb +16 -2
- data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
- data/lib/slack/web/pagination/cursor.rb +2 -2
- data/lib/tasks/real_time.rake +1 -1
- data/lib/tasks/web.rake +21 -4
- data/slack-ruby-client.gemspec +5 -5
- data/spec/fixtures/slack/web/channels_info.yml +108 -15
- data/spec/fixtures/slack/web/{groups_info.yml → conversations_info.yml} +4 -4
- data/spec/fixtures/slack/web/conversations_setTopic.yml +69 -0
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +142 -0
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +208 -0
- data/spec/fixtures/slack/web/views_open_error.yml +76 -0
- data/spec/slack/events/request_spec.rb +13 -8
- data/spec/slack/real_time/client_spec.rb +18 -1
- data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
- data/spec/slack/real_time/rtm_start_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +93 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +67 -0
- data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +20 -12
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/im_spec.rb +0 -31
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -31
- data/spec/slack/web/api/endpoints/oauth_spec.rb +3 -14
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/api/errors/slack_error_spec.rb +22 -0
- data/spec/slack/web/api/mixins/channels_spec.rb +1 -1
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +43 -0
- data/spec/slack/web/api/mixins/groups_spec.rb +1 -1
- data/spec/slack/web/api/mixins/users_spec.rb +1 -1
- data/spec/slack/web/client_spec.rb +121 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +33 -9
- data/spec/support/vcr.rb +4 -0
- metadata +145 -55
- data/examples/hi_real_time/Gemfile +0 -6
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -41
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
- data/examples/hi_real_time_async_celluloid/Procfile +0 -2
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
- data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
- data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
- data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
@@ -6,107 +6,6 @@ module Slack
|
|
6
6
|
module Api
|
7
7
|
module Endpoints
|
8
8
|
module Im
|
9
|
-
#
|
10
|
-
# Close a direct message channel.
|
11
|
-
#
|
12
|
-
# @option options [im] :channel
|
13
|
-
# Direct message channel to close.
|
14
|
-
# @see https://api.slack.com/methods/im.close
|
15
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.close.json
|
16
|
-
def im_close(options = {})
|
17
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
18
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
19
|
-
post('im.close', options)
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# Fetches history of messages and events from direct message channel.
|
24
|
-
#
|
25
|
-
# @option options [im] :channel
|
26
|
-
# Direct message channel to fetch history for.
|
27
|
-
# @option options [Object] :inclusive
|
28
|
-
# Include messages with latest or oldest timestamp in results.
|
29
|
-
# @option options [timestamp] :latest
|
30
|
-
# End of time range of messages to include in results.
|
31
|
-
# @option options [timestamp] :oldest
|
32
|
-
# Start of time range of messages to include in results.
|
33
|
-
# @option options [Object] :unreads
|
34
|
-
# Include unread_count_display in the output?.
|
35
|
-
# @see https://api.slack.com/methods/im.history
|
36
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.history.json
|
37
|
-
def im_history(options = {})
|
38
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
39
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
40
|
-
post('im.history', options)
|
41
|
-
end
|
42
|
-
|
43
|
-
#
|
44
|
-
# Lists direct message channels for the calling user.
|
45
|
-
#
|
46
|
-
# @option options [Object] :cursor
|
47
|
-
# Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
|
48
|
-
# @option options [Object] :limit
|
49
|
-
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
|
50
|
-
# @see https://api.slack.com/methods/im.list
|
51
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.list.json
|
52
|
-
def im_list(options = {})
|
53
|
-
if block_given?
|
54
|
-
Pagination::Cursor.new(self, :im_list, options).each do |page|
|
55
|
-
yield page
|
56
|
-
end
|
57
|
-
else
|
58
|
-
post('im.list', options)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
#
|
63
|
-
# Sets the read cursor in a direct message channel.
|
64
|
-
#
|
65
|
-
# @option options [im] :channel
|
66
|
-
# Direct message channel to set reading cursor in.
|
67
|
-
# @option options [timestamp] :ts
|
68
|
-
# Timestamp of the most recently seen message.
|
69
|
-
# @see https://api.slack.com/methods/im.mark
|
70
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.mark.json
|
71
|
-
def im_mark(options = {})
|
72
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
73
|
-
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
74
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
75
|
-
post('im.mark', options)
|
76
|
-
end
|
77
|
-
|
78
|
-
#
|
79
|
-
# Opens a direct message channel.
|
80
|
-
#
|
81
|
-
# @option options [user] :user
|
82
|
-
# User to open a direct message channel with.
|
83
|
-
# @option options [Object] :include_locale
|
84
|
-
# Set this to true to receive the locale for this im. Defaults to false.
|
85
|
-
# @option options [Object] :return_im
|
86
|
-
# Boolean, indicates you want the full IM channel definition in the response.
|
87
|
-
# @see https://api.slack.com/methods/im.open
|
88
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.open.json
|
89
|
-
def im_open(options = {})
|
90
|
-
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
91
|
-
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
92
|
-
post('im.open', options)
|
93
|
-
end
|
94
|
-
|
95
|
-
#
|
96
|
-
# Retrieve a thread of messages posted to a direct message conversation
|
97
|
-
#
|
98
|
-
# @option options [im] :channel
|
99
|
-
# Direct message channel to fetch thread from.
|
100
|
-
# @option options [Object] :thread_ts
|
101
|
-
# Unique identifier of a thread's parent message.
|
102
|
-
# @see https://api.slack.com/methods/im.replies
|
103
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/im/im.replies.json
|
104
|
-
def im_replies(options = {})
|
105
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
106
|
-
throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
|
107
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
108
|
-
post('im.replies', options)
|
109
|
-
end
|
110
9
|
end
|
111
10
|
end
|
112
11
|
end
|
@@ -11,6 +11,8 @@ module Slack
|
|
11
11
|
#
|
12
12
|
# @option options [Object] :users
|
13
13
|
# A comma-separated list of user ids, up to 400 per request.
|
14
|
+
# @option options [Object] :team_id
|
15
|
+
# Specify team_id starts with T in case of Org Token.
|
14
16
|
# @option options [Object] :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
|
@@ -6,102 +6,6 @@ module Slack
|
|
6
6
|
module Api
|
7
7
|
module Endpoints
|
8
8
|
module Mpim
|
9
|
-
#
|
10
|
-
# Closes a multiparty direct message channel.
|
11
|
-
#
|
12
|
-
# @option options [channel] :channel
|
13
|
-
# MPIM to close.
|
14
|
-
# @see https://api.slack.com/methods/mpim.close
|
15
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.close.json
|
16
|
-
def mpim_close(options = {})
|
17
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
18
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
19
|
-
post('mpim.close', options)
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# Fetches history of messages and events from a multiparty direct message.
|
24
|
-
#
|
25
|
-
# @option options [channel] :channel
|
26
|
-
# Multiparty direct message to fetch history for.
|
27
|
-
# @option options [Object] :inclusive
|
28
|
-
# Include messages with latest or oldest timestamp in results.
|
29
|
-
# @option options [timestamp] :latest
|
30
|
-
# End of time range of messages to include in results.
|
31
|
-
# @option options [timestamp] :oldest
|
32
|
-
# Start of time range of messages to include in results.
|
33
|
-
# @option options [Object] :unreads
|
34
|
-
# Include unread_count_display in the output?.
|
35
|
-
# @see https://api.slack.com/methods/mpim.history
|
36
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.history.json
|
37
|
-
def mpim_history(options = {})
|
38
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
39
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
40
|
-
post('mpim.history', options)
|
41
|
-
end
|
42
|
-
|
43
|
-
#
|
44
|
-
# Lists multiparty direct message channels for the calling user.
|
45
|
-
#
|
46
|
-
# @option options [Object] :cursor
|
47
|
-
# Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See pagination for more details.
|
48
|
-
# @option options [Object] :limit
|
49
|
-
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.
|
50
|
-
# @see https://api.slack.com/methods/mpim.list
|
51
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.list.json
|
52
|
-
def mpim_list(options = {})
|
53
|
-
if block_given?
|
54
|
-
Pagination::Cursor.new(self, :mpim_list, options).each do |page|
|
55
|
-
yield page
|
56
|
-
end
|
57
|
-
else
|
58
|
-
post('mpim.list', options)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
#
|
63
|
-
# Sets the read cursor in a multiparty direct message channel.
|
64
|
-
#
|
65
|
-
# @option options [channel] :channel
|
66
|
-
# multiparty direct message channel to set reading cursor in.
|
67
|
-
# @option options [timestamp] :ts
|
68
|
-
# Timestamp of the most recently seen message.
|
69
|
-
# @see https://api.slack.com/methods/mpim.mark
|
70
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.mark.json
|
71
|
-
def mpim_mark(options = {})
|
72
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
73
|
-
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
74
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
75
|
-
post('mpim.mark', options)
|
76
|
-
end
|
77
|
-
|
78
|
-
#
|
79
|
-
# This method opens a multiparty direct message.
|
80
|
-
#
|
81
|
-
# @option options [Object] :users
|
82
|
-
# Comma separated lists of users. The ordering of the users is preserved whenever a MPIM group is returned.
|
83
|
-
# @see https://api.slack.com/methods/mpim.open
|
84
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.open.json
|
85
|
-
def mpim_open(options = {})
|
86
|
-
throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
|
87
|
-
post('mpim.open', options)
|
88
|
-
end
|
89
|
-
|
90
|
-
#
|
91
|
-
# Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.
|
92
|
-
#
|
93
|
-
# @option options [channel] :channel
|
94
|
-
# Multiparty direct message channel to fetch thread from.
|
95
|
-
# @option options [Object] :thread_ts
|
96
|
-
# Unique identifier of a thread's parent message.
|
97
|
-
# @see https://api.slack.com/methods/mpim.replies
|
98
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.replies.json
|
99
|
-
def mpim_replies(options = {})
|
100
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
101
|
-
throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
|
102
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
103
|
-
post('mpim.replies', options)
|
104
|
-
end
|
105
9
|
end
|
106
10
|
end
|
107
11
|
end
|
@@ -18,13 +18,10 @@ module Slack
|
|
18
18
|
# @option options [Object] :redirect_uri
|
19
19
|
# This must match the originally submitted URI (if one was sent).
|
20
20
|
# @option options [Object] :single_channel
|
21
|
-
# Request the user to add your app only to a single channel.
|
21
|
+
# Request the user to add your app only to a single channel. Only valid with a legacy workspace app.
|
22
22
|
# @see https://api.slack.com/methods/oauth.access
|
23
23
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth/oauth.access.json
|
24
24
|
def oauth_access(options = {})
|
25
|
-
throw ArgumentError.new('Required arguments :client_id missing') if options[:client_id].nil?
|
26
|
-
throw ArgumentError.new('Required arguments :client_secret missing') if options[:client_secret].nil?
|
27
|
-
throw ArgumentError.new('Required arguments :code missing') if options[:code].nil?
|
28
25
|
post('oauth.access', options)
|
29
26
|
end
|
30
27
|
|
@@ -17,8 +17,7 @@ module Slack
|
|
17
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.add.json
|
18
18
|
def pins_add(options = {})
|
19
19
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
20
|
-
|
21
|
-
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
20
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
22
21
|
post('pins.add', options)
|
23
22
|
end
|
24
23
|
|
@@ -31,7 +30,7 @@ module Slack
|
|
31
30
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.list.json
|
32
31
|
def pins_list(options = {})
|
33
32
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
34
|
-
options = options.merge(channel:
|
33
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
35
34
|
post('pins.list', options)
|
36
35
|
end
|
37
36
|
|
@@ -40,17 +39,13 @@ module Slack
|
|
40
39
|
#
|
41
40
|
# @option options [channel] :channel
|
42
41
|
# Channel where the item is pinned to.
|
43
|
-
# @option options [file] :file
|
44
|
-
# File to un-pin.
|
45
|
-
# @option options [Object] :file_comment
|
46
|
-
# File comment to un-pin.
|
47
42
|
# @option options [Object] :timestamp
|
48
43
|
# Timestamp of the message to un-pin.
|
49
44
|
# @see https://api.slack.com/methods/pins.remove
|
50
45
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.remove.json
|
51
46
|
def pins_remove(options = {})
|
52
47
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
53
|
-
options = options.merge(channel:
|
48
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
54
49
|
post('pins.remove', options)
|
55
50
|
end
|
56
51
|
end
|
@@ -21,7 +21,7 @@ module Slack
|
|
21
21
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
22
22
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
23
23
|
throw ArgumentError.new('Required arguments :timestamp missing') if options[:timestamp].nil?
|
24
|
-
options = options.merge(channel:
|
24
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
25
25
|
post('reactions.add', options)
|
26
26
|
end
|
27
27
|
|
@@ -41,7 +41,7 @@ module Slack
|
|
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
|
43
43
|
def reactions_get(options = {})
|
44
|
-
options = options.merge(channel:
|
44
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
45
45
|
post('reactions.get', options)
|
46
46
|
end
|
47
47
|
|
@@ -54,6 +54,8 @@ module Slack
|
|
54
54
|
# If true always return the complete reaction list.
|
55
55
|
# @option options [Object] :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
|
58
|
+
# encoded team id to list reactions in, required if org token is used.
|
57
59
|
# @option options [user] :user
|
58
60
|
# Show reactions made by this user. Defaults to the authed user.
|
59
61
|
# @see https://api.slack.com/methods/reactions.list
|
@@ -86,7 +88,7 @@ module Slack
|
|
86
88
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.remove.json
|
87
89
|
def reactions_remove(options = {})
|
88
90
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
89
|
-
options = options.merge(channel:
|
91
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
90
92
|
post('reactions.remove', options)
|
91
93
|
end
|
92
94
|
end
|
@@ -17,6 +17,8 @@ module Slack
|
|
17
17
|
# Return matches sorted by either score or timestamp.
|
18
18
|
# @option options [Object] :sort_dir
|
19
19
|
# Change sort direction to ascending (asc) or descending (desc).
|
20
|
+
# @option options [Object] :team_id
|
21
|
+
# encoded team id to search in, required if org token is used.
|
20
22
|
# @see https://api.slack.com/methods/search.all
|
21
23
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.all.json
|
22
24
|
def search_all(options = {})
|
@@ -35,6 +37,8 @@ module Slack
|
|
35
37
|
# Return matches sorted by either score or timestamp.
|
36
38
|
# @option options [Object] :sort_dir
|
37
39
|
# Change sort direction to ascending (asc) or descending (desc).
|
40
|
+
# @option options [Object] :team_id
|
41
|
+
# encoded team id to search in, required if org token is used.
|
38
42
|
# @see https://api.slack.com/methods/search.files
|
39
43
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.files.json
|
40
44
|
def search_files(options = {})
|
@@ -53,6 +57,8 @@ module Slack
|
|
53
57
|
# Return matches sorted by either score or timestamp.
|
54
58
|
# @option options [Object] :sort_dir
|
55
59
|
# Change sort direction to ascending (asc) or descending (desc).
|
60
|
+
# @option options [Object] :team_id
|
61
|
+
# encoded team id to search in, required if org token is used.
|
56
62
|
# @see https://api.slack.com/methods/search.messages
|
57
63
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.messages.json
|
58
64
|
def search_messages(options = {})
|
@@ -20,7 +20,7 @@ module Slack
|
|
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
|
22
22
|
def stars_add(options = {})
|
23
|
-
options = options.merge(channel:
|
23
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
24
24
|
post('stars.add', options)
|
25
25
|
end
|
26
26
|
|
@@ -57,7 +57,7 @@ module Slack
|
|
57
57
|
# @see https://api.slack.com/methods/stars.remove
|
58
58
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.remove.json
|
59
59
|
def stars_remove(options = {})
|
60
|
-
options = options.merge(channel:
|
60
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
61
61
|
post('stars.remove', options)
|
62
62
|
end
|
63
63
|
end
|
@@ -11,6 +11,8 @@ module Slack
|
|
11
11
|
#
|
12
12
|
# @option options [Object] :before
|
13
13
|
# End of time range of logs to include in results (inclusive).
|
14
|
+
# @option options [Object] :team_id
|
15
|
+
# encoded team id to get logs from, required if org token is used.
|
14
16
|
# @see https://api.slack.com/methods/team.accessLogs
|
15
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.accessLogs.json
|
16
18
|
def team_accessLogs(options = {})
|
@@ -20,6 +22,8 @@ module Slack
|
|
20
22
|
#
|
21
23
|
# Gets billable users information for the current team.
|
22
24
|
#
|
25
|
+
# @option options [Object] :team_id
|
26
|
+
# encoded team id to get the billable information from, required if org token is used.
|
23
27
|
# @option options [user] :user
|
24
28
|
# A user to retrieve the billable information for. Defaults to all users.
|
25
29
|
# @see https://api.slack.com/methods/team.billableInfo
|
@@ -49,6 +53,8 @@ module Slack
|
|
49
53
|
# Filter logs with this change type. Defaults to all logs.
|
50
54
|
# @option options [Object] :service_id
|
51
55
|
# Filter logs to this service. Defaults to all logs.
|
56
|
+
# @option options [Object] :team_id
|
57
|
+
# encoded team id to get logs from, required if org token is used.
|
52
58
|
# @option options [user] :user
|
53
59
|
# Filter logs generated by this user's actions. Defaults to all logs.
|
54
60
|
# @see https://api.slack.com/methods/team.integrationLogs
|
@@ -19,6 +19,8 @@ module Slack
|
|
19
19
|
# A mention handle. Must be unique among channels, users and User Groups.
|
20
20
|
# @option options [Object] :include_count
|
21
21
|
# Include the number of users in each User Group.
|
22
|
+
# @option options [Object] :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 = {})
|
@@ -33,6 +35,8 @@ module Slack
|
|
33
35
|
# The encoded ID of the User Group to disable.
|
34
36
|
# @option options [Object] :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 = {})
|
@@ -47,6 +51,8 @@ module Slack
|
|
47
51
|
# The encoded ID of the User Group to enable.
|
48
52
|
# @option options [Object] :include_count
|
49
53
|
# Include the number of users in the User Group.
|
54
|
+
# @option options [Object] :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 = {})
|
@@ -63,6 +69,8 @@ module Slack
|
|
63
69
|
# Include disabled User Groups.
|
64
70
|
# @option options [Object] :include_users
|
65
71
|
# Include the list of users for each User Group.
|
72
|
+
# @option options [Object] :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 = {})
|
@@ -84,6 +92,8 @@ module Slack
|
|
84
92
|
# Include the number of users in the User Group.
|
85
93
|
# @option options [Object] :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 = {})
|
@@ -13,6 +13,8 @@ module Slack
|
|
13
13
|
# The encoded ID of the User Group to update.
|
14
14
|
# @option options [Object] :include_disabled
|
15
15
|
# Allow results that involve disabled User Groups.
|
16
|
+
# @option options [Object] :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 = {})
|
@@ -29,6 +31,8 @@ module Slack
|
|
29
31
|
# A comma separated string of encoded user IDs that represent the entire list of users for the User Group.
|
30
32
|
# @option options [Object] :include_count
|
31
33
|
# Include the number of users in the User Group.
|
34
|
+
# @option options [Object] :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 = {})
|
@@ -15,6 +15,8 @@ module Slack
|
|
15
15
|
# Set to true to exclude archived channels from the list.
|
16
16
|
# @option options [Object] :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] :team_id
|
19
|
+
# encoded team id to list conversations in, required if org token is used.
|
18
20
|
# @option options [Object] :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
|
@@ -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
|
@@ -86,7 +87,9 @@ module Slack
|
|
86
87
|
# @option options [Object] :include_locale
|
87
88
|
# Set this to true to receive the locale for users. Defaults to false.
|
88
89
|
# @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.
|
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 [Object] :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 = {})
|
@@ -123,18 +126,17 @@ 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
129
|
# @option options [Object] :crop_w
|
129
130
|
# Width/height of crop box (always square).
|
130
131
|
# @option options [Object] :crop_x
|
131
132
|
# X coordinate of top-left corner of crop box.
|
132
133
|
# @option options [Object] :crop_y
|
133
134
|
# Y coordinate of top-left corner of crop box.
|
135
|
+
# @option options [Object] :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
|
|