o
    f>h7                     @   s   d Z ddlmZ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 ddlmZ er8dd	lmZ G d
d de
ZG dd de
ZG dd de
ZG dd de
ZG dd de
ZG dd de
ZdS )z4This module contains classes related to unique gifs.    )TYPE_CHECKINGFinalOptional)	constants)Sticker)TelegramObject)enum)de_json_optional)JSONDict)Botc                
       d   e Zd ZdZdZdddedededee	 f fd	d
Z
edde	ded dd f fddZ  ZS )UniqueGiftModelaS  This object describes the model of a unique gift.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`name`, :attr:`sticker` and :attr:`rarity_per_mille` are equal.

    .. versionadded:: 22.1

    Args:
        name (:obj:`str`): Name of the model.
        sticker (:class:`telegram.Sticker`): The sticker that represents the unique gift.
        rarity_per_mille (:obj:`int`): The number of unique gifts that receive this
            model for every ``1000`` gifts upgraded.

    Attributes:
        name (:obj:`str`): Name of the model.
        sticker (:class:`telegram.Sticker`): The sticker that represents the unique gift.
        rarity_per_mille (:obj:`int`): The number of unique gifts that receive this
            model for every ``1000`` gifts upgraded.

    namerarity_per_millestickerN
api_kwargsr   r   r   r   c                   >   t  j|d || _|| _|| _| j| j| jf| _|   d S Nr   super__init__r   r   r   	_id_attrs_freezeselfr   r   r   r   	__class__ G/var/www/html/venv/lib/python3.10/site-packages/telegram/_uniquegift.pyr   >      zUniqueGiftModel.__init__databotr   returnc                    0   |  |}t|dt||d< t j||dS ,See :meth:`telegram.TelegramObject.de_json`.r   r"   r#   _parse_datar	   getr   r   de_jsonclsr"   r#   r   r   r    r,   O      
zUniqueGiftModel.de_jsonN__name__
__module____qualname____doc__	__slots__strr   intr   r
   r   classmethodr,   __classcell__r   r   r   r    r   "       *r   c                
       r   )UniqueGiftSymbolak  This object describes the symbol shown on the pattern of a unique gift.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`name`, :attr:`sticker` and :attr:`rarity_per_mille` are equal.

    .. versionadded:: 22.1

    Args:
        name (:obj:`str`): Name of the symbol.
        sticker (:class:`telegram.Sticker`): The sticker that represents the unique gift.
        rarity_per_mille (:obj:`int`): The number of unique gifts that receive this
            model for every ``1000`` gifts upgraded.

    Attributes:
        name (:obj:`str`): Name of the symbol.
        sticker (:class:`telegram.Sticker`): The sticker that represents the unique gift.
        rarity_per_mille (:obj:`int`): The number of unique gifts that receive this
            model for every ``1000`` gifts upgraded.

    r   Nr   r   r   r   r   c                   r   r   r   r   r   r   r    r   u   r!   zUniqueGiftSymbol.__init__r"   r#   r   r$   c                    r%   r&   r)   r-   r   r   r    r,      r/   zUniqueGiftSymbol.de_jsonr0   r1   r   r   r   r    r<   Y   r;   r<   c                       sD   e Zd ZdZdZdddedededed	ee f
 fd
dZ  Z	S )UniqueGiftBackdropColorsa"  This object describes the colors of the backdrop of a unique gift.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`center_color`, :attr:`edge_color`, :attr:`symbol_color`,
    and :attr:`text_color` are equal.

    .. versionadded:: 22.1

    Args:
        center_color (:obj:`int`): The color in the center of the backdrop in RGB format.
        edge_color (:obj:`int`): The color on the edges of the backdrop in RGB format.
        symbol_color (:obj:`int`): The color to be applied to the symbol in RGB format.
        text_color (:obj:`int`): The color for the text on the backdrop in RGB format.

    Attributes:
        center_color (:obj:`int`): The color in the center of the backdrop in RGB format.
        edge_color (:obj:`int`): The color on the edges of the backdrop in RGB format.
        symbol_color (:obj:`int`): The color to be applied to the symbol in RGB format.
        text_color (:obj:`int`): The color for the text on the backdrop in RGB format.

    )center_color
edge_colorsymbol_color
text_colorNr   r>   r?   r@   rA   r   c                   sH   t  j|d || _|| _|| _|| _| j| j| j| jf| _|   d S r   )r   r   r>   r?   r@   rA   r   r   )r   r>   r?   r@   rA   r   r   r   r    r      s   	z!UniqueGiftBackdropColors.__init__)
r2   r3   r4   r5   r6   r8   r   r
   r   r:   r   r   r   r    r=      s    r=   c                
       r   )UniqueGiftBackdropaX  This object describes the backdrop of a unique gift.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`name`, :attr:`colors`, and :attr:`rarity_per_mille` are equal.

    .. versionadded:: 22.1

    Args:
        name (:obj:`str`): Name of the backdrop.
        colors (:class:`telegram.UniqueGiftBackdropColors`): Colors of the backdrop.
        rarity_per_mille (:obj:`int`): The number of unique gifts that receive this backdrop
            for every ``1000`` gifts upgraded.

    Attributes:
        name (:obj:`str`): Name of the backdrop.
        colors (:class:`telegram.UniqueGiftBackdropColors`): Colors of the backdrop.
        rarity_per_mille (:obj:`int`): The number of unique gifts that receive this backdrop
            for every ``1000`` gifts upgraded.

    )colorsr   r   Nr   r   rC   r   r   c                   r   r   )r   r   r   rC   r   r   r   )r   r   rC   r   r   r   r   r    r      r!   zUniqueGiftBackdrop.__init__r"   r#   r   r$   c                    r%   )r'   rC   r(   )r*   r	   r+   r=   r   r,   r-   r   r   r    r,      r/   zUniqueGiftBackdrop.de_jsonr0   )r2   r3   r4   r5   r6   r7   r=   r8   r   r
   r   r9   r,   r:   r   r   r   r    rB      r;   rB   c                       sp   e Zd ZdZdZdddedededed	ed
