6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/zm/client/folder/mod_document_folder.rb', line 6
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?
jsns = { doc: { l: @id, upload: { id: uuid } } }
soap_request = Zm::Client::SoapElement.mail(Zm::Client::SoapMailConstants::SAVE_DOCUMENT_REQUEST).add_attributes(jsns)
rep = @parent.sacc.invoke(soap_request)
Zm::Client::DocumentJsnsInitializer.create(@parent, rep[:SaveDocumentResponse][:doc].first)
end
|