Ë
    ?—Öjb  ã                   ó"  — d dl 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 G d„ de«      Zy)é    N)ÚAny)ÚHTTPException)ÚAPP_XMLc                   óD   ‡ — e Zd ZdZdZdZdededdfˆ fd„Zdefd	„Z	ˆ xZ
S )
ÚServiceExceptionad  
    The base class for all (serializable) Moto service exceptions.

    Attributes:
        code (str): AWS service error code, e.g. ``InvalidParameterCombination``.
        message (str): A descriptive error message.

    The ``code`` and ``message`` attributes can be set as class attributes or
    provided at initialization, or a combination thereof.

    A single argument will explicitly set the message attribute:
    >>> raise ServiceException("A specific error has occurred.")

    Both class attributes overridden at initialization:
    >>> raise ServiceException("ErrorCode", "Error message")

    Notes:
       * The ``code`` value should match an exception ShapeID in the AWS model
         specification for a given service.  When the exception is serialized as
         part of a Moto server response, additional metadata from the model will
         be included (e.g. an HTTP status code).
       * If the AWS error model expects specific attributes in addition to ``message``,
         they can be set directly on the ``ServiceException`` (or subclass) object as
         class or instance attributes.
    ÚUnspecifiedErrorCodez%An unspecified service error occurredÚargsÚkwargsÚreturnNc                 óÎ   •— t        |«      dk(  r|d   }n:t        |«      dk(  r|d   | _        |d   }n | j                  j                  di |¤Ž}t        ‰| �  |«       || _        y )Né   r   é   © )ÚlenÚcodeÚmessageÚformatÚsuperÚ__init__)Úselfr	   r
   ÚmsgÚ	__class__s       €úQ/var/www/photos/backend/venv/lib/python3.12/site-packages/moto/core/exceptions.pyr   zServiceException.__init__'   sc   ø€ Üˆt‹9˜Š>Ø�q‘'‰CÜ�‹Y˜!Š^Ø˜Q™ˆDŒIØ�q‘'‰Cà%�$—,‘,×%Ñ%Ñ/¨Ñ/ˆCÜ‰Ñ˜ÔØˆ�ó    c                 ó8   — | j                   › d| j                  › �S )Nz: )r   r   ©r   s    r   Ú__str__zServiceException.__str__2   s   € Ø—)‘)�˜B˜tŸ|™|˜nÐ-Ð-r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Ústrr   Ú__classcell__©r   s   @r   r   r   	   s:   ø„ ñð4 "€DØ5€Gð	˜cð 	¨Sð 	°Tõ 	ð.˜÷ .r   r   c            	       ó�   ‡ — e Zd ZdZdZddedededefˆ fd„Zded	ed
ee	eef      fd„Z
ed
efd„«       Zded	ed
efd„Zdd„Zˆ xZS )Ú
_RESTErroré�  TÚ
error_typer   Ú_Ú__c                 óº   •— t         ‰| �  «        || _        || _        ||dœ}| j                  rd|d<   ddd|iii}ddlm}  ||d	¬
«      | _        t        | _	        y )N)ÚCodeÚMessageÚSenderÚTypeÚErrorResponseÚErrorsÚErrorr   )ÚunparseT)Úfull_document)
r   r   r(   r   Úinclude_type_senderÚ	xmltodictr3   Údescriptionr   Úcontent_type)	r   r(   r   r)   r*   ÚerrorÚresponser3   r   s	           €r   r   z_RESTError.__init__=   sk   ø€ Ü‰ÑÔØ$ˆŒØˆŒàØñ
ˆð ×#Ò#Ø$ˆE�&‰MØ# h°¸%Ð0@Ð%AÐBˆÝ%á" 8¸4Ô@ˆÔÜ#ˆÕr   r	   r
   r   c                 óB   — d| j                   xs dfd| j                  fgS )NzX-Amzn-ErrorTypeÚUnknownErrorzContent-Type)Úrelative_error_typer8   ©r   r	   r
   s      r   Úget_headersz_RESTError.get_headersM   s-   € à ×!9Ñ!9Ò!K¸^ÐLØ˜T×.Ñ.Ð/ð
