slack-ruby-client 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,11 +6,10 @@ module Slack
6
6
  module Endpoints
7
7
  module Emoji
8
8
  #
9
- # Lists custom emoji for a team.
9
+ # This method lists the custom emoji for a team.
10
10
  #
11
11
  # @see https://api.slack.com/methods/emoji.list
12
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/emoji.list.md
13
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/emoji.list.json
12
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/emoji.list.json
14
13
  def emoji_list(options = {})
15
14
  post('emoji.list', options)
16
15
  end
@@ -6,22 +6,33 @@ module Slack
6
6
  module Endpoints
7
7
  module Files
8
8
  #
9
- # Gets information about a team file.
9
+ # This method deletes a file from your team.
10
10
  #
11
- # @option options [file] :file
12
- # File to fetch info for
11
+ # @option options [Object] :file
12
+ # ID of file to delete.
13
+ # @see https://api.slack.com/methods/files.delete
14
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.delete.json
15
+ def files_delete(options = {})
16
+ throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
17
+ post('files.delete', options)
18
+ end
19
+
20
+ #
21
+ # This method returns information about a file in your team.
22
+ #
23
+ # @option options [Object] :file
24
+ # File to fetch info for.
13
25
  # @see https://api.slack.com/methods/files.info
14
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.info.md
15
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.info.json
26
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.info.json
16
27
  def files_info(options = {})
17
28
  throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
18
29
  post('files.info', options)
19
30
  end
20
31
 
21
32
  #
22
- # Lists & filters team files.
33
+ # This method returns a list of files within the team. It can be filtered and sliced in various ways.
23
34
  #
24
- # @option options [user] :user
35
+ # @option options [Object] :user
25
36
  # Filter files created by a single user.
26
37
  # @option options [Object] :ts_from
27
38
  # Filter files created after this timestamp (inclusive).
@@ -30,27 +41,28 @@ module Slack
30
41
  # @option options [Object] :types
31
42
  # Filter files by type:
32
43
  #
33
- # * `all` - All files
34
- # * `posts` - Posts
35
- # * `snippets` - Snippets
36
- # * `images` - Image files
37
- # * `gdocs` - Google docs
38
- # * `zips` - Zip files
39
- # * `pdfs` - PDF files
44
+ # all - All files
45
+ # posts - Posts
46
+ # snippets - Snippets
47
+ # images - Image files
48
+ # gdocs - Google docs
49
+ # zips - Zip files
50
+ # pdfs - PDF files
51
+ #
40
52
  #
41
- # You can pass multiple values in the types argument, like `types=posts,snippets`.The default value is `all`, which does not filter the list.
53
+ # You can pass multiple values in the types argument, like types=posts,snippets.The default value is all, which does not filter the list.
54
+ # .
42
55
  # @see https://api.slack.com/methods/files.list
43
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.list.md
44
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.list.json
56
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.list.json
45
57
  def files_list(options = {})
46
58
  post('files.list', options)
47
59
  end
48
60
 
49
61
  #
50
- # Uploads or creates a file.
62
+ # This method allows you to create or upload an existing file.
51
63
  #
52
64
  # @option options [Object] :file
53
- # File contents via `multipart/form-data`.
65
+ # File contents via multipart/form-data.
54
66
  # @option options [Object] :content
55
67
  # File contents via a POST var.
56
68
  # @option options [Object] :filetype
@@ -61,11 +73,10 @@ module Slack
61
73
  # Title of file.
62
74
  # @option options [Object] :initial_comment
63
75
  # Initial comment to add to file.
64
- # @option options [channel] :channels
76
+ # @option options [Object] :channels
65
77
  # Comma separated list of channels to share the file into.
66
78
  # @see https://api.slack.com/methods/files.upload
67
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.upload.md
68
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/files.upload.json
79
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.upload.json
69
80
  def files_upload(options = {})
70
81
  post('files.upload', options)
71
82
  end
@@ -6,86 +6,94 @@ module Slack
6
6
  module Endpoints
7
7
  module Groups
8
8
  #
9
- # Archives a private group.
9
+ # This method archives a private group.
10
10
  #
11
- # @option options [group] :channel
12
- # Private group to archive
11
+ # @option options [Object] :channel
12
+ # Private group to archive.
13
13
  # @see https://api.slack.com/methods/groups.archive
