lib/kloudless/file.rb in kloudless-0.2.1 vs lib/kloudless/file.rb in kloudless-1.0.0
- old
+ new
@@ -6,63 +6,63 @@
def self.upload(account_id:, data:, parent_id:, file_name:, **params)
headers = {
'X-Kloudless-Metadata' => {parent_id: parent_id, name: file_name}.to_json,
'Content-Type' => 'application/octet-stream'
}
- path = "/accounts/#{account_id}/files"
+ path = "/accounts/#{account_id}/storage/files"
new(http.post(path, params: params, data: data, headers: headers,
parse_request: false))
end
def self.upload_from_url(account_id:, params: {}, **data)
- path = "/accounts/#{account_id}/files"
+ path = "/accounts/#{account_id}/storage/files"
new(http.post(path, params: params, data: data))
end
def self.metadata(account_id:, file_id:, **params)
- path = "/accounts/#{account_id}/files/#{file_id}"
+ path = "/accounts/#{account_id}/storage/files/#{file_id}"
new(http.get(path, params: params))
end
def self.rename(account_id:, file_id:, params: {}, **data)
- path = "/accounts/#{account_id}/files/#{file_id}"
+ path = "/accounts/#{account_id}/storage/files/#{file_id}"
new(http.patch(path, params: params, data: data))
end
def self.update(account_id:, file_id:, data:)
- path = "/accounts/#{account_id}/files/#{file_id}"
+ path = "/accounts/#{account_id}/storage/files/#{file_id}"
new(http.put(path, data: data, parse_request: false,
headers: {'Content-Type' => 'application/octet-stream'}))
end
def self.download(account_id:, file_id:, **params)
- path = "/accounts/#{account_id}/files/#{file_id}/contents"
+ path = "/accounts/#{account_id}/storage/files/#{file_id}/contents"
http.get(path, params: params, parse_response: false)
end
def self.copy(account_id:, file_id:, parent_id:, params: {}, **data)
- path = "/accounts/#{account_id}/files/#{file_id}/copy"
+ path = "/accounts/#{account_id}/storage/files/#{file_id}/copy"
data[:parent_id] = parent_id
new(http.post(path, params: params, data: data))
end
def self.delete(account_id:, file_id:, **params)
- path = "/accounts/#{account_id}/files/#{file_id}"
+ path = "/accounts/#{account_id}/storage/files/#{file_id}"
new(http.delete(path, params: params))
end
def self.recent(account_ids:, **params)
- path = "/accounts/#{account_ids.join(',')}/recent"
+ path = "/accounts/#{account_ids.join(',')}/storage/recent"
Kloudless::Collection.new(self, http.get(path, params: params))
end
def self.search(account_ids:, **params)
- path = "/accounts/#{account_ids.join(',')}/search"
+ path = "/accounts/#{account_ids.join(',')}/storage/search"
Kloudless::Collection.new(self, http.get(path, params: params))
end
def self.convert_id(account_id:, raw_id:, type:, params: {}, **data)
- path = "/accounts/#{account_id}/convert_id"
+ path = "/accounts/#{account_id}/storage/convert_id"
data[:raw_id] = raw_id
data[:type] = type
http.post(path, params: params, data: data)
end
end