Class: Imagekitio::Resources::Assets
- Inherits:
-
Object
- Object
- Imagekitio::Resources::Assets
- Defined in:
- lib/imagekitio/resources/assets.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Assets
constructor
private
A new instance of Assets.
-
#list(file_type: nil, limit: nil, path: nil, search_query: nil, skip: nil, sort: nil, type: nil, request_options: {}) ⇒ Array<Imagekitio::Models::Folder, Imagekitio::Models::File>
Some parameter documentations has been truncated, see Models::AssetListParams for more details.
Constructor Details
#initialize(client:) ⇒ Assets
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Assets.
49 50 51 |
# File 'lib/imagekitio/resources/assets.rb', line 49 def initialize(client:) @client = client end |
Instance Method Details
#list(file_type: nil, limit: nil, path: nil, search_query: nil, skip: nil, sort: nil, type: nil, request_options: {}) ⇒ Array<Imagekitio::Models::Folder, Imagekitio::Models::File>
Some parameter documentations has been truncated, see Models::AssetListParams for more details.
This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the ‘searchQuery`.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/imagekitio/resources/assets.rb', line 35 def list(params = {}) parsed, = Imagekitio::AssetListParams.dump_request(params) @client.request( method: :get, path: "v1/files", query: parsed.transform_keys(file_type: "fileType", search_query: "searchQuery"), model: Imagekitio::Internal::Type::ArrayOf[union: Imagekitio::Models::AssetListResponseItem], options: ) end |