o
    Zzjî  ã                   @   sv   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ er*ddlmZ edd	d
d�ZG dd	„ d	eƒZdS )z3Common base class for media objects with thumbnailsé    )ÚTYPE_CHECKINGÚTypeVar)Ú_BaseMedium)Ú	PhotoSize)Úde_json_optional)ÚJSONDict)ÚBotÚThumbedMT_coÚ_BaseThumbedMediumT)ÚboundÚ	covariantc                       sz   e Zd ZdZdZ		dddœdedededB dedB d	edB f
‡ fd
d„Z	e
ddee dedddef‡ fdd„ƒZ‡  ZS )r
   aÓ  
    Base class for objects representing the various media file types that may include a thumbnail.

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

    Args:
        file_id (:obj:`str`): Identifier for this file, which can be used to download
            or reuse the file.
        file_unique_id (:obj:`str`): Unique identifier for this file, which
            is supposed to be the same over time and for different bots.
            Can't be used to download or reuse the file.
        file_size (:obj:`int`, optional): File size.
        thumbnail (:class:`telegram.PhotoSize`, optional): Thumbnail as defined by the sender.

            .. versionadded:: 20.2

    Attributes:
        file_id (:obj:`str`): File identifier.
        file_unique_id (:obj:`str`): Unique identifier for this file, which
            is supposed to be the same over time and for different bots.
            Can't be used to download or reuse the file.
        file_size (:obj:`int`): Optional. File size.
        thumbnail (:class:`telegram.PhotoSize`): Optional. Thumbnail as defined by the sender.

            .. versionadded:: 20.2

    )Ú	thumbnailN)Ú
api_kwargsÚfile_idÚfile_unique_idÚ	file_sizer   r   c                   s   t ƒ j||||d� || _d S )N)r   r   r   r   )ÚsuperÚ__init__r   )Úselfr   r   r   r   r   ©Ú	__class__© ú]/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telegram/_files/_basethumbedmedium.pyr   C   s   	ü
z_BaseThumbedMedium.__init__ÚclsÚdataÚbotz
Bot | NoneÚreturnc                    sb   |   |¡}t| d¡tƒst| d¡t|ƒ|d< i }| d¡dur(| d¡|d< tƒ j|||d�S )z,See :meth:`telegram.TelegramObject.de_json`.r   ÚthumbN)r   r   r   )Ú_parse_dataÚ
isinstanceÚgetr   r   Úpopr   Ú_de_json)r   r   r   r   r   r   r   Úde_jsonU   s   
z_BaseThumbedMedium.de_json)NN)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__ÚstrÚintr   r   r   ÚclassmethodÚtyper	   r#   Ú__classcell__r   r   r   r   r
   #   s(    ûùþýüûù.N)r'   Útypingr   r   Útelegram._files._basemediumr   Útelegram._files.photosizer   Útelegram._utils.argumentparsingr   Útelegram._utils.typesr   Útelegramr   r	   r
   r   r   r   r   Ú<module>   s   