
    ՟fI                     $   d 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  G d de      Z G d	 d
e      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zy)zNThis module contains the classes that represent Telegram PassportElementError.    )ListOptional)TelegramObject)JSONDict)warn)PTBDeprecationWarningc            
       D     e Zd ZdZdZdddedededee   f fd	Z xZ	S )
PassportElementErrora  Baseclass for the PassportElementError* classes.

    This object represents an error in the Telegram Passport element which was submitted that
    should be resolved by the user.

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

    Args:
        source (:obj:`str`): Error source.
        type (:obj:`str`): The section of the user's Telegram Passport which has the error.
        message (:obj:`str`): Error message.

    Attributes:
        source (:obj:`str`): Error source.
        type (:obj:`str`): The section of the user's Telegram Passport which has the error.
        message (:obj:`str`): Error message.

    )messagesourcetypeN
api_kwargsr   r   r   r   c                    t         |   |       t        |      | _        t        |      | _        t        |      | _        | j                  | j                  f| _        | j                          y )Nr   )super__init__strr   r   r   	_id_attrs_freeze)selfr   r   r   r   	__class__s        c/var/www/cvtools/html/venv/lib/python3.12/site-packages/telegram/_passport/passportelementerrors.pyr   zPassportElementError.__init__5   sS     	J/v;T	L++tyy1    
__name__
__module____qualname____doc__	__slots__r   r   r   r   __classcell__r   s   @r   r
   r
      sE    ( .I Y]!$/2CKHCU r   r
   c                   H     e Zd ZdZdZdddedededed	ee   f
 fd
Z xZ	S )PassportElementErrorDataFielda  
    Represents an issue in one of the data fields that was provided by the user. The error is
    considered resolved when the field's value changes.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`~telegram.PassportElementError.source`, :attr:`type`,
    :attr:`field_name`, :attr:`data_hash` and :attr:`message` are equal.

    Args:
        type (:obj:`str`): The section of the user's Telegram Passport which has the error, one of
            ``"personal_details"``, ``"passport"``, ``"driver_license"``, ``"identity_card"``,
            ``"internal_passport"``, ``"address"``.
        field_name (:obj:`str`): Name of the data field which has the error.
        data_hash (:obj:`str`): Base64-encoded data hash.
        message (:obj:`str`): Error message.

    Attributes:
        type (:obj:`str`): The section of the user's Telegram Passport which has the error, one of
            ``"personal_details"``, ``"passport"``, ``"driver_license"``, ``"identity_card"``,
            ``"internal_passport"``, ``"address"``.
        field_name (:obj:`str`): Name of the data field which has the error.
        data_hash (:obj:`str`): Base64-encoded data hash.
        message (:obj:`str`): Error message.

    )	data_hash
field_nameNr   r   r%   r$   r   r   c                   t         |   d|||       | j                         5  || _        || _        | j
                  | j                  | j                  | j                  | j                  f| _        d d d        y # 1 sw Y   y xY w)Ndatar   )	r   r   	_unfrozenr%   r$   r   r   r   r   )r   r   r%   r$   r   r   r   s         r   r   z&PassportElementErrorDataField.__init__`   sv     	w:F^^ 
	#-DO"+DN 		DN	
	 
	 
	s   AA;;Br   r!   s   @r   r#   r#   C   sS    4 ,I *.  	
  X& r   r#   c            
       D     e Zd ZdZdZdddedededee   f fd	Z xZ	S )
PassportElementErrorFileaQ  
    Represents an issue with a document scan. The error is considered resolved when the file with
    the document scan changes.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`~telegram.PassportElementError.source`, :attr:`type`,
    :attr:`file_hash`, and :attr:`message` are equal.

    Args:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"utility_bill"``, ``"bank_statement"``, ``"rental_agreement"``,
            ``"passport_registration"``, ``"temporary_registration"``.
        file_hash (:obj:`str`): Base64-encoded file hash.
        message (:obj:`str`): Error message.

    Attributes:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"utility_bill"``, ``"bank_statement"``, ``"rental_agreement"``,
            ``"passport_registration"``, ``"temporary_registration"``.
        file_hash (:obj:`str`): Base64-encoded file hash.
        message (:obj:`str`): Error message.

    	file_hashNr   r   r,   r   r   c                    t         |   d|||       | j                         5  || _        | j                  | j
                  | j                  | j                  f| _        d d d        y # 1 sw Y   y xY w)Nfiler   r   r   r(   r,   r   r   r   r   r   r   r,   r   r   r   s        r   r   z!PassportElementErrorFile.__init__   se     	w:F^^ 	T"+DN"kk499dnndllSDN	T 	T 	T   ;A))A2r   r!   s   @r   r*   r*   x   K    0 I \`TT$'T25TFNxFXT Tr   r*   c            
       |     e Zd ZdZdZdddedee   dedee   f fd	Z	dd
