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

/**
 * Type of paginated unit in a document.
 *
 * Distinguishes between different types of "pages" (PDF pages, presentation slides, spreadsheet sheets).
 */
enum class PageUnitType {
    /** Standard document pages (PDF, DOCX, images) */
    @com.fasterxml.jackson.annotation.JsonProperty("page")
    PAGE,
    /** Presentation slides (PPTX, ODP) */
    @com.fasterxml.jackson.annotation.JsonProperty("slide")
    SLIDE,
    /** Spreadsheet sheets (XLSX, ODS) */
    @com.fasterxml.jackson.annotation.JsonProperty("sheet")
    SHEET;

    @com.fasterxml.jackson.annotation.JsonValue
    fun toWire(): String = when (this) {
        PAGE -> "page"
        SLIDE -> "slide"
        SHEET -> "sheet"
    }

    companion object {
        @com.fasterxml.jackson.annotation.JsonCreator
        @JvmStatic
        fun fromWire(value: String): PageUnitType = when (value) {
            "page" -> PAGE
            "slide" -> SLIDE
            "sheet" -> SHEET
            else -> throw IllegalArgumentException("Unknown PageUnitType value: $value")
        }
    }
}
