from __future__ import annotations

import typing

import pydantic

from telegram_pydantic import types
from telegram_pydantic.utils import base_type_discriminator

# Peer - Layer 181
Peer = typing.Annotated[
    typing.Union[
        typing.Annotated[types.PeerChannel, pydantic.Tag('PeerChannel')],
        typing.Annotated[types.PeerChat, pydantic.Tag('PeerChat')],
        typing.Annotated[types.PeerUser, pydantic.Tag('PeerUser')]
    ],
    pydantic.Discriminator(base_type_discriminator)
]