e
def fdZedee   fd       Z xZS )PassportElementErrorFilesa5  
    Represents an issue with a list of scans. The error is considered resolved when the list of
    files with the document scans changes.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`~telegram.PassportElementError.source`, :attr:`type`,
    :attr:`file_hashes`, and :attr:`message` are equal.

    Args:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"utility_bill"``, ``"bank_statement"``, ``"rental_agreement"``,
            ``"passport_registration"``, ``"temporary_registration"``.
        file_hashes (List[:obj:`str`]): List of base64-encoded file hashes.
        message (:obj:`str`): Error message.

    Attributes:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"utility_bill"``, ``"bank_statement"``, ``"rental_agreement"``,
            ``"passport_registration"``, ``"temporary_registration"``.
        message (:obj:`str`): Error message.

    _file_hashesNr   r   file_hashesr   r   c                    t         |   d|||       | j                         5  || _        | j                  | j
                  | j                  gt        |      | _        d d d        y # 1 sw Y   y xY w)Nfilesr   	r   r   r(   r6   r   r   r   tupler   r   r   r7   r   r   r   s        r   r   z"PassportElementErrorFiles.__init__   sj     	$JG^^ 	Y+6D"kk499dllXU;EWXDN	Y 	Y 	Y   <A**A3	recursivereturnc                 D    t         |   |      }| j                  |d<   |S z8See :meth:`telegram.TelegramObject.to_dict` for details.r7   r   to_dictr6   r   r>   r'   r   s      r   rC   z!PassportElementErrorFiles.to_dict   &    wy)"//]r   c                 H    t        t        dd      d       | j                  S )List of base64-encoded file hashes.

        .. deprecated:: 20.6
            This attribute will return a tuple instead of a list in future major versions.
        20.6z[The attribute `file_hashes` will return a tuple instead of a list in future major versions.   
stacklevelr   r   r6   r   s    r   r7   z%PassportElementErrorFiles.file_hashes   s/     	!
 	
    r   Tr   r   r   r   r   r   r   r   r   r   boolrC   propertyr7   r    r!   s   @r   r4   r4      s    . "I *.YY #YY 	Y X&Y   !T#Y ! !r   r4   c            
       D     e Zd ZdZdZdddedededee   f fd	Z xZ	S )
PassportElementErrorFrontSideao  
    Represents an issue with the front side of a document. The error is considered resolved when
    the file with the front side of the document changes.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`~telegram.PassportElementError.source`, :attr:`type`,
    :attr:`file_hash`, and :attr:`message` are equal.

    Args:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"passport"``, ``"driver_license"``, ``"identity_card"``, ``"internal_passport"``.
        file_hash (:obj:`str`): Base64-encoded hash of the file with the front side of the
            document.
        message (:obj:`str`): Error message.

    Attributes:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"passport"``, ``"driver_license"``, ``"identity_card"``, ``"internal_passport"``.
        file_hash (:obj:`str`): Base64-encoded hash of the file with the front side of the
            document.
        message (:obj:`str`): Error message.

    r+   Nr   r   r,   r   r   c                    t         |   d|||       | j                         5  || _        | j                  | j
                  | j                  | j                  f| _        d d d        y # 1 sw Y   y xY w)N
front_sider   r/   r0   s        r   r   z&PassportElementErrorFrontSide.__init__   se     	tWL^^ 	T"+DN"kk499dnndllSDN	T 	T 	Tr1   r   r!   s   @r   rS   rS      r2   r   rS   c            
       D     e Zd ZdZdZdddedededee   f fd	Z xZ	S )
