from ._core import (
    DataRecord,
    DataRecordWrite,
    DomainModel,
    DomainModelCore,
    DomainModelWrite,
    DomainModelList,
    DomainRelationWrite,
    ResourcesWrite,
    ResourcesWriteResult,
)
{% for class_ in classes %}{{ class_.init_import }}
{% endfor %}
{% if is_pydantic_v2 %}{% for (read_name, write_name, has_write_class) in dependencies_by_names %}{{ read_name }}.model_rebuild(){% if has_write_class %}
{{ write_name }}.model_rebuild()
{{ read_name }}Apply.model_rebuild(){% endif %}
{% endfor %}{% else %}{% for (read_name, write_name, has_write_class), dependencies in dependencies_by_names.items() %}
{{ read_name }}.update_forward_refs({% for dependency in dependencies %}
    {{ dependency.read_name }}={{ dependency.read_name }},{%  endfor %}
){% if has_write_class %}
{{ write_name }}.update_forward_refs({% for dependency in dependencies %}{% if dependency.is_writable or dependency.is_interface %}
    {{ dependency.write_name }}={{ dependency.write_name }},{% endif %}{%  endfor %}
)
{{ read_name }}Apply.update_forward_refs({% for dependency in dependencies %}{% if dependency.is_writable or dependency.is_interface %}
    {{ dependency.write_name }}={{ dependency.write_name }},{% endif %}{%  endfor %}
){% endif %}
{% endfor %}{% endif %}
__all__ = [
    "DataRecord",
    "DataRecordWrite",
    "ResourcesWrite",
    "DomainModel",
    "DomainModelCore",
    "DomainModelWrite",
    "DomainModelList",
    "DomainRelationWrite",
    "ResourcesWriteResult",{% for class_ in classes %}
    "{{ class_.read_name }}",{% if class_.is_writable or class_.is_interface %}
    "{{ class_.write_name }}",
    "{{ class_.read_name }}Apply",{% endif %}
    "{{ class_.read_list_name }}",{% if class_.is_writable or class_.is_interface %}
    "{{ class_.write_list_name }}",
    "{{ class_.read_name }}ApplyList",{% endif %}{% if class_.has_field_of_type(ft.PrimitiveFieldCore) %}
    "{{ class_.field_names }}",{% endif %}{% if class_.has_primitive_field_of_type(dm.Text) %}
    "{{ class_.text_field_names }}", {% endif %}{% endfor %}
]
