// 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 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;

/**
 * A supported document format entry.
 *
 * Represents a file extension and its corresponding MIME type that Kreuzberg can process.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = SupportedFormat.Builder.class)
public record SupportedFormat(
    /**
     * File extension (without leading dot), e.g., "pdf", "docx"
     */
    @JsonProperty("extension") String extension,
    /**
     * MIME type string, e.g., "application/pdf"
     */
    @JsonProperty("mime_type") String mimeType
) {
    public static Builder builder() {
        return new Builder();
    }

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

private String extension = "";
        @JsonProperty("mime_type")
private String mimeType = "";

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

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

        /** Builds the SupportedFormat instance. */
        public SupportedFormat build() {
            return new SupportedFormat(
                extension,
                mimeType
            );
        }
    }
    // CPD-ON
}