ð 	
r   c                 ó   — | j                   S ©N)r(   r   s    r   r=   z_RESTError.relative_error_typeS   s   € à�‰Ðr   c                 ó"   — | j                   xs dS )NÚ ©r7   r>   s      r   Úget_bodyz_RESTError.get_bodyW   s   € Ø×ÑÒ% 2Ð%r   c                 ój   — t        | j                  | j                  ¬«      }| j                  |_        |S )N)r(   r   )ÚJsonRESTErrorr(   r   r   )r   Úerrs     r   Úto_jsonz_RESTError.to_jsonZ   s&   € Ü t§¡ÀÇÁÔMˆØ—9‘9ˆŒØˆ
r   ©rC   )r   rG   )r   r   r    r   r5   r"   r   r   ÚlistÚtupler?   Úpropertyr=   rE   rI   r#   r$   s   @r   r&   r&   7   s’   ø„ Ø€Dð Ðñ$ 3ð $°ð $¸ð $Èõ $ð 
 ð 
°ð 
¸¸UÀ3ÈÀ8¹_Ñ8Mó 
ð ð Sò ó ðð&˜cð &¨Sð &°Só &÷r   r&   c            	       ó\   ‡ — e Zd Zd
dedededefˆ fd„Zedefd„«       Zdededefd	„Zˆ xZ	S )rG   r(   r   r)   r
   c                 ó˜   •— t        ‰| �  ||fi |¤Ž t        j                  | j                  | j
                  dœ«      | _        d| _        y )N)Ú__typer   zapplication/json)r   r   ÚjsonÚdumpsr(   r   r7   r8   )r   r(   r   r)   r
   r   s        €r   r   zJsonRESTError.__init__a   sB   ø€ Ü‰Ñ˜ WÑ7°Ò7Ü $§
¡
Ø—‘°4·<±<Ñ@ó!
ˆÔð /ˆÕr   r   c                 óZ   — | j                   r| j                   j                  d«      d   S dS )Nú#éÿÿÿÿrC   )r(   Úsplitr   s    r   r=   z!JsonRESTError.relative_error_typeh   s)   € ð 48·?²?�—‘×%Ñ% cÓ*¨2Ñ.ÐJÈÐJr   r	   c                 ó   — | j                   S rA   rD   r>   s      r   rE   zJsonRESTError.get_bodyn   s   € Ø×ÑÐr   rJ   )
r   r   r    r"   r   r   rM   r=   rE   r#   r$   s   @r   rG   rG   `   s\   ø„ ñ/ 3ð /°ð /¸ð /ÈSõ /ð ðK Sò Kó ðKð
 ˜cð  ¨Sð  °S÷  r   rG   c                   ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )ÚSignatureDoesNotMatchErroré“  c                 ó&   •— t         ‰| �  dd«       y )NÚSignatureDoesNotMatchz²The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.©r   r   ©r   r   s    €r   r   z#SignatureDoesNotMatchError.__init__u   s   ø€ Ü‰ÑØ#ð Aõ	
