
    'i                         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
      Z G d d	e      Zy)z3Common base class for media objects with thumbnails    )TYPE_CHECKINGTypeVar)_BaseMedium)	PhotoSize)de_json_optional)JSONDict)BotThumbedMT_co_BaseThumbedMediumT)bound	covariantc                        e Zd ZdZdZ	 	 ddddedededz  dedz  d	edz  f
 fd
Z	e
ddee   dedddef fd       Z x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                :    t         |   ||||       || _        y )N)r   r   r   r   )super__init__r   )selfr   r   r   r   r   	__class__s         l/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/telegram/_files/_basethumbedmedium.pyr   z_BaseThumbedMedium.__init__C   s,     	)!	 	 	
 ,5    clsdatabotz
Bot | Nonereturnc                    | j                  |      }t        |j                  d      t              s#t	        |j                  d      t        |      |d<   i }|j                  d      |j                  d      |d<   t        |   |||      S )z,See :meth:`telegram.TelegramObject.de_json`.r   thumb)r   r   r   )_parse_data
isinstancegetr   r   popr   _de_json)r   r   r   r   r   s       r   de_jsonz_BaseThumbedMedium.de_jsonU   s     t$ $((;/; 0+1F	SV WD
 88G("&((7"3JwwTszJJr   )NN)N)__name__
__module____qualname____doc__	__slots__strintr   r   r   classmethodtyper
   r&   __classcell__)r   s   @r   r   r   #   s    : I !%&*5 '+55 5 :	5
 t#5 tO5$ KT,' Kx Kl KVb K Kr   N)r*   typingr   r   telegram._files._basemediumr   telegram._files.photosizer   telegram._utils.argumentparsingr   telegram._utils.typesr   telegramr	   r
   r    r   r   <module>r8      s@   & : ) 3 / < * ~-ATRAK AKr   