
    ib                     :    G d  de       Z G d dee      Z G d dee      Z G d dee      Z G d d	e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d Z G d de      Z G d de      Z G d dee      Zg dZy)c                       e Zd ZdZy)PineconeExceptionzFThe base exception class for all exceptions in the Pinecone Python SDKN__name__
__module____qualname____doc__     p/var/www/catia.catastroantioquia-mas.com/valormas/lib/python3.12/site-packages/pinecone/exceptions/exceptions.pyr   r      s    Pr
   r   c                   "     e Zd Zdd fdZ xZS )PineconeApiTypeErrorc                     || _         || _        || _        |}|rdj                  |t	        |            }t
        t        |   |       y)a  Raises an exception for TypeErrors

        Args:
            msg (str): the exception message

        Keyword Args:
            path_to_item (list): a list of keys an indices to get to the
                                 current_item
                                 None if unset
            valid_classes (tuple): the primitive classes that current item
                                   should be an instance of
                                   None if unset
            key_type (bool): False if our value is a value in a dict
                             True if it is a key in a dict
                             False if our item is an item in a list
                             None if unset
        
{0} at {1}N)path_to_itemvalid_classeskey_typeformatrender_pathsuperr   __init__)selfmsgr   r   r   full_msg	__class__s         r   r   zPineconeApiTypeError.__init__   sK    $ )* #**3L0IJH"D28<r
   NNNreturnNr   r   r   r   __classcell__r   s   @r   r   r      s    = =r
   r   c                   "     e Zd Zdd fdZ xZS )PineconeApiValueErrorc                 x    || _         |}|rdj                  |t        |            }t        t        |   |       y)z
        Args:
            msg (str): the exception message

        Keyword Args:
            path_to_item (list) the path to the exception in the
                received_data dict. None if unset
        r   N)r   r   r   r   r"   r   r   r   r   r   r   s       r   r   zPineconeApiValueError.__init__"   s<     )#**3L0IJH#T3H=r
   Nr   r   r    s   @r   r"   r"   !   s    > >r
   r"   c                   &     e Zd ZdZdd fdZ xZS )PineconeApiAttributeErrorz7Raised when an attribute reference or assignment fails.c                 x    || _         |}|rdj                  |t        |            }t        t        |   |       yz
        Args:
            msg (str): the exception message

        Keyword Args:
            path_to_item (None/list) the path to the exception in the
                received_data dict
        r   N)r   r   r   r   r'   r   r$   s       r   r   z"PineconeApiAttributeError.__init__6   s<     )#**3L0IJH'7Ar
   r%   r   r   r   r   r   r   r   r    s   @r   r'   r'   3   s    AB Br
   r'   c                   "     e Zd Zdd fdZ xZS )PineconeApiKeyErrorc                 x    || _         |}|rdj                  |t        |            }t        t        |   |       yr)   )r   r   r   r   r,   r   r$   s       r   r   zPineconeApiKeyError.__init__G   s<     )#**3L0IJH!41(;r
   r%   r   r   r    s   @r   r,   r,   F   s    < <r
   r,   c                        e Zd ZdZdddZd Zy)PineconeApiExceptionz$Raised when an API exception occurs.Nc                     |rI|j                   | _         |j                  | _        |j                  | _        |j	                         | _        y || _         || _        d | _        d | _        y r%   )statusreasondatabody
getheadersheaders)r   r1   r2   	http_resps       r   r   zPineconeApiException.__init__Z   sV    #**DK#**DK!DI$//1DL DK DKDIDLr
   c                     dj                  | j                  | j                        }| j                  r|dj                  | j                        z  }| j                  r|dj                  | j                        z  }|S )z#Custom error messages for exceptionz({0})
Reason: {1}
zHTTP response headers: {0}
zHTTP response body: {0}
)r   r1   r2   r6   r4   )r   error_messages     r   __str__zPineconeApiException.__str__f   sd    .55dkk4;;O<<;BB4<<PPM998??		JJMr
   r   r   )r   r   r   r   r   r:   r	   r
   r   r/   r/   W   s    .
 	r
   r/   c                   &     e Zd ZdZdd fdZ xZS )NotFoundExceptionz$Raised when a resource is not found.c                 0    t         t        |   |||       y r%   )r   r<   r   r   r1   r2   r7   r   s       r   r   zNotFoundException.__init__u   s    /	Jr
   r   r   r*   r    s   @r   r<   r<   r   s    .K Kr
   r<   c                   &     e Zd ZdZdd fdZ xZS )UnauthorizedExceptionz3Raised when access to a resource is not authorized.c                 0    t         t        |   |||       y r%   )r   r@   r   r>   s       r   r   zUnauthorizedException.__init__|   s    #T3FFINr
   r   r   r*   r    s   @r   r@   r@   y   s    =O Or
   r@   c                   &     e Zd ZdZdd fdZ xZS )ForbiddenExceptionz.Raised when access to a resource is forbidden.c                 0    t         t        |   |||       y r%   )r   rC   r   r>   s       r   r   zForbiddenException.__init__   s     $0Kr
   r   r   r*   r    s   @r   rC   rC      s    8L Lr
   rC   c                   &     e Zd ZdZdd fdZ xZS )ServiceExceptionz#Raised when a service error occurs.c                 0    t         t        |   |||       y r%   )r   rF   r   r>   s       r   r   zServiceException.__init__   s    .vvyIr
   r   r   r*   r    s   @r   rF   rF      s    -J Jr
   rF   c                     d}| D ];  }t        |t              r|dj                  |      z  }(|dj                  |      z  }= |S )z)Returns a string representation of a path z[{0}]z['{0}'])
isinstanceintr   )r   resultpths      r   r   r      sO    F ,c3gnnS))Fi&&s++F	,
 Mr
   c                       e Zd ZdZy)PineconeProtocolErrorz>Raised when something unexpected happens mid-request/response.Nr   r	   r
   r   rO   rO      s    Hr
   rO   c                       e Zd ZdZy)PineconeConfigurationErrorz)Raised when a configuration error occurs.Nr   r	   r
   r   rQ   rQ      s    3r
   rQ   c                        e Zd Z fdZ xZS )ListConversionExceptionc                 $    t         |   |       y r%   )r   r   )r   messager   s     r   r   z ListConversionException.__init__   s    !r
   r   r    s   @r   rS   rS      s    " "r
   rS   )r   r   r"   r'   r,   r/   r<   r@   rC   rF   rO   rQ   rS   N)	Exceptionr   	TypeErrorr   
ValueErrorr"   AttributeErrorr'   KeyErrorr,   r/   r<   r@   rC   rF   r   rO   rQ   rS   __all__r	   r
   r   <module>r\      s   Q	 Q=,i =8>-z >$B 1> B&<+X <", 6K, KO0 OL- LJ+ JI- I4!2 4"/ "
r
   