r   ©r   N©r   r   r    r   r   r#   r$   s   @r   rY   rY   r   ó   ø„ Ø€D÷
ñ 
r   rY   c                   ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )ÚInvalidClientTokenIdErrorrZ   c                 ó&   •— t         ‰| �  dd«       y )NÚInvalidClientTokenIdz6The security token included in the request is invalid.r]   r^   s    €r   r   z"InvalidClientTokenIdError.__init__   s   ø€ Ü‰ÑØ"ØDõ	
r   r_   r`   r$   s   @r   rc   rc   |   ra   r   rc   c                   ó,   ‡ — e Zd ZdZdedefˆ fd„Zˆ xZS )ÚAccessDeniedErrorrZ   Úuser_arnÚactionc                 ó2   •— t         ‰| �  dd|› d|› �«       y )NÚAccessDeniedzUser: z is not authorized to perform: r]   )r   rh   ri   r   s      €r   r   zAccessDeniedError.__init__‰   s#   ø€ Ü‰ÑØ˜f X JÐ.MÈfÈXÐVõ	
r   ©r   r   r    r   r"   r   r#   r$   s   @r   rg   rg   †   s    ø„ Ø€Dð
 ð 
¨c÷ 
ñ 
r   rg   c                   ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )ÚAuthFailureErrori‘  c                 ó&   •— t         ‰| �  dd«       y )NÚAuthFailurez<AWS was not able to validate the provided access credentialsr]   r^   s    €r   r   zAuthFailureError.__init__’   s   ø€ Ü‰ÑØØJõ	
r   r_   r`   r$   s   @r   rn   rn   �   ra   r   rn   c                   óX   ‡ — e Zd ZU dZedz  ed<   dZ	 	 ddededz  dedz  fˆ fd„Zˆ xZ	S )	ÚAWSErrorNÚTYPEr'   r   Úexception_typeÚstatusc                 ól   •— t         ‰| �  |xs | j                  |«       |xs | j                  | _        y rA   )r   r   rs   ÚSTATUSr   )r   r   rt   ru   r   s       €r   r   zAWSError.__init__�   s-   ø€ ô 	‰Ñ˜Ò4¨4¯9©9°gÔ>ØÒ)˜dŸk™kˆ�	r   )NN)
r   r   r    rs   r"   Ú__annotations__rw   Úintr   r#   r$   s   @r   rr   rr   ™   sL   ø… Ø€Dˆ#�‰*ÓØ€Fð
 &*Ø!ñ	*àð*ð ˜d™
ð*ð �d‘
÷	*ñ *r   rr   c                   ó(   ‡ — e Zd ZdZdZdˆ fd„Zˆ xZS )ÚInvalidNextTokenExceptionzoFor AWS Config resource listing. This will be used by many different resource types, and so it is in moto.core.r'   c                 ó&   •— t         ‰| �  dd«       y )Nr{   z!The nextToken provided is invalidr]   r^   s    €r   r   z"InvalidNextTokenException.__init__¬   s   ø€ Ü‰ÑØ'Ð)Lõ	
r   r_   )r   r   r    r!   r   r   r#   r$   s   @r   r{   r{   §   s   ø„ Ùyà€D÷
ñ 
r   r{   c                   ó*   ‡ — e Zd ZdZddefˆ fd„Zˆ xZS )ÚInvalidTokenr'   r   c                 ó,   •— t         ‰| �  d|› �d«       y )NzInvalid Token: r~   r]   )r   r   r   s     €r   r   zInvalidToken.__init__µ   s   ø€ Ü‰Ñ˜?¨7¨)Ð4°nÕEr   )zInvalid tokenrl   r$   s   @r   r~   r~   ²   s   ø„ Ø€DñF ÷ Fñ Fr   r~   c                   ó$   ‡ — e Zd Zdefˆ fd„Zˆ xZS )ÚServiceNotWhitelistedÚservice_namec                 ó€   •— ddl m} |j                  di «      j                  d«      }t        ‰| �  d|› d|› d�«       y )Nr   )Údefault_user_configÚcoreÚservice_whitelistzService z  not whitelisted. Only services z are allowed.)Úmoto.settingsr„   Úgetr   r   )r   r‚   r„   Úservices_whitelistedr   s       €r   r   zServiceNotWhitelisted.__init__º   sL   ø€ Ý5à2×6Ñ6°v¸rÓB×FÑFØó 
Ðô 	‰ÑØ�|�nÐ$DÐEYÐDZÐZgÐhõ	
r   )r   r   r    r"   r   r#   r$   s   @r   r�   r�   ¹   s   ø„ ð
 S÷ 
ñ 
r   r�   )rQ   Útypingr   Úwerkzeug.exceptionsr   Úmoto.core.mime_typesr   Ú	Exceptionr   r&   rG   rY   rc   rg   rn   rr   r{   r~   r�   r   r   r   ú<module>rŽ      s™   ðÛ Ý å -å (ô*.�yô *.ô\&�ô &ôR �Jô  ô$
 ô 
ô
 
ô 
ô
˜
ô 
ô
�zô 
ô*ˆ}ô *ô
 ô 
ôF�8ô Fô	
˜Iõ 	
r   