
    Yiqv                        S r SSKrSSKJr  SSK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  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& " 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),zAThis module contains the classes for Telegram Stars transactions.    N)Sequence)TYPE_CHECKINGFinalOptional)	constants)Chat)Gift)	PaidMedia)TelegramObject)User)enum)parse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc            	       H  ^  \ 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
\\   SS4U 4S jjjr\ SS\\   S\S   S\S    4U 4S jjj5       rSrU =r$ )RevenueWithdrawalState)   a  This object escribes the state of a revenue withdrawal operation. Currently, it can be one
of:

* :class:`telegram.RevenueWithdrawalStatePending`
* :class:`telegram.RevenueWithdrawalStateSucceeded`
* :class:`telegram.RevenueWithdrawalStateFailed`

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

.. versionadded:: 21.4

Args:
    type (:obj:`str`): The type of the state.

Attributes:
    type (:obj:`str`): The type of the state.
typePENDING	SUCCEEDEDFAILEDN
api_kwargsr   r   returnc                   > [         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   RevenueWithdrawalStateTyper   	_id_attrs_freezeselfr   r   	__class__s      B/app/.venv/lib/python3.13/site-packages/telegram/_payment/stars.pyr!   RevenueWithdrawalState.__init__F   sA    J/)M)MtZ	))    databotr   c                 0  > 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$ [        TU ])  XS9$ )a#  Converts JSON data to the appropriate :class:`RevenueWithdrawalState` object, i.e. takes
care of selecting the correct subclass.

Args:
    data (dict[:obj:`str`, ...]): The JSON data.
    bot (:class:`telegram.Bot`): The bot associated with this object.

Returns:
    The Telegram object.

Nr   r,   r-   )_parse_datar   RevenueWithdrawalStatePendingr   RevenueWithdrawalStateSucceededr   RevenueWithdrawalStateFailedr   getpopde_jsonr    clsr,   r-   _class_mappingr(   s       r)   r6   RevenueWithdrawalState.de_jsonM   s     t$ KK6MM:JJ4C
 ((TXXf-=-O!((6"23;;;OOwD22r+   r$   r   N)__name__
__module____qualname____firstlineno____doc__	__slots__r   r#   r   r   str__annotations__r   r   r   r   r!   classmethodr6   __static_attributes____classcell__r(   s   @r)   r   r   )   s    & I#>>FFGU3ZFH%@@JJIuSzJJ"==DDFE#JDGFJ S (1C t   >B3H%3,4UO3	*	+3 3r+   r   c                   J   ^  \ rS rSrSrSrSS.S\\   SS4U 4S jjjrSr	U =r
$ )	r1   m   zThe withdrawal is in progress.

.. versionadded:: 21.4

Attributes:
    type (:obj:`str`): The type of the state, always
        :tg-const:`telegram.RevenueWithdrawalState.PENDING`.
 Nr   r   r   c                ^   > [         TU ]  [        R                  US9  U R	                  5         g N)r   r   )r    r!   r   r   r%   r'   r   r(   s     r)   r!   &RevenueWithdrawalStatePending.__init__y   s%    4<<Tr+   r=   r>   r?   r@   rA   rB   r   r   r!   rF   rG   rH   s   @r)   r1   r1   m   /     I;? hx&8 D  r+   r1   c            	          ^  \ rS rSrSrSrSS.S\R                  S\S\	\
   S	S4U 4S
 jjjr\ SS\	\
   S\	S   S	\	S    4U 4S jjj5       rSrU =r$ )r2   ~   a  The withdrawal succeeded.

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

.. versionadded:: 21.4

Args:
    date (:obj:`datetime.datetime`): Date the withdrawal was completed as a datetime object.
    url (:obj:`str`): An HTTPS URL that can be used to see transaction details.

Attributes:
    type (:obj:`str`): The type of the state, always
        :tg-const:`telegram.RevenueWithdrawalState.SUCCEEDED`.
    date (:obj:`datetime.datetime`): Date the withdrawal was completed as a datetime object.
    url (:obj:`str`): An HTTPS URL that can be used to see transaction details.
)dateurlNr   rT   rU   r   r   c                   > [         TU ]  [        R                  US9  U R	                  5          Xl        X l        U R                  U R
                  4U l        S S S 5        g ! , (       d  f       g = frM   )	r    r!   r   r   	_unfrozenrT   rU   r   r$   )r'   rT   rU   r   r(   s       r)   r!   (RevenueWithdrawalStateSucceeded.__init__   sU     	4>>:V^^&*IH				DN    *A!!
