
    [j~	                    T    d Z ddlmZ ddlmZmZ  G d d          Z e            ZdS )z%Tools for working with read concerns.    )annotations)AnyOptionalc                  t    e Zd ZdZdddZedd            Zedd
            Zedd            ZddZ	ddZ
dS )ReadConcerna  ReadConcern

    :Parameters:
        - `level`: (string) The read concern level specifies the level of
          isolation for read operations.  For example, a read operation using a
          read concern level of ``majority`` will only return data that has been
          written to a majority of nodes. If the level is left unspecified, the
          server default will be used.

    .. versionadded:: 3.2

    NlevelOptional[str]returnNonec                `    |t          |t                    r	|| _        d S t          d          )Nzlevel must be a string or None.)
isinstancestr_ReadConcern__level	TypeError)selfr   s     X/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/pymongo/read_concern.py__init__zReadConcern.__init__#   s/    =Juc22= DLLL=>>>    c                    | j         S )zThe read concern level.)r   r   s    r   r   zReadConcern.level)   s     |r   boolc                *    | j         du p
| j         dk    S )zdReturn ``True`` if this read concern is compatible with
        old wire protocol versions.
        Nlocalr   r   s    r   ok_for_legacyzReadConcern.ok_for_legacy.   s    
 zT!:TZ7%::r   dict[str, Any]c                ,    i }| j         r
| j        |d<   |S )zThe document representation of this read concern.

        .. note::
          :class:`ReadConcern` is immutable. Mutating the value of
          :attr:`document` does not mutate this :class:`ReadConcern`.
        r   )r   r   )r   docs     r   documentzReadConcern.document5   s#     < 	&:CL
r   otherr   c                Z    t          |t                    r| j        |j        k    S t          S N)r   r   r   NotImplemented)r   r    s     r   __eq__zReadConcern.__eq__B   s)    e[)) 	3=EN22r   r   c                (    | j         r
d| j         z  S dS )NzReadConcern(%s)zReadConcern()r   r   s    r   __repr__zReadConcern.__repr__G   s    : 	2$tz11r   r"   )r   r	   r
   r   )r
   r	   )r
   r   )r
   r   )r    r   r
   r   )r
   r   )__name__
__module____qualname____doc__r   propertyr   r   r   r$   r&    r   r   r   r      s         ? ? ? ? ?    X ; ; ; X; 
 
 
 X
   
     r   r   N)r*   
__future__r   typingr   r   r   DEFAULT_READ_CONCERNr,   r   r   <module>r0      st    , + " " " " " "                5 5 5 5 5 5 5 5p #{}}   r   