14
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.archive.md
15
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.archive.json
14
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.archive.json
16
15
  def groups_archive(options = {})
17
16
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
18
17
  post('groups.archive', options)
19
18
  end
20
19
 
21
20
  #
22
- # Closes a private group.
21
+ # This method closes a private group.
23
22
  #
24
- # @option options [group] :channel
23
+ # @option options [Object] :channel
25
24
  # Group to open.
26
25
  # @see https://api.slack.com/methods/groups.close
27
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.close.md
28
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.close.json
26
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.close.json
29
27
  def groups_close(options = {})
30
28
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
31
29
  post('groups.close', options)
32
30
  end
33
31
 
34
32
  #
35
- # Creates a private group.
33
+ # This method creates a private group.
36
34
  #
37
35
  # @option options [Object] :name
38
- # Name of group to create
36
+ # Name of group to create.
39
37
  # @see https://api.slack.com/methods/groups.create
40
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.create.md
41
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.create.json
38
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.create.json
42
39
  def groups_create(options = {})
43
40
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
44
41
  post('groups.create', options)
45
42
  end
46
43
 
47
44
  #
48
- # Clones and archives a private group.
45
+ # This method takes an existing private group and performs the following steps:
49
46
  #
50
- # @option options [group] :channel
47
+ # @option options [Object] :channel
51
48
  # Group to clone and archive.
52
49
  # @see https://api.slack.com/methods/groups.createChild
53
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.createChild.md
54
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.createChild.json
50
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.createChild.json
55
51
  def groups_createChild(options = {})
56
52
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
57
53
  post('groups.createChild', options)
58
54
  end
59
55
 
60
56
  #
61
- # Fetches history of messages and events from a private group.
57
+ # This method returns a portion of messages/events from the specified private group.
58
+ # To read the entire history for a group, call the method with no latest or
59
+ # oldest arguments, and then continue paging using the instructions below.
62
60
  #
63
- # @option options [group] :channel
61
+ # @option options [Object] :channel
64
62
  # Group to fetch history for.
65
- # @option options [timestamp] :latest
66
- # Latest message timestamp to include in results.
67
- # @option options [timestamp] :oldest
68
- # Oldest message timestamp to include in results.
69
- # @option options [Object] :count
70
- # Number of messages to return, between 1 and 1000.
63
+ # @option options [Object] :latest
64
+ # End of time range of messages to include in results.
65
+ # @option options [Object] :oldest
66
+ # Start of time range of messages to include in results.
67
+ # @option options [Object] :inclusive
68
+ # Include messages with latest or oldest timestamp in results.
71
69
  # @see https://api.slack.com/methods/groups.history
72
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.history.md
73
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.history.json
70
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.history.json
74
71
  def groups_history(options = {})
75
72
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
76
73
  post('groups.history', options)
77
74
  end
78
75
 
79
76
  #
80
- # Invites a user to a private group.
77
+ # This method returns information about a private group.
81
78
  #
82
- # @option options [group] :channel
79
+ # @option options [Object] :channel
80
+ # Group to get info on.
81
+ # @see https://api.slack.com/methods/groups.info
82
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.info.json
83
+ def groups_info(options = {})
84
+ throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
85
+ post('groups.info', options)
86
+ end
87
+
88
+ #
89
+ # This method is used to invite a user to a private group. The calling user must be a member of the group.
90
+ #
91
+ # @option options [Object] :channel
83
92
  # Private group to invite user to.
84
- # @option options [user] :user
93
+ # @option options [Object] :user
85
94
  # User to invite.
86
95
  # @see https://api.slack.com/methods/groups.invite
87
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.invite.md
88
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.invite.json
96
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.invite.json
89
97
  def groups_invite(options = {})
90
98
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
91
99
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
@@ -93,15 +101,14 @@ module Slack
93
101
  end
94
102
 
95
103
  #
96
- # Removes a user from a private group.
104
+ # This method allows a user to remove another member from a private group.
97
105
  #
98
- # @option options [group] :channel
106
+ # @option options [Object] :channel
99
107
  # Group to remove user from.
100
- # @option options [user] :user
108
+ # @option options [Object] :user
101
109
  # User to remove from group.
102
110
  # @see https://api.slack.com/methods/groups.kick
