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

/** Text direction enumeration for HTML documents. */
enum class TextDirection {
    /** Left-to-right text direction */
    @com.fasterxml.jackson.annotation.JsonProperty("ltr")
    LEFT_TO_RIGHT,
    /** Right-to-left text direction */
    @com.fasterxml.jackson.annotation.JsonProperty("rtl")
    RIGHT_TO_LEFT,
    /** Automatic text direction detection */
    @com.fasterxml.jackson.annotation.JsonProperty("auto")
    AUTO;

    @com.fasterxml.jackson.annotation.JsonValue
    fun toWire(): String = when (this) {
        LEFT_TO_RIGHT -> "ltr"
        RIGHT_TO_LEFT -> "rtl"
        AUTO -> "auto"
    }

    companion object {
        @com.fasterxml.jackson.annotation.JsonCreator
        @JvmStatic
        fun fromWire(value: String): TextDirection = when (value) {
            "ltr" -> LEFT_TO_RIGHT
            "rtl" -> RIGHT_TO_LEFT
            "auto" -> AUTO
            else -> throw IllegalArgumentException("Unknown TextDirection value: $value")
        }
    }
}
