slack-api 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/tasks/generate.rb +1 -1
- data/lib/generators/templates/method.rb.erb +1 -1
- data/lib/slack/endpoint/channels.rb +4 -2
- data/lib/slack/endpoint/discovery.rb +18 -5
- data/lib/slack/endpoint/files.rb +37 -6
- data/lib/slack/endpoint/team.rb +5 -5
- data/lib/slack/endpoint/usergroups.rb +20 -5
- data/lib/slack/endpoint/users.rb +20 -6
- data/lib/slack/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2891cd4a06dfc68f65ba2ad8628980ddc008ddba
|
4
|
+
data.tar.gz: ff8a862175ad65f0a76d18a1d46f07470f07fa49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07de10a285ece0080aa4b47309c0432298da56d942c96cdb6407b3c0007525e95fd2f97ff6e08fee6894fa04cbed2fb3dc1c70915fff043763be5b918d3e90d7
|
7
|
+
data.tar.gz: 2611525bec9c74a89b939bf6ecc7b9fa6757f83054345b818b9b28c48b73c7b6b5caf2118cb257f3caa28d0884e89d7b1e7326a8169fc27925a963b849768e93
|
@@ -18,7 +18,7 @@ module Slack
|
|
18
18
|
# @see https://api.slack.com/methods/<%= group %>.<%= name %>
|
19
19
|
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/<%= group %>.<%= name %>.md
|
20
20
|
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/<%= group %>.<%= name %>.json
|
21
|
-
def <%= group %>_<%= name %>(options={})
|
21
|
+
def <%= group %>_<%= name.gsub(".", "_") %>(options={})
|
22
22
|
<% data["args"].reject{|k, v| k=="token"}.select{|k,v| v["required"]}.each do |arg_name, arg_v| %>
|
23
23
|
<% if group == "chat" && name == "postMessage" && arg_name == "text" %>
|
24
24
|
throw ArgumentError.new("Required arguments :text or :attachments missing") if options[:<%= arg_name %>].nil? && options[:attachments].nil?
|
@@ -32,7 +32,7 @@ module Slack
|
|
32
32
|
end
|
33
33
|
|
34
34
|
#
|
35
|
-
# This method returns a portion of message events from the specified channel.
|
35
|
+
# This method returns a portion of message events from the specified public channel.
|
36
36
|
#
|
37
37
|
# @option options [Object] :channel
|
38
38
|
# Channel to fetch history for.
|
@@ -132,7 +132,9 @@ module Slack
|
|
132
132
|
# This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived channels but does not include private channels. The number of (non-deactivated) members in each channel is also returned.
|
133
133
|
#
|
134
134
|
# @option options [Object] :exclude_archived
|
135
|
-
#
|
135
|
+
# Exclude archived channels from the list
|
136
|
+
# @option options [Object] :exclude_members
|
137
|
+
# Exclude the members collection from each channel
|
136
138
|
# @see https://api.slack.com/methods/channels.list
|
137
139
|
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/channels.list.md
|
138
140
|
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/channels.list.json
|
@@ -8,12 +8,25 @@ module Slack
|
|
8
8
|
#
|
9
9
|
# @option options [Object] :file
|
10
10
|
# Specify a file by providing its ID.
|
11
|
-
# @see https://api.slack.com/methods/discovery.file
|
12
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/discovery.file.md
|
13
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/discovery.file.json
|
14
|
-
def
|
11
|
+
# @see https://api.slack.com/methods/discovery.file.restore
|
12
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/discovery.file.restore.md
|
13
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/discovery.file.restore.json
|
14
|
+
def discovery_file_restore(options={})
|
15
15
|
throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
|
16
|
-
post("discovery.file", options)
|
16
|
+
post("discovery.file.restore", options)
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# There is no documentation for this method.
|
21
|
+
#
|
22
|
+
# @option options [Object] :file
|
23
|
+
# Specify a file by providing its ID.
|
24
|
+
# @see https://api.slack.com/methods/discovery.file.tombstone
|
25
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/discovery.file.tombstone.md
|
26
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/discovery.file.tombstone.json
|
27
|
+
def discovery_file_tombstone(options={})
|
28
|
+
throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
|
29
|
+
post("discovery.file.tombstone", options)
|
17
30
|
end
|
18
31
|
|
19
32
|
end
|
data/lib/slack/endpoint/files.rb
CHANGED
@@ -3,6 +3,38 @@
|
|
3
3
|
module Slack
|
4
4
|
module Endpoint
|
5
5
|
module Files
|
6
|
+
#
|
7
|
+
# Add a comment to an existing file.
|
8
|
+
#
|
9
|
+
# @option options [Object] :file
|
10
|
+
# File to add a comment to.
|
11
|
+
# @option options [Object] :comment
|
12
|
+
# Text of the comment to add.
|
13
|
+
# @see https://api.slack.com/methods/files.comments.add
|
14
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.comments.add.md
|
15
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.comments.add.json
|
16
|
+
def files_comments_add(options={})
|
17
|
+
throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
|
18
|
+
throw ArgumentError.new("Required arguments :comment missing") if options[:comment].nil?
|
19
|
+
post("files.comments.add", options)
|
20
|
+
end
|
21
|
+
|
22
|
+
#
|
23
|
+
# Delete an existing comment on a file. Only the original author of the comment or a Team Administrator may delete a file comment.
|
24
|
+
#
|
25
|
+
# @option options [Object] :file
|
26
|
+
# File to delete a comment from.
|
27
|
+
# @option options [Object] :id
|
28
|
+
# The comment to delete.
|
29
|
+
# @see https://api.slack.com/methods/files.comments.delete
|
30
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.comments.delete.md
|
31
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.comments.delete.json
|
32
|
+
def files_comments_delete(options={})
|
33
|
+
throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
|
34
|
+
throw ArgumentError.new("Required arguments :id missing") if options[:id].nil?
|
35
|
+
post("files.comments.delete", options)
|
36
|
+
end
|
37
|
+
|
6
38
|
#
|
7
39
|
# Edit an existing comment on a file. Only the user who created a comment may make edits. Teams may configure a limited time window during which file comment edits are allowed.
|
8
40
|
#
|
@@ -12,14 +44,14 @@ module Slack
|
|
12
44
|
# The comment to edit.
|
13
45
|
# @option options [Object] :comment
|
14
46
|
# Text of the comment to edit.
|
15
|
-
# @see https://api.slack.com/methods/files.comments
|
16
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.comments.md
|
17
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.comments.json
|
18
|
-
def
|
47
|
+
# @see https://api.slack.com/methods/files.comments.edit
|
48
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.comments.edit.md
|
49
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.comments.edit.json
|
50
|
+
def files_comments_edit(options={})
|
19
51
|
throw ArgumentError.new("Required arguments :file missing") if options[:file].nil?
|
20
52
|
throw ArgumentError.new("Required arguments :id missing") if options[:id].nil?
|
21
53
|
throw ArgumentError.new("Required arguments :comment missing") if options[:comment].nil?
|
22
|
-
post("files.comments", options)
|
54
|
+
post("files.comments.edit", options)
|
23
55
|
end
|
24
56
|
|
25
57
|
#
|
@@ -148,7 +180,6 @@ module Slack
|
|
148
180
|
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.upload.md
|
149
181
|
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/files.upload.json
|
150
182
|
def files_upload(options={})
|
151
|
-
throw ArgumentError.new("Required arguments :filename missing") if options[:filename].nil?
|
152
183
|
post("files.upload", options)
|
153
184
|
end
|
154
185
|
|
data/lib/slack/endpoint/team.rb
CHANGED
@@ -69,11 +69,11 @@ module Slack
|
|
69
69
|
#
|
70
70
|
# @option options [Object] :visibility
|
71
71
|
# Filter by visibility.
|
72
|
-
# @see https://api.slack.com/methods/team.profile
|
73
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/team.profile.md
|
74
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/team.profile.json
|
75
|
-
def
|
76
|
-
post("team.profile", options)
|
72
|
+
# @see https://api.slack.com/methods/team.profile.get
|
73
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/team.profile.get.md
|
74
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/team.profile.get.json
|
75
|
+
def team_profile_get(options={})
|
76
|
+
post("team.profile.get", options)
|
77
77
|
end
|
78
78
|
|
79
79
|
end
|
@@ -93,6 +93,21 @@ module Slack
|
|
93
93
|
post("usergroups.update", options)
|
94
94
|
end
|
95
95
|
|
96
|
+
#
|
97
|
+
# This method returns a list of all users within a User Group.
|
98
|
+
#
|
99
|
+
# @option options [Object] :usergroup
|
100
|
+
# The encoded ID of the User Group to update.
|
101
|
+
# @option options [Object] :include_disabled
|
102
|
+
# Allow results that involve disabled User Groups.
|
103
|
+
# @see https://api.slack.com/methods/usergroups.users.list
|
104
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/usergroups.users.list.md
|
105
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/usergroups.users.list.json
|
106
|
+
def usergroups_users_list(options={})
|
107
|
+
throw ArgumentError.new("Required arguments :usergroup missing") if options[:usergroup].nil?
|
108
|
+
post("usergroups.users.list", options)
|
109
|
+
end
|
110
|
+
|
96
111
|
#
|
97
112
|
# This method updates the list of users that belong to a User Group. This method replaces all users in a User Group with the list of users provided in the users parameter.
|
98
113
|
#
|
@@ -102,13 +117,13 @@ module Slack
|
|
102
117
|
# A comma separated string of encoded user IDs that represent the entire list of users for the User Group.
|
103
118
|
# @option options [Object] :include_count
|
104
119
|
# Include the number of users in the User Group.
|
105
|
-
# @see https://api.slack.com/methods/usergroups.users
|
106
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/usergroups.users.md
|
107
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/usergroups.users.json
|
108
|
-
def
|
120
|
+
# @see https://api.slack.com/methods/usergroups.users.update
|
121
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/usergroups.users.update.md
|
122
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/usergroups.users.update.json
|
123
|
+
def usergroups_users_update(options={})
|
109
124
|
throw ArgumentError.new("Required arguments :usergroup missing") if options[:usergroup].nil?
|
110
125
|
throw ArgumentError.new("Required arguments :users missing") if options[:users].nil?
|
111
|
-
post("usergroups.users", options)
|
126
|
+
post("usergroups.users.update", options)
|
112
127
|
end
|
113
128
|
|
114
129
|
end
|
data/lib/slack/endpoint/users.rb
CHANGED
@@ -63,7 +63,21 @@ module Slack
|
|
63
63
|
end
|
64
64
|
|
65
65
|
#
|
66
|
-
#
|
66
|
+
# Use this method to retrieve a user's profile information.
|
67
|
+
#
|
68
|
+
# @option options [Object] :user
|
69
|
+
# User to retrieve profile info for
|
70
|
+
# @option options [Object] :include_labels
|
71
|
+
# Include labels for each ID in custom profile fields
|
72
|
+
# @see https://api.slack.com/methods/users.profile.get
|
73
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/users.profile.get.md
|
74
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/users.profile.get.json
|
75
|
+
def users_profile_get(options={})
|
76
|
+
post("users.profile.get", options)
|
77
|
+
end
|
78
|
+
|
79
|
+
#
|
80
|
+
# Use this method to set a user's profile information, including name, email, current status, and other attributes.
|
67
81
|
#
|
68
82
|
# @option options [Object] :user
|
69
83
|
# ID of user to change. This argument may only be specified by team admins on paid teams.
|
@@ -73,11 +87,11 @@ module Slack
|
|
73
87
|
# Name of a single key to set. Usable only if profile is not passed.
|
74
88
|
# @option options [Object] :value
|
75
89
|
# Value to set a single key to. Usable only if profile is not passed.
|
76
|
-
# @see https://api.slack.com/methods/users.profile
|
77
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/users.profile.md
|
78
|
-
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/users.profile.json
|
79
|
-
def
|
80
|
-
post("users.profile", options)
|
90
|
+
# @see https://api.slack.com/methods/users.profile.set
|
91
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/users.profile.set.md
|
92
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/users.profile.set.json
|
93
|
+
def users_profile_set(options={})
|
94
|
+
post("users.profile.set", options)
|
81
95
|
end
|
82
96
|
|
83
97
|
#
|
data/lib/slack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki017
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|