o
    "h#                     @   st   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r0ddlmZ G d	d
 d
eZdS )z?This module contains the classes for Telegram Stars affiliates.    )TYPE_CHECKINGOptional)Chat)TelegramObject)User)de_json_optional)JSONDict)Botc                       s   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dZe	ddeded dd f fddZ
  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                   sR   t  j|d || _|| _|| _|| _|| _| 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__ X/var/www/html/venv/lib/python3.10/site-packages/telegram/_payment/stars/affiliateinfo.pyr   R   s   
zAffiliateInfo.__init__databotr	   c                    sF   |  |}t|dt||d< t|dt||d< t j||dS )z,See :meth:`telegram.TelegramObject.de_json`.r   r   )r   r   )_parse_datar   getr   r   r   de_json)clsr   r   r   r   r   r    l   s   
zAffiliateInfo.de_json)NNN)N)__name__
__module____qualname____doc__	__slots__intr   r   r   classmethodr    __classcell__r   r   r   r   r
       s2    )	*r
   N)r%   typingr   r   telegram._chatr   telegram._telegramobjectr   telegram._userr   telegram._utils.argumentparsingr   telegram._utils.typesr   telegramr	   r
   r   r   r   r   <module>   s   