PassportElementErrorReverseSidea%  
    Represents an issue with the reverse side of a document. The error is considered resolved when
    the file with the reverse side of the document changes.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`~telegram.PassportElementError.source`, :attr:`type`,
    :attr:`file_hash`, and :attr:`message` are equal.

    Args:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"driver_license"``, ``"identity_card"``.
        file_hash (:obj:`str`): Base64-encoded hash of the file with the reverse side of the
            document.
        message (:obj:`str`): Error message.

    Attributes:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"driver_license"``, ``"identity_card"``.
        file_hash (:obj:`str`): Base64-encoded hash of the file with the reverse side of the
            document.
        message (:obj:`str`): Error message.

    r+   Nr   r   r,   r   r   c                    t         |   d|||       | j                         5  || _        | j                  | j
                  | j                  | j                  f| _        d d d        y # 1 sw Y   y xY w)Nreverse_sider   r/   r0   s        r   r   z(PassportElementErrorReverseSide.__init__   se     	w:N^^ 	T"+DN"kk499dnndllSDN	T 	T 	Tr1   r   r!   s   @r   rW   rW     r2   r   rW   c            
       D     e Zd ZdZdZdddedededee   f fd	Z xZ	S )
PassportElementErrorSelfiea  
    Represents an issue with the selfie with a document. The error is considered resolved when
    the file with the selfie changes.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`~telegram.PassportElementError.source`, :attr:`type`,
    :attr:`file_hash`, and :attr:`message` are equal.

    Args:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"passport"``, ``"driver_license"``, ``"identity_card"``, ``"internal_passport"``.
        file_hash (:obj:`str`): Base64-encoded hash of the file with the selfie.
        message (:obj:`str`): Error message.

    Attributes:
        type (:obj:`str`): The section of the user's Telegram Passport which has the issue, one of
            ``"passport"``, ``"driver_license"``, ``"identity_card"``, ``"internal_passport"``.
        file_hash (:obj:`str`): Base64-encoded hash of the file with the selfie.
        message (:obj:`str`): Error message.

    r+   Nr   r   r,   r   r   c                    t         |   d|||       | j                         5  || _        | j                  | j
                  | j                  | j                  f| _        d d d        y # 1 sw Y   y xY w)Nselfier   r/   r0   s        r   r   z#PassportElementErrorSelfie.__init__D  se     	4ZH^^ 	T"+DN"kk499dnndllSDN	T 	T 	Tr1   r   r!   s   @r   r[   r[   +  sK    , I \`TT$'T25TFNxFXT Tr   r[   c            
       D     e Zd ZdZdZdddedededee   f fd	Z xZ	S )
#PassportElementErrorTranslationFilea?  
    Represents an issue with one of the files that constitute the translation of a document.
    The error is considered resolved when the file changes.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`~telegram.PassportElementError.source`, :attr:`type`,
    :attr:`file_hash`, and :attr:`message` are equal.

    Args:
        type (:obj:`str`): Type of element of the user's Telegram Passport which has the issue,
            one of ``"passport"``, ``"driver_license"``, ``"identity_card"``,
            ``"internal_passport"``, ``"utility_bill"``, ``"bank_statement"``,
            ``"rental_agreement"``, ``"passport_registration"``, ``"temporary_registration"``.
        file_hash (:obj:`str`): Base64-encoded hash of the file.
        message (:obj:`str`): Error message.

    Attributes:
        type (:obj:`str`): Type of element of the user's Telegram Passport which has the issue,
            one of ``"passport"``, ``"driver_license"``, ``"identity_card"``,
            ``"internal_passport"``, ``"utility_bill"``, ``"bank_statement"``,
            ``"rental_agreement"``, ``"passport_registration"``, ``"temporary_registration"``.
        file_hash (:obj:`str`): Base64-encoded hash of the file.
        message (:obj:`str`): Error message.

    r+   Nr   r   r,   r   r   c                    t         |   d|||       | j                         5  || _        | j                  | j
                  | j                  | j                  f| _        d d d        y # 1 sw Y   y xY w)Ntranslation_filer   r/   r0   s        r   r   z,PassportElementErrorTranslationFile.__init__l  sf     	+T7zR^^ 	T"+DN"kk499dnndllSDN	T 	T 	Tr1   r   r!   s   @r   r_   r_   O  sK    4 I \`TT$'T25TFNxFXT Tr   r_   c            
       |     e Zd ZdZdZdddedee   dedee   f fd	Z	dd
