
    Yie>                     2   S r SSKJr  SSKJr  SSK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g)z;This module contains the Telegram Business related classes.    )Sequence)datetime)TYPE_CHECKINGOptional)Chat)Location)Sticker)TelegramObject)User)parse_sequence_arg)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)Botc                      ^  \ rS rSrSrSrSS.S\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$ )BusinessConnection'   a  
Describes the connection of the bot with a business account.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal if their :attr:`id`, :attr:`user`, :attr:`user_chat_id`, :attr:`date`,
:attr:`can_reply`, and :attr:`is_enabled` are equal.

.. versionadded:: 21.1

Args:
    id (:obj:`str`): Unique identifier of the business connection.
    user (:class:`telegram.User`): Business account user that created the business connection.
    user_chat_id (:obj:`int`): Identifier of a private chat with the user who created the
        business connection.
    date (:obj:`datetime.datetime`): Date the connection was established in Unix time.
    can_reply (:obj:`bool`): True, if the bot can act on behalf of the business account in
        chats that were active in the last 24 hours.
    is_enabled (:obj:`bool`): True, if the connection is active.

Attributes:
    id (:obj:`str`): Unique identifier of the business connection.
    user (:class:`telegram.User`): Business account user that created the business connection.
    user_chat_id (:obj:`int`): Identifier of a private chat with the user who created the
        business connection.
    date (:obj:`datetime.datetime`): Date the connection was established in Unix time.
    can_reply (:obj:`bool`): True, if the bot can act on behalf of the business account in
        chats that were active in the last 24 hours.
    is_enabled (:obj:`bool`): True, if the connection is active.
)	can_replydateid
is_enableduseruser_chat_idN
api_kwargsr   r   r   r   r   r   r   r   c                  > [         TU ]  US9  Xl        X l        X0l        X@l        XPl        X`l        U R                  U R                  U R                  U R
                  U R                  U R                  4U l        U R                  5         g 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.13/site-packages/telegram/_business.pyr   BusinessConnection.__init__O   sv     	J/	!-"	( * GGIIIINNOO
 	    databotr   returnc                    > U R                  U5      nU(       d  g[        U5      n[        UR                  S5      US9US'   [        R
                  " UR                  S5      U5      US'   [        TU ]  XS9$ ),See :meth:`telegram.TelegramObject.de_json`.Nr   )tzinfor   r'   r(   )_parse_datar   r   getr   de_jsonr   )clsr'   r(   
loc_tzinfor#   s       r$   r0   BusinessConnection.de_jsonm   sl    
 t$ 2#6
%dhhv&6zJV||DHHV$4c:VwD22r&   )r    r   r   r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__	__slots__strintr   boolr   r   r   classmethodr0   __static_attributes____classcell__r#   s   @r$   r   r   '   s    <I$ *.  	
    X& < >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	\
\   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$ )BusinessMessagesDeleted   a8  
This object is received when messages are deleted from a connected business account.

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

.. versionadded:: 21.1

Args:
    business_connection_id (:obj:`str`): Unique identifier of the business connection.
    chat (:class:`telegram.Chat`): Information about a chat in the business account. The bot
        may not have access to the chat or the corresponding user.
    message_ids (Sequence[:obj:`int`]): A list of identifiers of the deleted messages in the
        chat of the business account.

Attributes:
    business_connection_id (:obj:`str`): Unique identifier of the business connection.
    chat (:class:`telegram.Chat`): Information about a chat in the business account. The bot
        may not have access to the chat or the corresponding user.
    message_ids (tuple[:obj:`int`]): A list of identifiers of the deleted messages in the
        chat of the business account.
)business_connection_idchatmessage_idsNr   rE   rF   rG   r   c                   > [         TU ]  US9  Xl        X l        [	        U5      U l        U R                  U R                  U R
                  4U l        U R                  5         g r   )r   r   rE   rF   r   rG   r    r!   )r"   rE   rF   rG   r   r#   s        r$   r    BusinessMessagesDeleted.__init__   s\     	J/+A#	,>{,K ''II
 	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+   NrF   r-   )r.   r   r0   r/   r   r1   r'   r(   r#   s      r$   r0   BusinessMessagesDeleted.de_json   sG    
 t$||DHHV$4c:VwD22r&   )r    rE   rF   rG   r4   )r5   r6   r7   r8   r9   r:   r;   r   r   r<   r   r   r   r>   r0   r?   r@   rA   s   @r$   rC   rC      s    0I *. #  c]	 X& * >B3H%3,4UO3	+	,3 3r&   rC   c                      ^  \ 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S\\	   S\S   S\S    4U 4S jjj5       rSrU =r$ )BusinessIntro   a  
This object contains information about the start page settings of a Telegram Business account.

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

.. versionadded:: 21.1

Args:
    title (:obj:`str`, optional): Title text of the business intro.
    message (:obj:`str`, optional): Message text of the business intro.
    sticker (:class:`telegram.Sticker`, optional): Sticker of the business intro.

Attributes:
    title (:obj:`str`): Optional. Title text of the business intro.
    message (:obj:`str`): Optional. Message text of the business intro.
    sticker (:class:`telegram.Sticker`): Optional. Sticker of the business intro.
)messagestickertitleNr   rR   rP   rQ   r   c                   > [         TU ]  US9  Xl        X l        X0l        U R                  U R                  U R                  4U l        U R                  5         g r   )r   r   rR   rP   rQ   r    r!   )r"   rR   rP   rQ   r   r#   s        r$   r   BusinessIntro.__init__   sG     	J/$)
&-*1**dllDLLA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+   NrQ   r-   )r.   r	   r0   r/   r   rK   s      r$   r0   BusinessIntro.de_json   sG    
 t$!//$((9*=sCYwD22r&   )r    rP   rQ   rR   )NNNr4   )r5   r6   r7   r8   r9   r:   r   r;   r	   r   r   r>   r0   r?   r@   rA   s   @r$   rN   rN      s    (I  $!%%)	 *.} # '"	 X& " >B3H%3,4UO3	/	"3 3r&   rN   c            	          ^  \ rS rSrSr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$ )BusinessLocation   a  
This object contains information about the location of a Telegram Business account.

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

.. versionadded:: 21.1

Args:
    address (:obj:`str`): Address of the business.
    location (:class:`telegram.Location`, optional): Location of the business.

Attributes:
    address (:obj:`str`): Address of the business.
    location (:class:`telegram.Location`): Optional. Location of the business.
)addresslocationNr   rZ   r[   r   c                |   > [         TU ]  US9  Xl        X l        U R                  4U l        U R                  5         g r   )r   r   rZ   r[   r    r!   )r"   rZ   r[   r   r#   s       r$   r   BusinessLocation.__init__  s5     	J/#,4,,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[   r-   )r.   r   r0   r/   r   rK   s      r$   r0   BusinessLocation.de_json%  sJ    
 t$#++DHHZ,@#FZwD22r&   )r    rZ   r[   r4   )r5   r6   r7   r8   r9   r:   r;   r   r   r   r   r>   r0   r?   r@   rA   s   @r$   rX   rX      s    $I (,
 *. 8$
 X&  >B3H%3,4UO3	$	%3 3r&   rX   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\
\\\4   4S jr\S\
\\\4   4S j5       r\S\
\\\4   4S j5       rSrU =r$ )BusinessOpeningHoursIntervali4  a  
This object describes an interval of time during which a business is open.

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

.. versionadded:: 21.1

Examples:
    A day has (24 * 60 =) 1440 minutes, a week has (7 * 1440 =) 10080 minutes.
    Starting the the minute's sequence from Monday, example values of
    :attr:`opening_minute`, :attr:`closing_minute` will map to the following day times:

    * Monday - 8am to 8:30pm:
        - ``opening_minute = 480`` :guilabel:`8 * 60`
        - ``closing_minute = 1230`` :guilabel:`20 * 60 + 30`
    * Tuesday - 24 hours:
        - ``opening_minute = 1440`` :guilabel:`24 * 60`
        - ``closing_minute = 2879`` :guilabel:`2 * 24 * 60 - 1`
    * Sunday - 12am - 11:58pm:
        - ``opening_minute = 8640`` :guilabel:`6 * 24 * 60`
        - ``closing_minute = 10078`` :guilabel:`7 * 24 * 60 - 2`

Args:
    opening_minute (:obj:`int`): The minute's sequence number in a week, starting on Monday,
        marking the start of the time interval during which the business is open;
        0 - 7 * 24 * 60.
    closing_minute (:obj:`int`): The minute's
        sequence number in a week, starting on Monday, marking the end of the time interval
        during which the business is open; 0 - 8 * 24 * 60

Attributes:
    opening_minute (:obj:`int`): The minute's sequence number in a week, starting on Monday,
        marking the start of the time interval during which the business is open;
        0 - 7 * 24 * 60.
    closing_minute (:obj:`int`): The minute's
        sequence number in a week, starting on Monday, marking the end of the time interval
        during which the business is open; 0 - 8 * 24 * 60
)_closing_time_opening_timeclosing_minuteopening_minuteNr   re   rd   r   c                   > [         TU ]  US9  Xl        X l        S U l        S U l        U R                  U R                  4U l        U R                  5         g r   )r   r   re   rd   rc   rb   r    r!   )r"   re   rd   r   r#   s       r$   r   %BusinessOpeningHoursInterval.__init__`  sR     	J/#1#1=A=A--t/B/BCr&   minuter)   c                 *    US-  US-  S-  US-  S-  4$ )Ni  <    )r"   rh   s     r$   _parse_minute*BusinessOpeningHoursInterval._parse_minuter  s%    $ 3Vd]R5GHHr&   c                 t    U R                   c   U R                  U R                  5      U l         U R                   $ )a/  Convenience attribute. A :obj:`tuple` parsed from :attr:`opening_minute`. It contains
the `weekday`, `hour` and `minute` in the same ranges as :attr:`datetime.datetime.weekday`,
:attr:`datetime.datetime.hour` and :attr:`datetime.datetime.minute`

