{# Custom template for IdsElement in ts-ids-core, based on the Pydantic v2 template #}
{# here: https://github.com/koxudaxi/datamodel-code-generator/blob/b4533213cb03cebc1b936df7e902e8cbb19e1b35/datamodel_code_generator/model/template/pydantic_v2/BaseModel.jinja2 #}
{# The filepath under `_templates` has to be `pydantic_v2/BaseModel.jinja2` #}
{% for decorator in decorators -%}
{{ decorator }}
{% endfor -%}
class {{ class_name }}({{ base_class }}):{% if comment is defined %}  # {{ comment }}{% endif %}
{%- if description %}
    """
    {{ description | indent(4) }}
    """
{%- endif %}
{%- if not fields and not description %}
    pass
{%- endif %}
{%- for field in fields %}
    {{ field.name }}:
    {%- if field.required %} Required[{{ field.data_type.type_hint }}]
    {%- else %} {{ field.data_type.type_hint }}
    {%- endif -%}
    {%- if field.field %} = {{ field.field }}
    {%- elif field.has_default %} = {{ field.represented_default }}
    {%- endif -%}
{%- for method in methods -%}
    {{ method }}
{%- endfor -%}
{%- endfor -%}
