-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbatch.rb
More file actions
38 lines (31 loc) · 1.24 KB
/
batch.rb
File metadata and controls
38 lines (31 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module Wework
module Api
module Methods
module Batch
def batch_syncuser media_id, callback_url=nil, token=nil, encodingaeskey=nil
post 'batch/syncuser', batch_params(media_id, callback_url, token, encodingaeskey)
end
def batch_replaceuser media_id, callback_url=nil, token=nil, encodingaeskey=nil
post 'batch/replaceuser', batch_params(media_id, callback_url, token, encodingaeskey)
end
def batch_replaceparty media_id, callback_url=nil, token=nil, encodingaeskey=nil
post 'batch/replaceparty', batch_params(media_id, callback_url, token, encodingaeskey)
end
def batch_getresult job_id
get 'batch/getresult', params: {jobid: job_id}
end
def batch_invite user=[], party=[], tag=[]
post 'batch/invite', {user: user, party: party, tag: tag}
end
private
def batch_params media_id, callback_url, token, encodingaeskey
params = {media_id: media_id}
if callback_url.present? && token.present? && encodingaeskey.present?
params[:callback] = {url: callback_url, token: token, encodingaeskey: encodingaeskey}
end
params
end
end
end
end
end