Returns:
    tuple[:obj:`int`, :obj:`int`, :obj:`int`]:
)rc   rl   re   r"   s    r$   opening_time)BusinessOpeningHoursInterval.opening_timeu  5     %!%!3!3D4G4G!HD!!!r&   c                 t    U R                   c   U R                  U R                  5      U l         U R                   $ )a/  Convenience attribute. A :obj:`tuple` parsed from :attr:`closing_minute`. It contains
the `weekday`, `hour` and `minute` in the same ranges as :attr:`datetime.datetime.weekday`,
:attr:`datetime.datetime.hour` and :attr:`datetime.datetime.minute`

Returns:
    tuple[:obj:`int`, :obj:`int`, :obj:`int`]:
)rb   rl   rd   ro   s    r$   closing_time)BusinessOpeningHoursInterval.closing_time  rr   r&   )rb   r    rc   rd   re   )r5   r6   r7   r8   r9   r:   r<   r   r   r   tuplerl   propertyrp   rt   r?   r@   rA   s   @r$   ra   ra   4  s    'R WI *. 
 X& $IC IE#sC-,@ I 
"eCcM2 
" 
" 
"eCcM2 
" 
"r&   ra   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\	S    4U 4S jjj5       rSrU =r$ )BusinessOpeningHoursi  a  
This object describes the opening hours of a business.

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

