// 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 kind of a relationship between document elements. */
enum class RelationshipKind {
    /** Footnote marker -> footnote definition. */
    @com.fasterxml.jackson.annotation.JsonProperty("footnote_reference")
    FOOTNOTE_REFERENCE,
    /** Citation marker -> bibliography entry. */
    @com.fasterxml.jackson.annotation.JsonProperty("citation_reference")
    CITATION_REFERENCE,
    /** Internal anchor link (`#id`) -> target heading/element. */
    @com.fasterxml.jackson.annotation.JsonProperty("internal_link")
    INTERNAL_LINK,
    /** Caption paragraph -> figure/table it describes. */
    @com.fasterxml.jackson.annotation.JsonProperty("caption")
    CAPTION,
    /** Label -> labeled element (HTML `<label for>`, LaTeX `\label{}`). */
    @com.fasterxml.jackson.annotation.JsonProperty("label")
    LABEL,
    /** TOC entry -> target section. */
    @com.fasterxml.jackson.annotation.JsonProperty("toc_entry")
    TOC_ENTRY,
    /** Cross-reference (LaTeX `\ref{}`, DOCX cross-reference field). */
    @com.fasterxml.jackson.annotation.JsonProperty("cross_reference")
    CROSS_REFERENCE;

    @com.fasterxml.jackson.annotation.JsonValue
    fun toWire(): String = when (this) {
        FOOTNOTE_REFERENCE -> "footnote_reference"
        CITATION_REFERENCE -> "citation_reference"
        INTERNAL_LINK -> "internal_link"
        CAPTION -> "caption"
        LABEL -> "label"
        TOC_ENTRY -> "toc_entry"
        CROSS_REFERENCE -> "cross_reference"
    }

    companion object {
        @com.fasterxml.jackson.annotation.JsonCreator
        @JvmStatic
        fun fromWire(value: String): RelationshipKind = when (value) {
            "footnote_reference" -> FOOTNOTE_REFERENCE
            "citation_reference" -> CITATION_REFERENCE
            "internal_link" -> INTERNAL_LINK
            "caption" -> CAPTION
            "label" -> LABEL
            "toc_entry" -> TOC_ENTRY
            "cross_reference" -> CROSS_REFERENCE
            else -> throw IllegalArgumentException("Unknown RelationshipKind value: $value")
        }
    }
}