A/r,   r-   r   c                    > U R                  U5      nU(       d  g[        U5      n[        UR                  SS5      US9US'   [        TU ]  XS9$ )z4See :meth:`telegram.RevenueWithdrawalState.de_json`.NrT   tzinfor/   )r0   r   r   r4   r    r6   r8   r,   r-   
loc_tzinfor(   s       r)   r6   'RevenueWithdrawalStateSucceeded.de_json   sQ    
 t$ 2#6
%dhhvt&<ZPVwD22r+   )r$   rT   rU   r<   )r=   r>   r?   r@   rA   rB   dtmdatetimerC   r   r   r!   rE   r6   rF   rG   rH   s   @r)   r2   r2   ~   s    $  I *.ll 
 X& 
 " >B3H%3,4UO3	3	43 3r+   r2   c                   J   ^  \ rS rSrSrSrSS.S\\   SS4U 4S jjjrSr	U =r
$ )	r3      zThe withdrawal failed and the transaction was refunded.

.. versionadded:: 21.4

Attributes:
    type (:obj:`str`): The type of the state, always
        :tg-const:`telegram.RevenueWithdrawalState.FAILED`.
rK   Nr   r   r   c                ^   > [         TU ]  [        R                  US9  U R	                  5         g rM   )r    r!   r   r   r%   rN   s     r)   r!   %RevenueWithdrawalStateFailed.__init__   s%    4;;
Sr+   rP   rH   s   @r)   r3   r3      rQ   r+   r3   c                      ^  \ rS rSrSrSr   SSS.S\S\S\S	   S
\S   S\\   S\\   SS4U 4S jjjjr	\
 SS\\   S\S   S\S    4U 4S jjj5       rSrU =r$ )AffiliateInfo   a	  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.StarTransactions.NANOSTAR_VALUE` shares of Telegram
        Stars received by the affiliate; from
        :tg-const:`~telegram.constants.StarTransactionsLimit.NANOSTAR_MIN_AMOUNT` to
        :tg-const:`~telegram.constants.StarTransactionsLimit.NANOSTAR_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.StarTransactions.NANOSTAR_VALUE` shares of Telegram
        Stars received by the affiliate; from
        :tg-const:`~telegram.constants.StarTransactionsLimit.NANOSTAR_MIN_AMOUNT` to
        :tg-const:`~telegram.constants.StarTransactionsLimit.NANOSTAR_MAX_AMOUNT`;
        can be negative for refunds
)affiliate_chataffiliate_useramountcommission_per_millenanostar_amountNr   rl   rk   rj   r   ri   r   rm   r   r   c                   > [         TU ]  US9  X0l        X@l        Xl        X l        XPl        U R                  U R                  U R                  U R
                  U R                  4U l        U R                  5         g r   )	r    r!   rj   ri   rl   rk   rm   r$   r%   )r'   rl   rk   rj   ri   rm   r   r(   s          r)   r!   AffiliateInfo.__init__   ss     	J/.<.<)=!!.= %%KK  
 	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$ ),See :meth:`telegram.TelegramObject.de_json`.Nrj   ri   r/   )r0   r   r6   r4   r   r    r8   r,   r-   r(   s      r)   r6   AffiliateInfo.de_json  sj    
 t$!%dhh7G.H#!N!%dhh7G.H#!NwD22r+   )r$   ri   rj   rk   rl   rm   NNNr<   r=   r>   r?   r@   rA   rB   intr   r   r!   rE   r6   rF   rG   rH   s   @r)   rg   rg      s    'RI ,0+/)- *.!  !(	
 !( "# X& 
 4 >B3H%3,4UO3	/	"3 3r+   rg   c            	         ^  \ rS rSr% SrSr\R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                   r\	\
   \S	'    S
S.S\
S\\   SS
4U 4S jjjr\ SS\\   S\S   S\S    4U 4S jjj5       rSrU =r$ )TransactionPartneri"  a  This object describes the source of a transaction, or its recipient for outgoing
transactions. Currently, it can be one of:

* :class:`TransactionPartnerUser`
* :class:`TransactionPartnerAffiliateProgram`
* :class:`TransactionPartnerFragment`
* :class:`TransactionPartnerTelegramAds`
* :class:`TransactionPartnerTelegramApi`
* :class:`TransactionPartnerOther`

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

.. versionadded:: 21.4

Args:
    type (:obj:`str`): The type of the transaction partner.

Attributes:
    type (:obj:`str`): The type of the transaction partner.
r   AFFILIATE_PROGRAMFRAGMENTOTHERTELEGRAM_ADSTELEGRAM_APIUSERNr   r   r   r   c                   > [         TU ]  US9  [        R                  " [        R
                  X5      U l        U R                  4U l        U R                  5         g r   )	r    r!   r   r"   r   TransactionPartnerTyper   r$   r%   r&   s      r)   r!   TransactionPartner.__init__K  sA    J/)I)I4V	))r+   r,   r-   r   c                   > U R                  U5      nUc  gU(       d
  U [        L a  gU R                  [        U R                  [
        U R                  [        U R                  [        U R                  [        U R                  [        0nU [        L a5  UR                  S5      U;   a   X1R                  S5         R!                  XS9$ ["        TU ]A  XS9$ )a  Converts JSON data to the appropriate :class:`TransactionPartner` object, i.e. takes
care of selecting the correct subclass.

Args:
    data (dict[:obj:`str`, ...]): The JSON data.
    bot (:class:`telegram.Bot`): The bot associated with this object.

Returns:
    The Telegram object.

Nr   r/   )r0   rx   ry   "TransactionPartnerAffiliateProgramrz   TransactionPartnerFragmentr~   TransactionPartnerUserr|   TransactionPartnerTelegramAdsr}   TransactionPartnerTelegramApir{   TransactionPartnerOtherr4   r5   r6   r    r7   s       r)   r6   TransactionPartner.de_jsonR  s     t$<11 !!#ELL4HH,;;II.?
 $$&)9^)K!((6"23;;;OOwD22r+   r;   r<   )r=   r>   r?   r@   rA   rB   r   r   ry   r   rC   rD   rz   r{   r|   r}   r~   r   r   r!   rE   r6   rF   rG   rH   s   @r)   rx   rx   "  s'   , I$-$D$D$V$VuSzV %;;DDHeCjDE!88>>E5:>B(??LLL%*LI(??LLL%*LI 77<<D%*<AFJ S (1C t   >B"3H%"3,4UO"3	&	'"3 "3r+   rx   c            
          ^  \ rS rSrSrSr SSS.S\S\S   S	\\   S
S4U 4S jjjjr	\
 SS\\   S\S   S
\S    4U 4S jjj5       rSrU =r$ )r   ix  a  Describes the affiliate program that issued the affiliate commission received via this
transaction.

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

.. versionadded:: 21.9

Args:
    sponsor_user (:class:`telegram.User`, optional): Information about the bot that sponsored
        the affiliate program
    commission_per_mille (:obj:`int`): The number of Telegram Stars received by the bot for
        each 1000 Telegram Stars received by the affiliate program sponsor from referred users.

Attributes:
    type (:obj:`str`): The type of the transaction partner,
        always :tg-const:`telegram.TransactionPartner.AFFILIATE_PROGRAM`.
    sponsor_user (:class:`telegram.User`): Optional. Information about the bot that sponsored
        the affiliate program
    commission_per_mille (:obj:`int`): The number of Telegram Stars received by the bot for
        each 1000 Telegram Stars received by the affiliate program sponsor from referred users.
)rl   sponsor_userNr   rl   r   r   r   r   c                   > [         TU ]  [        R                  US9  U R	                  5          X l        Xl        U R                  U R                  4U l        S S S 5        g ! , (       d  f       g = frM   )	r    r!   rx   ry   rW   r   rl   r   r$   )r'   rl   r   r   r(   s       r)   r!   +TransactionPartnerAffiliateProgram.__init__  sY     	0BBzZ^^0<-A%		))DN rY   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$ )0See :meth:`telegram.TransactionPartner.de_json`.Nr   r/   )r0   r   r6   r4   r    rr   s      r)   r6   *TransactionPartnerAffiliateProgram.de_json  sH    
 t$#||DHH^,DcJ^wD22r+   )r$   rl   r   r<   ru   rH   s   @r)   r   r   x  s    . 9I
 *.
 *.! v&
 X& 
 " >B3H%3,4UO3	6	73 3r+   r   c            	          ^  \ rS rSrSrSr SSS.S\S   S\\   S	S4U 4S
 jjjjr\	 SS\\   S\S   S	\S    4U 4S jjj5       r
SrU =r$ )r   i  a  Describes a withdrawal transaction with Fragment.

.. versionadded:: 21.4

Args:
    withdrawal_state (:class:`telegram.RevenueWithdrawalState`, optional): State of the
        transaction if the transaction is outgoing.

Attributes:
    type (:obj:`str`): The type of the transaction partner,
        always :tg-const:`telegram.TransactionPartner.FRAGMENT`.
    withdrawal_state (:class:`telegram.RevenueWithdrawalState`): Optional. State of the
        transaction if the transaction is outgoing.
)withdrawal_stateNr   r   r   r   r   c                   > [         TU ]  [        R                  US9  U R	                  5          Xl        S S S 5        g ! , (       d  f       g = frM   )r    r!   rx   rz   rW   r   )r'   r   r   r(   s      r)   r!   #TransactionPartnerFragment.__init__  s:     	099jQ^^FV! s	   >
A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   r/   )r0   r   r6   r4   r    rr   s      r)   r6   "TransactionPartnerFragment.de_json  sQ    
 t$#9#A#AHH'(#$
  wD22r+   r<   )r=   r>   r?   r@   rA   rB   r   r   r!   rE   r6   rF   rG   rH   s   @r)   r   r     s     &I @D	W *.		W"#;<	W X&		W
 
	W 	W >B3H%3,4UO3	.	/3 3r+   r   c                      ^  \ rS rSrSrSr      SSS.SSS\\   S	\\\	      S
\\   S\\
R                     S\\   S\\   S\\   SS4U 4S jjjjr\ SS\\   S\S   S\S    4U 4S jjj5       rSrU =r$ )r   i  a  Describes a transaction with a user.

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

.. versionadded:: 21.4

Args:
    user (:class:`telegram.User`): Information about the user.
    affiliate (:class:`telegram.AffiliateInfo`, optional): Information about the affiliate that
        received a commission via this transaction

        .. versionadded:: 21.9
    invoice_payload (:obj:`str`, optional): Bot-specified invoice payload.
    subscription_period (:class:`datetime.timedelta`, optional): The duration of the paid
        subscription

        .. versionadded:: 21.8
    paid_media (Sequence[:class:`telegram.PaidMedia`], optional): Information about the paid
        media bought by the user.

        .. versionadded:: 21.5
    paid_media_payload (:obj:`str`, optional): Bot-specified paid media payload.

        .. versionadded:: 21.6
    gift (:class:`telegram.Gift`, optional): The gift sent to the user by the bot

        .. versionadded:: 21.8

Attributes:
    type (:obj:`str`): The type of the transaction partner,
        always :tg-const:`telegram.TransactionPartner.USER`.
    user (:class:`telegram.User`): Information about the user.
    affiliate (:class:`telegram.AffiliateInfo`): Optional. Information about the affiliate that
        received a commission via this transaction

        .. versionadded:: 21.9
    invoice_payload (:obj:`str`): Optional. Bot-specified invoice payload.
    subscription_period (:class:`datetime.timedelta`): Optional. The duration of the paid
        subscription

        .. versionadded:: 21.8
    paid_media (tuple[:class:`telegram.PaidMedia`]): Optional. Information about the paid
        media bought by the user.

        .. versionadded:: 21.5
    paid_media_payload (:obj:`str`): Optional. Bot-specified paid media payload.

        .. versionadded:: 21.6
    gift (:class:`telegram.Gift`): Optional. The gift sent to the user by the bot

        .. versionadded:: 21.8

)	affiliategiftinvoice_payload
paid_mediapaid_media_payloadsubscription_perioduserNr   r   r   r   r   r   r   r   r   r   r   c                4  > [         T	U ]  [        R                  US9  U R	                  5          Xl        Xpl        X l        [        U5      U l	        X@l
        XPl        X`l        U R                  U R
                  4U l        S S S 5        g ! , (       d  f       g = frM   )r    r!   rx   r~   rW   r   r   r   r   r   r   r   r   r   r$   )
