class Quickbooks::Service::Upload
Constants
- XML_NODE
Public Instance Methods
Source
# File lib/quickbooks/service/upload.rb, line 22 def download(uploadId) url = url_for_resource("download/#{uploadId}") do_http_get(url, {}, headers) end
Source
# File lib/quickbooks/service/upload.rb, line 10 def upload(path_to_file, mime_type, attachable = nil) url = url_for_resource("upload") uploadIO = Faraday::UploadIO.new(path_to_file, mime_type) response = do_http_file_upload(uploadIO, url, attachable) prefix = "AttachableResponse/xmlns:Attachable" if response.code.to_i == 200 model.from_xml(parse_singular_entity_response(model, response.plain_body, prefix)) else nil end end
path_to_file: String - path to file mime_type: String - the MIME type of the file, e.g. image/jpeg attachable: Quickbooks::Model::Attachable
meta-data details, can be null
Private Instance Methods
Source
# File lib/quickbooks/service/upload.rb, line 29 def model Quickbooks::Model::Attachable end