U
    g                     @   s   d Z ddlZddlmZmZmZmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZmZ ddlmZ ertdd	lmZ G d
d de	ZG dd de	ZG dd de	ZG dd de	ZdS )z=This module contains objects related to Telegram video chats.    N)TYPE_CHECKINGOptionalSequenceTuple)TelegramObject)User)parse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc                       s6   e Zd ZdZdZddee dd fddZ  ZS )VideoChatStarteda  
    This object represents a service message about a video
    chat started in the chat. Currently holds no information.

    .. versionadded:: 13.4
    .. versionchanged:: 20.0
        This class was renamed from ``VoiceChatStarted`` in accordance to Bot API 6.0.
     N
api_kwargs)r   returnc                   s   t  j|d |   d S Nr   )super__init___freeze)selfr   	__class__r   7/tmp/pip-unpacked-wheel-swnnwir2/telegram/_videochat.pyr   -   s    zVideoChatStarted.__init__)	__name__
__module____qualname____doc__	__slots__r   r   r   __classcell__r   r   r   r   r   !   s   	r   c                       s8   e Zd ZdZdZddeee dd fddZ  Z	S )VideoChatEndeda"  
    This object represents a service message about a
    video chat ended in the chat.

    Objects of this class are comparable in terms of equality.
    Two objects of this class are considered equal, if their
    :attr:`duration` are equal.

    .. versionadded:: 13.4
    .. versionchanged:: 20.0
        This class was renamed from ``VoiceChatEnded`` in accordance to Bot API 6.0.

    Args:
        duration (:obj:`int`): Voice chat duration in seconds.

    Attributes:
        duration (:obj:`int`): Voice chat duration in seconds.

    )durationNr   )r!   r   r   c                   s*   t  j|d || _| jf| _|   d S r   )r   r   r!   	_id_attrsr   )r   r!   r   r   r   r   r   J   s    
zVideoChatEnded.__init__)
r   r   r   r   r   intr   r   r   r   r   r   r   r   r    3   s   r    c                       sd   e Zd ZdZdZddee ee dd fddZ	e
dee ed ed  d	 fd
dZ  ZS )VideoChatParticipantsInviteda  
    This object represents a service message about new members invited to a video chat.

    Objects of this class are comparable in terms of equality.
    Two objects of this class are considered equal, if their :attr:`users` are equal.

    .. versionadded:: 13.4
    .. versionchanged:: 20.0
        This class was renamed from ``VoiceChatParticipantsInvited`` in accordance to Bot API 6.0.

    Args:
        users (Sequence[:class:`telegram.User`]): New members that were invited to the video chat.

            .. versionchanged:: 20.0
                |sequenceclassargs|

    Attributes:
        users (Tuple[:class:`telegram.User`]): New members that were invited to the video chat.

            .. versionchanged:: 20.0
                |tupleclassattrs|

    )usersNr   )r%   r   r   c                   s.   t  j|d t|| _| jf| _|   d S r   )r   r   r   r%   r"   r   )r   r%   r   r   r   r   r   r   s    

z%VideoChatParticipantsInvited.__init__r   databotr   c                    s:   |  |}|sdS t|dg ||d< t j||dS ),See :meth:`telegram.TelegramObject.de_json`.Nr%   r'   r(   )_parse_datar   Zde_listgetr   de_json)clsr'   r(   r   r   r   r-   ~   s
    
z$VideoChatParticipantsInvited.de_json)N)r   r   r   r   r   r   r   r   r   r   classmethodr-   r   r   r   r   r   r$   W   s     r$   c                       sb   e Zd ZdZdZddejee dd fddZ	e
dee ed ed  d	 fd
dZ  ZS )VideoChatScheduledaa  This object represents a service message about a video chat scheduled in the chat.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`start_date` are equal.

    .. versionchanged:: 20.0
        This class was renamed from ``VoiceChatScheduled`` in accordance to Bot API 6.0.

    Args:
        start_date (:obj:`datetime.datetime`): Point in time (Unix timestamp) when the video
            chat is supposed to be started by a chat administrator

            .. versionchanged:: 20.3
                |datetime_localization|
    Attributes:
        start_date (:obj:`datetime.datetime`): Point in time (Unix timestamp) when the video
            chat is supposed to be started by a chat administrator

            .. versionchanged:: 20.3
                |datetime_localization|

    )
start_dateNr   )r1   r   r   c                   s*   t  j|d || _| jf| _|   d S r   )r   r   r1   r"   r   )r   r1   r   r   r   r   r      s    
zVideoChatScheduled.__init__r   r&   c                    s>   |  |}|sdS t|}t|d |d|d< t j||dS )r)   Nr1   )tzinfor*   )r+   r	   r
   r   r-   )r.   r'   r(   Z
loc_tzinfor   r   r   r-      s    
zVideoChatScheduled.de_json)N)r   r   r   r   r   dtmdatetimer   r   r   r/   r-   r   r   r   r   r   r0      s     r0   )r   r4   r3   typingr   r   r   r   Ztelegram._telegramobjectr   Ztelegram._userr   Ztelegram._utils.argumentparsingr   Ztelegram._utils.datetimer	   r
   Ztelegram._utils.typesr   Ztelegramr   r   r    r$   r0   r   r   r   r   <module>   s   $5