o
    :iP                     @   sd   d dl Z d dlmZmZmZ d dlmZmZ dZG dd de	Z
G dd de
ZG d	d
 d
e
ZdS )    N)AnyDictOptional)HeadersResponse   c                   @   s   e Zd ZdZdS )ApiExceptionz
Base classN)__name__
__module____qualname____doc__ r   r   j/home/aiteam/pcaa-dev/dashboard-backend/venv/lib/python3.10/site-packages/qdrant_client/http/exceptions.pyr   	   s    r   c                
   @   sh   e Zd Zdee dedededdf
ddZe	d	e
dd
fddZdefddZdeeef fddZdS )UnexpectedResponsestatus_codereason_phrasecontentheadersreturnNc                 C   s   || _ || _|| _|| _d S Nr   r   r   r   )selfr   r   r   r   r   r   r   __init__   s   
zUnexpectedResponse.__init__responser   c                 C   s   t | j| j| j| jdS )Nr   )r   r   r   r   r   )r   r   r   r   for_response   s   zUnexpectedResponse.for_responsec                 C   s   | j d ur	| j  nd}| jdkr| j d urd}nd| j d}| d|  }t| jtkr2| jn
| jd td  d }d|}d	| d
| S )N z(Unrecognized Status Code)()    s    ...zRaw response content:
zUnexpected Response: 
)r   r   striplenr   MAX_CONTENT)r   status_code_strreason_phrase_str
status_strshort_contentraw_content_strr   r   r   __str__   s   *
zUnexpectedResponse.__str__c                 C   s   t | jS r   )jsonloadsr   )r   r   r   r   
structured(   s   zUnexpectedResponse.structured)r	   r
   r   r   intstrbytesr   r   staticmethodr   r   r)   r   r   r,   r   r   r   r   r      s    "r   c                   @   s   e Zd ZdefddZdS )ResponseHandlingExceptionsourcec                 C   s
   || _ d S r   )r2   )r   r2   r   r   r   r   -   s   
z"ResponseHandlingException.__init__N)r	   r
   r   	Exceptionr   r   r   r   r   r1   ,   s    r1   )r*   typingr   r   r   httpxr   r   r#   r3   r   r   r1   r   r   r   r   <module>   s    