
    ynh#                     z    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 erddlmZ  G d	 d
e      Zy)z?This module contains the classes for Telegram Stars affiliates.    )TYPE_CHECKINGOptional)Chat)TelegramObject)User)de_json_optional)JSONDict)Botc                        e Zd ZdZdZ	 	 	 ddddededed   d	ed
   dee   dee   ddf fdZe	ddeded   dd f fd       Z
 xZS )AffiliateInfoa	  Contains information about the affiliate that received a commission via this transaction.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`affiliate_user`, :attr:`affiliate_chat`,
    :attr:`commission_per_mille`, :attr:`amount`, and :attr:`nanostar_amount` are equal.

    .. versionadded:: 21.9

    Args:
        affiliate_user (:class:`telegram.User`, optional): The bot or the user that received an
            affiliate commission if it was received by a bot or a user
        affiliate_chat (:class:`telegram.Chat`, optional): The chat that received an affiliate
            commission if it was received by a chat
        commission_per_mille (:obj:`int`): The number of Telegram Stars received by the affiliate
            for each 1000 Telegram Stars received by the bot from referred users
        amount (:obj:`int`): Integer amount of Telegram Stars received by the affiliate from the
            transaction, rounded to 0; can be negative for refunds
        nanostar_amount (:obj:`int`, optional): The number of
            :tg-const:`~telegram.constants.Nanostar.VALUE` shares of Telegram
            Stars received by the affiliate; from
            :tg-const:`~telegram.constants.NanostarLimit.MIN_AMOUNT` to
            :tg-const:`~telegram.constants.NanostarLimit.MAX_AMOUNT`;
            can be negative for refunds

    Attributes:
        affiliate_user (:class:`telegram.User`): Optional. The bot or the user that received an
            affiliate commission if it was received by a bot or a user
        affiliate_chat (:class:`telegram.Chat`): Optional. The chat that received an affiliate
            commission if it was received by a chat
        commission_per_mille (:obj:`int`): The number of Telegram Stars received by the affiliate
            for each 1000 Telegram Stars received by the bot from referred users
        amount (:obj:`int`): Integer amount of Telegram Stars received by the affiliate from the
            transaction, rounded to 0; can be negative for refunds
        nanostar_amount (:obj:`int`): Optional. The number of
            :tg-const:`~telegram.constants.Nanostar.VALUE` shares of Telegram
            Stars received by the affiliate; from
            :tg-const:`~telegram.constants.NanostarLimit.MIN_AMOUNT` to
            :tg-const:`~telegram.constants.NanostarLimit.MAX_AMOUNT`;
            can be negative for refunds
    )affiliate_chataffiliate_useramountcommission_per_millenanostar_amountN
api_kwargsr   r   r   r   r   r   r   r   returnc                   t         |   |       || _        || _        || _        || _        || _        | j                  | j                  | j                  | j
                  | j                  f| _        | j                          y )Nr   )	super__init__r   r   r   r   r   	_id_attrs_freeze)selfr   r   r   r   r   r   	__class__s          f/var/www/html/profi_bot/bot/venv/lib/python3.12/site-packages/telegram/_payment/stars/affiliateinfo.pyr   zAffiliateInfo.__init__R   s}     	J/.<.<)=!!.= %%KK  
 	    databotr
   c                     | j                  |      }t        |j                  d      t        |      |d<   t        |j                  d      t        |      |d<   t
        |   ||      S )z,See :meth:`telegram.TelegramObject.de_json`.r   r   )r   r   )_parse_datar   getr   r   r   de_json)clsr   r   r   s      r   r#   zAffiliateInfo.de_jsonl   sd     t$!1$((;K2LdTW!X!1$((;K2LdTW!XwDc22r   )NNN)N)__name__
__module____qualname____doc__	__slots__intr   r	   r   classmethodr#   __classcell__)r   s   @r   r   r       s    'RI ,0+/)- *.!  !(	
 !( "# X& 
4 38 3(5/ 3_ 3 3r   r   N)r(   typingr   r   telegram._chatr   telegram._telegramobjectr   telegram._userr   telegram._utils.argumentparsingr   telegram._utils.typesr	   telegramr
   r    r   r   <module>r5      s1   & F *  3  < *T3N T3r   