L i6~dZddlmZddlmZmZddlmZddlm Z ddl m Z m Z ddl mZerddlmZGd d eZy ) zSThis module contains a class that represents a Telegram InputInvoiceMessageContent.)Sequence) TYPE_CHECKINGOptional)InputMessageContent) LabeledPrice)de_list_optionalparse_sequence_arg)JSONDict)Botc-8eZdZdZdZ d dddedededed eed eed ee d eee d eedeedee dee dee dee dee dee dee dee dee dee dee f*fdZ e d!de dedddffd ZxZS)"InputInvoiceMessageContentaU$ Represents the content of a invoice message to be sent as the result of an inline query. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`title`, :attr:`description`, :attr:`payload`, :attr:`currency` and :attr:`prices` are equal. .. versionadded:: 13.5 .. versionchanged:: 21.11 :attr:`provider_token` is no longer considered for equality comparison. Args: title (:obj:`str`): Product name. :tg-const:`telegram.Invoice.MIN_TITLE_LENGTH`- :tg-const:`telegram.Invoice.MAX_TITLE_LENGTH` characters. description (:obj:`str`): Product description. :tg-const:`telegram.Invoice.MIN_DESCRIPTION_LENGTH`- :tg-const:`telegram.Invoice.MAX_DESCRIPTION_LENGTH` characters. payload (:obj:`str`): Bot-defined invoice payload. :tg-const:`telegram.Invoice.MIN_PAYLOAD_LENGTH`- :tg-const:`telegram.Invoice.MAX_PAYLOAD_LENGTH` bytes. This will not be displayed to the user, use it for your internal processes. provider_token (:obj:`str`, optional): Payment provider token, obtained via `@Botfather `_. Pass an empty string for payments in |tg_stars|. .. versionchanged:: 21.11 Bot API 7.4 made this parameter is optional and this is now reflected in the class signature. currency (:obj:`str`): Three-letter ISO 4217 currency code, see more on `currencies `_. Pass ``XTR`` for payments in |tg_stars|. prices (Sequence[:class:`telegram.LabeledPrice`]): Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in |tg_stars|. .. versionchanged:: 20.0 |sequenceclassargs| max_tip_amount (:obj:`int`, optional): The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of ``US$ 1.45`` pass ``max_tip_amount = 145``. See the ``exp`` parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to ``0``. Not supported for payments in |tg_stars|. suggested_tip_amounts (Sequence[:obj:`int`], optional): An array of suggested amounts of tip in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed :attr:`max_tip_amount`. .. versionchanged:: 20.0 * |tupleclassattrs| * |alwaystuple| provider_data (:obj:`str`, optional): An object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. photo_url (:obj:`str`, optional): URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. photo_size (:obj:`int`, optional): Photo size. photo_width (:obj:`int`, optional): Photo width. photo_height (:obj:`int`, optional): Photo height. need_name (:obj:`bool`, optional): Pass :obj:`True`, if you require the user's full name to complete the order. Ignored for payments in |tg_stars|. need_phone_number (:obj:`bool`, optional): Pass :obj:`True`, if you require the user's phone number to complete the order. Ignored for payments in |tg_stars|. need_email (:obj:`bool`, optional): Pass :obj:`True`, if you require the user's email address to complete the order. Ignored for payments in |tg_stars|. need_shipping_address (:obj:`bool`, optional): Pass :obj:`True`, if you require the user's shipping address to complete the order. Ignored for payments in |tg_stars| send_phone_number_to_provider (:obj:`bool`, optional): Pass :obj:`True`, if user's phone number should be sent to provider. Ignored for payments in |tg_stars|. send_email_to_provider (:obj:`bool`, optional): Pass :obj:`True`, if user's email address should be sent to provider. Ignored for payments in |tg_stars|. is_flexible (:obj:`bool`, optional): Pass :obj:`True`, if the final price depends on the shipping method. Ignored for payments in |tg_stars|. Attributes: title (:obj:`str`): Product name. :tg-const:`telegram.Invoice.MIN_TITLE_LENGTH`- :tg-const:`telegram.Invoice.MAX_TITLE_LENGTH` characters. description (:obj:`str`): Product description. :tg-const:`telegram.Invoice.MIN_DESCRIPTION_LENGTH`- :tg-const:`telegram.Invoice.MAX_DESCRIPTION_LENGTH` characters. payload (:obj:`str`): Bot-defined invoice payload. :tg-const:`telegram.Invoice.MIN_PAYLOAD_LENGTH`- :tg-const:`telegram.Invoice.MAX_PAYLOAD_LENGTH` bytes. This will not be displayed to the user, use it for your internal processes. provider_token (:obj:`str`): Payment provider token, obtained via `@Botfather `_. Pass an empty string for payments in `Telegram Stars `_. currency (:obj:`str`): Three-letter ISO 4217 currency code, see more on `currencies `_. Pass ``XTR`` for payments in |tg_stars|. prices (tuple[:class:`telegram.LabeledPrice`]): Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in |tg_stars|. .. versionchanged:: 20.0 |tupleclassattrs| max_tip_amount (:obj:`int`): Optional. The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of ``US$ 1.45`` ``max_tip_amount`` is ``145``. See the ``exp`` parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to ``0``. Not supported for payments in |tg_stars|. suggested_tip_amounts (tuple[:obj:`int`]): Optional. An array of suggested amounts of tip in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed :attr:`max_tip_amount`. .. versionchanged:: 20.0 |tupleclassattrs| provider_data (:obj:`str`): Optional. An object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. photo_url (:obj:`str`): Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. photo_size (:obj:`int`): Optional. Photo size. photo_width (:obj:`int`): Optional. Photo width. photo_height (:obj:`int`): Optional. Photo height. need_name (:obj:`bool`): Optional. Pass :obj:`True`, if you require the user's full name to complete the order. Ignored for payments in |tg_stars|. need_phone_number (:obj:`bool`): Optional. Pass :obj:`True`, if you require the user's phone number to complete the order. Ignored for payments in |tg_stars|. need_email (:obj:`bool`): Optional. Pass :obj:`True`, if you require the user's email address to complete the order. Ignored for payments in |tg_stars|. need_shipping_address (:obj:`bool`): Optional. Pass :obj:`True`, if you require the user's shipping address to complete the order. Ignored for payments in |tg_stars|. send_phone_number_to_provider (:obj:`bool`): Optional. Pass :obj:`True`, if user's phone number should be sent to provider. Ignored for payments in |tg_stars|. send_email_to_provider (:obj:`bool`): Optional. Pass :obj:`True`, if user's email address should be sent to provider. Ignored for payments in |tg_stars|. is_flexible (:obj:`bool`): Optional. Pass :obj:`True`, if the final price depends on the shipping method. Ignored for payments in |tg_stars|. )currency description is_flexiblemax_tip_amount need_email need_nameneed_phone_numberneed_shipping_addresspayload photo_height photo_size photo_url photo_widthprices provider_dataprovider_tokensend_email_to_providersend_phone_number_to_providersuggested_tip_amountstitleN api_kwargsr!rrrrrrr rrrrrrrrrrrrr#c(t|||j5||_||_||_||_t||_||_ ||_ t||_ | |_ | |_ | |_| |_| |_||_||_||_||_||_||_||_|j|j|j |j |jf|_dddy#1swYyxYw)Nr")super__init__ _unfrozenr!rrrr rrrr rrrrrrrrrrrr _id_attrs)selfr!rrrrrrr rrrrrrrrrrrrr# __class__s q/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_inline/inputinvoicemessagecontent.pyr&z#InputInvoiceMessageContent.__init__s2 J/ ^^  #DJ$/D  'DL!)DM4Fv4NDK1?D 1?D :LMb:cD &0=D ,5DN-7DO.9D /;D -6DN5FD ".8DO9ND &A^D .:PD '/:D       DN1   s CDDdatabotr returnc|j|}t|jdt||d<t|||S)z,See :meth:`telegram.TelegramObject.de_json`.r)r,r-) _parse_datargetrr%de_json)clsr,r-r*s r+r2z"InputInvoiceMessageContent.de_jsonsAt$)$((8*8 $D>!8"TN#8$ (~%8&(0~'8(!))8*d^+8.X&/8t383(5/3Ea33r4r N)r8collections.abcrtypingrr$telegram._inline.inputmessagecontentrtelegram._payment.labeledpricertelegram._utils.argumentparsingrr telegram._utils.typesr telegramr r r4r+rGs2&Z$*D7P*h3!4h3r4