
    Qi                         d Z ddlm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 erddlmZ  G d	 d
e	      Z G d de	      Zy)z:This module contains classes related to gifs sent by bots.    )Sequence)TYPE_CHECKINGOptional)Sticker)TelegramObject)parse_sequence_arg)JSONDict)Botc                        e Zd ZdZdZ	 	 	 ddddedededee   d	ee   d
ee   dee	   f fdZ
eddee	   ded   ded    f fd       Z xZS )Gifta  This object represents a gift that can be sent by the bot.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`id` is equal.

    .. versionadded:: 21.8

    Args:
        id (:obj:`str`): Unique identifier of the gift
        sticker (:class:`~telegram.Sticker`): The sticker that represents the gift
        star_count (:obj:`int`): The number of Telegram Stars that must be paid to send the sticker
        total_count (:obj:`int`, optional): The total number of the gifts of this type that can be
            sent; for limited gifts only
        remaining_count (:obj:`int`, optional): The number of remaining gifts of this type that can
            be sent; for limited gifts only
        upgrade_star_count (:obj:`int`, optional): The number of Telegram Stars that must be paid
            to upgrade the gift to a unique one

            .. versionadded:: 21.10

    Attributes:
        id (:obj:`str`): Unique identifier of the gift
        sticker (:class:`~telegram.Sticker`): The sticker that represents the gift
        star_count (:obj:`int`): The number of Telegram Stars that must be paid to send the sticker
        total_count (:obj:`int`): Optional. The total number of the gifts of this type that can be
            sent; for limited gifts only
        remaining_count (:obj:`int`): Optional. The number of remaining gifts of this type that can
            be sent; for limited gifts only
        upgrade_star_count (:obj:`int`): Optional. The number of Telegram Stars that must be paid
            to upgrade the gift to a unique one

            .. versionadded:: 21.10

    )idremaining_count
star_countstickertotal_countupgrade_star_countN
api_kwargsr   r   r   r   r   r   r   c                    t         |   |       || _        || _        || _        || _        || _        || _        | j                  f| _        | j                          y Nr   )
super__init__r   r   r   r   r   r   	_id_attrs_freeze)	selfr   r   r   r   r   r   r   	__class__s	           :/app/.venv/lib/python3.12/site-packages/telegram/_gifts.pyr   zGift.__init__N   sX     	J/ ')*5.=1C''    databotr
   returnc                     | j                  |      }|syt        j                  |j                  d      |      |d<   t        | 	  ||      S ),See :meth:`telegram.TelegramObject.de_json`.Nr   r   r    )_parse_datar   de_jsongetr   clsr   r    r   s      r   r&   zGift.de_jsone   sI     t$!//$((9*=sCYwDc22r   )NNNN)__name__
__module____qualname____doc__	__slots__strr   intr   r	   r   classmethodr&   __classcell__r   s   @r   r   r   !   s    !FI &*)-,0 *.  	
 c] "# %SM X&. 38H- 3HUO 3xX^O_ 3 3r   r   c            	       x     e Zd ZdZdZdddee   dee   f fdZ	e
ddee   d	ed
   ded    f fd       Z xZS )Giftsat  This object represent a list of gifts.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`gifts` are equal.

    .. versionadded:: 21.8

    Args:
        gifts (Sequence[:class:`Gift`]): The sequence of gifts

    Attributes:
        gifts (tuple[:class:`Gift`]): The sequence of gifts

    )giftsNr   r7   r   c                    t         |   |       t        |      | _        | j                  f| _        | j                          y r   )r   r   r   r7   r   r   )r   r7   r   r   s      r   r   zGifts.__init__   s7     	J/'9%'@
**r   r   r    r
   r!   c                     | j                  |      }|syt        j                  |j                  d      |      |d<   t        |   ||      S )r#   Nr7   r$   )r%   r   de_listr'   r   r&   r(   s      r   r&   zGifts.de_json   sI     t$TXXg%6<WwDc22r   r*   )r+   r,   r-   r.   r/   r   r   r   r	   r   r2   r&   r3   r4   s   @r   r6   r6   q   sl     I *.	~ X&	 38H- 3HUO 3xX_O` 3 3r   r6   N)r.   collections.abcr   typingr   r   telegram._files.stickerr   telegram._telegramobjectr   telegram._utils.argumentparsingr   telegram._utils.typesr	   telegramr
   r   r6    r   r   <module>rC      s>   ( A $ * + 3 > *M3> M3`(3N (3r   