U
    g                     @   sh   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rTddlmZ G dd	 d	eZd
S )zMThis module contains an object that represents a Telegram ChosenInlineResult.    )TYPE_CHECKINGOptional)Location)TelegramObject)User)JSONDict)Botc                	       sp   e Zd ZdZdZdddeeeee ee ee	 d fddZ
edee	 ed ed  d	 fd
dZ  ZS )ChosenInlineResulta	  
    Represents a result of an inline query that was chosen by the user and sent to their chat
    partner.

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

    Note:
        * In Python :keyword:`from` is a reserved word. Use :paramref:`from_user` instead.
        * It is necessary to enable inline feedback via `@Botfather <https://t.me/BotFather>`_ in
          order to receive these objects in updates.

    Args:
        result_id (:obj:`str`): The unique identifier for the result that was chosen.
        from_user (:class:`telegram.User`): The user that chose the result.
        location (:class:`telegram.Location`, optional): Sender location, only for bots that
            require user location.
        inline_message_id (:obj:`str`, optional): Identifier of the sent inline message. Available
            only if there is an inline keyboard attached to the message. Will be also received in
            callback queries and can be used to edit the message.
        query (:obj:`str`): The query that was used to obtain the result.

    Attributes:
        result_id (:obj:`str`): The unique identifier for the result that was chosen.
        from_user (:class:`telegram.User`): The user that chose the result.
        location (:class:`telegram.Location`): Optional. Sender location, only for bots that
            require user location.
        inline_message_id (:obj:`str`): Optional. Identifier of the sent inline message. Available
            only if there is an inline keyboard attached to the message. Will be also received in
            callback queries and can be used to edit the message.
        query (:obj:`str`): The query that was used to obtain the result.

    )	from_userinline_message_idlocationquery	result_idN
api_kwargs)r   r
   r   r   r   r   c                   sB   t  j|d || _|| _|| _|| _|| _| jf| _|   d S )Nr   )	super__init__r   r
   r   r   r   Z	_id_attrsZ_freeze)selfr   r
   r   r   r   r   	__class__ @/tmp/pip-unpacked-wheel-swnnwir2/telegram/_choseninlineresult.pyr   F   s    

zChosenInlineResult.__init__r   )databotreturnc                    sP   |  |}|sdS t|dd||d< t|d||d< t j||dS )z,See :meth:`telegram.TelegramObject.de_json`.Nfromr
   r   )r   r   )Z_parse_datar   de_jsonpopr   getr   )clsr   r   r   r   r   r   ^   s    
zChosenInlineResult.de_json)NN)N)__name__
__module____qualname____doc__	__slots__strr   r   r   r   r   classmethodr   __classcell__r   r   r   r   r	   !   s*   "    r	   N)r#   typingr   r   Ztelegram._files.locationr   Ztelegram._telegramobjectr   Ztelegram._userr   Ztelegram._utils.typesr   Ztelegramr   r	   r   r   r   r   <module>   s   