o
    "h"                     @   s   d Z ddlZddlmZ ddlmZmZmZ ddl	m
Z
 ddlmZ ddlmZmZ ddlmZmZmZ dd	lmZmZ erDd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)Sequence)TYPE_CHECKINGOptionalUnion)TelegramObject)User)parse_sequence_argto_timedelta)extract_tzinfo_from_defaultsfrom_timestampget_timedelta_value)JSONDict
TimePeriod)Botc                       s8   e Zd ZdZdZdddee ddf 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_kwargsr   returnc                   s   t  j|d |   d S Nr   )super__init___freeze)selfr   	__class__r   F/var/www/html/venv/lib/python3.10/site-packages/telegram/_videochat.pyr   2   s   zVideoChatStarted.__init__)	__name__
__module____qualname____doc__	__slots__r   r   r   __classcell__r   r   r   r   r   &   s    	(r   c                       sX   e Zd ZdZdZdddedee ddf fdd	Ze	de
eejf 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.

    .. versionchanged:: v22.2
       As part of the migration to representing time periods using ``datetime.timedelta``,
       equality comparison now considers integer durations and equivalent timedeltas as equal.

    Args:
        duration (:obj:`int` | :class:`datetime.timedelta`): Voice chat duration
            in seconds.

            .. versionchanged:: v22.2
                |time-period-input|

    Attributes:
        duration (:obj:`int` | :class:`datetime.timedelta`): Voice chat duration in seconds.

            .. deprecated:: v22.2
                |time-period-int-deprecated|

    )	_durationNr   durationr   r   c                   .   t  j|d t|| _| jf| _|   d S r   )r   r   r	   r$   	_id_attrsr   )r   r%   r   r   r   r   r   Z      

zVideoChatEnded.__init__c                 C   s   t | jddS )Nr%   )	attribute)r   r$   )r   r   r   r   r%   f   s   zVideoChatEnded.duration)r   r   r   r    r!   r   r   r   r   propertyr   intdtm	timedeltar%   r"   r   r   r   r   r#   8   s    "r#   c                       sf   e Zd ZdZdZdddee dee ddf fdd	Z	e
	dd
eded dd f 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                   r&   r   )r   r   r   r/   r'   r   )r   r/   r   r   r   r   r      r(   z%VideoChatParticipantsInvited.__init__databotr   c                    s2   |  |}t|dg ||d< t j||dS ),See :meth:`telegram.TelegramObject.de_json`.r/   r0   r1   )_parse_datar   de_listgetr   de_json)clsr0   r1   r   r   r   r7      s   
z$VideoChatParticipantsInvited.de_jsonN)r   r   r   r    r!   r   r   r   r   r   classmethodr7   r"   r   r   r   r   r.   m   s(    r.   c                       sb   e Zd ZdZdZdddejdee ddf fdd	Z	e
dd
eded dd f 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   r<   r   r   c                   s*   t  j|d || _| jf| _|   d S r   )r   r   r<   r'   r   )r   r<   r   r   r   r   r      s   
zVideoChatScheduled.__init__r0   r1   r   c                    s8   |  |}t|}t|d|d|d< t j||dS )r2   r<   )tzinfor3   )r4   r
   r   r6   r   r7   )r8   r0   r1   
loc_tzinfor   r   r   r7      s   
zVideoChatScheduled.de_jsonr9   )r   r   r   r    r!   r,   datetimer   r   r   r:   r7   r"   r   r   r   r   r;      s    *r;   )r    r?   r,   collections.abcr   typingr   r   r   telegram._telegramobjectr   telegram._userr   telegram._utils.argumentparsingr   r	   telegram._utils.datetimer
   r   r   telegram._utils.typesr   r   telegramr   r   r#   r.   r;   r   r   r   r   <module>   s   52