e
def fdZedee   fd       Z xZS )$PassportElementErrorTranslationFilesa  
    Represents an issue with the translated version of a document. The error is considered
    resolved when a file with the document translation changes.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`~telegram.PassportElementError.source`, :attr:`type`,
    :attr:`file_hashes`, and :attr:`message` are equal.

    Args:
        type (:obj:`str`): Type of element of the user's Telegram Passport which has the issue,
            one of ``"passport"``, ``"driver_license"``, ``"identity_card"``,
            ``"internal_passport"``, ``"utility_bill"``, ``"bank_statement"``,
            ``"rental_agreement"``, ``"passport_registration"``, ``"temporary_registration"``.
        file_hashes (List[:obj:`str`]): List of base64-encoded file hashes.
        message (:obj:`str`): Error message.

    Attributes:
        type (:obj:`str`): Type of element of the user's Telegram Passport which has the issue,
            one of ``"passport"``, ``"driver_license"``, ``"identity_card"``,
            ``"internal_passport"``, ``"utility_bill"``, ``"bank_statement"``,
            ``"rental_agreement"``, ``"passport_registration"``, ``"temporary_registration"``.
        message (:obj:`str`): Error message.

    r5   Nr   r   r7   r   r   c                    t         |   d|||       | j                         5  || _        | j                  | j
                  | j                  gt        |      | _        d d d        y # 1 sw Y   y xY w)Ntranslation_filesr   r:   r<   s        r   r   z-PassportElementErrorTranslationFiles.__init__  sk     	,dG
S^^ 	Y+6D"kk499dllXU;EWXDN	Y 	Y 	Yr=   r>   r?   c                 D    t         |   |      }| j                  |d<   |S rA   rB   rD   s      r   rC   z,PassportElementErrorTranslationFiles.to_dict  rE   r   c                 H    t        t        dd      d       | j                  S )rG   rH   zThe attribute `file_hashes` will return a tuple instead of a list in future major versions. See the stability policy: https://docs.python-telegram-bot.org/en/stable/stability_policy.htmlrI   rJ   rL   rM   s    r   r7   z0PassportElementErrorTranslationFiles.file_hashes  s0     	!X 	
    r   rN   rO   r!   s   @r   rc   rc   w  s    2 "I *.YY #YY 	Y X&Y   !T#Y ! !r   rc   c            
       D     e Zd ZdZdZdddedededee   f fd	Z xZ	S )
PassportElementErrorUnspecifieda  
    Represents an issue in an unspecified place. The error is considered resolved when new
    data is added.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`~telegram.PassportElementError.source`, :attr:`type`,
    :attr:`element_hash`, and :attr:`message` are equal.

    Args:
        type (:obj:`str`): Type of element of the user's Telegram Passport which has the issue.
        element_hash (:obj:`str`): Base64-encoded element hash.
        message (:obj:`str`): Error message.

    Attributes:
        type (:obj:`str`): Type of element of the user's Telegram Passport which has the issue.
        element_hash (:obj:`str`): Base64-encoded element hash.
        message (:obj:`str`): Error message.

    )element_hashNr   r   rj   r   r   c                    t         |   d|||       | j                         5  || _        | j                  | j
                  | j                  | j                  f| _        d d d        y # 1 sw Y   y xY w)Nunspecifiedr   )r   r   r(   rj   r   r   r   r   )r   r   rj   r   r   r   s        r   r   z(PassportElementErrorUnspecified.__init__  sh     	g*M^^ 	W%1D"kk499d6G6GVDN	W 	W 	Wr1   r   r!   s   @r   ri   ri     sL    ( "I _cWW'*W58WIQRZI[W Wr   ri   N)r   typingr   r   telegram._telegramobjectr   telegram._utils.typesr   telegram._utils.warningsr   telegram.warningsr   r
   r#   r*   r4   rS   rW   r[   r_   rc   ri    r   r   <module>rs      s   ( U ! 3 * ) 3"> "J2$8 2j#T3 #TL>! 4 >!B#T$8 #TL#T&: #TL!T!5 !TH%T*> %TPA!+? A!HW&: Wr   