{% for decorator in decorators -%}
{{ decorator }}
{% endfor -%}
class {{ class_name }}({{ base_class }}):{% if comment is defined %}  # {{ comment }}{% endif %}
{%- if description %}
    """
    {{ description | escape_docstring | indent(4) }}
    """
{%- endif %}
{%- if not fields and not description and not config and not class_body_lines %}
    pass
{%- endif %}
{%- if config %}
{%- filter indent(4) %}
{% include 'ConfigDict.jinja2' %}
{%- endfilter %}
{%- endif %}
{%- for line in class_body_lines %}
    {{ line }}
{%- endfor %}
{%- for field in fields %}
    {%- if not field.annotated and field.field %}
    {{ field.name }}: {{ field.type_hint }} = {{ field.field }}
    {%- else %}
    {%- if field.annotated %}
    {{ field.name }}: {{ field.annotated }}
    {%- else %}
    {{ field.name }}: {{ field.type_hint }}
    {%- endif %}
    {%- if not field.has_default_factory_in_field and not field.required and (field.represented_default != 'None' or not field.strip_default_none or field.data_type.is_optional)
            %} = {{ field.represented_default }}
    {%- endif -%}
    {%- endif %}
    {%- if field.docstring %}
    """
    {{ field.docstring | escape_docstring | indent(4) }}
    """
{%- if field.use_inline_field_description and not loop.last %}

{% endif %}
    {%- elif field.inline_field_docstring %}
    {{ field.inline_field_docstring }}
{%- if not loop.last %}

{% endif %}
    {%- endif %}
{%- for method in methods -%}
    {{ method }}
{%- endfor -%}
{%- endfor -%}
{%- if prepared_validators %}
{% for v in prepared_validators %}

    @field_validator({{ v.fields_str }}, {{ v.mode_str }})
    @classmethod
{%- if v.mode == 'wrap' %}
    def {{ v.method_name }}(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any:
        return {{ v.function_name }}(v, handler, info)
{%- elif v.mode == 'plain' %}
    def {{ v.method_name }}(cls, v: Any) -> Any:
        return {{ v.function_name }}(v)
{%- else %}
    def {{ v.method_name }}(cls, v: Any, info: ValidationInfo) -> Any:
        return {{ v.function_name }}(v, info)
{%- endif %}
{%- endfor %}
{%- endif %}
