@@ -46,18 +46,6 @@ enum class {{ obj.name|camelize }}{{ suffix }} : ReasonCode {
4646}
4747{%- endmacro % }
4848
49- {%- macro enum_decl(obj, name, suffix) -% }
50- @Suppress(" ClassNaming" , " EnumNaming" )
51- enum class {{ obj.name|camelize }}{{ suffix }} : EventExtraKey {
52- {% for key in obj|attr(name) % }
53- {{ key|camelize }} {
54- override fun keyName (): String = " {{ key }}"
55- }{{ " ," if not loop.last }}{{ " ;" if loop.last }}
56-
57- {% endfor % }
58- }
59- {%- endmacro % }
60-
6149{%- macro struct_decl(obj, name, suffix) -% }
6250@Suppress(" ClassNaming" , " EnumNaming" )
6351data class {{ obj.name|Camelize }}{{ suffix }}(
@@ -83,12 +71,10 @@ data class {{ obj.name|Camelize }}{{ suffix }}(
8371package {{ namespace }}
8472
8573import {{ glean_namespace }}.private.CommonMetricData // ktlint-disable import-ordering no-unused-imports
86- import {{ glean_namespace }}.private.EventExtraKey // ktlint-disable import-ordering no-unused-imports
8774import {{ glean_namespace }}.private.EventExtras // ktlint-disable import-ordering no-unused-imports
8875import {{ glean_namespace }}.private.HistogramType // ktlint-disable import-ordering no-unused-imports
8976import {{ glean_namespace }}.private.Lifetime // ktlint-disable import-ordering no-unused-imports
9077import {{ glean_namespace }}.private.MemoryUnit // ktlint-disable import-ordering no-unused-imports
91- import {{ glean_namespace }}.private.NoExtraKeys // ktlint-disable import-ordering no-unused-imports
9278import {{ glean_namespace }}.private.NoExtras // ktlint-disable import-ordering no-unused-imports
9379import {{ glean_namespace }}.private.ReasonCode // ktlint-disable import-ordering no-unused-imports
9480import {{ glean_namespace }}.private.NoReasonCodes // ktlint-disable import-ordering no-unused-imports
@@ -114,11 +100,7 @@ internal object {{ category_name|Camelize }} {
114100 {% if obj|attr(" _generate_enums" ) % }
115101 {% for name, suffix in obj[" _generate_enums" ] % }
116102 {% if obj|attr(name)|length % }
117- {% if obj.has_extra_types % }
118103 {{ struct_decl(obj, name, suffix)|indent }}
119- {% else % }
120- {{ enum_decl(obj, name, suffix)|indent }}
121- {% endif % }
122104 {% endif % }
123105 {% endfor % }
124106 {% endif % }
0 commit comments