4
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/zm/client/folder/mod_document_folder.rb', line 4
def upload(file_path)
uploader = Zm::Client::Upload.new(@parent, Zm::Client::RestAccountConnector.new)
str = uploader.upload_attachment(file_path)
uuid = str.scan(UUID_REGEX).first
raise Zm::Client::RestError, "failed to extract uuid" if uuid.nil?
upload_options = { upload: { id: uuid } }
rep = @parent.sacc.save_document(@parent.token, id, upload_options)
Zm::Client::Document.new(@parent, rep[:Body][:SaveDocumentResponse][:doc].first)
end
|