U
    g                     @   s`   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	m
Z
 erLddlmZ G dd deZd	S )
z#Common base class for media objects    )TYPE_CHECKINGOptional)TelegramObject)DEFAULT_NONE)JSONDictODVInput)Filec                       sz   e Zd ZdZdZdddeeee ee d fddZ	e
e
e
e
ddee ee ee ee ee d	d
ddZ  ZS )_BaseMediuma  Base class for objects representing the various media file types.
    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.

    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.


    )file_id	file_sizefile_unique_idN
api_kwargs)r
   r   r   r   c                   s6   t  j|d t|| _t|| _|| _| jf| _d S )Nr   )super__init__strr
   r   r   Z	_id_attrs)selfr
   r   r   r   	__class__ ?/tmp/pip-unpacked-wheel-swnnwir2/telegram/_files/_basemedium.pyr   7   s
    

z_BaseMedium.__init__)read_timeoutwrite_timeoutconnect_timeoutpool_timeoutr   r   )r   r   r   r   r   returnc                   s"   |   j| j|||||dI dH S )a  Convenience wrapper over :meth:`telegram.Bot.get_file`

        For the documentation of the arguments, please see :meth:`telegram.Bot.get_file`.

        Returns:
            :class:`telegram.File`

        Raises:
            :class:`telegram.error.TelegramError`

        )r
   r   r   r   r   r   N)Zget_botget_filer
   )r   r   r   r   r   r   r   r   r   r   I   s    z_BaseMedium.get_file)N)__name__
__module____qualname____doc__	__slots__r   r   intr   r   r   r   floatr   __classcell__r   r   r   r   r	      s0    r	   N)r    typingr   r   Ztelegram._telegramobjectr   Ztelegram._utils.defaultvaluer   Ztelegram._utils.typesr   r   Ztelegramr   r	   r   r   r   r   <module>   s   