
    Yi                         S r SSKJrJ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  \(       a
  SSKJrJrJr   " S	 S
\5      rg)zHThis module contains an object that represents a Encrypted PassportFile.    )TYPE_CHECKINGOptional)TelegramObject)DEFAULT_NONE)JSONDictODVInput)warn)PTBDeprecationWarning)BotFileFileCredentialsc                   r  ^  \ 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jr
S!S\S\	4U 4S jjjr\S\4S j5       r\S\\	   S\S   S
SS\S    4U 4S jj5       r\S\\\	      S\S   S
\S   S\\S    S4   4S j5       r\\\\SS.S\\   S\\   S\\   S\\   S\\	   SS4S jjrSrU =r$ )"PassportFile!   a  
This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport
files are in JPEG format when decrypted and don't exceed 10MB.

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

Args:
    file_id (:obj:`str`): Identifier for this file, which can be used to download
        or reuse the file.
    file_unique_id (:obj:`str`): Unique identifier for this file, which
        is supposed to be the same over time and for different bots.
        Can't be used to download or reuse the file.
    file_size (:obj:`int`): File size in bytes.
    file_date (:obj:`int`): Unix time when the file was uploaded.

        .. deprecated:: 20.6
            This argument will only accept a datetime instead of an integer in future
            major versions.

Attributes:
    file_id (:obj:`str`): Identifier for this file, which can be used to download
        or reuse the file.
    file_unique_id (:obj:`str`): Unique identifier for this file, which
        is supposed to be the same over time and for different bots.
        Can't be used to download or reuse the file.
    file_size (:obj:`int`): File size in bytes.
)_credentials
_file_datefile_id	file_sizefile_unique_idN
api_kwargsr   r   	file_dater   credentialsr   r   c                   > [         TU ]  US9  Xl        X l        X@l        X0l        XPl        U R                  4U l        U R                  5         g )Nr   )	super__init__r   r   r   r   r   	_id_attrs_freeze)selfr   r   r   r   r   r   	__class__s          J/app/.venv/lib/python3.13/site-packages/telegram/_passport/passportfile.pyr   PassportFile.__init__G   sN     	J/ $#1'( 8C--/    	recursivereturnc                 D   > [         TU ]  U5      nU R                  US'   U$ )z8See :meth:`telegram.TelegramObject.to_dict` for details.r   )r   to_dictr   )r   r$   datar    s      r!   r'   PassportFile.to_dict`   s$    wy) OO[r#   c                 B    [        [        SS5      SS9  U R                  $ )z:obj:`int`: Unix time when the file was uploaded.

.. deprecated:: 20.6
    This attribute will return a datetime instead of a integer in future major versions.
z20.6z`The attribute `file_date` will return a datetime instead of an integer in future major versions.   )
stacklevel)r	   r
   r   )r   s    r!   r   PassportFile.file_datef   s-     	!#
 	
 r#   r(   botr   c                 X   > U R                  U5      nU(       d  gX1S'   [        TU ]	  XS9$ )a  Variant of :meth:`telegram.TelegramObject.de_json` that also takes into account
passport credentials.

Args:
    data (dict[:obj:`str`, ...]): The JSON data.
    bot (:class:`telegram.Bot` | :obj:`None`): The bot associated with these object.
        May be :obj:`None`, in which case shortcut methods will not be available.

        .. versionchanged:: 21.4
           :paramref:`bot` is now optional and defaults to :obj:`None`

        .. deprecated:: 21.4
           This argument will be converted to an optional argument in future versions.
    credentials (:class:`telegram.FileCredentials`): The credentials

Returns:
    :class:`telegram.PassportFile`:

Nr   )r(   r.   )_parse_datar   de_json)clsr(   r.   r   r    s       r!   de_json_decryptedPassportFile.de_json_decryptedw   s2    . t$)]wD22r#   .c                 f   ^ ^^ U(       d  g[        S UU U4S j[        U5       5        5       5      $ )a  Variant of :meth:`telegram.TelegramObject.de_list` that also takes into account
passport credentials.

.. versionchanged:: 20.0

   * Returns a tuple instead of a list.
   * Filters out any :obj:`None` values

Args:
    data (list[dict[:obj:`str`, ...]]): The JSON data.
    bot (:class:`telegram.Bot` | :obj:`None`): The bot associated with these object.
        May be :obj:`None`, in which case shortcut methods will not be available.

        .. versionchanged:: 21.4
           :paramref:`bot` is now optional and defaults to :obj:`None`

        .. deprecated:: 21.4
           This argument will be converted to an optional argument in future versions.
    credentials (:class:`telegram.FileCredentials`): The credentials

Returns:
    tuple[:class:`telegram.PassportFile`]:

 c              3   0   #    U  H  nUc  M  Uv   M     g 7fNr6   ).0objs     r!   	<genexpr>1PassportFile.de_list_decrypted.<locals>.<genexpr>   s"      
  Cs   	c              3   T   >#    U  H  u  pTR                  UTTU   5      v   M     g 7fr8   )r3   )r9   ipassport_filer.   r2   r   s      r!   r;   r<      s1      (7$A %%mS+a.II(7s   %()tuple	enumerate)r2   r(   r.   r   s   ` ``r!   de_list_decryptedPassportFile.de_list_decrypted   s3    >  
(1$
 
 	
r#   )read_timeoutwrite_timeoutconnect_timeoutpool_timeoutr   rD   rE   rF   rG   r   c          	         #    U R                  5       R                  U R                  UUUUUS9I Sh  vN nU R                  (       a  UR	                  U R                  5        U$  N27f)at  
Wrapper over :meth:`telegram.Bot.get_file`. Will automatically assign the correct
credentials to the returned :class:`telegram.File` if originating from
:attr:`telegram.PassportData.decrypted_data`.

For the documentation of the arguments, please see :meth:`telegram.Bot.get_file`.

Returns:
    :class:`telegram.File`

Raises:
    :class:`telegram.error.TelegramError`

)r   rD   rE   rF   rG   r   N)get_botget_filer   r   set_credentials)r   rD   rE   rF   rG   r   files          r!   rJ   PassportFile.get_file   sf     . \\^,,LL%'+%! - 
 
   !2!23
s   0A'A%3A')r   r   r   r   r   r   r8   )T)__name__
__module____qualname____firstlineno____doc__	__slots__strintr   r   r   boolr'   propertyr   classmethodr3   listr@   rB   r   r   floatrJ   __static_attributes____classcell__)r    s   @r!   r   r   !   s   :I 48 *.  	
  /0 X& 2    3    3H%3,4UO3J[3	.	!3 3> (
tH~&(
 e_(
 +,	(

 
x',	-(
 (
Z )5)5+7(4)-! uo!  	!
 "%! uo! X&! 
! !r#   r   N)rR   typingr   r   telegram._telegramobjectr   telegram._utils.defaultvaluer   telegram._utils.typesr   r   telegram._utils.warningsr	   telegram.warningsr
   telegramr   r   r   r   r6   r#   r!   <module>rd      s4   & O * 3 5 4 ) 333B> Br#   