{%- macro get_type_annotation(_field) -%}
{%- if _field.annotated -%}
{{ _field.annotated }}
{%- elif _field.field -%}
Annotated[{{ _field.type_hint }}, {{ _field.field }}]
{%- else -%}
{{ _field.type_hint }}
{%- endif -%}
{%- endmacro -%}

{%- if fields %}
type {{ class_name }} = {{ get_type_annotation(fields[0]) }}{% if comment is defined %}  # {{ comment }}{% endif %}
{%- if description %}
{{ description }}
{%- elif fields[0].docstring %}
{{ fields[0].docstring }}
{%- endif %}
{%- else %}
type {{ class_name }} = {{ base_class }}{% if comment is defined %}  # {{ comment }}{% endif %}
{%- if description %}
{{ description }}
{%- endif %}
{%- endif %}
