
    IiG9                     f   S r SSKJr  SSKJrJrJrJrJrJrJ	r	  SSK
Jr  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJrJr  SSKJr  \(       a  SSK
Jr   " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r  " S S\5      r! " S S\5      r" " S S\5      r#g)zDThis module contains the classes that represent Telegram ChatBoosts.    )datetime)TYPE_CHECKINGDictFinalOptionalSequenceTupleType)	constants)Chat)TelegramObject)User)enum)parse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc                   8  ^  \ rS rSr% SrSr\R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    SS.S	\
S
\\   4U 4S jjjr\S\\   SSS\S    4U 4S jj5       rSrU =r$ )ChatBoostSource%   a<  
Base class for Telegram ChatBoostSource objects. It can be one of:

* :class:`telegram.ChatBoostSourcePremium`
* :class:`telegram.ChatBoostSourceGiftCode`
* :class:`telegram.ChatBoostSourceGiveaway`

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

.. versionadded:: 20.8

Args:
    source (:obj:`str`): The source of the chat boost. Can be one of:
        :attr:`~telegram.ChatBoostSource.PREMIUM`, :attr:`~telegram.ChatBoostSource.GIFT_CODE`,
        or :attr:`~telegram.ChatBoostSource.GIVEAWAY`.

Attributes:
    source (:obj:`str`): The source of the chat boost. Can be one of:
        :attr:`~telegram.ChatBoostSource.PREMIUM`, :attr:`~telegram.ChatBoostSource.GIFT_CODE`,
        or :attr:`~telegram.ChatBoostSource.GIVEAWAY`.
)sourcePREMIUM	GIFT_CODEGIVEAWAYN
api_kwargsr   r   c                   > [         TU ]  US9  [        R                  " [        R
                  X5      U l        U R                  4U l        U R                  5         g Nr   )	super__init__r   
