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

/** OCR backend types. */
enum class OcrBackendType {
    /** Tesseract OCR (native Rust binding) */
    @com.fasterxml.jackson.annotation.JsonProperty("Tesseract")
    TESSERACT,
    /** EasyOCR (Python-based, via FFI) */
    @com.fasterxml.jackson.annotation.JsonProperty("EasyOCR")
    EASY_O_C_R,
    /** PaddleOCR (Python-based, via FFI) */
    @com.fasterxml.jackson.annotation.JsonProperty("PaddleOCR")
    PADDLE_O_C_R,
    /** Custom/third-party OCR backend */
    @com.fasterxml.jackson.annotation.JsonProperty("Custom")
    CUSTOM;

    @com.fasterxml.jackson.annotation.JsonValue
    fun toWire(): String = when (this) {
        TESSERACT -> "Tesseract"
        EASY_O_C_R -> "EasyOCR"
        PADDLE_O_C_R -> "PaddleOCR"
        CUSTOM -> "Custom"
    }

    companion object {
        @com.fasterxml.jackson.annotation.JsonCreator
        @JvmStatic
        fun fromWire(value: String): OcrBackendType = when (value) {
            "Tesseract", "tesseract" -> TESSERACT
            "EasyOCR", "easyocr" -> EASY_O_C_R
            "PaddleOCR", "paddleocr" -> PADDLE_O_C_R
            "Custom", "custom" -> CUSTOM
            else -> throw IllegalArgumentException("Unknown OcrBackendType value: $value")
        }
    }
}