r'   r   r   r   r   r   r   r   r   r(   s
            r)   r!   TransactionPartnerUser.__init__"  s{     	055*M^^"I6?N2A ?QR\?]DO5G#@S$(,I 				DN s   AB		
B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'   [
        R                  " UR                  S5      US9US'   UR                  S5      =nb  [        R                  " US9OSUS'   [        R                  " UR                  S5      U5      US'   [        TU ]	  XS	9$ )
r   Nr   r   r   )r-   r   )secondsr   r/   )r0   r   r6   r4   rg   r
   de_listr`   	timedeltar	   r    )r8   r,   r-   spr(   s       r)   r6   TransactionPartnerUser.de_json>  s    
 t$||DHHV$4c:V)11$((;2GM[&..txx/E3O\ hh455B MM"% 	"#
 ||DHHV$4c:VwD22r+   )r$   r   r   r   r   r   r   r   )NNNNNNr<   )r=   r>   r?   r@   rA   rB   r   rC   r   r
   r`   r   r	   rg   r   r!   rE   r6   rF   rG   rH   s   @r)   r   r     s    5nI *.48,07;#-1 *. "# Xi01	
 %SM &cmm4 tn M* X& 
 8 >B3H%3,4UO3	*	+3 3r+   r   c                   J   ^  \ rS rSrSrSrSS.S\\   SS4U 4S jjjrSr	U =r