get_memberr   ChatBoostSourcesr   	_id_attrs_freeze)selfr   r   	__class__s      9/venv/lib/python3.13/site-packages/telegram/_chatboost.pyr!   ChatBoostSource.__init__F   sC    J/  ??9+E+EvV++    databotr   returnc                   > U R                  U5      nU(       d  gU R                  [        U R                  [        U R
                  [        0nU [        L a5  UR                  S5      U;   a   X1R                  S5         R                  XS9$ SU;   a)  [        R                  " UR                  S5      U5      US'   [        TU ])  XS9$ ),See :meth:`telegram.TelegramObject.de_json`.Nr   r+   r,   user)_parse_datar   ChatBoostSourcePremiumr   ChatBoostSourceGiftCoder   ChatBoostSourceGiveawayr   getpopde_jsonr   r    )clsr+   r,   _class_mappingr'   s       r(   r8   ChatBoostSource.de_jsonO   s     t$ KK/MM2LL1<
 /!dhhx&8N&J!((8"45==4=QQT><<(8#>DLwD22r*   )r$   r   )__name__
__module____qualname____firstlineno____doc__	__slots__r   r#   r   r   str__annotations__r   r   r   r   r!   classmethodr8   __static_attributes____classcell__r'   s   @r(   r   r   %   s    . I#44<<GU3Z<>%66@@IuSz@@$55>>HeCj>?HL s 8H3E   38H- 3E 3hGX>Y 3 3r*   r   c                   J   ^  \ rS rSrSrSrSS.S\S\\   4U 4S jjjr	Sr
U =r$ )	r3   f   a  
The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium
subscription to another user.

.. versionadded:: 20.8

Args:
    user (:class:`telegram.User`): User that boosted the chat.

Attributes:
    source (:obj:`str`): The source of the chat boost. Always
        :attr:`~telegram.ChatBoostSource.PREMIUM`.
    user (:class:`telegram.User`): User that boosted the chat.
r1   Nr   r1   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        S S S 5        g ! , (       d  f       g = fN)r   r   )r    r!   r   	_unfrozenr1   r&   r1   r   r'   s      r(   r!   ChatBoostSourcePremium.__init__x   s4    D^^"I 	   :
Ar<   r=   r>   r?   r@   rA   r   r   r   r!   rE   rF   rG   s   @r(   r3   r3   f   s/     IGK #T #(82D # #r*   r3   c                   J   ^  \ rS rSrSrSrSS.S\S\\   4U 4S jjjr	Sr
U =r$ )	r4      a  
The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each
such code boosts the chat 4 times for the duration of the corresponding Telegram Premium
subscription.

.. versionadded:: 20.8

Args:
    user (:class:`telegram.User`): User for which the gift code was created.

Attributes:
    source (:obj:`str`): The source of the chat boost. Always
        :attr:`~telegram.ChatBoostSource.GIFT_CODE`.
    user (:class:`telegram.User`): User for which the gift code was created.
rJ   Nr   r1   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        S S S 5        g ! , (       d  f       g = frL   )r    r!   r   rM   r1   rN   s      r(   r!    ChatBoostSourceGiftCode.__init__   s4    :F^^"I rP   rQ   rG   s   @r(   r4   r4      s/      IGK #T #(82D # #r*   r4   c                   f   ^  \ rS rSrSrSr  SSS.S\S\\   S\\	   S	\\
   4U 4S
 jjjjrSrU =r$ )r5      ay  
The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4
times for the duration of the corresponding Telegram Premium subscription.

.. versionadded:: 20.8

Args:
    giveaway_message_id (:obj:`int`): Identifier of a message in the chat with the giveaway;
        the message could have been deleted already. May be 0 if the message isn't sent yet.
    user (:class:`telegram.User`, optional): User that won the prize in the giveaway if any.
    is_unclaimed (:obj:`bool`, optional): :obj:`True`, if the giveaway was completed, but
        there was no user to win the prize.

Attributes:
    source (:obj:`str`): Source of the boost. Always
        :attr:`~telegram.ChatBoostSource.GIVEAWAY`.
    giveaway_message_id (:obj:`int`): Identifier of a message in the chat with the giveaway;
        the message could have been deleted already. May be 0 if the message isn't sent yet.
    user (:class:`telegram.User`): Optional. User that won the prize in the giveaway if any.
    is_unclaimed (:obj:`bool`): Optional. :obj:`True`, if the giveaway was completed, but
        there was no user to win the prize.
)giveaway_message_idis_unclaimedr1   Nr   rX   r1   rY   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        X l        X0l        S S S 5        g ! , (       d  f       g = frL   )r    r!   r   rM   rX   r1   rY   )r&   rX   r1   rY   r   r'   s        r(   r!    ChatBoostSourceGiveaway.__init__   sB     	*E^^,?$(,I0< s   A
A)NN)r<   r=   r>   r?   r@   rA   intr   r   boolr   r!   rE   rF   rG   s   @r(   r5   r5      s_    . @I
  $'+	= *.= = tn= tn	= X&= =r*   r5   c                      ^  \ rS rSrSrSrSS.S\S\S\S	\S
\	\
   4
U 4S jjjr\S\	\
   SSS\	S    4U 4S jj5       rSrU =r$ )	ChatBoost   a  
This object contains information about a chat boost.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`boost_id`, :attr:`add_date`, :attr:`expiration_date`,
and :attr:`source` are equal.

.. versionadded:: 20.8

Args:
    boost_id (:obj:`str`): Unique identifier of the boost.
    add_date (:obj:`datetime.datetime`): Point in time when the chat was boosted.
    expiration_date (:obj:`datetime.datetime`): Point in time when the boost
        will automatically expire, unless the booster's Telegram Premium subscription is
        prolonged.
    source (:class:`telegram.ChatBoostSource`): Source of the added boost.

Attributes:
    boost_id (:obj:`str`): Unique identifier of the boost.
    add_date (:obj:`datetime.datetime`): Point in time when the chat was boosted.
        |datetime_localization|
    expiration_date (:obj:`datetime.datetime`): Point in time when the boost
        will automatically expire, unless the booster's Telegram Premium subscription is
        prolonged. |datetime_localization|
    source (:class:`telegram.ChatBoostSource`): Source of the added boost.
)add_dateboost_idexpiration_dater   Nr   rb   ra   rc   r   r   c                   > [         TU ]  US9  Xl        X l        X0l        X@l        U R                  U R                  U R                  U R
                  4U l        U R                  5         g r   )r    r!   rb   ra   rc   r   r$   r%   )r&   rb   ra   rc   r   r   r'   s         r(   r!   ChatBoost.__init__   sU     	J/%"*)8'---8L8LdkkZr*   r+   r,   r   r-   c                    > U R                  U5      nU(       d  g[        R                  UR                  S5      U5      US'   [	        U5      n[        US   US9US'   [        US   US9US'   [        TU ]	  XS9$ )r/   Nr   ra   tzinforc   r0   )r2   r   r8   r6   r   r   r    r9   r+   r,   
loc_tzinfor'   s       r(   r8   ChatBoost.de_json   s     t$(00(1CSIX1#6
)$z*::NZ"06G1HQ["\wD22r*   )r$   ra   rb   rc   r   )r<   r=   r>   r?   r@   rA   rB   r   r   r   r   r!   rD   r8   rE   rF   rG   s   @r(   r_   r_      s    6 FI *.  "	
   X& & 38H- 3E 3h{>S 3 3r*   r_   c                      ^  \ rS rSrSrSrSS.S\S\S\\	   4U 4S	 jjjr
\S
\\	   SSS\S    4U 4S jj5       rSrU =r$ )ChatBoostUpdatedi  a  This object represents a boost added to a chat or changed.

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

.. versionadded:: 20.8

Args:
    chat (:class:`telegram.Chat`): Chat which was boosted.
    boost (:class:`telegram.ChatBoost`): Information about the chat boost.

Attributes:
    chat (:class:`telegram.Chat`): Chat which was boosted.
    boost (:class:`telegram.ChatBoost`): Information about the chat boost.
)boostchatNr   ro   rn   r   c                   > [         TU ]  US9  Xl        X l        U R                  R                  U R                  4U l        U R                  5         g r   )r    r!   ro   rn   idr$   r%   )r&   ro   rn   r   r'   s       r(   r!   ChatBoostUpdated.__init__  s@     	J/	 %
)),,

