// 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.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Result-shape selection for extraction results.
 *
 * Distinct from {@code OutputFormat} (which controls rendering — Plain, Markdown,
 * HTML, etc.). {@code ResultFormat} controls the *shape* of the result: a unified content
 * blob vs. an element-based decomposition.
 */
public enum ResultFormat {
    /** Unified format with all content in {@code content} field */
    Unified("unified"),
    /** Element-based format with semantic element extraction */
    ElementBased("element_based");

    /** The string value. */
    private final String value;

    ResultFormat(final String value) {
        this.value = value;
    }

    /** Returns the string value. */
    @JsonValue
    public String getValue() {
        return value;
    }

    /** Creates an instance from a string value. */
    @JsonCreator
    public static ResultFormat fromValue(final String value) {
        for (ResultFormat e : values()) {
            if (e.value.equalsIgnoreCase(value)) {
                return e;
            }
        }
        throw new IllegalArgumentException("Unknown value: " + value);
    }

    /** Returns the wire-format string value (matches JSON serialization). */
    @Override
    public String toString() {
        return value;
    }
}
