from __future__ import annotations

from typing import final

from yatbaf.typing import NoneInt
from yatbaf.typing import NoneStr

from .abc import TelegramType
from .user import User

# from datetime import datetime


@final
class ChatInviteLink(TelegramType):
    """Represents an invite link for a chat.

    See: https://core.telegram.org/bots/api#chatinvitelink
    """

    invite_link: str
    """The invite link. If the link was created by another chat administrator,
    then the second part of the link will be replaced with “…”.
    """

    creator: User
    """Creator of the link."""

    creates_join_request: bool
    """``True``, if users joining the chat via the link need to be approved by
    chat administrators.
    """

    is_primary: bool
    """``True``, if the link is primary."""

    is_revoked: bool
    """``True``, if the link is revoked."""

    name: NoneStr = None
    """*Optional.* Invite link name."""

    expire_date: NoneInt = None  # TODO: datetime
    """*Optional.* Point in time (Unix timestamp) when the link will expire or
    has been expired."""

    member_limit: NoneInt = None
    """*Optional.* The maximum number of users that can be members of the chat
    simultaneously after joining the chat via this invite link; 1-99999.
    """

    pending_join_request_count: NoneInt = None
    """*Optional.* Number of pending join requests created using this link."""