3r*   r+   r,   r   r-   c                    > U R                  U5      nU(       d  g[        R                  " UR                  S5      U5      US'   [        R                  UR                  S5      U5      US'   [
        TU ]	  XS9$ )r/   Nro   rn   r0   )r2   r   r8   r6   r_   r    r9   r+   r,   r'   s      r(   r8   ChatBoostUpdated.de_json&  sf     t$||DHHV$4c:V!))$((7*;SAWwD22r*   )r$   rn   ro   )r<   r=   r>   r?   r@   rA   r   r_   r   r   r!   rD   r8   rE   rF   rG   s   @r(   rm   rm     ss      "I *. 
 X&  
38H- 
3E 
3hGY>Z 
3 
3r*   rm   c                      ^  \ rS rSrSrSrSS.S\S\S\S	\	S
\
\   4
U 4S jjjr\S\
\   SSS\
S    4U 4S jj5       rSrU =r$ )ChatBoostRemovedi4  ac  
This object represents a boost removed from a chat.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`chat`, :attr:`boost_id`, :attr:`remove_date`, and
:attr:`source` are equal.

Args:
    chat (:class:`telegram.Chat`): Chat which was boosted.
    boost_id (:obj:`str`): Unique identifier of the boost.
    remove_date (:obj:`datetime.datetime`): Point in time when the boost was removed.
    source (:class:`telegram.ChatBoostSource`): Source of the removed boost.

Attributes:
    chat (:class:`telegram.Chat`): Chat which was boosted.
    boost_id (:obj:`str`): Unique identifier of the boost.
    remove_date (:obj:`datetime.datetime`): Point in time when the boost was removed.
        |datetime_localization|
    source (:class:`telegram.ChatBoostSource`): Source of the removed boost.
)rb   ro   remove_dater   Nr   ro   rb   rx   r   r   c                   > [         TU ]  US9  Xl        X l        X0l        X@l        U R                  U R                  U R                  U R
                  4U l        U R                  5         g r   )r    r!   ro   rb   rx   r   r$   r%   )r&   ro   rb   rx   r   r   r'   s         r(   r!   ChatBoostRemoved.__init__L  sU     	J/	%%0'-))T]]D4D4DdkkRr*   r+   r,   r   r-   c                 (  > U R                  U5      nU(       d  g[        R                  " UR                  S5      U5      US'   [        R                  UR                  S5      U5      US'   [        U5      n[        US   US9US'   [        TU ]	  XS9$ )r/   Nro   r   rx   rg   r0   )r2   r   r8   r6   r   r   r   r    ri   s       r(   r8   ChatBoostRemoved.de_json_  s     t$||DHHV$4c:V(00(1CSIX1#6
,T--@T]wD22r*   )r$   rb   ro   rx   r   )r<   r=   r>   r?   r@   rA   r   rB   r   r   r   r   r!   rD   r8   rE   rF   rG   s   @r(   rw   rw   4  s    * >I *.  	
   X& & 38H- 3E 3hGY>Z 3 3r*   rw   c                      ^  \ rS rSrSrSrSS.S\\   S\\	   4U 4S jjjr
\S	\\	   S
SS\S    4U 4S jj5       rSrU =r$ )UserChatBoostsio  a  This object represents a list of boosts added to a chat by a user.

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

.. versionadded:: 20.8

Args:
    boosts (Sequence[:class:`telegram.ChatBoost`]): List of boosts added to the chat by the
        user.

Attributes:
    boosts (Tuple[:class:`telegram.ChatBoost`]): List of boosts added to the chat by the user.
)boostsNr   r   r   c                   > [         TU ]  US9  [        U5      U l        U R                  4U l        U R                  5         g r   )r    r!   r   r   r$   r%   )r&   r   r   r'   s      r(   r!   UserChatBoosts.__init__  s7     	J/-?-G++r*   r+   r,   r   r-   c                    > U R                  U5      nU(       d  g[        R                  UR                  S5      U5      US'   [        TU ]  XS9$ )r/   Nr   r0   )r2   r_   de_listr6   r    r8   rt   s      r(   r8   UserChatBoosts.de_json  sI     t$"**488H+=sCXwD22r*   )r$   r   )r<   r=   r>   r?   r@   rA   r   r_   r   r   r!   rD   r8   rE   rF   rG   s   @r(   r~   r~   o  sn     I *.	# X&	  	38H- 	3E 	3hGW>X 	3 	3r*   r~   N)$r@   r   typingr   r   r   r   r   r	   r
   telegramr   telegram._chatr   telegram._telegramobjectr   telegram._userr   telegram._utilsr   telegram._utils.argumentparsingr   telegram._utils.datetimer   r   telegram._utils.typesr   r   r   r3   r4   r5   r_   rm   rw   r~    r*   r(   <module>r      s   & K  N N N   3    > Q *>3n >3B#_ #2#o #4'=o '=T>3 >3B-3~ -3`83~ 83v)3^ )3r*   