// Generated by alef. Do not edit by hand.
@file:Suppress(
    "ktlint:standard:trailing-comma-on-call-site",
    "ktlint:standard:trailing-comma-on-declaration-site",
    "ktlint:standard:spacing-between-declarations-with-comments",
    "ktlint:standard:spacing-between-declarations-with-annotations",
    "ktlint:standard:when-entry-bracing",
    "ktlint:standard:blank-line-between-when-conditions",
    "ktlint:standard:blank-line-before-declaration",
    "ktlint:standard:chain-method-continuation",
    "ktlint:standard:annotation",
    "ktlint:standard:max-line-length",
    "ktlint:standard:no-semi",
    "ktlint:standard:statement-wrapping",
    "MaxLineLength",
    "TooManyFunctions",
    "FunctionParameterNaming",
    "LongParameterList",
    "CyclomaticComplexMethod",
    "LongMethod",
)

package dev.kreuzberg

/**
 * Semantic element type classification.
 *
 * Categorizes text content into semantic units for downstream processing.
 * Supports the element types commonly found in Unstructured documents.
 */
enum class ElementType {
    /** Document title */
    @com.fasterxml.jackson.annotation.JsonProperty("title")
    TITLE,
    /** Main narrative text body */
    @com.fasterxml.jackson.annotation.JsonProperty("narrative_text")
    NARRATIVE_TEXT,
    /** Section heading */
    @com.fasterxml.jackson.annotation.JsonProperty("heading")
    HEADING,
    /** List item (bullet, numbered, etc.) */
    @com.fasterxml.jackson.annotation.JsonProperty("list_item")
    LIST_ITEM,
    /** Table element */
    @com.fasterxml.jackson.annotation.JsonProperty("table")
    TABLE,
    /** Image element */
    @com.fasterxml.jackson.annotation.JsonProperty("image")
    IMAGE,
    /** Page break marker */
    @com.fasterxml.jackson.annotation.JsonProperty("page_break")
    PAGE_BREAK,
    /** Code block */
    @com.fasterxml.jackson.annotation.JsonProperty("code_block")
    CODE_BLOCK,
    /** Block quote */
    @com.fasterxml.jackson.annotation.JsonProperty("block_quote")
    BLOCK_QUOTE,
    /** Footer text */
    @com.fasterxml.jackson.annotation.JsonProperty("footer")
    FOOTER,
    /** Header text */
    @com.fasterxml.jackson.annotation.JsonProperty("header")
    HEADER;

    @com.fasterxml.jackson.annotation.JsonValue
    fun toWire(): String = when (this) {
        TITLE -> "title"
        NARRATIVE_TEXT -> "narrative_text"
        HEADING -> "heading"
        LIST_ITEM -> "list_item"
        TABLE -> "table"
        IMAGE -> "image"
        PAGE_BREAK -> "page_break"
        CODE_BLOCK -> "code_block"
        BLOCK_QUOTE -> "block_quote"
        FOOTER -> "footer"
        HEADER -> "header"
    }

    companion object {
        @com.fasterxml.jackson.annotation.JsonCreator
        @JvmStatic
        fun fromWire(value: String): ElementType = when (value) {
            "title" -> TITLE
            "narrative_text" -> NARRATIVE_TEXT
            "heading" -> HEADING
            "list_item" -> LIST_ITEM
            "table" -> TABLE
            "image" -> IMAGE
            "page_break" -> PAGE_BREAK
            "code_block" -> CODE_BLOCK
            "block_quote" -> BLOCK_QUOTE
            "footer" -> FOOTER
            "header" -> HEADER
            else -> throw IllegalArgumentException("Unknown ElementType value: $value")
        }
    }
}
