// This file is auto-generated by alef — DO NOT EDIT.
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
// To regenerate: alef generate
// To verify freshness: alef verify --exit-code
// Issues & docs: https://github.com/kreuzberg-dev/alef
package dev.kreuzberg;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import org.jspecify.annotations.Nullable;

/**
 * Image element metadata.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = ImageMetadataType.Builder.class)
public record ImageMetadataType(
    /**
     * Image source (URL, data URI, or SVG content)
     */
    @JsonProperty("src") String src,
    /**
     * Alternative text from alt attribute
     */
    @Nullable @JsonProperty("alt") String alt,
    /**
     * Title attribute
     */
    @Nullable @JsonProperty("title") String title,
    /**
     * Image dimensions as (width, height) if available
     */
    @Nullable @JsonProperty("dimensions") List<Integer> dimensions,
    /**
     * Image type classification
     */
    @JsonProperty("image_type") ImageType imageType,
    /**
     * Additional attributes as key-value pairs
     */
    @JsonProperty("attributes") List<List<String>> attributes
) {
    public static Builder builder() {
        return new Builder();
    }

    // CPD-OFF
    @JsonPOJOBuilder(withPrefix = "with", buildMethodName = "build")
    public static final class Builder {

private String src = "";
private String alt = null;
private String title = null;
private List<Integer> dimensions = null;
        @JsonProperty("image_type")
private ImageType imageType = null;
private List<List<String>> attributes = List.of();

        /** Sets the src field. */
        @JsonProperty("src")
        public Builder withSrc(final String value) {
            this.src = value;
            return this;
        }

        /** Sets the alt field. */
        @JsonProperty("alt")
        public Builder withAlt(final @Nullable String value) {
            this.alt = value;
            return this;
        }

        /** Sets the title field. */
        @JsonProperty("title")
        public Builder withTitle(final @Nullable String value) {
            this.title = value;
            return this;
        }

        /** Sets the dimensions field. */
        @JsonProperty("dimensions")
        public Builder withDimensions(final @Nullable List<Integer> value) {
            this.dimensions = value;
            return this;
        }

        /** Sets the imageType field. */
        @JsonProperty("image_type")
        public Builder withImageType(final ImageType value) {
            this.imageType = value;
            return this;
        }

        /** Sets the attributes field. */
        @JsonProperty("attributes")
        public Builder withAttributes(final List<List<String>> value) {
            this.attributes = value;
            return this;
        }

        /** Builds the ImageMetadataType instance. */
        public ImageMetadataType build() {
            return new ImageMetadataType(
                src,
                alt,
                title,
                dimensions,
                imageType,
                attributes
            );
        }
    }
    // CPD-ON
}
