Class CustomMetadataField

  • All Implemented Interfaces:

    
    public final class CustomMetadataField
    
                        

    Object containing details of a custom metadata field.

    • Constructor Detail

    • Method Detail

      • id

         final String id()

        Unique identifier for the custom metadata field. Use this to update the field.

      • label

         final String label()

        Human readable name of the custom metadata field. This name is displayed as form field label to the users while setting field value on the asset in the media library UI.

      • name

         final String name()

        API name of the custom metadata field. This becomes the key while setting customMetadata (key-value object) for an asset using upload or update API.

      • description

         final Optional<String> description()

        Optional description of the custom metadata field. Only present when a description has been set. Shown as a hint to the users while setting the field's value on an asset in the media library UI.

      • reserved

         final Optional<Boolean> reserved()

        Present and set to true when the field is reserved, i.e. created and managed by ImageKit rather than by you. Omitted for regular fields.

        Currently the only reserved field is _internal_original_created_datetime (label "Original creation date", type Date). ImageKit creates it when you enable the original creation date setting under the Custom Metadata tab of the media library settings in the dashboard. Use it to preserve the original creation date of assets migrated from another system: set its value through the customMetadata object in the upload or update file details API, then sort with ASC_ORIGINAL_CREATION_DATE or DESC_ORIGINAL_CREATION_DATE in the list and search assets API, or filter with "customMetadata._internal_original_created_datetime" in searchQuery.

        Reserved fields cannot be deleted, and their name cannot be reused when creating a new field.

      • _id

         final JsonField<String> _id()

        Returns the raw JSON value of id.

        Unlike id, this method doesn't throw if the JSON field has an unexpected type.

      • _label

         final JsonField<String> _label()

        Returns the raw JSON value of label.

        Unlike label, this method doesn't throw if the JSON field has an unexpected type.

      • _name

         final JsonField<String> _name()

        Returns the raw JSON value of name.

        Unlike name, this method doesn't throw if the JSON field has an unexpected type.

      • validate

         final CustomMetadataField validate()

        Validates that the types of all values in this object match their expected types recursively.

        This method is not forwards compatible with new types from the API for existing fields.