{%- if attribute.enum_type.size > 0 -%}
{%- if params.package.size > 0 -%} package {{ params.package }} {%- endif %}
/* DO NOT EDIT | Generated by gyro */ {{ empty_line }}
enum class {{ attribute.enum_type }}(val jsonValue: String
) {
{% for value in attribute.enum_values %} {% if attribute.enum_values.size > 0 %} {%- assign jsonKey = value -%} {%- if attribute.json_values.size > 0 and attribute.json_values[forloop.index0] -%} {%- assign jsonKey = attribute.json_values[forloop.index0] -%} {%- endif -%} {{ value | snake_case | upcase | strip }}("{{ jsonKey }}") {%- if forloop.last == true -%};{%- else -%},{%- endif -%} {%- endif -%} {%- endfor %} companion object { @JvmStatic fun get(jsonValue: String?): {{ attribute.enum_type }}? { return {{ attribute.enum_type }}.values().firstOrNull { it.jsonValue == jsonValue } } }
} {%- endif %}