
    RǻiB3                       U d dl mZ d dlmZ d dlmZmZ ddlmZ	m
Z
 ddlmZ g dZdZd	ed<   d
Zd	ed
<   dZd	ed<   dZd	ed<   dZd	ed<   d Zd Zd Z G d dee      Ze	j2                  r#ee	j4                  d   z  Zej9                  d        G d dee      Z G d dee      Z G d dee      Ze	j2                  r&eez  e	j4                  d   z  Z ej9                  d        G d dee      Z! G d d ee      Z" G d! d"ee      Z# G d# d$e$e      Z%e	j2                  r$e#e	j4                  d%   z  Z&ej9                  d&       y'y')(    )annotations)Enum)parse_qsurlparse   )_typingapi)ConfigurationError)DRIVER_BOLTDRIVER_NEO4JSECURITY_TYPE_NOT_SECURESECURITY_TYPE_SECURE%SECURITY_TYPE_SELF_SIGNED_CERTIFICATENotificationCategoryNotificationClassificationNotificationDisabledCategory"NotificationDisabledClassificationNotificationMinimumSeverityNotificationSeverityRoutingControlTelemetryAPIcheck_access_modeparse_neo4j_uriparse_routing_contextr   zt.Final[str]r   r   r   r   c                   t        |       }|j                  rt        d      |j                  rt        d      |j                  t
        j                  k(  r)t        d|j                  dt
        j                        |j                  t
        j                  k(  rt        }t        }nK|j                  t
        j                  k(  rt        }t        }n |j                  t
        j                  k(  rt        }t        }n|j                  t
        j                  k(  rt        }t        }n|j                  t
        j                   k(  rt        }t        }n|j                  t
        j"                  k(  rt        }t        }nxt
        j                  t
        j                  t
        j                  t
        j                  t
        j                   t
        j"                  g}t        d|j                  d| d      |||fS )Nz$Username is not supported in the URIz$Password is not supported in the URIzUri scheme z has been renamed. Use zURI scheme z- is not supported. Supported URI schemes are zG. Examples: bolt://host[:port] or neo4j://host[:port][?routing_context])r   usernamer
   passwordschemer	   URI_SCHEME_BOLT_ROUTINGURI_SCHEME_NEO4JURI_SCHEME_BOLTr   r   'URI_SCHEME_BOLT_SELF_SIGNED_CERTIFICATEr   URI_SCHEME_BOLT_SECUREr   r   (URI_SCHEME_NEO4J_SELF_SIGNED_CERTIFICATEURI_SCHEME_NEO4J_SECURE)uriparseddriver_typesecurity_typesupported_schemess        H/opt/lhia/marcimex/agent/venv/lib/python3.12/site-packages/neo4j/_api.pyr   r   >   s   c]F !GHH !GHH}}333 &--* +''*,
 	
 
#--	-!0	#EE	E!=	#44	4!,	#..	."0	#FF	F"=	#55	5", 77&&  88''
 !&--* +)):(; <44
 	
 v--    c           	         | t         j                  t         j                  hvr1t        d|  dt         j                   dt         j                   d      | S )NzUnsupported access mode z, must be one of 'z' or ''.)r	   READ_ACCESSWRITE_ACCESS
ValueError)access_modes    r+   r   r   q   sX    3??C,<,<==&{m 4 s'7'7&8<
 	

 r,   c           
         | si S i }t        | d      }|D ]K  }||   }t        |      dk7  rt        d| d| d|  d      |d   }|st        d| d	| d
|  d      |||<   M |S )zX
    Parse the query portion of a URI.

    Generates a routing context dictionary.
    Tr   z&Duplicated query parameters with key 'z
', value 'z' found in query string ''r   zInvalid parameters:'=z' in query string 'r.   )r   lenr
   )querycontext