$ )	r   iU  zDescribes a transaction with an unknown partner.

.. versionadded:: 21.4

Attributes:
    type (:obj:`str`): The type of the transaction partner,
        always :tg-const:`telegram.TransactionPartner.OTHER`.
rK   Nr   r   r   c                ^   > [         TU ]  [        R                  US9  U R	                  5         g rM   )r    r!   rx   r{   r%   rN   s     r)   r!    TransactionPartnerOther.__init__a  s%    066:Nr+   rP   rH   s   @r)   r   r   U  rQ   r+   r   c                   J   ^  \ rS rSrSrSrSS.S\\   SS4U 4S jjjrSr	U =r
$ )	r   if  zDescribes a withdrawal transaction to the Telegram Ads platform.

.. versionadded:: 21.4

Attributes:
    type (:obj:`str`): The type of the transaction partner,
        always :tg-const:`telegram.TransactionPartner.TELEGRAM_ADS`.
rK   Nr   r   r   c                ^   > [         TU ]  [        R                  US9  U R	                  5         g rM   )r    r!   rx   r|   r%   rN   s     r)   r!   &TransactionPartnerTelegramAds.__init__r  s%    0==*Ur+   rP   rH   s   @r)   r   r   f  rQ   r+   r   c                   N   ^  \ rS rSrSrSrSS.S\S\\   SS4U 4S	 jjjr	S
r
U =r$ )r   iw  a  Describes a transaction with payment for
`paid broadcasting <https://core.telegram.org/bots/api#paid-broadcasts>`_.

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

