
    iv                         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 ddlmZmZ erddlmZ  G d	 d
e          ZdS )zKThis module contains an object that represents a Telegram PreCheckoutQuery.    )TYPE_CHECKINGOptional)	OrderInfo)TelegramObject)User)DEFAULT_NONE)JSONDictODVInput)Botc                   :    e Zd ZdZdZ	 	 ddddedededed	ed
ee         dee	         dee
         f fdZedee
         ddded          f fd            Z	 deeeedddedee         dee         dee         dee         dee         dee
         defdZ x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 ``amount`` is ``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                    t                                          |           || _        || _        || _        || _        || _        || _        || _        | 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__s
            h/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/telegram/_payment/precheckoutquery.pyr   zPreCheckoutQuery.__init__W   sp     	J///(%!-$31C/9'    databotr   returnc                 *   |                      |          }|sdS t          j        |                    dd          |          |d<   t	          j        |                    d          |          |d<   t                                          ||          S )z,See :meth:`telegram.TelegramObject.de_json`.Nfromr   r   )r    r!   )_parse_datar   de_jsonpopr   getr   )clsr    r!   r   s      r   r&   zPreCheckoutQuery.de_jsonp   s     t$$ 	4 L&$)?)?EE[&.txx/E/EsKK\wwDc222r   )read_timeoutwrite_timeoutconnect_timeoutpool_timeoutr   okerror_messager*   r+   r,   r-   c          
      z   K   |                                                      | j        |||||||           d{V S )zShortcut 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   s           r   answerzPreCheckoutQuery.answer}   se      & \\^^=="&''%'+%! > 	
 	
 	
 	
 	
 	
 	
 	
 		
r   )NN)N)__name__
__module____qualname____doc__	__slots__strr   intr   r   r	   r   classmethodr&   r   boolr
   floatr4   __classcell__)r   s   @r   r   r   !   s       ) )VI" -1*. *.    	
   %SM Y' X&     2 
38H- 
3E 
3hGY>Z 
3 
3 
3 
3 
3 [
3 (,

 )5)5+7(4)-
 
 

  }

 uo
  
 "%
 uo
 X&
 

 
 
 
 
 
 
 
r   r   N)r8   typingr   r   telegram._payment.orderinfor   telegram._telegramobjectr   telegram._userr   telegram._utils.defaultvaluer   telegram._utils.typesr	   r
   telegramr   r    r   r   <module>rH      s   & R Q * * * * * * * * 1 1 1 1 1 1 3 3 3 3 3 3       5 5 5 5 5 5 4 4 4 4 4 4 4 4 x
 x
 x
 x
 x
~ x
 x
 x
 x
 x
r   