{# All the imports needed for this file. The useless imports will be removed by Ruff. #}

# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: {{ ', '.join(output_file.input_filenames) }}
# plugin: python-betterproto2
# This file has been @generated

__all__ = (
    {% for _, enum in output_file.enums|dictsort(by="key") %}
        "{{ enum.py_name }}",
    {%- endfor -%}
    {% for _, message in output_file.messages|dictsort(by="key") %}
        "{{ message.py_name }}",
    {%- endfor -%}
    {% for _, service in output_file.services|dictsort(by="key") %}
        "{{ service.py_name }}Stub",
        "{{ service.py_name }}Base",
    {%- endfor -%}
)

import builtins
import datetime
import warnings
from collections.abc import AsyncIterable, AsyncIterator, Iterable
import typing
from typing import TYPE_CHECKING

{% if output_file.settings.pydantic_dataclasses %}
from pydantic.dataclasses import dataclass
from pydantic import model_validator
{%- else -%}
from dataclasses import dataclass
{% endif %}

import betterproto2
{% if output_file.services %}
from betterproto2.grpc.grpclib_server import ServiceBase
import grpclib
{% endif %}

{# Import the message pool of the generated code. #}
{% if output_file.package %}
from {{ "." * output_file.package.count(".") }}..message_pool import default_message_pool
{% else %}
from .message_pool import default_message_pool
{% endif %}

if TYPE_CHECKING:
    import grpclib.server
    from betterproto2.grpc.grpclib_client import MetadataLike
    from grpclib.metadata import Deadline

betterproto2.check_compiler_version("{{ version }}")