.. versionadded:: 21.7

Args:
    request_count (:obj:`int`): The number of successful requests that exceeded regular limits
        and were therefore billed.

Attributes:
    type (:obj:`str`): The type of the transaction partner,
        always :tg-const:`telegram.TransactionPartner.TELEGRAM_API`.
    request_count (:obj:`int`): The number of successful requests that exceeded regular limits
        and were therefore billed.
)request_countNr   r   r   r   c                   > [         TU ]  [        R                  US9  U R	                  5          Xl        U R
                  4U l        S S S 5        g ! , (       d  f       g = frM   )r    r!   rx   r}   rW   r   r$   )r'   r   r   r(   s      r)   r!   &TransactionPartnerTelegramApi.__init__  sH    0==*U^^&3"002DN s   A
A)r$   r   )r=   r>   r?   r@   rA   rB   rv   r   r   r!   rF   rG   rH   s   @r)   r   r   w  s7    & #IOS 3c 3(8:L 3X\ 3 3r+   r   c                      ^  \ rS rSrSrSr   SSS.S\S\S\R                  S	\
\   S
\
\   S\
\   S\
\   SS4U 4S jjjjr\ SS\
\   S\
S   S\
S    4U 4S jjj5       rSrU =r$ )StarTransactioni  a
  Describes a Telegram Star transaction.

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

.. versionadded:: 21.4

Args:
    id (:obj:`str`): Unique identifier of the transaction. Coincides with the identifer
        of the original transaction for refund transactions.
        Coincides with :attr:`SuccessfulPayment.telegram_payment_charge_id` for
        successful incoming payments from users.
    amount (:obj:`int`): Integer amount of Telegram Stars transferred by the transaction.
    nanostar_amount (:obj:`int`, optional): The number of
        :tg-const:`~telegram.constants.StarTransactions.NANOSTAR_VALUE` shares of Telegram
        Stars transferred by the transaction; from 0 to
        :tg-const:`~telegram.constants.StarTransactionsLimit.NANOSTAR_MAX_AMOUNT`

        .. versionadded:: 21.9
    date (:obj:`datetime.datetime`): Date the transaction was created as a datetime object.
    source (:class:`telegram.TransactionPartner`, optional): Source of an incoming transaction
        (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal).
        Only for incoming transactions.
    receiver (:class:`telegram.TransactionPartner`, optional): Receiver of an outgoing
        transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for
        outgoing transactions.

