// 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 classification of a tracked change. */
enum class RevisionKind {
    /** Text or content was inserted. */
    @com.fasterxml.jackson.annotation.JsonProperty("insertion")
    INSERTION,
    /** Text or content was deleted. */
    @com.fasterxml.jackson.annotation.JsonProperty("deletion")
    DELETION,
    /** Run-level formatting (font, size, colour, …) was changed. */
    @com.fasterxml.jackson.annotation.JsonProperty("format_change")
    FORMAT_CHANGE,
    /** A reviewer comment or annotation. */
    @com.fasterxml.jackson.annotation.JsonProperty("comment")
    COMMENT;

    @com.fasterxml.jackson.annotation.JsonValue
    fun toWire(): String = when (this) {
        INSERTION -> "insertion"
        DELETION -> "deletion"
        FORMAT_CHANGE -> "format_change"
        COMMENT -> "comment"
    }

    companion object {
        @com.fasterxml.jackson.annotation.JsonCreator
        @JvmStatic
        fun fromWire(value: String): RevisionKind = when (value) {
            "insertion" -> INSERTION
            "deletion" -> DELETION
            "format_change" -> FORMAT_CHANGE
            "comment" -> COMMENT
            else -> throw IllegalArgumentException("Unknown RevisionKind value: $value")
        }
    }
}
