# AUTO-GENERATED by ninja-codegen — DO NOT EDIT
# Re-run `ninjastack sync` to regenerate.
# Source entity: {{ entity.name }}

from __future__ import annotations

from typing import Any
{% if has_uuid %}
from uuid import UUID
{% endif %}
{% if has_datetime %}
from datetime import datetime
{% endif %}
{% if has_date %}
from datetime import date
{% endif %}

from pydantic import BaseModel, Field


class {{ entity.name }}(BaseModel):
    """Generated Pydantic model for {{ entity.name }}."""
{% if entity.description %}
    # {{ entity.description }}
{% endif %}

{% for field in fields_meta %}
    {{ field.name }}: {{ field.python_type }}{% if field.nullable %} | None{% endif %}{% if field.primary_key %} = Field({% if field.default is not none %}default={{ field.default | repr }}{% else %}...{% endif %}{% if field.description %}, description={{ field.description | repr }}{% endif %}){% elif field.default is not none %} = Field(default={{ field.default | repr }}{% if field.description %}, description={{ field.description | repr }}{% endif %}){% elif field.nullable %} = Field(default=None{% if field.description %}, description={{ field.description | repr }}{% endif %}){% elif field.description %} = Field(..., description={{ field.description | repr }}){% endif %}

{% endfor %}
    model_config = {"extra": "forbid"}
