
    YPiO                         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mZmZ ddlmZ erdd	lmZmZ  G d
 de      Zy)zRContains information about Telegram Passport data shared with the bot by the user.    )Sequence)TYPE_CHECKINGOptional)EncryptedCredentials)EncryptedPassportElement)TelegramObject)de_json_optionalde_list_optionalparse_sequence_arg)JSONDict)BotCredentialsc                        e Zd ZdZdZdddee   dedee	   f fdZ
edde	d	ed
   dd f fd       Zedeedf   fd       Zedd       Z xZS )PassportDataa  Contains information about Telegram Passport data shared with the bot by the user.

    Note:
        To be able to decrypt this object, you must pass your ``private_key`` to either
        :class:`telegram.ext.Updater` or :class:`telegram.Bot`. Decrypted data is then found in
        :attr:`decrypted_data` and the payload can be found in :attr:`decrypted_credentials`'s
        attribute :attr:`telegram.Credentials.nonce`.

    Args:
        data (Sequence[:class:`telegram.EncryptedPassportElement`]): Array with encrypted
            information about documents and other Telegram Passport elements that was shared with
            the bot.

            .. versionchanged:: 20.0
                |sequenceclassargs|

        credentials (:class:`telegram.EncryptedCredentials`)): Encrypted credentials.

    Attributes:
        data (tuple[:class:`telegram.EncryptedPassportElement`]): Array with encrypted
            information about documents and other Telegram Passport elements that was shared with
            the bot.

            .. versionchanged:: 20.0
                |tupleclassattrs|

        credentials (:class:`telegram.EncryptedCredentials`): Encrypted credentials.


    )_decrypted_datacredentialsdataN
api_kwargsr   r   r   c                    t         |   |       t        |      | _        || _        d | _        t        |D cg c]  }|j                   c}|j                  gz         | _	        | j                          y c c}w )Nr   )super__init__r   r   r   r   tupletypehash	_id_attrs_freeze)selfr   r   r   x	__class__s        U/root/twitch_bot/venv/lib/python3.12/site-packages/telegram/_passport/passportdata.pyr   zPassportData.__init__D   sh     	J/:LT:R	1<JN5159I9I8JJK  6s   A7botr   returnc                     | j                  |      }t        |j                  d      t        |      |d<   t	        |j                  d      t
        |      |d<   t        |   ||      S )z,See :meth:`telegram.TelegramObject.de_json`.r   r   )r   r"   )_parse_datar
   getr   r	   r   r   de_json)clsr   r"   r    s      r!   r'   zPassportData.de_jsonU   sa     t$'(8:RTWXV.txx/FH\^ab]wDc22    .c                 z      j                   #t         fd j                  D               _          j                   S )a  
        tuple[:class:`telegram.EncryptedPassportElement`]: Lazily decrypt and return information
            about documents and other Telegram Passport elements which were shared with the bot.

        .. versionchanged:: 20.0
            Returns a tuple instead of a list.

        Raises:
            telegram.error.PassportDecryptionError: Decryption failed. Usually due to bad
                private/public key but can also suggest malformed/tampered data.
        c              3      K   | ]A  }t        j                  |j                         j                         j                         C y wN)r   de_json_decryptedto_dictget_botdecrypted_credentials).0elementr   s     r!   	<genexpr>z.PassportData.decrypted_data.<locals>.<genexpr>m   s@      )  )::OO%t||~t7Q7Q)s   AA
)r   r   r   r   s   `r!   decrypted_datazPassportData.decrypted_data_   s?     '#( )  $yy	) $D  ###r)   c                 .    | j                   j                  S )a  
        :class:`telegram.Credentials`: Lazily decrypt and return credentials that were used
            to decrypt the data. This object also contains the user specified payload as
            `decrypted_data.payload`.

        Raises:
            telegram.error.PassportDecryptionError: Decryption failed. Usually due to bad
                private/public key but can also suggest malformed/tampered data.
        )r   r5   r4   s    r!   r0   z"PassportData.decrypted_credentialsu   s     ...r)   r,   )r#   r   )__name__
__module____qualname____doc__	__slots__r   r   r   r   r   r   classmethodr'   propertyr   r5   r0   __classcell__)r    s   @r!   r   r   "   s    > ;I *./0 *
 X&" 38 3(5/ 3^ 3 3 $&>&C D $ $* 
/ 
/r)   r   N)r:   collections.abcr   typingr   r   telegram._passport.credentialsr   +telegram._passport.encryptedpassportelementr   telegram._telegramobjectr   telegram._utils.argumentparsingr	   r
   r   telegram._utils.typesr   telegramr   r   r    r)   r!   <module>rH      s7   & Y $ * ? P 3 b b *)^/> ^/r)   