U
    ¯ªhã  ã                   @   s$   d dl mZmZ G dd„ deƒZdS )é    )ÚABCÚabstractmethodc                   @   s  e Zd Zdd„ Zd*dd„Zedd„ ƒZeedd	„ ƒƒZeed
d„ ƒƒZ	eedd„ ƒƒZ
eedd„ ƒƒZejedd„ ƒƒZeedd„ ƒƒZejedd„ ƒƒZedd„ ƒZedd„ ƒZedd„ ƒZdd„ Zedd„ ƒZedd„ ƒZed d!„ ƒZed"d#„ ƒZed$d%„ ƒZed&d'„ ƒZed(d)„ ƒZdS )+ÚSessionc                 C   s   d S )N© ©Úselfr   r   ú>/tmp/pip-unpacked-wheel-c81u5j2r/telethon/sessions/abstract.pyÚ__init__   s    zSession.__init__Nc                 C   s   |p
|   ¡ S )z7
        Creates a clone of this session file.
        )Ú	__class__)r   Zto_instancer   r   r   Úclone   s    zSession.clonec                 C   s   t ‚dS )z¸
        Sets the information of the data center address and port that
        the library should connect to, as well as the data center ID,
        which is currently unused.
        N©ÚNotImplementedError)r   Údc_idÚserver_addressÚportr   r   r   Úset_dc   s    zSession.set_dcc                 C   s   t ‚dS )z<
        Returns the currently-used data center ID.
        Nr   r   r   r   r   r      s    zSession.dc_idc                 C   s   t ‚dS )zQ
        Returns the server address where the library should connect to.
        Nr   r   r   r   r   r      s    zSession.server_addressc                 C   s   t ‚dS )zJ
        Returns the port to which the library should connect to.
        Nr   r   r   r   r   r   '   s    zSession.portc                 C   s   t ‚dS )zŒ
        Returns an ``AuthKey`` instance associated with the saved
        data center, or `None` if a new one should be generated.
        Nr   r   r   r   r   Úauth_key/   s    zSession.auth_keyc                 C   s   t ‚dS )zL
        Sets the ``AuthKey`` to be used for the saved data center.
        Nr   ©r   Úvaluer   r   r   r   8   s    c                 C   s   t ‚dS )zš
        Returns an ID of the takeout process initialized for this session,
        or `None` if there's no were any unfinished takeout requests.
        Nr   r   r   r   r   Ú
takeout_id@   s    zSession.takeout_idc                 C   s   t ‚dS )zQ
        Sets the ID of the unfinished takeout process for this session.
        Nr   r   r   r   r   r   I   s    c                 C   s   t ‚dS )a	  
        Returns the ``UpdateState`` associated with the given `entity_id`.
        If the `entity_id` is 0, it should return the ``UpdateState`` for
        no specific channel (the "general" state). If no state is known
        it should ``return None``.
        Nr   )r   Ú	entity_idr   r   r   Úget_update_stateQ   s    zSession.get_update_statec                 C   s   t ‚dS )zÃ
        Sets the given ``UpdateState`` for the specified `entity_id`, which
        should be 0 if the ``UpdateState`` is the "general" state (and not
        for any specific channel).
        Nr   )r   r   Ústater   r   r   Úset_update_state[   s    zSession.set_update_statec                 C   s   dS )z\
        Returns an iterable over all known pairs of ``(entity ID, update state)``.
        Nr   r   r   r   r   Úget_update_statesd   s    zSession.get_update_statesc                 C   s   dS )z
        Called on client disconnection. Should be used to
        free any used resources. Can be left empty if none.
        Nr   r   r   r   r   Úclosej   s    zSession.closec                 C   s   t ‚dS )z‡
        Called whenever important properties change. It should
        make persist the relevant session information to disk.
        Nr   r   r   r   r   Úsavep   s    zSession.savec                 C   s   t ‚dS )z„
        Called upon client.log_out(). Should delete the stored
        information from disk since it's not valid anymore.
        Nr   r   r   r   r   Údeletex   s    zSession.deletec                 C   s   g S )zK
        Lists available sessions. Not used by the library itself.
        r   )Úclsr   r   r   Úlist_sessions€   s    zSession.list_sessionsc                 C   s   t ‚dS )zŒ
        Processes the input ``TLObject`` or ``list`` and saves
        whatever information is relevant (e.g., ID or access hash).
        Nr   )r   Ztlor   r   r   Úprocess_entities‡   s    zSession.process_entitiesc                 C   s   t ‚dS )a  
        Turns the given key into an ``InputPeer`` (e.g. ``InputPeerUser``).
        The library uses this method whenever an ``InputPeer`` is needed
        to suit several purposes (e.g. user only provided its ID or wishes
        to use a cached username to avoid extra RPC).
        Nr   )r   Úkeyr   r   r   Úget_input_entity   s    zSession.get_input_entityc                 C   s   t ‚dS )a"  
        Caches the given file information persistently, so that it
        doesn't need to be re-uploaded in case the file is used again.

        The ``instance`` will be either an ``InputPhoto`` or ``InputDocument``,
        both with an ``.id`` and ``.access_hash`` attributes.
        Nr   )r   Ú
md5_digestÚ	file_sizeÚinstancer   r   r   Ú
cache_file™   s    	zSession.cache_filec                 C   s   t ‚dS )a  
        Returns an instance of ``cls`` if the ``md5_digest`` and ``file_size``
        match an existing saved record. The class will either be an
        ``InputPhoto`` or ``InputDocument``, both with two parameters
        ``id`` and ``access_hash`` in that order.
        Nr   )r   r#   r$   r   r   r   r   Úget_file¤   s    zSession.get_file)N)Ú__name__Ú
__module__Ú__qualname__r	   r   r   r   Úpropertyr   r   r   r   Úsetterr   r   r   r   r   r   r   Úclassmethodr   r    r"   r&   r'   r   r   r   r   r      s\   


	






	

r   N)Úabcr   r   r   r   r   r   r   Ú<module>   s   