slack-ruby-client 0.10.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 +30 -34
- data/.travis.yml +0 -1
- data/CHANGELOG.md +9 -0
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +3 -1
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/bin/commands/channels.rb +18 -9
- data/bin/commands/chat.rb +24 -3
- data/bin/commands/dialog.rb +14 -0
- data/bin/commands/files.rb +21 -0
- data/bin/commands/groups.rb +10 -10
- data/bin/commands/migration.rb +14 -0
- data/bin/commands/rtm.rb +2 -4
- data/bin/commands/users.rb +18 -18
- data/bin/commands/users_admin.rb +28 -0
- data/bin/commands/users_prefs.rb +12 -0
- data/bin/commands.rb +5 -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 +10 -9
- data/lib/slack/real_time/concurrency/celluloid.rb +5 -1
- 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 +76 -76
- data/lib/slack/real_time/stores/store.rb +104 -94
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/api.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_permissions.rb +2 -2
- data/lib/slack/web/api/endpoints/auth.rb +2 -2
- data/lib/slack/web/api/endpoints/bots.rb +1 -1
- data/lib/slack/web/api/endpoints/channels.rb +27 -15
- data/lib/slack/web/api/endpoints/chat.rb +42 -9
- data/lib/slack/web/api/endpoints/conversations.rb +17 -17
- data/lib/slack/web/api/endpoints/dialog.rb +32 -0
- data/lib/slack/web/api/endpoints/dnd.rb +5 -5
- data/lib/slack/web/api/endpoints/emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/files.rb +37 -6
- data/lib/slack/web/api/endpoints/files_comments.rb +3 -3
- data/lib/slack/web/api/endpoints/groups.rb +17 -17
- data/lib/slack/web/api/endpoints/im.rb +6 -6
- data/lib/slack/web/api/endpoints/migration.rb +25 -0
- data/lib/slack/web/api/endpoints/mpim.rb +6 -6
- data/lib/slack/web/api/endpoints/oauth.rb +2 -2
- data/lib/slack/web/api/endpoints/pins.rb +3 -3
- data/lib/slack/web/api/endpoints/presence.rb +1 -1
- data/lib/slack/web/api/endpoints/reactions.rb +4 -4
- data/lib/slack/web/api/endpoints/reminders.rb +5 -5
- data/lib/slack/web/api/endpoints/rtm.rb +3 -7
- data/lib/slack/web/api/endpoints/search.rb +3 -3
- data/lib/slack/web/api/endpoints/stars.rb +3 -3
- data/lib/slack/web/api/endpoints/team.rb +4 -4
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
- data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
- data/lib/slack/web/api/endpoints/users.rb +8 -8
- 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 +2 -2
- data/lib/slack/web/api/endpoints.rb +10 -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 +1 -1
- data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +17 -0
- data/lib/slack/web/api/templates/command.erb +2 -1
- 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 +8 -3
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/config.rb +12 -12
- data/lib/slack/web/faraday/response/raise_error.rb +3 -3
- 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/slack/messages/formatting_spec.rb +1 -1
- data/spec/slack/real_time/client_spec.rb +3 -2
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +1 -1
- 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/custom_specs/dialog_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +8 -6
- data/spec/slack/web/api/endpoints/files_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/migration_spec.rb +12 -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/support/queue_with_timeout.rb +1 -1
- data/spec/support/real_time/concurrency/mock.rb +1 -2
- metadata +34 -31
|
@@ -17,7 +17,7 @@ module Slack
|
|
|
17
17
|
# @option options [Object] :redirect_uri
|
|
18
18
|
# This must match the originally submitted URI (if one was sent).
|
|
19
19
|
# @see https://api.slack.com/methods/oauth.access
|
|
20
|
-
# @see https://github.com/
|
|
20
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth/oauth.access.json
|
|
21
21
|
def oauth_access(options = {})
|
|
22
22
|
throw ArgumentError.new('Required arguments :client_id missing') if options[:client_id].nil?
|
|
23
23
|
throw ArgumentError.new('Required arguments :client_secret missing') if options[:client_secret].nil?
|
|
@@ -39,7 +39,7 @@ module Slack
|
|
|
39
39
|
# @option options [Object] :single_channel
|
|
40
40
|
# Request the user to add your app only to a single channel.
|
|
41
41
|
# @see https://api.slack.com/methods/oauth.token
|
|
42
|
-
# @see https://github.com/
|
|
42
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/oauth/oauth.token.json
|
|
43
43
|
def oauth_token(options = {})
|
|
44
44
|
throw ArgumentError.new('Required arguments :client_id missing') if options[:client_id].nil?
|
|
45
45
|
throw ArgumentError.new('Required arguments :client_secret missing') if options[:client_secret].nil?
|
|
@@ -17,7 +17,7 @@ module Slack
|
|
|
17
17
|
# @option options [Object] :timestamp
|
|
18
18
|
# Timestamp of the message to pin.
|
|
19
19
|
# @see https://api.slack.com/methods/pins.add
|
|
20
|
-
# @see https://github.com/
|
|
20
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.add.json
|
|
21
21
|
def pins_add(options = {})
|
|
22
22
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
|
23
23
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
|
@@ -30,7 +30,7 @@ module Slack
|
|
|
30
30
|
# @option options [channel] :channel
|
|
31
31
|
# Channel to get pinned items for.
|
|
32
32
|
# @see https://api.slack.com/methods/pins.list
|
|
33
|
-
# @see https://github.com/
|
|
33
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.list.json
|
|
34
34
|
def pins_list(options = {})
|
|
35
35
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
|
36
36
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
|
@@ -49,7 +49,7 @@ module Slack
|
|
|
49
49
|
# @option options [Object] :timestamp
|
|
50
50
|
# Timestamp of the message to un-pin.
|
|
51
51
|
# @see https://api.slack.com/methods/pins.remove
|
|
52
|
-
# @see https://github.com/
|
|
52
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.remove.json
|
|
53
53
|
def pins_remove(options = {})
|
|
54
54
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
|
55
55
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
|
@@ -11,7 +11,7 @@ module Slack
|
|
|
11
11
|
# @option options [Object] :presence
|
|
12
12
|
# Either `active` or `away`.
|
|
13
13
|
# @see https://api.slack.com/methods/presence.set
|
|
14
|
-
# @see https://github.com/
|
|
14
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/presence.set.json
|
|
15
15
|
def presence_set(options = {})
|
|
16
16
|
throw ArgumentError.new('Required arguments :presence missing') if options[:presence].nil?
|
|
17
17
|
post('presence.set', options)
|
|
@@ -19,7 +19,7 @@ module Slack
|
|
|
19
19
|
# @option options [Object] :timestamp
|
|
20
20
|
# Timestamp of the message to add reaction to.
|
|
21
21
|
# @see https://api.slack.com/methods/reactions.add
|
|
22
|
-
# @see https://github.com/
|
|
22
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.add.json
|
|
23
23
|
def reactions_add(options = {})
|
|
24
24
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
|
25
25
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
|
@@ -40,7 +40,7 @@ module Slack
|
|
|
40
40
|
# @option options [Object] :timestamp
|
|
41
41
|
# Timestamp of the message to get reactions for.
|
|
42
42
|
# @see https://api.slack.com/methods/reactions.get
|
|
43
|
-
# @see https://github.com/
|
|
43
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.get.json
|
|
44
44
|
def reactions_get(options = {})
|
|
45
45
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
|
46
46
|
post('reactions.get', options)
|
|
@@ -54,7 +54,7 @@ module Slack
|
|
|
54
54
|
# @option options [user] :user
|
|
55
55
|
# Show reactions made by this user. Defaults to the authed user.
|
|
56
56
|
# @see https://api.slack.com/methods/reactions.list
|
|
57
|
-
# @see https://github.com/
|
|
57
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.list.json
|
|
58
58
|
def reactions_list(options = {})
|
|
59
59
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
60
60
|
post('reactions.list', options)
|
|
@@ -74,7 +74,7 @@ module Slack
|
|
|
74
74
|
# @option options [Object] :timestamp
|
|
75
75
|
# Timestamp of the message to remove reaction from.
|
|
76
76
|
# @see https://api.slack.com/methods/reactions.remove
|
|
77
|
-
# @see https://github.com/
|
|
77
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.remove.json
|
|
78
78
|
def reactions_remove(options = {})
|
|
79
79
|
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
|
|
80
80
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
|
@@ -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?
|
|
@@ -29,7 +29,7 @@ module Slack
|
|
|
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)
|
|
@@ -41,7 +41,7 @@ module Slack
|
|
|
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)
|
|
@@ -53,7 +53,7 @@ module Slack
|
|
|
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)
|
|
@@ -63,7 +63,7 @@ module Slack
|
|
|
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
|
|
@@ -9,11 +9,9 @@ module Slack
|
|
|
9
9
|
# Starts a Real Time Messaging session.
|
|
10
10
|
#
|
|
11
11
|
# @option options [Object] :batch_presence_aware
|
|
12
|
-
# Group presence change notices as presence_change_batch events when possible. See batching.
|
|
13
|
-
# @option options [Object] :presence_sub
|
|
14
12
|
# Only deliver presence events when requested by subscription. See presence subscriptions.
|
|
15
13
|
# @see https://api.slack.com/methods/rtm.connect
|
|
16
|
-
# @see https://github.com/
|
|
14
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/rtm/rtm.connect.json
|
|
17
15
|
def rtm_connect(options = {})
|
|
18
16
|
post('rtm.connect', options)
|
|
19
17
|
end
|
|
@@ -22,7 +20,7 @@ module Slack
|
|
|
22
20
|
# Starts a Real Time Messaging session.
|
|
23
21
|
#
|
|
24
22
|
# @option options [Object] :batch_presence_aware
|
|
25
|
-
#
|
|
23
|
+
# Only deliver presence events when requested by subscription. See presence subscriptions.
|
|
26
24
|
# @option options [Object] :include_locale
|
|
27
25
|
# Set this to true to receive the locale for users and channels. Defaults to false.
|
|
28
26
|
# @option options [Object] :mpim_aware
|
|
@@ -31,12 +29,10 @@ module Slack
|
|
|
31
29
|
# Exclude latest timestamps for channels, groups, mpims, and ims. Automatically sets no_unreads to 1.
|
|
32
30
|
# @option options [Object] :no_unreads
|
|
33
31
|
# Skip unread counts for each channel (improves performance).
|
|
34
|
-
# @option options [Object] :presence_sub
|
|
35
|
-
# Only deliver presence events when requested by subscription. See presence subscriptions.
|
|
36
32
|
# @option options [Object] :simple_latest
|
|
37
33
|
# Return timestamp only for latest message object of each channel (improves performance).
|
|
38
34
|
# @see https://api.slack.com/methods/rtm.start
|
|
39
|
-
# @see https://github.com/
|
|
35
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/rtm/rtm.start.json
|
|
40
36
|
def rtm_start(options = {})
|
|
41
37
|
post('rtm.start', options)
|
|
42
38
|
end
|
|
@@ -17,7 +17,7 @@ module Slack
|
|
|
17
17
|
# @option options [Object] :sort_dir
|
|
18
18
|
# Change sort direction to ascending (asc) or descending (desc).
|
|
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)
|
|
@@ -35,7 +35,7 @@ module Slack
|
|
|
35
35
|
# @option options [Object] :sort_dir
|
|
36
36
|
# Change sort direction to ascending (asc) or descending (desc).
|
|
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)
|
|
@@ -53,7 +53,7 @@ module Slack
|
|
|
53
53
|
# @option options [Object] :sort_dir
|
|
54
54
|
# Change sort direction to ascending (asc) or descending (desc).
|
|
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)
|
|
@@ -17,7 +17,7 @@ module Slack
|
|
|
17
17
|
# @option options [Object] :timestamp
|
|
18
18
|
# Timestamp of the message to add star to.
|
|
19
19
|
# @see https://api.slack.com/methods/stars.add
|
|
20
|
-
# @see https://github.com/
|
|
20
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.add.json
|
|
21
21
|
def stars_add(options = {})
|
|
22
22
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
|
23
23
|
post('stars.add', options)
|
|
@@ -27,7 +27,7 @@ module Slack
|
|
|
27
27
|
# Lists stars for a user.
|
|
28
28
|
#
|
|
29
29
|
# @see https://api.slack.com/methods/stars.list
|
|
30
|
-
# @see https://github.com/
|
|
30
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.list.json
|
|
31
31
|
def stars_list(options = {})
|
|
32
32
|
post('stars.list', options)
|
|
33
33
|
end
|
|
@@ -44,7 +44,7 @@ module Slack
|
|
|
44
44
|
# @option options [Object] :timestamp
|
|
45
45
|
# Timestamp of the message to remove star from.
|
|
46
46
|
# @see https://api.slack.com/methods/stars.remove
|
|
47
|
-
# @see https://github.com/
|
|
47
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/stars/stars.remove.json
|
|
48
48
|
def stars_remove(options = {})
|
|
49
49
|
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
|
50
50
|
post('stars.remove', options)
|
|
@@ -11,7 +11,7 @@ module Slack
|
|
|
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
|
|
@@ -22,7 +22,7 @@ module Slack
|
|
|
22
22
|
# @option options [user] :user
|
|
23
23
|
# A user to retrieve the billable information for. Defaults to all users.
|
|
24
24
|
# @see https://api.slack.com/methods/team.billableInfo
|
|
25
|
-
# @see https://github.com/
|
|
25
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.billableInfo.json
|
|
26
26
|
def team_billableInfo(options = {})
|
|
27
27
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
28
28
|
post('team.billableInfo', options)
|
|
@@ -32,7 +32,7 @@ module Slack
|
|
|
32
32
|
# Gets information about the current team.
|
|
33
33
|
#
|
|
34
34
|
# @see https://api.slack.com/methods/team.info
|
|
35
|
-
# @see https://github.com/
|
|
35
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.info.json
|
|
36
36
|
def team_info(options = {})
|
|
37
37
|
post('team.info', options)
|
|
38
38
|
end
|
|
@@ -49,7 +49,7 @@ module Slack
|
|
|
49
49
|
# @option options [user] :user
|
|
50
50
|
# Filter logs generated by this user's actions. Defaults to all logs.
|
|
51
51
|
# @see https://api.slack.com/methods/team.integrationLogs
|
|
52
|
-
# @see https://github.com/
|
|
52
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/team/team.integrationLogs.json
|
|
53
53
|
def team_integrationLogs(options = {})
|
|
54
54
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
55
55
|
post('team.integrationLogs', options)
|
|
@@ -11,7 +11,7 @@ module Slack
|
|
|
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
|
|
@@ -19,7 +19,7 @@ module Slack
|
|
|
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)
|
|
@@ -33,7 +33,7 @@ module Slack
|
|
|
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)
|
|
@@ -47,7 +47,7 @@ module Slack
|
|
|
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)
|
|
@@ -63,7 +63,7 @@ module Slack
|
|
|
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
|
|
@@ -84,7 +84,7 @@ module Slack
|
|
|
84
84
|
# @option options [Object] :name
|
|
85
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)
|
|
@@ -13,7 +13,7 @@ module Slack
|
|
|
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)
|
|
@@ -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?
|
|
@@ -9,7 +9,7 @@ module Slack
|
|
|
9
9
|
# Delete the user profile photo
|
|
10
10
|
#
|
|
11
11
|
# @see https://api.slack.com/methods/users.deletePhoto
|
|
12
|
-
# @see https://github.com/
|
|
12
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.deletePhoto.json
|
|
13
13
|
def users_deletePhoto(options = {})
|
|
14
14
|
post('users.deletePhoto', options)
|
|
15
15
|
end
|
|
@@ -20,7 +20,7 @@ module Slack
|
|
|
20
20
|
# @option options [user] :user
|
|
21
21
|
# User to get presence info on. Defaults to the authed user.
|
|
22
22
|
# @see https://api.slack.com/methods/users.getPresence
|
|
23
|
-
# @see https://github.com/
|
|
23
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.getPresence.json
|
|
24
24
|
def users_getPresence(options = {})
|
|
25
25
|
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
|
26
26
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
@@ -31,7 +31,7 @@ module Slack
|
|
|
31
31
|
# Get a user's identity.
|
|
32
32
|
#
|
|
33
33
|
# @see https://api.slack.com/methods/users.identity
|
|
34
|
-
# @see https://github.com/
|
|
34
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.identity.json
|
|
35
35
|
def users_identity(options = {})
|
|
36
36
|
post('users.identity', options)
|
|
37
37
|
end
|
|
@@ -44,7 +44,7 @@ module Slack
|
|
|
44
44
|
# @option options [Object] :include_locale
|
|
45
45
|
# Set this to true to receive the locale for this user. Defaults to false.
|
|
46
46
|
# @see https://api.slack.com/methods/users.info
|
|
47
|
-
# @see https://github.com/
|
|
47
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.info.json
|
|
48
48
|
def users_info(options = {})
|
|
49
49
|
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
|
50
50
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
@@ -63,7 +63,7 @@ module Slack
|
|
|
63
63
|
# @option options [Object] :presence
|
|
64
64
|
# Whether to include presence data in the output. Setting this to false improves performance, especially with large teams.
|
|
65
65
|
# @see https://api.slack.com/methods/users.list
|
|
66
|
-
# @see https://github.com/
|
|
66
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.list.json
|
|
67
67
|
def users_list(options = {})
|
|
68
68
|
if block_given?
|
|
69
69
|
Pagination::Cursor.new(self, :users_list, options).each do |page|
|
|
@@ -78,7 +78,7 @@ module Slack
|
|
|
78
78
|
# Marks a user as active.
|
|
79
79
|
#
|
|
80
80
|
# @see https://api.slack.com/methods/users.setActive
|
|
81
|
-
# @see https://github.com/
|
|
81
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setActive.json
|
|
82
82
|
def users_setActive(options = {})
|
|
83
83
|
post('users.setActive', options)
|
|
84
84
|
end
|
|
@@ -95,7 +95,7 @@ module Slack
|
|
|
95
95
|
# @option options [Object] :crop_y
|
|
96
96
|
# Y coordinate of top-left corner of crop box.
|
|
97
97
|
# @see https://api.slack.com/methods/users.setPhoto
|
|
98
|
-
# @see https://github.com/
|
|
98
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setPhoto.json
|
|
99
99
|
def users_setPhoto(options = {})
|
|
100
100
|
throw ArgumentError.new('Required arguments :image missing') if options[:image].nil?
|
|
101
101
|
post('users.setPhoto', options)
|
|
@@ -107,7 +107,7 @@ module Slack
|
|
|
107
107
|
# @option options [Object] :presence
|
|
108
108
|
# Either auto or away.
|
|
109
109
|
# @see https://api.slack.com/methods/users.setPresence
|
|
110
|
-
# @see https://github.com/
|
|
110
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users/users.setPresence.json
|
|
111
111
|
def users_setPresence(options = {})
|
|
112
112
|
throw ArgumentError.new('Required arguments :presence missing') if options[:presence].nil?
|
|
113
113
|
post('users.setPresence', options)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# This file was auto-generated by lib/tasks/web.rake
|
|
2
|
+
|
|
3
|
+
module Slack
|
|
4
|
+
module Web
|
|
5
|
+
module Api
|
|
6
|
+
module Endpoints
|
|
7
|
+
module UsersAdmin
|
|
8
|
+
#
|
|
9
|
+
# Send an invitation to a new user by email (undocumented)
|
|
10
|
+
#
|
|
11
|
+
# @option options [Object] :email
|
|
12
|
+
# Email address of the new user
|
|
13
|
+
# @option options [Object] :channels
|
|
14
|
+
# Comma-separated list of IDs (not names!) for channels, which the new user will auto-join. Both channel IDs for public channels and group IDs for private chanels work.
|
|
15
|
+
# @option options [Object] :first_name
|
|
16
|
+
# Prefilled input for the "First name" field on the "new user registration" page.
|
|
17
|
+
# @option options [Object] :last_name
|
|
18
|
+
# Prefilled input for the "Last name" field on the "new user registration" page.
|
|
19
|
+
# @option options [Object] :resend
|
|
20
|
+
# Resend the invitation email if the user has already been invited and the email was sent some time ago.
|
|
21
|
+
# @option options [Object] :restricted
|
|
22
|
+
# Invite a guest that can use multiple channels
|
|
23
|
+
# @option options [Object] :ultra_restricted
|
|
24
|
+
# Invite a guest that can use one channel only
|
|
25
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/users.admin/users.admin.invite.json
|
|
26
|
+
def users_admin_invite(options = {})
|
|
27
|
+
throw ArgumentError.new('Required arguments :email missing') if options[:email].nil?
|
|
28
|
+
post('users.admin.invite', options)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
#
|
|
32
|
+
# Disable a user (undocumented)
|
|
33
|
+
#
|
|
34
|
+
# @option options [user] :user
|
|
35
|
+
# User to disable
|
|
36
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/users.admin/users.admin.setInactive.json
|
|
37
|
+
def users_admin_setInactive(options = {})
|
|
38
|
+
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
|
39
|
+
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
40
|
+
post('users.admin.setInactive', options)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|