{{ self::kdoc_block(doc, "") }}enum class {{ class_name }}(val value: Int) {
{%- for variant in variants %}
{{ self::kdoc_block(variant.doc, "    ") }}    {{ variant.name }}({{ variant.tag }}){% if !loop.last %},{% else %};{% endif %}
{%- endfor %}

    companion object {
        fun fromValue(value: Int): {{ class_name }} = entries.first { it.value == value }
    }
}
