o
    Zzj„  ã                   @   s€   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZ er6dd	lmZ G d
d„ deƒZdS )zKThis module contains an object that represents a Telegram PreCheckoutQuery.é    )ÚTYPE_CHECKING)Ú	OrderInfo)ÚTelegramObject)ÚUser)Úde_json_optional)ÚDEFAULT_NONE)ÚJSONDictÚODVInput)ÚBotc                       sÒ   e Zd ZdZdZ		dddœdedede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	dddd f‡ fdd„ƒZ	deeeeddœdededB dee dee dee dee de	dB defdd„Z‡  ZS ) ÚPreCheckoutQueryaù  This object contains information about an incoming pre-checkout query.

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

    Note:
        In Python :keyword:`from` is a reserved word. Use :paramref:`from_user` instead.

    Args:
        id (:obj:`str`): Unique query identifier.
        from_user (:class:`telegram.User`): User who sent the query.
        currency (:obj:`str`): Three-letter ISO 4217 currency code, or ``XTR`` for payments in
            |tg_stars|.
        total_amount (:obj:`int`): Total price in the smallest units of the currency (integer,
            **not** float/double). For example, for a price of ``US$ 1.45`` pass ``amount = 145``.
            See the ``exp`` parameter in
            `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_,
            it shows the number of digits past the decimal point for each currency
            (2 for the majority of currencies).
        invoice_payload (:obj:`str`): Bot-specified invoice payload.
        shipping_option_id (:obj:`str`, optional): Identifier of the shipping option chosen by the
            user.
        order_info (:class:`telegram.OrderInfo`, optional): Order info provided by the user.

    Attributes:
        id (:obj:`str`): Unique query identifier.
        from_user (:class:`telegram.User`): User who sent the query.
        currency (:obj:`str`): Three-letter ISO 4217 currency code, or ``XTR`` for payments in
            |tg_stars|.
        total_amount (:obj:`int`): Total price in the smallest units of the currency (integer,
            **not** float/double). For example, for a price of ``US$ 1.45`` pass ``amount = 145``.
            See the ``exp`` parameter in
            `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_,
            it shows the number of digits past the decimal point for each currency
            (2 for the majority of currencies).
        invoice_payload (:obj:`str`): Bot-specified invoice payload.
        shipping_option_id (:obj:`str`): Optional. Identifier of the shipping option chosen by the
            user.
        order_info (:class:`telegram.OrderInfo`): Optional. Order info provided by the user.


    )ÚcurrencyÚ	from_userÚidÚinvoice_payloadÚ
order_infoÚshipping_option_idÚtotal_amountN©Ú
api_kwargsr   r   r   r   r   r   r   r   c          	         sN   t ƒ j|d� || _|| _|| _|| _|| _|| _|| _| jf| _	|  
¡  d S )Nr   )ÚsuperÚ__init__r   r   r   r   r   r   r   Ú	_id_attrsÚ_freeze)	Úselfr   r   r   r   r   r   r   r   ©Ú	__class__© ú]/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telegram/_payment/precheckoutquery.pyr   X   s   
zPreCheckoutQuery.__init__ÚdataÚbotz
Bot | NoneÚreturnc                    sH   |   |¡}t| dd¡t|ƒ|d< t| d¡t|ƒ|d< tƒ j||d�S )z,See :meth:`telegram.TelegramObject.de_json`.ÚfromNr   r   )r   r   )Ú_parse_datar   Úpopr   Úgetr   r   Úde_json)Úclsr   r   r   r   r   r%   q   s   
zPreCheckoutQuery.de_json)Úread_timeoutÚwrite_timeoutÚconnect_timeoutÚpool_timeoutr   ÚokÚerror_messager'   r(   r)   r*   c             
   Ã   s(   �|   ¡ j| j|||||||d�I dH S )zíShortcut for::

             await bot.answer_pre_checkout_query(update.pre_checkout_query.id, *args, **kwargs)

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

        )Úpre_checkout_query_idr+   r,   r'   r(   r)   r*   r   N)Úget_botÚanswer_pre_checkout_queryr   )r   r+   r,   r'   r(   r)   r*   r   r   r   r   Úanswer{   s   €øzPreCheckoutQuery.answer)NN)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Ústrr   Úintr   r   r   Úclassmethodr%   r   Úboolr	   Úfloatr0   Ú__classcell__r   r   r   r   r   "   sd    +ø
öþýüûúùø
öý÷þýûúùø	÷
ör   N)r4   Útypingr   Útelegram._payment.orderinfor   Útelegram._telegramobjectr   Útelegram._userr   Útelegram._utils.argumentparsingr   Útelegram._utils.defaultvaluer   Útelegram._utils.typesr   r	   Útelegramr
   r   r   r   r   r   Ú<module>   s   