o
    )if                     @   s"  U d dl mZmZmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dlm
Z d dlmZ d dlmZ g d	ZG d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZeZeZeeeeedZeeee f ed< dS )    )AnyDictType)ApiError)ConnectionError)ConnectionTimeout)SerializationError)TlsError)TransportError)TransportWarning)
r   r
   r   SSLErrorr   AuthorizationExceptionAuthenticationExceptionNotFoundErrorConflictErrorBadRequestErrorc                   @   sP   e Zd ZedefddZedefddZedefddZ	defdd	Z
d
S )r   returnc                 C   s   | j jS )z7Backwards-compatible way to access ``self.meta.status``)metastatusself r   Q/var/www/html/corbot_env/lib/python3.10/site-packages/elasticsearch/exceptions.pystatus_code+   s   zApiError.status_codec                 C      | j S )z3Backwards-compatible way to access ``self.message``messager   r   r   r   error0      zApiError.errorc                 C   r   )z0Backwards-compatible way to access ``self.body``)bodyr   r   r   r   info5   r   zApiError.infoc              	   C   s   d}z>| j r?t| j tr?d| j v r?t| j d tr8| j d d d }dtd t|d |d|dg}nt| j d }W n	 tyI   Y nw dtd t| j	t| j
|g}| jj d	| d
S )N r   
root_causer   z, reasonzresource.idzresource.type())r   
isinstancedictjoinfilterreprgetLookupErrorstrr   r   	__class____name__)r   causer"   msgr   r   r   __str__:   s*   
"zApiError.__str__N)r/   
__module____qualname__propertyintr   r-   r   r   r    r2   r   r   r   r   r   *   s    r   c                   @   s   e Zd ZdZdefddZdS )UnsupportedProductErrorzaError which is raised when the client detects
    it's not connected to a supported product.
    r   c                 C   r   )Nr   r   r   r   r   r2   X   s   zUnsupportedProductError.__str__N)r/   r3   r4   __doc__r-   r2   r   r   r   r   r7   S   s    r7   c                   @      e Zd ZdZdS )r   z)Exception representing a 404 status code.Nr/   r3   r4   r8   r   r   r   r   r   \       r   c                   @   r9   )r   z)Exception representing a 409 status code.Nr:   r   r   r   r   r   `   r;   r   c                   @   r9   )r   z)Exception representing a 400 status code.Nr:   r   r   r   r   r   d   r;   r   c                   @   r9   )r   z)Exception representing a 401 status code.Nr:   r   r   r   r   r   h   r;   r   c                   @   r9   )r   z)Exception representing a 403 status code.Nr:   r   r   r   r   r   l   r;   r   c                   @   r9   )ElasticsearchWarningzuWarning that is raised when a deprecated option
    or incorrect usage is flagged via the 'Warning' HTTP header.
    Nr:   r   r   r   r   r<   p   r;   r<   )i  i  i  i  i  HTTP_EXCEPTIONSN)typingr   r   r   elastic_transportr   	_ApiErrorr   r   r   r	   r   r
   r   __all__r7   r   r   r   r   r   r<   ElasticsearchDeprecationWarningRequestErrorr=   r6   __annotations__r   r   r   r   <module>   s2   )	