.. versionadded:: 21.1

Args:
    time_zone_name (:obj:`str`): Unique name of the time zone for which the opening
        hours are defined.
    opening_hours (Sequence[:class:`telegram.BusinessOpeningHoursInterval`]): List of
        time intervals describing business opening hours.

Attributes:
    time_zone_name (:obj:`str`): Unique name of the time zone for which the opening
        hours are defined.
    opening_hours (Sequence[:class:`telegram.BusinessOpeningHoursInterval`]): List of
        time intervals describing business opening hours.
)opening_hourstime_zone_nameNr   r{   rz   r   c                   > [         TU ]  US9  Xl        [        U5      U l        U R                  U R                  4U l        U R                  5         g r   )r   r   r{   r   rz   r    r!   )r"   r{   rz   r   r#   s       r$   r   BusinessOpeningHours.__init__  sO     	J/#1EWF
 --t/A/AB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+   Nrz   r-   )r.   ra   de_listr/   r   r0   rK   s      r$   r0   BusinessOpeningHours.de_json  sO    
 t$ < D DHH_%s!
_ wD22r&   )r    rz   r{   r4   )r5   r6   r7   r8   r9   r:   r;   r   ra   r   r   r   r>   r0   r?   r@   rA   s   @r$   ry   ry     s    , 4I *.   <=
 X& " >B3H%3,4UO3	(	)3 3r&   ry   N) r9   collections.abcr   r   typingr   r   telegram._chatr   telegram._files.locationr   telegram._files.stickerr	   telegram._telegramobjectr
   telegram._userr   telegram._utils.argumentparsingr   telegram._utils.datetimer   r   telegram._utils.typesr   telegramr   r   rC   rN   rX   ra   ry   rk   r&   r$   <module>r      s   ( B $  *  - + 3  > Q *V3 V3r@3n @3F83N 83v33~ 33lY"> Y"x83> 83r&   