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

/** Link type classification. */
enum class LinkType {
    /** Anchor link (#section) */
    @com.fasterxml.jackson.annotation.JsonProperty("anchor")
    ANCHOR,
    /** Internal link (same domain) */
    @com.fasterxml.jackson.annotation.JsonProperty("internal")
    INTERNAL,
    /** External link (different domain) */
    @com.fasterxml.jackson.annotation.JsonProperty("external")
    EXTERNAL,
    /** Email link (mailto:) */
    @com.fasterxml.jackson.annotation.JsonProperty("email")
    EMAIL,
    /** Phone link (tel:) */
    @com.fasterxml.jackson.annotation.JsonProperty("phone")
    PHONE,
    /** Other link type */
    @com.fasterxml.jackson.annotation.JsonProperty("other")
    OTHER;

    @com.fasterxml.jackson.annotation.JsonValue
    fun toWire(): String = when (this) {
        ANCHOR -> "anchor"
        INTERNAL -> "internal"
        EXTERNAL -> "external"
        EMAIL -> "email"
        PHONE -> "phone"
        OTHER -> "other"
    }

    companion object {
        @com.fasterxml.jackson.annotation.JsonCreator
        @JvmStatic
        fun fromWire(value: String): LinkType = when (value) {
            "anchor" -> ANCHOR
            "internal" -> INTERNAL
            "external" -> EXTERNAL
            "email" -> EMAIL
            "phone" -> PHONE
            "other" -> OTHER
            else -> throw IllegalArgumentException("Unknown LinkType value: $value")
        }
    }
}