103
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.kick.md
104
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.kick.json
111
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.kick.json
105
112
  def groups_kick(options = {})
106
113
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
107
114
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
@@ -109,40 +116,38 @@ module Slack
109
116
  end
110
117
 
111
118
  #
112
- # Leaves a private group.
119
+ # This method is used to leave a private group.
113
120
  #
114
- # @option options [group] :channel
115
- # Group to leave
121
+ # @option options [Object] :channel
122
+ # Group to leave.
116
123
  # @see https://api.slack.com/methods/groups.leave
117
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.leave.md
118
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.leave.json
124
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.leave.json
119
125
  def groups_leave(options = {})
120
126
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
121
127
  post('groups.leave', options)
122
128
  end
123
129
 
124
130
  #
125
- # Lists private groups that the calling user has access to.
131
+ # This method returns a list of groups in the team that the caller is in and archived groups that the caller was in.
132
+ # The list of (non-deactivated) members in each group is also returned.
126
133
  #
127
134
  # @option options [Object] :exclude_archived
128
135
  # Don't return archived groups.
129
136
  # @see https://api.slack.com/methods/groups.list
130
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.list.md
131
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.list.json
137
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.list.json
132
138
  def groups_list(options = {})
133
139
  post('groups.list', options)
134
140
  end
135
141
 
136
142
  #
137
- # Sets the read cursor in a private group.
143
+ # This method moves the read cursor in a private group.
138
144
  #
139
- # @option options [group] :channel
145
+ # @option options [Object] :channel
140
146
  # Group to set reading cursor in.
141
- # @option options [timestamp] :ts
147
+ # @option options [Object] :ts
142
148
  # Timestamp of the most recently seen message.
143
149
  # @see https://api.slack.com/methods/groups.mark
144
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.mark.md
145
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.mark.json
150
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.mark.json
146
151
  def groups_mark(options = {})
147
152
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
148
153
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
@@ -150,28 +155,26 @@ module Slack
150
155
  end
151
156
 
152
157
  #
153
- # Opens a private group.
158
+ # This method opens a private group.
154
159
  #
155
- # @option options [group] :channel
160
+ # @option options [Object] :channel
156
161
  # Group to open.
157
162
  # @see https://api.slack.com/methods/groups.open
158
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.open.md
159
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.open.json
163
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.open.json
160
164
  def groups_open(options = {})
161
165
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
162
166
  post('groups.open', options)
163
167
  end
164
168
 
165
169
  #
166
- # Renames a private group.
170
+ # This method renames a private group.
167
171
  #
168
- # @option options [channel] :channel
169
- # Group to rename
172
+ # @option options [Object] :channel
173
+ # Group to rename.
170
174
  # @option options [Object] :name
171
175
  # New name for group.
172
176
  # @see https://api.slack.com/methods/groups.rename
173
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.rename.md
174
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.rename.json
177
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.rename.json
175
178
  def groups_rename(options = {})
176
179
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
177
180
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
@@ -179,15 +182,14 @@ module Slack
179
182
  end
180
183
 
181
184
  #
182
- # Sets the purpose for a private group.
185
+ # This method is used to change the purpose of a private group. The calling user must be a member of the private group.
183
186
  #
184
- # @option options [channel] :channel
185
- # Private group to set the purpose of
187
+ # @option options [Object] :channel
188
+ # Private group to set the purpose of.
186
189
  # @option options [Object] :purpose
187
- # The new purpose
190
+ # The new purpose.
188
191
  # @see https://api.slack.com/methods/groups.setPurpose
189
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.setPurpose.md
190
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.setPurpose.json
192
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.setPurpose.json
191
193
  def groups_setPurpose(options = {})
192
194
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
193
195
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
@@ -195,15 +197,14 @@ module Slack
195
197
  end
196
198
 
197
199
  #
198
- # Sets the topic for a private group.
200
+ # This method is used to change the topic of a private group. The calling user must be a member of the private group.
199
201
  #
200
- # @option options [channel] :channel
201
- # Private group to set the topic of
202
+ # @option options [Object] :channel
203
+ # Private group to set the topic of.
202
204
  # @option options [Object] :topic
203
- # The new topic
205
+ # The new topic.
204
206
  # @see https://api.slack.com/methods/groups.setTopic
