Class: Uploadcare::Client::FileListClient
- Inherits:
-
RestClient
- Object
- ApiStruct::Client
- RestClient
- Uploadcare::Client::FileListClient
- Defined in:
- lib/uploadcare/client/file_list_client.rb
Overview
API client for handling file lists
Instance Method Summary collapse
-
#batch_delete(uuids) ⇒ Object
(also: #delete_files)
Delete several files by list of uids uuids: Array.
-
#batch_store(uuids) ⇒ Object
(also: #store_files)
Make a set of files "stored".
-
#file_list(options = {}) ⇒ Object
(also: #list)
Returns a pagination json of files stored in project valid options: removed: [true|false] stored: [true|false] limit: (1..1000) ordering: ["datetime_uploaded"|"-datetime_uploaded"] from: number of files skipped.
Methods inherited from RestClient
#api_root, #api_struct_delete, #api_struct_get, #api_struct_post, #api_struct_put, #delete, #get, #headers, #post, #put, #request
Methods included from Uploadcare::Concerns::ThrottleHandler
Methods included from Uploadcare::Concerns::ErrorHandler
Instance Method Details
#batch_delete(uuids) ⇒ Object Also known as: delete_files
Delete several files by list of uids uuids: Array
36 37 38 39 |
# File 'lib/uploadcare/client/file_list_client.rb', line 36 def batch_delete(uuids) body = uuids.to_json request_delete(uri: '/files/storage/', content: body) end |
#batch_store(uuids) ⇒ Object Also known as: store_files
Make a set of files "stored". This will prevent them from being deleted automatically uuids: Array
26 27 28 29 |
# File 'lib/uploadcare/client/file_list_client.rb', line 26 def batch_store(uuids) body = uuids.to_json put(uri: '/files/storage/', content: body) end |
#file_list(options = {}) ⇒ Object Also known as: list
Returns a pagination json of files stored in project valid options: removed: [true|false] stored: [true|false] limit: (1..1000) ordering: ["datetime_uploaded"|"-datetime_uploaded"] from: number of files skipped
18 19 20 21 |
# File 'lib/uploadcare/client/file_list_client.rb', line 18 def file_list( = {}) query = .empty? ? '' : "?#{URI.encode_www_form()}" get(uri: "/files/#{query}") end |