parameterskey
value_listvalues         r+   r   r   {   s     	G%&J _
z?a$8 ><8qB  1$&se1UG 47"   Nr,   c                      e Zd ZdZdZdZdZy)r   a  
    Filter notifications returned by the server by minimum severity.

    For GQL-aware servers, notifications are a subset of GqlStatusObjects.
    See also :attr:`.GqlStatusObject.is_notification`.

    Inherits from :class:`str` and :class:`enum.Enum`.
    Every driver API accepting a :class:`.NotificationMinimumSeverity` value
    will also accept a string::

        >>> NotificationMinimumSeverity.OFF == "OFF"
        True
        >>> NotificationMinimumSeverity.WARNING == "WARNING"
        True
        >>> NotificationMinimumSeverity.INFORMATION == "INFORMATION"
        True

    .. seealso::
        driver config :ref:`driver-notifications-min-severity-ref`,
        session config :ref:`session-notifications-min-severity-ref`

    .. versionadded:: 5.7
    OFFWARNINGINFORMATIONN)__name__
__module____qualname____doc__r>   r?   r@    r,   r+   r   r      s    0 CGKr,   r   )r>   r?   r@   T_NotificationMinimumSeverityc                      e Zd ZdZdZdZdZy)r   a  
    Server-side notification severity.

    Inherits from :class:`str` and :class:`enum.Enum`.
    Hence, can also be compared to its string value::

        >>> NotificationSeverity.WARNING == "WARNING"
        True
        >>> NotificationSeverity.INFORMATION == "INFORMATION"
        True
        >>> NotificationSeverity.UNKNOWN == "UNKNOWN"
        True

    Example::

        import logging

        from neo4j import NotificationSeverity


        log = logging.getLogger(__name__)

        ...

        summary = session.run("RETURN 1").consume()

        for notification in summary.summary_notifications:
            severity = notification.severity_level
            if severity == NotificationSeverity.WARNING:
                # or severity == "WARNING"
                log.warning("%r", notification)
            elif severity == NotificationSeverity.INFORMATION:
                # or severity == "INFORMATION"
                log.info("%r", notification)
            else:
                # assert severity == NotificationSeverity.UNKNOWN
                # or severity == "UNKNOWN"
                log.debug("%r", notification)

    .. seealso:: :attr:`.SummaryNotification.severity_level`

    .. versionadded:: 5.7
    r?   r@   UNKNOWNN)rA   rB   rC   rD   r?   r@   rH   rE   r,   r+   r   r      s    *X GK Gr,   r   c                  4    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
Zy)r   a,  
    Filter notifications returned by the server by category.

    For GQL-aware servers, notifications are a subset of GqlStatusObjects.
    See also :attr:`.GqlStatusObject.is_notification`.

    Inherits from :class:`str` and :class:`enum.Enum`.
    Every driver API accepting a :class:`.NotificationDisabledCategory` value
    will also accept a string::

        >>> NotificationDisabledCategory.UNRECOGNIZED == "UNRECOGNIZED"
        True
        >>> NotificationDisabledCategory.PERFORMANCE == "PERFORMANCE"
        True
        >>> NotificationDisabledCategory.DEPRECATION == "DEPRECATION"
        True

    .. seealso::
        driver config :ref:`driver-notifications-disabled-categories-ref`,
        session config :ref:`session-notifications-disabled-categories-ref`

    .. versionadded:: 5.7

    .. versionchanged:: 5.14
        Added categories :attr:`.SECURITY` and :attr:`.TOPOLOGY`.

    .. versionchanged:: 5.24
        Added category :attr:`.SCHEMA`.

    .. deprecated:: 6.0
        Use :class:`.NotificationDisabledClassification` instead.
    HINTUNRECOGNIZEDUNSUPPORTEDPERFORMANCEDEPRECATIONGENERICSECURITYTOPOLOGYSCHEMANrA   rB   rC   rD   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rE   r,   r+   r   r      s7    B D!LKKKGHHFr,   r   c                  4    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
