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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 017d1be126fe1d0e7c4ae9a08ad1eeedf088580e
4
- data.tar.gz: 8680353ff493994af9da9152bf2b45bceba7e3db
3
+ metadata.gz: 2891cd4a06dfc68f65ba2ad8628980ddc008ddba
4
+ data.tar.gz: ff8a862175ad65f0a76d18a1d46f07470f07fa49
5
5
  SHA512:
6
- metadata.gz: 0895bc70fc8fc801123acbbaf0bb2dd5ab3dacbdb696de96bf0b1504d22a7ca39448f4a8827a37ed8528cce99294f13e3ce90a3f34b2fcd033d8d7530f0c2f4c
7
- data.tar.gz: 13779cc2cfd9bce0ef574fa1b737b1b3c1ba55890e12821bf40e1a44d6c936e681b059351e89c499e08d4dd4926006c2c21e6b70815d8fbd6610af63a80be277
6
+ metadata.gz: 07de10a285ece0080aa4b47309c0432298da56d942c96cdb6407b3c0007525e95fd2f97ff6e08fee6894fa04cbed2fb3dc1c70915fff043763be5b918d3e90d7
7
+ data.tar.gz: 2611525bec9c74a89b939bf6ecc7b9fa6757f83054345b818b9b28c48b73c7b6b5caf2118cb257f3caa28d0884e89d7b1e7326a8169fc27925a963b849768e93
@@ -22,7 +22,7 @@ namespace :api do
22
22
 
23
23
  data = Dir.glob(jsons).sort.each_with_object({}) do |path, result|
24
24
  name = File.basename(path, ".json")
25
- prefix, name = name.split(".")
25
+ prefix, name = name.split(".", 2)
26
26
  next if prefix == "rtm"
27
27
  result[prefix] ||= {}
28
28
 
@@ -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
- # Don't return archived channels.
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 discovery_file(options={})
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
@@ -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 files_comments(options={})
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
 
@@ -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 team_profile(options={})
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 usergroups_users(options={})
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
@@ -63,7 +63,21 @@ module Slack
63
63
  end
64
64
 
65
65
  #
66
- # This method is used to set the profile information for a user.
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 users_profile(options={})
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
  #
@@ -1,3 +1,3 @@
1
1
  module Slack
2
- VERSION = "1.5.0"
2
+ VERSION = "1.6.0"
3
3
  end
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.5.0
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-04-09 00:00:00.000000000 Z
11
+ date: 2017-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler