U
    [e	                     @   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
Errors
======

    N)OptionalUnionc                   @   s   e Zd ZdZdS )GeoIP2ErrorzThere 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
   O/var/www/html/services/stratfitenv/lib/python3.8/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 )AddressNotFoundErrora  The address you were looking up was not found.

    .. attribute:: ip_address

      The IP address used in the lookup. This is only available for database
      lookups.

      :type: str

    .. attribute:: network

      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.

      :type: ipaddress.IPv4Network or ipaddress.IPv6Network

    
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   s2   | j dks| jdkrdS t| j  d| j dS )zThe network for the errorN/F)r   r   	ipaddress
ip_network)r   r
   r
   r   network6   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#   ?   s   r#   c                       s<   e Zd ZdZdeee ee ee dd fddZ  ZS )	HTTPErrora=  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.

    :ivar http_status: The HTTP status code returned
    :ivar uri: The URI queried
    :ivar decoded_content: The decoded response content

    N)r   http_statusuridecoded_contentr   c                    s"   t  | || _|| _|| _d S r   )r   r   r%   r&   r'   )r   r   r%   r&   r'   r   r
   r   r   O   s    zHTTPError.__init__)NNN)	r   r   r   r	   r   r   r   r   r"   r
   r
   r   r   r$   C   s      r$   c                   @   s   e Zd ZdZdS )InvalidRequestErrorzThe request was invalid.Nr   r
   r
   r
   r   r(   \   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)   `   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*   d   s   r*   )r	   r   typingr   r   RuntimeErrorr   r   r#   r$   r(   r)   r*   r
   r
   r
   r   <module>   s   	*