Zy)r   a  
    Identical to :class:`.NotificationDisabledCategory`.

    This alternative is provided for a consistent naming with
    :attr:`.GqlStatusObject.classification`.

    .. seealso::
        driver config
        :ref:`driver-notifications-disabled-classifications-ref`,
        session config
        :ref:`session-notifications-disabled-classifications-ref`

    .. versionadded:: 5.22

    .. versionchanged:: 5.24
        Added classification :attr:`.SCHEMA`.

    .. versionchanged:: 6.0 Stabilized from preview.
    rJ   rK   rL   rM   rN   rO   rP   rQ   rR   NrS   rE   r,   r+   r   r   %  s6    ( D!LKKKGHHFr,   r   )	rJ   rK   rL   rM   rN   rO   rP   rQ   rR   $T_NotificationDisabledClassificationc                  8    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZy)r   ae  
    Server-side notification category.

    Inherits from :class:`str` and :class:`enum.Enum`.
    Hence, can also be compared to its string value::

        >>> NotificationCategory.DEPRECATION == "DEPRECATION"
        True
        >>> NotificationCategory.GENERIC == "GENERIC"
        True
        >>> NotificationCategory.UNKNOWN == "UNKNOWN"
        True

    .. seealso:: :attr:`.SummaryNotification.category`

    .. versionadded:: 5.7

    .. versionchanged:: 5.14
        Added categories :attr:`.SECURITY` and :attr:`.TOPOLOGY`.

    .. versionchanged:: 5.24
        Added category :attr:`.SCHEMA`.
    rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rH   NrA   rB   rC   rD   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rH   rE   r,   r+   r   r   Z  s=    0 D!LKKKGHHF Gr,   r   c                  8    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZy)r   az  
    Identical to :class:`.NotificationCategory`.

    This alternative is provided for a consistent naming with
    :attr:`.GqlStatusObject.classification`.

    .. seealso:: :attr:`.GqlStatusObject.classification`

    .. versionadded:: 5.22

    .. versionchanged:: 5.24
        Added classification :attr:`.SCHEMA`.

    .. versionchanged:: 6.0 Stabilized from preview.
    rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rH   NrW   rE   r,   r+   r   r     s=      D!LKKKGHHF Gr,   r   c                      e Zd ZdZdZdZy)r   aM  
    Selection which cluster members to route a query connect to.

    Inherits from :class:`str` and :class:`enum.Enum`.
    Every driver API accepting a :class:`.RoutingControl` value will also
    accept a string::

        >>> RoutingControl.READ == "r"
        True
        >>> RoutingControl.WRITE == "w"
        True

    .. seealso::
        :meth:`.AsyncDriver.execute_query`, :meth:`.Driver.execute_query`

    .. versionadded:: 5.5

    .. versionchanged:: 5.8

        * Renamed ``READERS`` to ``READ`` and ``WRITERS`` to ``WRITE``.
        * Stabilized from experimental.
    rwN)rA   rB   rC   rD   READWRITErE   r,   r+   r   r     s    . DEr,   r   c                      e Zd ZdZdZdZdZy)r   r   r         N)rA   rB   rC   TX_FUNCTXAUTO_COMMITDRIVERrE   r,   r+   r   r     s    G	
BKFr,   r   )rZ   r[   T_RoutingControlN)'
__future__r   enumr   urllib.parser   r    r   tr	   
exceptionsr
   __all__r   __annotations__r   r   r   r   r   r   r   strr   TYPE_CHECKINGLiteralrF   appendr   r   r   rU   r   r   r   intr   re   rE   r,   r+   <module>rs      s  " # 
 +( *\ )+l +)C , C+ &|  &< l ;0.f: #t  < ??#
))
	
 " NN2313 1h,3 ,^d D ??$
,	-
))

	
 ) NN9:%3 %Pd @S$ 83  ??%		((;;NN%& r,   