a
    8öj¹	  ã                   @   s�   d Z ddlZddlmZ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dS )z$Typed errors thrown by this library.é    N)ÚOptionalÚUnionc                   @   s   e Zd ZdZdS )ÚGeoIP2Errorz¨There was a generic error in GeoIP2.

    This class represents a generic error. It extends :py:exc:`RuntimeError`
    and does not add any additional attributes.

    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r
   r
   úL/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/geoip2/errors.pyr      s   r   c                       sr   e Zd ZU dZee ed< ee ed< deee ee ddœ‡ fdd„Ze	ee
ejejf  dœd	d
„ƒZ‡  ZS )ÚAddressNotFoundErrorz.The address you were looking up was not found.Ú
ip_addressÚ_prefix_lenN)Úmessager   Ú
prefix_lenÚreturnc                    s   t ƒ  |¡ || _|| _d S ©N)ÚsuperÚ__init__r   r   )Úselfr   r   r   ©Ú	__class__r
   r   r      s    zAddressNotFoundError.__init__)r   c                 C   s4   | j du s| jdu rdS tj| j › d| j› �dd�S )z¹The network associated with the error.

        In particular, this is the largest network where no address would be
        found. This is only available for database lookups.
        Nú/F)Ústrict)r   r   Ú	ipaddressÚ
ip_network)r   r
   r
   r   Únetwork#   s
    ÿzAddressNotFoundError.network)NN)r   r   r   r	   r   ÚstrÚ__annotations__Úintr   Úpropertyr   r   ÚIPv4NetworkÚIPv6Networkr   Ú__classcell__r
   r
   r   r   r      s   
  üû
r   c                   @   s   e Zd ZdZdS )ÚAuthenticationErrorz/There was a problem authenticating the request.Nr   r
   r
   r
   r   r$   1   s   r$   c                       sb   e Zd ZU dZee ed< ee ed< ee ed< d	eee ee ee ddœ‡ fdd„Z‡  Z	S )
Ú	HTTPErrorz°There was an error when making your HTTP request.

    This class represents an HTTP transport error. It extends
    :py:exc:`GeoIP2Error` and adds attributes of its own.

    Úhttp_statusÚuriÚdecoded_contentN)r   r&   r'   r(   r   c                    s"   t ƒ  |¡ || _|| _|| _d S r   )r   r   r&   r'   r(   )r   r   r&   r'   r(   r   r
   r   r   D   s    zHTTPError.__init__)NNN)
r   r   r   r	   r   r   r   r   r   r#   r
   r
   r   r   r%   5   s   
   ûúr%   c                   @   s   e Zd ZdZdS )ÚInvalidRequestErrorzThe request was invalid.Nr   r
   r
   r
   r   r)   Q   s   r)   c                   @   s   e Zd ZdZdS )ÚOutOfQueriesErrorz5Your account is out of funds for the service queried.Nr   r
   r
   r
   r   r*   U   s   r*   c                   @   s   e Zd ZdZdS )ÚPermissionRequiredErrorz=Your account does not have permission to access this service.Nr   r
   r
   r
   r   r+   Y   s   r+   )r	   r   Útypingr   r   ÚRuntimeErrorr   r   r$   r%   r)   r*   r+   r
   r
   r
   r   Ú<module>   s   	!