slack-ruby-client 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +40 -39
- data/.travis.yml +1 -9
- data/CHANGELOG.md +24 -0
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +3 -1
- data/README.md +40 -12
- data/Rakefile +1 -1
- data/UPGRADING.md +1 -1
- data/bin/commands/api.rb +2 -2
- data/bin/commands/apps_permissions.rb +22 -0
- data/bin/commands/auth.rb +4 -4
- data/bin/commands/bots.rb +2 -2
- data/bin/commands/channels.rb +52 -40
- data/bin/commands/chat.rb +63 -25
- data/bin/commands/conversations.rb +178 -0
- data/bin/commands/dialog.rb +14 -0
- data/bin/commands/dnd.rb +8 -8
- data/bin/commands/emoji.rb +2 -2
- data/bin/commands/files.rb +38 -17
- data/bin/commands/files_comments.rb +6 -6
- data/bin/commands/groups.rb +44 -51
- data/bin/commands/im.rb +16 -13
- data/bin/commands/migration.rb +14 -0
- data/bin/commands/mpim.rb +11 -11
- data/bin/commands/oauth.rb +15 -2
- data/bin/commands/pins.rb +6 -6
- data/bin/commands/reactions.rb +13 -13
- data/bin/commands/reminders.rb +10 -10
- data/bin/commands/rtm.rb +9 -6
- data/bin/commands/search.rb +9 -9
- data/bin/commands/stars.rb +8 -8
- data/bin/commands/team.rb +10 -10
- data/bin/commands/team_profile.rb +2 -2
- data/bin/commands/usergroups.rb +16 -16
- data/bin/commands/usergroups_users.rb +4 -4
- data/bin/commands/users.rb +40 -36
- data/bin/commands/users_admin.rb +28 -0
- data/bin/commands/users_prefs.rb +12 -0
- data/bin/commands/users_profile.rb +7 -7
- data/bin/commands.rb +7 -1
- data/bin/slack +1 -1
- data/examples/hi_real_time/hi.rb +1 -1
- data/examples/hi_real_time_and_web/hi.rb +1 -1
- data/examples/hi_real_time_async_celluloid/hi.rb +1 -1
- data/examples/hi_real_time_async_eventmachine/hi.rb +1 -1
- data/examples/hi_web/hi.rb +1 -1
- data/examples/new_ticket/new_ticket.rb +1 -1
- data/lib/slack/messages/formatting.rb +4 -4
- data/lib/slack/messages/message.rb +1 -2
- data/lib/slack/real_time/api/templates/event_handler.erb +1 -1
- data/lib/slack/real_time/client.rb +11 -10
- data/lib/slack/real_time/concurrency/celluloid.rb +6 -2
- data/lib/slack/real_time/config.rb +11 -11
- data/lib/slack/real_time/models/base.rb +1 -2
- data/lib/slack/real_time/socket.rb +2 -2
- data/lib/slack/real_time/stores/base.rb +1 -2
- data/lib/slack/real_time/stores/starter.rb +92 -72
- data/lib/slack/real_time/stores/store.rb +120 -90
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/api.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_permissions.rb +35 -0
- data/lib/slack/web/api/endpoints/auth.rb +4 -4
- data/lib/slack/web/api/endpoints/bots.rb +2 -2
- data/lib/slack/web/api/endpoints/channels.rb +57 -34
- data/lib/slack/web/api/endpoints/chat.rb +107 -37
- data/lib/slack/web/api/endpoints/conversations.rb +301 -0
- data/lib/slack/web/api/endpoints/dialog.rb +32 -0
- data/lib/slack/web/api/endpoints/dnd.rb +9 -9
- data/lib/slack/web/api/endpoints/emoji.rb +2 -2
- data/lib/slack/web/api/endpoints/files.rb +53 -23
- data/lib/slack/web/api/endpoints/files_comments.rb +11 -11
- data/lib/slack/web/api/endpoints/groups.rb +38 -50
- data/lib/slack/web/api/endpoints/im.rb +27 -17
- data/lib/slack/web/api/endpoints/migration.rb +25 -0
- data/lib/slack/web/api/endpoints/mpim.rb +13 -15
- data/lib/slack/web/api/endpoints/oauth.rb +24 -3
- data/lib/slack/web/api/endpoints/pins.rb +6 -8
- data/lib/slack/web/api/endpoints/presence.rb +1 -1
- data/lib/slack/web/api/endpoints/reactions.rb +18 -20
- data/lib/slack/web/api/endpoints/reminders.rb +10 -10
- data/lib/slack/web/api/endpoints/rtm.rb +14 -8
- data/lib/slack/web/api/endpoints/search.rb +12 -12
- data/lib/slack/web/api/endpoints/stars.rb +10 -12
- data/lib/slack/web/api/endpoints/team.rb +12 -13
- data/lib/slack/web/api/endpoints/team_profile.rb +2 -2
- data/lib/slack/web/api/endpoints/usergroups.rb +22 -22
- data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -4
- data/lib/slack/web/api/endpoints/users.rb +34 -24
- data/lib/slack/web/api/endpoints/users_admin.rb +46 -0
- data/lib/slack/web/api/endpoints/users_prefs.rb +19 -0
- data/lib/slack/web/api/endpoints/users_profile.rb +10 -10
- data/lib/slack/web/api/endpoints.rb +14 -2
- data/lib/slack/web/api/mixins/ids.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.search.rb +38 -36
- data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +1 -1
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +4 -3
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +17 -0
- data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +17 -0
- data/lib/slack/web/api/templates/command.erb +4 -3
- data/lib/slack/web/api/templates/commands.erb +1 -1
- data/lib/slack/web/api/templates/endpoints.erb +2 -2
- data/lib/slack/web/api/templates/method.erb +18 -3
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/config.rb +16 -12
- data/lib/slack/web/faraday/connection.rb +1 -1
- data/lib/slack/web/faraday/response/raise_error.rb +3 -3
- data/lib/slack/web/pagination/cursor.rb +48 -0
- data/lib/slack-ruby-client.rb +6 -0
- data/lib/tasks/git.rake +1 -1
- data/lib/tasks/real_time.rake +1 -1
- data/lib/tasks/web.rake +4 -1
- data/slack-ruby-client.gemspec +2 -3
- data/spec/fixtures/slack/web/paginated_users_list.yml +181 -0
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/messages/formatting_spec.rb +1 -1
- data/spec/slack/real_time/client_spec.rb +62 -63
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +41 -31
- data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +1 -1
- data/spec/slack/real_time/event_handlers/bot_spec.rb +4 -2
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/user_spec.rb +4 -2
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +15 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +100 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +37 -1
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +16 -6
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +8 -8
- data/spec/slack/web/api/endpoints/files_spec.rb +16 -5
- data/spec/slack/web/api/endpoints/migration_spec.rb +12 -0
- data/spec/slack/web/api/endpoints/oauth_spec.rb +11 -0
- data/spec/slack/web/api/endpoints/users_admin_spec.rb +17 -0
- data/spec/slack/web/api/endpoints/users_prefs_spec.rb +7 -0
- data/spec/slack/web/api/error_spec.rb +1 -1
- data/spec/slack/web/api/errors/slack_error_spec.rb +1 -1
- data/spec/slack/web/api/mixins/users_spec.rb +6 -4
- data/spec/slack/web/api/pagination/cursor_spec.rb +70 -0
- data/spec/support/queue_with_timeout.rb +1 -1
- data/spec/support/real_time/concurrency/mock.rb +1 -2
- metadata +47 -30
@@ -6,21 +6,20 @@ module Slack
|
|
6
6
|
module Endpoints
|
7
7
|
module Reactions
|
8
8
|
#
|
9
|
-
#
|
10
|
-
# One of file, file_comment, or the combination of channel and timestamp must be specified.
|
9
|
+
# Adds a reaction to an item.
|
11
10
|
#
|
12
11
|
# @option options [Object] :name
|
13
12
|
# Reaction (emoji) name.
|
13
|
+
# @option options [channel] :channel
|
14
|
+
# Channel where the message to add reaction to was posted.
|
14
15
|
# @option options [file] :file
|
15
16
|
# File to add reaction to.
|
16
17
|
# @option options [Object] :file_comment
|
17
18
|
# File comment to add reaction to.
|
18
|
-
# @option options [channel] :channel
|
19
|
-
# Channel where the message to add reaction to was posted.
|
20
19
|
# @option options [Object] :timestamp
|
21
20
|
# Timestamp of the message to add reaction to.
|
22
21
|
# @see https://api.slack.com/methods/reactions.add
|
23
|
-
# @see https://github.com/
|
22
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.add.json
|
24
23
|
def reactions_add(options = {})
|
25
24
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
26
25
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
@@ -28,55 +27,54 @@ module Slack
|
|
28
27
|
end
|
29
28
|
|
30
29
|
#
|
31
|
-
#
|
30
|
+
# Gets reactions for an item.
|
32
31
|
#
|
32
|
+
# @option options [channel] :channel
|
33
|
+
# Channel where the message to get reactions for was posted.
|
33
34
|
# @option options [file] :file
|
34
35
|
# File to get reactions for.
|
35
36
|
# @option options [Object] :file_comment
|
36
37
|
# File comment to get reactions for.
|
37
|
-
# @option options [channel] :channel
|
38
|
-
# Channel where the message to get reactions for was posted.
|
39
|
-
# @option options [Object] :timestamp
|
40
|
-
# Timestamp of the message to get reactions for.
|
41
38
|
# @option options [Object] :full
|
42
39
|
# If true always return the complete reaction list.
|
40
|
+
# @option options [Object] :timestamp
|
41
|
+
# Timestamp of the message to get reactions for.
|
43
42
|
# @see https://api.slack.com/methods/reactions.get
|
44
|
-
# @see https://github.com/
|
43
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.get.json
|
45
44
|
def reactions_get(options = {})
|
46
45
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
47
46
|
post('reactions.get', options)
|
48
47
|
end
|
49
48
|
|
50
49
|
#
|
51
|
-
#
|
50
|
+
# Lists reactions made by a user.
|
52
51
|
#
|
53
|
-
# @option options [user] :user
|
54
|
-
# Show reactions made by this user. Defaults to the authed user.
|
55
52
|
# @option options [Object] :full
|
56
53
|
# If true always return the complete reaction list.
|
54
|
+
# @option options [user] :user
|
55
|
+
# Show reactions made by this user. Defaults to the authed user.
|
57
56
|
# @see https://api.slack.com/methods/reactions.list
|
58
|
-
# @see https://github.com/
|
57
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.list.json
|
59
58
|
def reactions_list(options = {})
|
60
59
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
61
60
|
post('reactions.list', options)
|
62
61
|
end
|
63
62
|
|
64
63
|
#
|
65
|
-
#
|
66
|
-
# One of file, file_comment, or the combination of channel and timestamp must be specified.
|
64
|
+
# Removes a reaction from an item.
|
67
65
|
#
|
68
66
|
# @option options [Object] :name
|
69
67
|
# Reaction (emoji) name.
|
68
|
+
# @option options [channel] :channel
|
69
|
+
# Channel where the message to remove reaction from was posted.
|
70
70
|
# @option options [file] :file
|
71
71
|
# File to remove reaction from.
|
72
72
|
# @option options [Object] :file_comment
|
73
73
|
# File comment to remove reaction from.
|
74
|
-
# @option options [channel] :channel
|
75
|
-
# Channel where the message to remove reaction from was posted.
|
76
74
|
# @option options [Object] :timestamp
|
77
75
|
# Timestamp of the message to remove reaction from.
|
78
76
|
# @see https://api.slack.com/methods/reactions.remove
|
79
|
-
# @see https://github.com/
|
77
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.remove.json
|
80
78
|
def reactions_remove(options = {})
|
81
79
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
82
80
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
@@ -6,7 +6,7 @@ module Slack
|
|
6
6
|
module Endpoints
|
7
7
|
module Reminders
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# Creates a reminder.
|
10
10
|
#
|
11
11
|
# @option options [Object] :text
|
12
12
|
# The content of the reminder.
|
@@ -15,7 +15,7 @@ module Slack
|
|
15
15
|
# @option options [user] :user
|
16
16
|
# The user who will receive the reminder. If no user is specified, the reminder will go to user who created it.
|
17
17
|
# @see https://api.slack.com/methods/reminders.add
|
18
|
-
# @see https://github.com/
|
18
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.add.json
|
19
19
|
def reminders_add(options = {})
|
20
20
|
throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
|
21
21
|
throw ArgumentError.new('Required arguments :time missing') if options[:time].nil?
|
@@ -24,46 +24,46 @@ module Slack
|
|
24
24
|
end
|
25
25
|
|
26
26
|
#
|
27
|
-
#
|
27
|
+
# Marks a reminder as complete.
|
28
28
|
#
|
29
29
|
# @option options [Object] :reminder
|
30
30
|
# The ID of the reminder to be marked as complete.
|
31
31
|
# @see https://api.slack.com/methods/reminders.complete
|
32
|
-
# @see https://github.com/
|
32
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.complete.json
|
33
33
|
def reminders_complete(options = {})
|
34
34
|
throw ArgumentError.new('Required arguments :reminder missing') if options[:reminder].nil?
|
35
35
|
post('reminders.complete', options)
|
36
36
|
end
|
37
37
|
|
38
38
|
#
|
39
|
-
#
|
39
|
+
# Deletes a reminder.
|
40
40
|
#
|
41
41
|
# @option options [Object] :reminder
|
42
42
|
# The ID of the reminder.
|
43
43
|
# @see https://api.slack.com/methods/reminders.delete
|
44
|
-
# @see https://github.com/
|
44
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.delete.json
|
45
45
|
def reminders_delete(options = {})
|
46
46
|
throw ArgumentError.new('Required arguments :reminder missing') if options[:reminder].nil?
|
47
47
|
post('reminders.delete', options)
|
48
48
|
end
|
49
49
|
|
50
50
|
#
|
51
|
-
#
|
51
|
+
# Gets information about a reminder.
|
52
52
|
#
|
53
53
|
# @option options [Object] :reminder
|
54
54
|
# The ID of the reminder.
|
55
55
|
# @see https://api.slack.com/methods/reminders.info
|
56
|
-
# @see https://github.com/
|
56
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.info.json
|
57
57
|
def reminders_info(options = {})
|
58
58
|
throw ArgumentError.new('Required arguments :reminder missing') if options[:reminder].nil?
|
59
59
|
post('reminders.info', options)
|
60
60
|
end
|
61
61
|
|
62
62
|
#
|
63
|
-
#
|
63
|
+
# Lists all reminders created by or for a given user.
|
64
64
|
#
|
65
65
|
# @see https://api.slack.com/methods/reminders.list
|
66
|
-
# @see https://github.com/
|
66
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.list.json
|
67
67
|
def reminders_list(options = {})
|
68
68
|
post('reminders.list', options)
|
69
69
|
end
|
@@ -6,27 +6,33 @@ module Slack
|
|
6
6
|
module Endpoints
|
7
7
|
module Rtm
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# Starts a Real Time Messaging session.
|
10
10
|
#
|
11
|
+
# @option options [Object] :batch_presence_aware
|
12
|
+
# Only deliver presence events when requested by subscription. See presence subscriptions.
|
11
13
|
# @see https://api.slack.com/methods/rtm.connect
|
12
|
-
# @see https://github.com/
|
14
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/rtm/rtm.connect.json
|
13
15
|
def rtm_connect(options = {})
|
14
16
|
post('rtm.connect', options)
|
15
17
|
end
|
16
18
|
|
17
19
|
#
|
18
|
-
#
|
20
|
+
# Starts a Real Time Messaging session.
|
19
21
|
#
|
20
|
-
# @option options [Object] :
|
21
|
-
#
|
22
|
-
# @option options [Object] :
|
23
|
-
#
|
22
|
+
# @option options [Object] :batch_presence_aware
|
23
|
+
# Only deliver presence events when requested by subscription. See presence subscriptions.
|
24
|
+
# @option options [Object] :include_locale
|
25
|
+
# Set this to true to receive the locale for users and channels. Defaults to false.
|
24
26
|
# @option options [Object] :mpim_aware
|
25
27
|
# Returns MPIMs to the client in the API response.
|
26
28
|
# @option options [Object] :no_latest
|
27
29
|
# Exclude latest timestamps for channels, groups, mpims, and ims. Automatically sets no_unreads to 1.
|
30
|
+
# @option options [Object] :no_unreads
|
31
|
+
# Skip unread counts for each channel (improves performance).
|
32
|
+
# @option options [Object] :simple_latest
|
33
|
+
# Return timestamp only for latest message object of each channel (improves performance).
|
28
34
|
# @see https://api.slack.com/methods/rtm.start
|
29
|
-
# @see https://github.com/
|
35
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/rtm/rtm.start.json
|
30
36
|
def rtm_start(options = {})
|
31
37
|
post('rtm.start', options)
|
32
38
|
end
|
@@ -6,54 +6,54 @@ module Slack
|
|
6
6
|
module Endpoints
|
7
7
|
module Search
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# Searches for messages and files matching a query.
|
10
10
|
#
|
11
11
|
# @option options [Object] :query
|
12
12
|
# Search query. May contains booleans, etc.
|
13
|
+
# @option options [Object] :highlight
|
14
|
+
# Pass a value of true to enable query highlight markers (see below).
|
13
15
|
# @option options [Object] :sort
|
14
16
|
# Return matches sorted by either score or timestamp.
|
15
17
|
# @option options [Object] :sort_dir
|
16
18
|
# Change sort direction to ascending (asc) or descending (desc).
|
17
|
-
# @option options [Object] :highlight
|
18
|
-
# Pass a value of true to enable query highlight markers (see below).
|
19
19
|
# @see https://api.slack.com/methods/search.all
|
20
|
-
# @see https://github.com/
|
20
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.all.json
|
21
21
|
def search_all(options = {})
|
22
22
|
throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
|
23
23
|
post('search.all', options)
|
24
24
|
end
|
25
25
|
|
26
26
|
#
|
27
|
-
#
|
27
|
+
# Searches for files matching a query.
|
28
28
|
#
|
29
29
|
# @option options [Object] :query
|
30
30
|
# Search query. May contain booleans, etc.
|
31
|
+
# @option options [Object] :highlight
|
32
|
+
# Pass a value of true to enable query highlight markers (see below).
|
31
33
|
# @option options [Object] :sort
|
32
34
|
# Return matches sorted by either score or timestamp.
|
33
35
|
# @option options [Object] :sort_dir
|
34
36
|
# Change sort direction to ascending (asc) or descending (desc).
|
35
|
-
# @option options [Object] :highlight
|
36
|
-
# Pass a value of true to enable query highlight markers (see below).
|
37
37
|
# @see https://api.slack.com/methods/search.files
|
38
|
-
# @see https://github.com/
|
38
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.files.json
|
39
39
|
def search_files(options = {})
|
40
40
|
throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
|
41
41
|
post('search.files', options)
|
42
42
|
end
|
43
43
|
|
44
44
|
#
|
45
|
-
#
|
45
|
+
# Searches for messages matching a query.
|
46
46
|
#
|
47
47
|
# @option options [Object] :query
|
48
48
|
# Search query. May contains booleans, etc.
|
49
|
+
# @option options [Object] :highlight
|
50
|
+
# Pass a value of true to enable query highlight markers (see below).
|
49
51
|
# @option options [Object] :sort
|
50
52
|
# Return matches sorted by either score or timestamp.
|
51
53
|
# @option options [Object] :sort_dir
|
52
54
|
# Change sort direction to ascending (asc) or descending (desc).
|
53
|
-
# @option options [Object] :highlight
|
54
|
-
# Pass a value of true to enable query highlight markers (see below).
|
55
55
|
# @see https://api.slack.com/methods/search.messages
|
56
|
-
# @see https://github.com/
|
56
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.messages.json
|
57
57
|
def search_messages(options = {})
|
58
58
|
throw ArgumentError.new('Required arguments :query missing') if options[:query].nil?
|
59
59
|
post('search.messages', options)
|
@@ -6,47 +6,45 @@ module Slack
|
|
6
6
|
module Endpoints
|
7
7
|
module Stars
|
8
8
|
#
|
9
|
-
#
|
10
|
-
# One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
|
9
|
+
# Adds a star to an item.
|
11
10
|
#
|
11
|
+
# @option options [channel] :channel
|
12
|
+
# Channel to add star to, or channel where the message to add star to was posted (used with timestamp).
|
12
13
|
# @option options [file] :file
|
13
14
|
# File to add star to.
|
14
15
|
# @option options [Object] :file_comment
|
15
16
|
# File comment to add star to.
|
16
|
-
# @option options [channel] :channel
|
17
|
-
# Channel to add star to, or channel where the message to add star to was posted (used with timestamp).
|
18
17
|
# @option options [Object] :timestamp
|
19
18
|
# Timestamp of the message to add star to.
|
20
19
|
# @see https://api.slack.com/methods/stars.add
|
21
|
-
# @see https://github.com/
|
20
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.add.json
|
22
21
|
def stars_add(options = {})
|
23
22
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
24
23
|
post('stars.add', options)
|
25
24
|
end
|
26
25
|
|
27
26
|
#
|
28
|
-
#
|
27
|
+
# Lists stars for a user.
|
29
28
|
#
|
30
29
|
# @see https://api.slack.com/methods/stars.list
|
31
|
-
# @see https://github.com/
|
30
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.list.json
|
32
31
|
def stars_list(options = {})
|
33
32
|
post('stars.list', options)
|
34
33
|
end
|
35
34
|
|
36
35
|
#
|
37
|
-
#
|
38
|
-
# One of file, file_comment, channel, or the combination of channel and timestamp must be specified.
|
36
|
+
# Removes a star from an item.
|
39
37
|
#
|
38
|
+
# @option options [channel] :channel
|
39
|
+
# Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).
|
40
40
|
# @option options [file] :file
|
41
41
|
# File to remove star from.
|
42
42
|
# @option options [Object] :file_comment
|
43
43
|
# File comment to remove star from.
|
44
|
-
# @option options [channel] :channel
|
45
|
-
# Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).
|
46
44
|
# @option options [Object] :timestamp
|
47
45
|
# Timestamp of the message to remove star from.
|
48
46
|
# @see https://api.slack.com/methods/stars.remove
|
49
|
-
# @see https://github.com/
|
47
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.remove.json
|
50
48
|
def stars_remove(options = {})
|
51
49
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
52
50
|
post('stars.remove', options)
|
@@ -6,51 +6,50 @@ module Slack
|
|
6
6
|
module Endpoints
|
7
7
|
module Team
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# Gets the access logs for the current team.
|
10
10
|
#
|
11
11
|
# @option options [Object] :before
|
12
12
|
# End of time range of logs to include in results (inclusive).
|
13
13
|
# @see https://api.slack.com/methods/team.accessLogs
|
14
|
-
# @see https://github.com/
|
14
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.accessLogs.json
|
15
15
|
def team_accessLogs(options = {})
|
16
16
|
post('team.accessLogs', options)
|
17
17
|
end
|
18
18
|
|
19
19
|
#
|
20
|
-
#
|
21
|
-
# subject to billing per Slack's Fair Billing policy.
|
20
|
+
# Gets billable users information for the current team.
|
22
21
|
#
|
23
22
|
# @option options [user] :user
|
24
23
|
# A user to retrieve the billable information for. Defaults to all users.
|
25
24
|
# @see https://api.slack.com/methods/team.billableInfo
|
26
|
-
# @see https://github.com/
|
25
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.billableInfo.json
|
27
26
|
def team_billableInfo(options = {})
|
28
27
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
29
28
|
post('team.billableInfo', options)
|
30
29
|
end
|
31
30
|
|
32
31
|
#
|
33
|
-
#
|
32
|
+
# Gets information about the current team.
|
34
33
|
#
|
35
34
|
# @see https://api.slack.com/methods/team.info
|
36
|
-
# @see https://github.com/
|
35
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.info.json
|
37
36
|
def team_info(options = {})
|
38
37
|
post('team.info', options)
|
39
38
|
end
|
40
39
|
|
41
40
|
#
|
42
|
-
#
|
41
|
+
# Gets the integration logs for the current team.
|
43
42
|
#
|
44
|
-
# @option options [Object] :service_id
|
45
|
-
# Filter logs to this service. Defaults to all logs.
|
46
43
|
# @option options [Object] :app_id
|
47
44
|
# Filter logs to this Slack app. Defaults to all logs.
|
48
|
-
# @option options [user] :user
|
49
|
-
# Filter logs generated by this user's actions. Defaults to all logs.
|
50
45
|
# @option options [Object] :change_type
|
51
46
|
# Filter logs with this change type. Defaults to all logs.
|
47
|
+
# @option options [Object] :service_id
|
48
|
+
# Filter logs to this service. Defaults to all logs.
|
49
|
+
# @option options [user] :user
|
50
|
+
# Filter logs generated by this user's actions. Defaults to all logs.
|
52
51
|
# @see https://api.slack.com/methods/team.integrationLogs
|
53
|
-
# @see https://github.com/
|
52
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.integrationLogs.json
|
54
53
|
def team_integrationLogs(options = {})
|
55
54
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
56
55
|
post('team.integrationLogs', options)
|
@@ -6,12 +6,12 @@ module Slack
|
|
6
6
|
module Endpoints
|
7
7
|
module TeamProfile
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# Retrieve a team's profile.
|
10
10
|
#
|
11
11
|
# @option options [Object] :visibility
|
12
12
|
# Filter by visibility.
|
13
13
|
# @see https://api.slack.com/methods/team.profile.get
|
14
|
-
# @see https://github.com/
|
14
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team.profile/team.profile.get.json
|
15
15
|
def team_profile_get(options = {})
|
16
16
|
post('team.profile.get', options)
|
17
17
|
end
|
@@ -6,85 +6,85 @@ module Slack
|
|
6
6
|
module Endpoints
|
7
7
|
module Usergroups
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# Create a User Group
|
10
10
|
#
|
11
11
|
# @option options [Object] :name
|
12
12
|
# A name for the User Group. Must be unique among User Groups.
|
13
|
-
# @option options [Object] :handle
|
14
|
-
# A mention handle. Must be unique among channels, users and User Groups.
|
15
|
-
# @option options [Object] :description
|
16
|
-
# A short description of the User Group.
|
17
13
|
# @option options [Object] :channels
|
18
14
|
# A comma separated string of encoded channel IDs for which the User Group uses as a default.
|
15
|
+
# @option options [Object] :description
|
16
|
+
# A short description of the User Group.
|
17
|
+
# @option options [Object] :handle
|
18
|
+
# A mention handle. Must be unique among channels, users and User Groups.
|
19
19
|
# @option options [Object] :include_count
|
20
20
|
# Include the number of users in each User Group.
|
21
21
|
# @see https://api.slack.com/methods/usergroups.create
|
22
|
-
# @see https://github.com/
|
22
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.create.json
|
23
23
|
def usergroups_create(options = {})
|
24
24
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
25
25
|
post('usergroups.create', options)
|
26
26
|
end
|
27
27
|
|
28
28
|
#
|
29
|
-
#
|
29
|
+
# Disable an existing User Group
|
30
30
|
#
|
31
31
|
# @option options [Object] :usergroup
|
32
32
|
# The encoded ID of the User Group to disable.
|
33
33
|
# @option options [Object] :include_count
|
34
34
|
# Include the number of users in the User Group.
|
35
35
|
# @see https://api.slack.com/methods/usergroups.disable
|
36
|
-
# @see https://github.com/
|
36
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.disable.json
|
37
37
|
def usergroups_disable(options = {})
|
38
38
|
throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
|
39
39
|
post('usergroups.disable', options)
|
40
40
|
end
|
41
41
|
|
42
42
|
#
|
43
|
-
#
|
43
|
+
# Enable a User Group
|
44
44
|
#
|
45
45
|
# @option options [Object] :usergroup
|
46
46
|
# The encoded ID of the User Group to enable.
|
47
47
|
# @option options [Object] :include_count
|
48
48
|
# Include the number of users in the User Group.
|
49
49
|
# @see https://api.slack.com/methods/usergroups.enable
|
50
|
-
# @see https://github.com/
|
50
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.enable.json
|
51
51
|
def usergroups_enable(options = {})
|
52
52
|
throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
|
53
53
|
post('usergroups.enable', options)
|
54
54
|
end
|
55
55
|
|
56
56
|
#
|
57
|
-
#
|
57
|
+
# List all User Groups for a team
|
58
58
|
#
|
59
|
-
# @option options [Object] :include_disabled
|
60
|
-
# Include disabled User Groups.
|
61
59
|
# @option options [Object] :include_count
|
62
60
|
# Include the number of users in each User Group.
|
61
|
+
# @option options [Object] :include_disabled
|
62
|
+
# Include disabled User Groups.
|
63
63
|
# @option options [Object] :include_users
|
64
64
|
# Include the list of users for each User Group.
|
65
65
|
# @see https://api.slack.com/methods/usergroups.list
|
66
|
-
# @see https://github.com/
|
66
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json
|
67
67
|
def usergroups_list(options = {})
|
68
68
|
post('usergroups.list', options)
|
69
69
|
end
|
70
70
|
|
71
71
|
#
|
72
|
-
#
|
72
|
+
# Update an existing User Group
|
73
73
|
#
|
74
74
|
# @option options [Object] :usergroup
|
75
75
|
# The encoded ID of the User Group to update.
|
76
|
-
# @option options [Object] :name
|
77
|
-
# A name for the User Group. Must be unique among User Groups.
|
78
|
-
# @option options [Object] :handle
|
79
|
-
# A mention handle. Must be unique among channels, users and User Groups.
|
80
|
-
# @option options [Object] :description
|
81
|
-
# A short description of the User Group.
|
82
76
|
# @option options [Object] :channels
|
83
77
|
# A comma separated string of encoded channel IDs for which the User Group uses as a default.
|
78
|
+
# @option options [Object] :description
|
79
|
+
# A short description of the User Group.
|
80
|
+
# @option options [Object] :handle
|
81
|
+
# A mention handle. Must be unique among channels, users and User Groups.
|
84
82
|
# @option options [Object] :include_count
|
85
83
|
# Include the number of users in the User Group.
|
84
|
+
# @option options [Object] :name
|
85
|
+
# A name for the User Group. Must be unique among User Groups.
|
86
86
|
# @see https://api.slack.com/methods/usergroups.update
|
87
|
-
# @see https://github.com/
|
87
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.update.json
|
88
88
|
def usergroups_update(options = {})
|
89
89
|
throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
|
90
90
|
post('usergroups.update', options)
|
@@ -6,21 +6,21 @@ module Slack
|
|
6
6
|
module Endpoints
|
7
7
|
module UsergroupsUsers
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# List all users in a User Group
|
10
10
|
#
|
11
11
|
# @option options [Object] :usergroup
|
12
12
|
# The encoded ID of the User Group to update.
|
13
13
|
# @option options [Object] :include_disabled
|
14
14
|
# Allow results that involve disabled User Groups.
|
15
15
|
# @see https://api.slack.com/methods/usergroups.users.list
|
16
|
-
# @see https://github.com/
|
16
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.list.json
|
17
17
|
def usergroups_users_list(options = {})
|
18
18
|
throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
|
19
19
|
post('usergroups.users.list', options)
|
20
20
|
end
|
21
21
|
|
22
22
|
#
|
23
|
-
#
|
23
|
+
# Update the list of users for a User Group
|
24
24
|
#
|
25
25
|
# @option options [Object] :usergroup
|
26
26
|
# The encoded ID of the User Group to update.
|
@@ -29,7 +29,7 @@ module Slack
|
|
29
29
|
# @option options [Object] :include_count
|
30
30
|
# Include the number of users in the User Group.
|
31
31
|
# @see https://api.slack.com/methods/usergroups.users.update
|
32
|
-
# @see https://github.com/
|
32
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups.users/usergroups.users.update.json
|
33
33
|
def usergroups_users_update(options = {})
|
34
34
|
throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
|
35
35
|
throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
|