205
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.setTopic.md
206
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.setTopic.json
207
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.setTopic.json
207
208
  def groups_setTopic(options = {})
208
209
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
209
210
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
@@ -211,13 +212,12 @@ module Slack
211
212
  end
212
213
 
213
214
  #
214
- # Unarchives a private group.
215
+ # This method unarchives a private group.
215
216
  #
216
- # @option options [group] :channel
217
- # Group to unarchive
217
+ # @option options [Object] :channel
218
+ # Group to unarchive.
218
219
  # @see https://api.slack.com/methods/groups.unarchive
219
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.unarchive.md
220
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/groups.unarchive.json
220
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups.unarchive.json
221
221
  def groups_unarchive(options = {})
222
222
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
223
223
  post('groups.unarchive', options)
@@ -6,57 +6,55 @@ module Slack
6
6
  module Endpoints
7
7
  module Im
8
8
  #
9
- # Close a direct message channel.
9
+ # This method closes a direct message channel.
10
10
  #
11
- # @option options [im] :channel
11
+ # @option options [Object] :channel
12
12
  # Direct message channel to close.
13
13
  # @see https://api.slack.com/methods/im.close
14
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.close.md
15
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.close.json
14
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/im.close.json
16
15
  def im_close(options = {})
17
16
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
18
17
  post('im.close', options)
19
18
  end
20
19
 
21
20
  #
22
- # Fetches history of messages and events from direct message channel.
21
+ # This method returns a portion of messages/events from the specified direct message channel.
22
+ # To read the entire history for a direct message channel, call the method with no latest or
23
+ # oldest arguments, and then continue paging using the instructions below.
23
24
  #
24
- # @option options [im] :channel
25
+ # @option options [Object] :channel
25
26
  # Direct message channel to fetch history for.
26
- # @option options [timestamp] :latest
27
- # Latest message timestamp to include in results.
28
- # @option options [timestamp] :oldest
29
- # Oldest message timestamp to include in results.
30
- # @option options [Object] :count
31
- # Number of messages to return, between 1 and 1000.
27
+ # @option options [Object] :latest
28
+ # End of time range of messages to include in results.
29
+ # @option options [Object] :oldest
30
+ # Start of time range of messages to include in results.
31
+ # @option options [Object] :inclusive
32
+ # Include messages with latest or oldest timestamp in results.
32
33
  # @see https://api.slack.com/methods/im.history
33
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.history.md
34
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.history.json
34
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/im.history.json
35
35
  def im_history(options = {})
36
36
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
37
37
  post('im.history', options)
38
38
  end
39
39
 
40
40
  #
41
- # Lists direct message channels for the calling user.
41
+ # This method returns a list of all im channels that the user has.
42
42
  #
43
43
  # @see https://api.slack.com/methods/im.list
44
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.list.md
45
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.list.json
44
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/im.list.json
46
45
  def im_list(options = {})
47
46
  post('im.list', options)
48
47
  end
49
48
 
50
49
  #
51
- # Sets the read cursor in a direct message channel.
50
+ # This method moves the read cursor in a direct message channel.
52
51
  #
53
- # @option options [im] :channel
52
+ # @option options [Object] :channel
54
53
  # Direct message channel to set reading cursor in.
55
- # @option options [timestamp] :ts
54
+ # @option options [Object] :ts
56
55
  # Timestamp of the most recently seen message.
57
56
  # @see https://api.slack.com/methods/im.mark
58
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.mark.md
59
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.mark.json
57
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/im.mark.json
60
58
  def im_mark(options = {})
61
59
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
62
60
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
@@ -64,13 +62,12 @@ module Slack
64
62
  end
65
63
 
66
64
  #
67
- # Opens a direct message channel.
65
+ # This method opens a direct message channel with another member of your Slack team.
68
66
  #
69
- # @option options [user] :user
67
+ # @option options [Object] :user
70
68
  # User to open a direct message channel with.
71
69
  # @see https://api.slack.com/methods/im.open
72
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.open.md
73
- # @see https://github.com/slackhq/slack-api-docs/blob/master/methods/im.open.json
70
+ # @see https://github.com/dblock/slack-api-ref/blob/master/methods/im.open.json
74
71
  def im_open(options = {})
75
72
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
76
73
  post('im.open', options)