slack-web-api 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.gitmodules +3 -0
- data/.rspec +2 -0
- data/.travis.yml +6 -0
- data/Gemfile +4 -0
- data/Guardfile +13 -0
- data/LICENSE.txt +22 -0
- data/README.md +33 -0
- data/Rakefile +13 -0
- data/examples/basic.rb +35 -0
- data/lib/faraday/raise_http_exception.rb +51 -0
- data/lib/slack.rb +27 -0
- data/lib/slack/api.rb +24 -0
- data/lib/slack/client.rb +4 -0
- data/lib/slack/configuration.rb +76 -0
- data/lib/slack/connection.rb +29 -0
- data/lib/slack/endpoint.rb +43 -0
- data/lib/slack/endpoint/api.rb +23 -0
- data/lib/slack/endpoint/auth.rb +19 -0
- data/lib/slack/endpoint/channels.rb +236 -0
- data/lib/slack/endpoint/chat.rb +86 -0
- data/lib/slack/endpoint/emoji.rb +19 -0
- data/lib/slack/endpoint/files.rb +100 -0
- data/lib/slack/endpoint/groups.rb +262 -0
- data/lib/slack/endpoint/im.rb +90 -0
- data/lib/slack/endpoint/mpim.rb +90 -0
- data/lib/slack/endpoint/oauth.rb +31 -0
- data/lib/slack/endpoint/pins.rb +64 -0
- data/lib/slack/endpoint/presence.rb +22 -0
- data/lib/slack/endpoint/reactions.rb +94 -0
- data/lib/slack/endpoint/search.rb +80 -0
- data/lib/slack/endpoint/stars.rb +65 -0
- data/lib/slack/endpoint/team.rb +57 -0
- data/lib/slack/endpoint/usergroups.rb +122 -0
- data/lib/slack/endpoint/users.rb +78 -0
- data/lib/slack/error.rb +19 -0
- data/lib/slack/request.rb +41 -0
- data/lib/slack/version.rb +3 -0
- data/slack.gemspec +38 -0
- data/spec/api_spec.rb +23 -0
- data/spec/auth_spec.rb +22 -0
- data/spec/channels_spec.rb +247 -0
- data/spec/spec_helper.rb +86 -0
- metadata +313 -0
@@ -0,0 +1,262 @@
|
|
1
|
+
# This file was auto-generated by lib/generators/tasks/generate.rb
|
2
|
+
|
3
|
+
module Slack
|
4
|
+
module Endpoint
|
5
|
+
module Groups
|
6
|
+
#
|
7
|
+
# This method archives a private group.
|
8
|
+
#
|
9
|
+
# @option options [Object] :channel
|
10
|
+
# Private group to archive
|
11
|
+
# @see https://api.slack.com/methods/groups.archive
|
12
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.archive.md
|
13
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.archive.json
|
14
|
+
def groups_archive(options={})
|
15
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
16
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
17
|
+
post("groups.archive", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
#
|
21
|
+
# This method closes a private group.
|
22
|
+
#
|
23
|
+
# @option options [Object] :channel
|
24
|
+
# Group to close.
|
25
|
+
# @see https://api.slack.com/methods/groups.close
|
26
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.close.md
|
27
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.close.json
|
28
|
+
def groups_close(options={})
|
29
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
30
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
31
|
+
post("groups.close", options)
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# This method creates a private group.
|
36
|
+
#
|
37
|
+
# @option options [Object] :name
|
38
|
+
# Name of group to create
|
39
|
+
# @see https://api.slack.com/methods/groups.create
|
40
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.create.md
|
41
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.create.json
|
42
|
+
def groups_create(options={})
|
43
|
+
throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
|
44
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
45
|
+
post("groups.create", options)
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# This method takes an existing private group and performs the following steps:
|
50
|
+
#
|
51
|
+
# @option options [Object] :channel
|
52
|
+
# Group to clone and archive.
|
53
|
+
# @see https://api.slack.com/methods/groups.createChild
|
54
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.createChild.md
|
55
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.createChild.json
|
56
|
+
def groups_createChild(options={})
|
57
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
58
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
59
|
+
post("groups.createChild", options)
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# This method returns a portion of messages/events from the specified private group.
|
64
|
+
# To read the entire history for a group, call the method with no latest or
|
65
|
+
# oldest arguments, and then continue paging using the instructions below.
|
66
|
+
#
|
67
|
+
# @option options [Object] :channel
|
68
|
+
# Group to fetch history for.
|
69
|
+
# @option options [Object] :latest
|
70
|
+
# End of time range of messages to include in results.
|
71
|
+
# @option options [Object] :oldest
|
72
|
+
# Start of time range of messages to include in results.
|
73
|
+
# @option options [Object] :inclusive
|
74
|
+
# Include messages with latest or oldest timestamp in results.
|
75
|
+
# @option options [Object] :count
|
76
|
+
# Number of messages to return, between 1 and 1000.
|
77
|
+
# @option options [Object] :unreads
|
78
|
+
# Include unread_count_display in the output?
|
79
|
+
# @see https://api.slack.com/methods/groups.history
|
80
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.history.md
|
81
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.history.json
|
82
|
+
def groups_history(options={})
|
83
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
84
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
85
|
+
post("groups.history", options)
|
86
|
+
end
|
87
|
+
|
88
|
+
#
|
89
|
+
# This method returns information about a private group.
|
90
|
+
#
|
91
|
+
# @option options [Object] :channel
|
92
|
+
# Group to get info on
|
93
|
+
# @see https://api.slack.com/methods/groups.info
|
94
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.info.md
|
95
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.info.json
|
96
|
+
def groups_info(options={})
|
97
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
98
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
99
|
+
post("groups.info", options)
|
100
|
+
end
|
101
|
+
|
102
|
+
#
|
103
|
+
# This method is used to invite a user to a private group. The calling user must be a member of the group.
|
104
|
+
#
|
105
|
+
# @option options [Object] :channel
|
106
|
+
# Private group to invite user to.
|
107
|
+
# @option options [Object] :user
|
108
|
+
# User to invite.
|
109
|
+
# @see https://api.slack.com/methods/groups.invite
|
110
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.invite.md
|
111
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.invite.json
|
112
|
+
def groups_invite(options={})
|
113
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
114
|
+
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
115
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
116
|
+
post("groups.invite", options)
|
117
|
+
end
|
118
|
+
|
119
|
+
#
|
120
|
+
# This method allows a user to remove another member from a private group.
|
121
|
+
#
|
122
|
+
# @option options [Object] :channel
|
123
|
+
# Group to remove user from.
|
124
|
+
# @option options [Object] :user
|
125
|
+
# User to remove from group.
|
126
|
+
# @see https://api.slack.com/methods/groups.kick
|
127
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.kick.md
|
128
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.kick.json
|
129
|
+
def groups_kick(options={})
|
130
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
131
|
+
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
132
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
133
|
+
post("groups.kick", options)
|
134
|
+
end
|
135
|
+
|
136
|
+
#
|
137
|
+
# This method is used to leave a private group.
|
138
|
+
#
|
139
|
+
# @option options [Object] :channel
|
140
|
+
# Group to leave
|
141
|
+
# @see https://api.slack.com/methods/groups.leave
|
142
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.leave.md
|
143
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.leave.json
|
144
|
+
def groups_leave(options={})
|
145
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
146
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
147
|
+
post("groups.leave", options)
|
148
|
+
end
|
149
|
+
|
150
|
+
#
|
151
|
+
# This method returns a list of groups in the team that the caller is in and archived groups that the caller was in.
|
152
|
+
# The list of (non-deactivated) members in each group is also returned.
|
153
|
+
#
|
154
|
+
# @option options [Object] :exclude_archived
|
155
|
+
# Don't return archived groups.
|
156
|
+
# @see https://api.slack.com/methods/groups.list
|
157
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.list.md
|
158
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.list.json
|
159
|
+
def groups_list(options={})
|
160
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
161
|
+
post("groups.list", options)
|
162
|
+
end
|
163
|
+
|
164
|
+
#
|
165
|
+
# This method moves the read cursor in a private group.
|
166
|
+
#
|
167
|
+
# @option options [Object] :channel
|
168
|
+
# Group to set reading cursor in.
|
169
|
+
# @option options [Object] :ts
|
170
|
+
# Timestamp of the most recently seen message.
|
171
|
+
# @see https://api.slack.com/methods/groups.mark
|
172
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.mark.md
|
173
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.mark.json
|
174
|
+
def groups_mark(options={})
|
175
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
176
|
+
throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
|
177
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
178
|
+
post("groups.mark", options)
|
179
|
+
end
|
180
|
+
|
181
|
+
#
|
182
|
+
# This method opens a private group.
|
183
|
+
#
|
184
|
+
# @option options [Object] :channel
|
185
|
+
# Group to open.
|
186
|
+
# @see https://api.slack.com/methods/groups.open
|
187
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.open.md
|
188
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.open.json
|
189
|
+
def groups_open(options={})
|
190
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
191
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
192
|
+
post("groups.open", options)
|
193
|
+
end
|
194
|
+
|
195
|
+
#
|
196
|
+
# This method renames a private group.
|
197
|
+
#
|
198
|
+
# @option options [Object] :channel
|
199
|
+
# Group to rename
|
200
|
+
# @option options [Object] :name
|
201
|
+
# New name for group.
|
202
|
+
# @see https://api.slack.com/methods/groups.rename
|
203
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.rename.md
|
204
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.rename.json
|
205
|
+
def groups_rename(options={})
|
206
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
207
|
+
throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
|
208
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
209
|
+
post("groups.rename", options)
|
210
|
+
end
|
211
|
+
|
212
|
+
#
|
213
|
+
# This method is used to change the purpose of a private group. The calling user must be a member of the private group.
|
214
|
+
#
|
215
|
+
# @option options [Object] :channel
|
216
|
+
# Private group to set the purpose of
|
217
|
+
# @option options [Object] :purpose
|
218
|
+
# The new purpose
|
219
|
+
# @see https://api.slack.com/methods/groups.setPurpose
|
220
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.setPurpose.md
|
221
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.setPurpose.json
|
222
|
+
def groups_setPurpose(options={})
|
223
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
224
|
+
throw ArgumentError.new("Required arguments :purpose missing") if options[:purpose].nil?
|
225
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
226
|
+
post("groups.setPurpose", options)
|
227
|
+
end
|
228
|
+
|
229
|
+
#
|
230
|
+
# This method is used to change the topic of a private group. The calling user must be a member of the private group.
|
231
|
+
#
|
232
|
+
# @option options [Object] :channel
|
233
|
+
# Private group to set the topic of
|
234
|
+
# @option options [Object] :topic
|
235
|
+
# The new topic
|
236
|
+
# @see https://api.slack.com/methods/groups.setTopic
|
237
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.setTopic.md
|
238
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.setTopic.json
|
239
|
+
def groups_setTopic(options={})
|
240
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
241
|
+
throw ArgumentError.new("Required arguments :topic missing") if options[:topic].nil?
|
242
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
243
|
+
post("groups.setTopic", options)
|
244
|
+
end
|
245
|
+
|
246
|
+
#
|
247
|
+
# This method unarchives a private group.
|
248
|
+
#
|
249
|
+
# @option options [Object] :channel
|
250
|
+
# Group to unarchive
|
251
|
+
# @see https://api.slack.com/methods/groups.unarchive
|
252
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.unarchive.md
|
253
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/groups.unarchive.json
|
254
|
+
def groups_unarchive(options={})
|
255
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
256
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
257
|
+
post("groups.unarchive", options)
|
258
|
+
end
|
259
|
+
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# This file was auto-generated by lib/generators/tasks/generate.rb
|
2
|
+
|
3
|
+
module Slack
|
4
|
+
module Endpoint
|
5
|
+
module Im
|
6
|
+
#
|
7
|
+
# This method closes a direct message channel.
|
8
|
+
#
|
9
|
+
# @option options [Object] :channel
|
10
|
+
# Direct message channel to close.
|
11
|
+
# @see https://api.slack.com/methods/im.close
|
12
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.close.md
|
13
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.close.json
|
14
|
+
def im_close(options={})
|
15
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
16
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
17
|
+
post("im.close", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
#
|
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.
|
24
|
+
#
|
25
|
+
# @option options [Object] :channel
|
26
|
+
# Direct message channel to fetch history for.
|
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.
|
33
|
+
# @option options [Object] :count
|
34
|
+
# Number of messages to return, between 1 and 1000.
|
35
|
+
# @option options [Object] :unreads
|
36
|
+
# Include unread_count_display in the output?
|
37
|
+
# @see https://api.slack.com/methods/im.history
|
38
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.history.md
|
39
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.history.json
|
40
|
+
def im_history(options={})
|
41
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
42
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
43
|
+
post("im.history", options)
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# This method returns a list of all im channels that the user has.
|
48
|
+
#
|
49
|
+
# @see https://api.slack.com/methods/im.list
|
50
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.list.md
|
51
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.list.json
|
52
|
+
def im_list(options={})
|
53
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
54
|
+
post("im.list", options)
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# This method moves the read cursor in a direct message channel.
|
59
|
+
#
|
60
|
+
# @option options [Object] :channel
|
61
|
+
# Direct message channel to set reading cursor in.
|
62
|
+
# @option options [Object] :ts
|
63
|
+
# Timestamp of the most recently seen message.
|
64
|
+
# @see https://api.slack.com/methods/im.mark
|
65
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.mark.md
|
66
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.mark.json
|
67
|
+
def im_mark(options={})
|
68
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
69
|
+
throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
|
70
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
71
|
+
post("im.mark", options)
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# This method opens a direct message channel with another member of your Slack team.
|
76
|
+
#
|
77
|
+
# @option options [Object] :user
|
78
|
+
# User to open a direct message channel with.
|
79
|
+
# @see https://api.slack.com/methods/im.open
|
80
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.open.md
|
81
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/im.open.json
|
82
|
+
def im_open(options={})
|
83
|
+
throw ArgumentError.new("Required arguments :user missing") if options[:user].nil?
|
84
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
85
|
+
post("im.open", options)
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# This file was auto-generated by lib/generators/tasks/generate.rb
|
2
|
+
|
3
|
+
module Slack
|
4
|
+
module Endpoint
|
5
|
+
module Mpim
|
6
|
+
#
|
7
|
+
# This method closes a multiparty direct message channel.
|
8
|
+
#
|
9
|
+
# @option options [Object] :channel
|
10
|
+
# MPIM to close.
|
11
|
+
# @see https://api.slack.com/methods/mpim.close
|
12
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.close.md
|
13
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.close.json
|
14
|
+
def mpim_close(options={})
|
15
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
16
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
17
|
+
post("mpim.close", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
#
|
21
|
+
# This method returns a portion of messages/events from the specified multiparty direct message channel.
|
22
|
+
# To read the entire history for a multiparty direct message, call the method with no latest or
|
23
|
+
# oldest arguments, and then continue paging using the instructions below.
|
24
|
+
#
|
25
|
+
# @option options [Object] :channel
|
26
|
+
# Multiparty direct message to fetch history for.
|
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.
|
33
|
+
# @option options [Object] :count
|
34
|
+
# Number of messages to return, between 1 and 1000.
|
35
|
+
# @option options [Object] :unreads
|
36
|
+
# Include unread_count_display in the output?
|
37
|
+
# @see https://api.slack.com/methods/mpim.history
|
38
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.history.md
|
39
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.history.json
|
40
|
+
def mpim_history(options={})
|
41
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
42
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
43
|
+
post("mpim.history", options)
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# This method returns a list of all multiparty direct message channels that the user has.
|
48
|
+
#
|
49
|
+
# @see https://api.slack.com/methods/mpim.list
|
50
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.list.md
|
51
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.list.json
|
52
|
+
def mpim_list(options={})
|
53
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
54
|
+
post("mpim.list", options)
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# This method moves the read cursor in a multiparty direct message channel.
|
59
|
+
#
|
60
|
+
# @option options [Object] :channel
|
61
|
+
# multiparty direct message channel to set reading cursor in.
|
62
|
+
# @option options [Object] :ts
|
63
|
+
# Timestamp of the most recently seen message.
|
64
|
+
# @see https://api.slack.com/methods/mpim.mark
|
65
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.mark.md
|
66
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.mark.json
|
67
|
+
def mpim_mark(options={})
|
68
|
+
throw ArgumentError.new("Required arguments :channel missing") if options[:channel].nil?
|
69
|
+
throw ArgumentError.new("Required arguments :ts missing") if options[:ts].nil?
|
70
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
71
|
+
post("mpim.mark", options)
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# This method opens a multiparty direct message.
|
76
|
+
#
|
77
|
+
# @option options [Object] :users
|
78
|
+
# Comma separated lists of users. The ordering of the users is preserved whenever a MPIM group is returned.
|
79
|
+
# @see https://api.slack.com/methods/mpim.open
|
80
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.open.md
|
81
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/mpim.open.json
|
82
|
+
def mpim_open(options={})
|
83
|
+
throw ArgumentError.new("Required arguments :users missing") if options[:users].nil?
|
84
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
85
|
+
post("mpim.open", options)
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file was auto-generated by lib/generators/tasks/generate.rb
|
2
|
+
|
3
|
+
module Slack
|
4
|
+
module Endpoint
|
5
|
+
module Oauth
|
6
|
+
#
|
7
|
+
# This method allows you to exchange a temporary OAuth code for an API access token.
|
8
|
+
# This is used as part of the OAuth authentication flow.
|
9
|
+
#
|
10
|
+
# @option options [Object] :client_id
|
11
|
+
# Issued when you created your application.
|
12
|
+
# @option options [Object] :client_secret
|
13
|
+
# Issued when you created your application.
|
14
|
+
# @option options [Object] :code
|
15
|
+
# The code param returned via the OAuth callback.
|
16
|
+
# @option options [Object] :redirect_uri
|
17
|
+
# This must match the originally submitted URI (if one was sent).
|
18
|
+
# @see https://api.slack.com/methods/oauth.access
|
19
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/oauth.access.md
|
20
|
+
# @see https://github.com/aki017/slack-api-docs/blob/master/methods/oauth.access.json
|
21
|
+
def oauth_access(options={})
|
22
|
+
throw ArgumentError.new("Required arguments :client_id missing") if options[:client_id].nil?
|
23
|
+
throw ArgumentError.new("Required arguments :client_secret missing") if options[:client_secret].nil?
|
24
|
+
throw ArgumentError.new("Required arguments :code missing") if options[:code].nil?
|
25
|
+
options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
|
26
|
+
post("oauth.access", options)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|