{%- macro get_type_hint(_fields) -%}
{%- if _fields -%}
{#There will only ever be a single field for RootModel#}
{{- _fields[0].type_hint}}
{%- endif -%}
{%- endmacro -%}


{% for decorator in decorators -%}
{{ decorator }}
{% endfor -%}

class {{ class_name }}({{ base_class }}{%- if fields -%}[{{get_type_hint(fields)}}]{%- endif -%}):{% if comment is defined %}  # {{ comment }}{% endif %}
    {%- if description %}
    """
    {{ description | indent(4) }}
    """
{%- endif %}
{%- if config %}
{%- filter indent(4) %}
{% include 'ConfigDict.jinja2' %}
{%- endfilter %}
{%- endif %}
{%- if not fields and not description %}
    pass
{%- else %}
    {%- set field = fields[0] %}
    {%- if not field.annotated and field.field %}
    root: {{ field.type_hint }} = {{ field.field }}
    {%- else %}
    {%- if field.annotated %}
    root: {{ field.annotated }}
    {%- else %}
    root: {{ field.type_hint }}
    {%- endif %}
    {%- if not (field.required or (field.represented_default == 'None' and field.strip_default_none))
            %} = {{ field.represented_default }}
    {%- endif -%}
    {%- endif %}
    {%- if field.docstring %}
    """
    {{ field.docstring | indent(4) }}
    """
    {%- endif %}
{%- endif %}