e	de
e f fddZeddede
d dd f fddZ  ZS )
UniqueGifta"  This object describes a unique gift that was upgraded from a regular gift.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`base_name`, :attr:`name`, :attr:`number`, :class:`model`,
    :attr:`symbol`, and :attr:`backdrop` are equal.

    .. versionadded:: 22.1

    Args:
        base_name (:obj:`str`): Human-readable name of the regular gift from which this unique
            gift was upgraded.
        name (:obj:`str`): Unique name of the gift. This name can be used
            in ``https://t.me/nft/...`` links and story areas.
        number (:obj:`int`): Unique number of the upgraded gift among gifts upgraded from the
            same regular gift.
        model (:class:`UniqueGiftModel`): Model of the gift.
        symbol (:class:`UniqueGiftSymbol`): Symbol of the gift.
        backdrop (:class:`UniqueGiftBackdrop`): Backdrop of the gift.

    Attributes:
        base_name (:obj:`str`): Human-readable name of the regular gift from which this unique
            gift was upgraded.
        name (:obj:`str`): Unique name of the gift. This name can be used
            in ``https://t.me/nft/...`` links and story areas.
        number (:obj:`int`): Unique number of the upgraded gift among gifts upgraded from the
            same regular gift.
        model (:class:`telegram.UniqueGiftModel`): Model of the gift.
        symbol (:class:`telegram.UniqueGiftSymbol`): Symbol of the gift.
        backdrop (:class:`telegram.UniqueGiftBackdrop`): Backdrop of the gift.

    )backdrop	base_namemodelr   numbersymbolNr   rF   r   rH   rG   rI   rE   r   c                   s\   t  j|d || _|| _|| _|| _|| _|| _| j| j| j| j| j| jf| _| 	  d S r   )
r   r   rF   r   rH   rG   rI   rE   r   r   )r   rF   r   rH   rG   rI   rE   r   r   r   r    r   #  s   	zUniqueGift.__init__r"   r#   r   r$   c                    s\   |  |}t|dt||d< t|dt||d< t|dt||d< t j||dS )r'   rG   rI   rE   r(   )r*   r	   r+   r   r<   rB   r   r,   r-   r   r   r    r,   A  s
   
zUniqueGift.de_jsonr0   )r2   r3   r4   r5   r6   r7   r8   r   r<   rB   r   r
   r   r9   r,   r:   r   r   r   r    rD      s*     	*rD   c                       s   e Zd ZU dZejjZee e	d< 	 ejj
Z
ee e	d< 	 dZ		ddddeded	ee d
ee dee f
 fddZeddeded dd f fddZ  ZS )UniqueGiftInfoaN  Describes a service message about a unique gift that was sent or received.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`gift`, and :attr:`origin` are equal.

    .. versionadded:: 22.1

    Args:
        gift (:class:`UniqueGift`): Information about the gift.
        origin (:obj:`str`): Origin of the gift. Currently, either :attr:`UPGRADE`
            or :attr:`TRANSFER`.
        owned_gift_id (:obj:`str`, optional) Unique identifier of the received gift for the
            bot; only present for gifts received on behalf of business accounts.
        transfer_star_count (:obj:`int`, optional): Number of Telegram Stars that must be paid
            to transfer the gift; omitted if the bot cannot transfer the gift.

    Attributes:
        gift (:class:`UniqueGift`): Information about the gift.
        origin (:obj:`str`): Origin of the gift. Currently, either :attr:`UPGRADE`
            or :attr:`TRANSFER`.
        owned_gift_id (:obj:`str`) Optional. Unique identifier of the received gift for the
            bot; only present for gifts received on behalf of business accounts.
        transfer_star_count (:obj:`int`): Optional. Number of Telegram Stars that must be paid
            to transfer the gift; omitted if the bot cannot transfer the gift.

    UPGRADETRANSFER)giftoriginowned_gift_idtransfer_star_countNr   rM   rN   rO   rP   r   c                   sL   t  j|d || _ttj||| _|| _|| _	| j| jf| _
|   d S r   )r   r   rM   r   
get_memberr   UniqueGiftInfoOriginrN   rO   rP   r   r   )r   rM   rN   rO   rP   r   r   r   r    r   u  s   	zUniqueGiftInfo.__init__r"   r#   r   r$   c                    r%   )r'   rM   r(   )r*   r	   r+   rD   r   r,   r-   r   r   r    r,     r/   zUniqueGiftInfo.de_json)NNr0   )r2   r3   r4   r5   r   rR   rK   r   r7   __annotations__rL   r6   rD   r   r8   r
   r   r9   r,   r:   r   r   r   r    rJ   M  s0   
 *rJ   N)r5   typingr   r   r   telegramr   telegram._files.stickerr   telegram._telegramobjectr   telegram._utilsr   telegram._utils.argumentparsingr	   telegram._utils.typesr
   r   r   r<   r=   rB   rD   rJ   r   r   r   r    <module>   s    7727T