Attributes:
    id (:obj:`str`): Unique identifier of the transaction. Coincides with the identifer
        of the original transaction for refund transactions.
        Coincides with :attr:`SuccessfulPayment.telegram_payment_charge_id` for
        successful incoming payments from users.
    amount (:obj:`int`): Integer amount of Telegram Stars transferred by the transaction.
    nanostar_amount (:obj:`int`): Optional. The number of
        :tg-const:`~telegram.constants.StarTransactions.NANOSTAR_VALUE` shares of Telegram
        Stars transferred by the transaction; from 0 to
        :tg-const:`~telegram.constants.StarTransactionsLimit.NANOSTAR_MAX_AMOUNT`

        .. versionadded:: 21.9
    date (:obj:`datetime.datetime`): Date the transaction was created as a datetime object.
    source (:class:`telegram.TransactionPartner`): Optional. Source of an incoming transaction
        (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal).
        Only for incoming transactions.
    receiver (:class:`telegram.TransactionPartner`): Optional. Receiver of an outgoing
        transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for
        outgoing transactions.
)rk   rT   idrm   receiversourceNr   r   rk   rT   r   r   rm   r   r   c                   > [         TU ]  US9  Xl        X l        X0l        X@l        XPl        X`l        U R                  U R
                  U R                  4U l        U R                  5         g r   )
r    r!   r   rk   rT   r   r   rm   r$   r%   )	r'   r   rk   rT   r   r   rm   r   r(   s	           r)   r!   StarTransaction.__init__  s_     	J/!"&	4:6>.= GGKKMM

 	r+   r,   r-   r   c                 @  > U R                  U5      nU(       d  g[        U5      n[        UR                  SS5      US9US'   [        R                  UR                  S5      U5      US'   [        R                  UR                  S5      U5      US'   [        TU ]  XS9$ )rq   NrT   r[   r   r   r/   )r0   r   r   r4   rx   r6   r    r]   s       r)   r6   StarTransaction.de_json  s    
 t$ 2#6
%dhhvt&<ZPV+33DHHX4FLX-55dhhz6JCPZwD22r+   )r$   rk   rT   r   rm   r   r   rt   r<   )r=   r>   r?   r@   rA   rB   rC   rv   r`   ra   r   rx   r   r!   rE   r6   rF   rG   rH   s   @r)   r   r     s    .` RI 0415)- *.  ll	
 +, -. "# X& 
 4 >B3H%3,4UO3	#	$3 3r+   r   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\S    4U 4S jjj5       rSrU =r$ )StarTransactionsi  a  
Contains a list of Telegram Star transactions.

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

.. versionadded:: 21.4

Args:
    transactions (Sequence[:class:`telegram.StarTransaction`]): The list of transactions.

Attributes:
    transactions (tuple[:class:`telegram.StarTransaction`]): The list of transactions.
)transactionsNr   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!   StarTransactions.__init__  s;     	J/9KL9Y++-r+   r,   r-   r   r   c                    > U R                  U5      nUc  g[        R                  UR                  S5      U5      US'   [        TU ]  XS9$ )rq   Nr   r/   )r0   r   r   r4   r    r6   rr   s      r)   r6   StarTransactions.de_json  sM    
 t$<.66txx7OQTU^wD22r+   )r$   r   r<   )r=   r>   r?   r@   rA   rB   r   r   r   r   r!   rE   r6   rF   rG   rH   s   @r)   r   r     sx     "I \`$_5FNxFX  >B
3H%
3,4UO
3	$	%
3 
3r+   r   )-rA   ra   r`   collections.abcr   typingr   r   r   telegramr   telegram._chatr   telegram._giftsr	   telegram._paidmediar
   telegram._telegramobjectr   telegram._userr   telegram._utilsr   telegram._utils.argumentparsingr   telegram._utils.datetimer   r   telegram._utils.typesr   r   r   r1   r2   r3   rg   rx   r   r   r   r   r   r   r   r   rK   r+   r)   <module>r      s   ( H  $ 1 1     ) 3    > Q *A3^ A3H$: "43&< 43n#9 "Y3N Y3xS3 S3l73); 73t+3!3 +3\r3/ r3j0 "$6 "3$6 3:^3n ^3B&3~ &3r+   