a
    Õ|òf±  ã                   @   s°   d Z ddlmZmZmZmZmZ ddlm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dS )zE
gspread.exceptions
~~~~~~~~~~~~~~~~~~

Exceptions used in gspread.

é    )ÚAnyÚDictÚMappingÚOptionalÚUnion)ÚResponsec                   @   s   e Zd ZdZdS )ÚUnSupportedExportFormatz+Raised when export format is not supported.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   úLD:\Projects\storyit_web\backend\venv\Lib\site-packages\gspread/exceptions.pyr      s   r   c                   @   s   e Zd ZdZdS )ÚGSpreadExceptionz&A base class for gspread's exceptions.Nr	   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )ÚWorksheetNotFoundz6Trying to open non-existent or inaccessible worksheet.Nr	   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )ÚNoValidUrlKeyFoundzNo valid key found in URL.Nr	   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )ÚIncorrectCellLabelzThe cell label is incorrect.Nr	   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )ÚInvalidInputValuez!The provided values is incorrect.Nr	   r   r   r   r   r   "   s   r   c                       sf   e Zd ZdZedœ‡ fdd„Zeeeee	e
ef f  dœdd„Zedœd	d
„Zedœdd„Z‡  ZS )ÚAPIErrorzcErrors coming from the API itself,
    such as when we attempt to retrieve things that don't exist.)Úresponsec                    s6   t ƒ  |  |¡¡ || _| ¡ d | _| jd | _d S )NÚerrorÚcode)ÚsuperÚ__init__Ú_extract_errorr   Újsonr   r   )Úselfr   ©Ú	__class__r   r   r   *   s    zAPIError.__init__)r   Úreturnc              
   C   s6   z|  ¡ }t|d ƒW S  tttfy0   Y d S 0 d S )Nr   )r   ÚdictÚAttributeErrorÚKeyErrorÚ
ValueError)r   r   Úerrorsr   r   r   r   0   s
    zAPIError._extract_error)r    c                 C   s   d  | jj| j| jd ¡S )Nz{}: [{}]: {}Úmessage)Úformatr   r
   r   r   ©r   r   r   r   Ú__str__9   s    ÿzAPIError.__str__c                 C   s   |   ¡ S )N)r)   r(   r   r   r   Ú__repr__>   s    zAPIError.__repr__)r
   r   r   r   r   r   r   r   Ústrr   Úintr   r)   r*   Ú__classcell__r   r   r   r   r   &   s   þ	r   c                   @   s   e Zd ZdZdS )ÚSpreadsheetNotFoundz8Trying to open non-existent or inaccessible spreadsheet.Nr	   r   r   r   r   r.   B   s   r.   N)r   Útypingr   r   r   r   r   Úrequestsr   Ú	Exceptionr   r   r   r   r   r   r   r.   r   r   r   r   Ú<module>   s   