""" Contains all the data models used in inputs/outputs """

{% for import in imports | sort %}
{{ import }}
{% endfor %}

{% if imports %}
__all__ = (
    {% for all in alls | sort %}
    "{{ all }}",
    {% endfor %}
)
{% endif %}

# Ensure all Pydantic models have forward refs rebuilt
import sys, inspect
from pydantic import BaseModel

_current_module = sys.modules[__name__]

for _obj in list(_current_module.__dict__.values()):
    if inspect.isclass(_obj) and issubclass(_obj, BaseModel) and _obj is not BaseModel:
        _obj.model_rebuild()
