
    di                     ~    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 erddlmZ  G d	 d
e          ZdS )z?This module contains the classes for Telegram Stars affiliates.    )TYPE_CHECKING)Chat)TelegramObject)User)de_json_optional)JSONDict)Botc                        e Zd ZdZdZ	 	 	 ddddededdd	d
dedz  dedz  ddf fdZedded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   zUser | Noner   zChat | Noner   r   returnc                   t                                          |           || _        || _        || _        || _        || _        | j        | j        | j        | j        | j        f| _        |                                  d S )Nr   )	super__init__r   r   r   r   r   	_id_attrs_freeze)selfr   r   r   r   r   r   	__class__s          b/root/projects/qq-shell/venv/lib/python3.11/site-packages/telegram/_payment/stars/affiliateinfo.pyr   zAffiliateInfo.__init__S   s     	J///+9+9)=!!+: %K 
 	    databotz
Bot | Nonec                 $   |                      |          }t          |                    d          t          |          |d<   t          |                    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_jsonm   sz     t$$!1$((;K2L2LdTW!X!X!1$((;K2L2LdTW!X!XwwDc222r   )NNN)N)__name__
__module____qualname____doc__	__slots__intr   r   classmethodr"   __classcell__)r   s   @r   r   r   !   s        ' 'RI )-(,&* '+  !  &	
 & t tO 
     4 3 38 3, 3/ 3 3 3 3 3 [3 3 3 3 3r   r   N)r'   typingr   telegram._chatr   telegram._telegramobjectr   telegram._userr   telegram._utils.argumentparsingr   telegram._utils.typesr   telegramr	   r    r   r   <module>r4      s   & F E                   3 3 3 3 3 3       < < < < < < * * * * * * T3 T3 T3 T3 T3N T3 T3 T3 T3 T3r   