Class AssetListParams

  • All Implemented Interfaces:
    io.imagekit.core.Params

    
    public final class AssetListParams
     implements Params
                        

    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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public final class AssetListParams.Builder

      A builder for AssetListParams.

      public final class AssetListParams.FileType

      Filter results by file type.

      • all — include all file types

      • image — include only image files

      • non-image — include only non-image files (e.g., JS, CSS, video)

      public final class AssetListParams.Sort

      Sort the results by one of the supported fields in ascending or descending order.

      ASC_ORIGINAL_CREATION_DATE and DESC_ORIGINAL_CREATION_DATE sort files by the value of the reserved _internal_original_created_datetime custom metadata field (labelled "Original creation date" in the dashboard). This field exists only after you enable the original creation date setting under the Custom Metadata tab of the media library settings. Files that have no value set for this field fall back to their upload time, so migrated assets carrying a preserved original date and natively uploaded assets are ordered together in a single timeline.

      public final class AssetListParams.Type

      Filter results by asset type.

      • file — returns only files

      • file-version — returns specific file versions

      • folder — returns only folders

      • all — returns both files and folders (excludes file-version)

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • fileType

         final Optional<AssetListParams.FileType> fileType()

        Filter results by file type.

        • all — include all file types

        • image — include only image files

        • non-image — include only non-image files (e.g., JS, CSS, video)

      • limit

         final Optional<Long> limit()

        The maximum number of results to return in response.

      • path

         final Optional<String> path()

        Folder path if you want to limit the search within a specific folder. For example, /sales-banner/ will only search in folder sales-banner.

        Note : If your use case involves searching within a folder as well as its subfolders, you can use path parameter in searchQuery with appropriate operator. Checkout /docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters for more information.

      • searchQuery

         final Optional<String> searchQuery()

        Query string in a Lucene-like query language e.g. createdAt > "7d".

        Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result:

        • tags

        • type

        • name

        /docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries from examples.

      • skip

         final Optional<Long> skip()

        The number of results to skip before returning results.

      • sort

         final Optional<AssetListParams.Sort> sort()

        Sort the results by one of the supported fields in ascending or descending order.

        ASC_ORIGINAL_CREATION_DATE and DESC_ORIGINAL_CREATION_DATE sort files by the value of the reserved _internal_original_created_datetime custom metadata field (labelled "Original creation date" in the dashboard). This field exists only after you enable the original creation date setting under the Custom Metadata tab of the media library settings. Files that have no value set for this field fall back to their upload time, so migrated assets carrying a preserved original date and natively uploaded assets are ordered together in a single timeline.

      • type

         final Optional<AssetListParams.Type> type()

        Filter results by asset type.

        • file — returns only files

        • file-version — returns specific file versions

        • folder — returns only folders

        • all — returns both files and folders (excludes file-version)

      • _headers

         Headers _headers()

        The full set of headers in the parameters, including both fixed and additional headers.

      • _queryParams

         QueryParams _queryParams()

        The full set of query params in the parameters, including both fixed and additional query params.