Ë
    Ü_Ëi:  ã                  ó°   — d Z ddlmZ ddlZddlZddlZddlmZmZm	Z	m
Z
 ddlmZ ddlmZ ddlmZ ddlmZmZ dd	„Z G d
„ d«      Z G d„ dee   «      Zy)z2Helpers for the 'hello' and legacy hello commands.é    )ÚannotationsN)ÚAnyÚGenericÚMappingÚOptional)ÚObjectId)Úcommon)ÚSERVER_TYPE)ÚClusterTimeÚ_DocumentTypec                óô  — | j                  d«      st        j                  S | j                  d«      rt        j                  S | j                  d«      rt        j                  S | j                  d«      rÑ| j                  d«      rt        j
                  S | j                  t        j                  «      rt        j                  S | j                  t        j                  «      rt        j                  S | j                  d«      rt        j                  S | j                  d«      rt        j                  S t        j
                  S | j                  d«      d	k(  rt        j                  S t        j                  S )
z0Determine the server type from a hello response.ÚokÚ	serviceIdÚisreplicasetÚsetNameÚhiddenÚ	secondaryÚarbiterOnlyÚmsgÚisdbgrid)Úgetr
   ÚUnknownÚLoadBalancerÚRSGhostÚRSOtherÚHelloCompatÚPRIMARYÚ	RSPrimaryÚLEGACY_PRIMARYÚRSSecondaryÚ	RSArbiterÚMongosÚ
Standalone)Údocs    úP/var/www/pod-logistic/pod-api/venv/lib/python3.12/site-packages/pymongo/hello.pyÚ_get_server_typer&      s  € à�7‰7�4Œ=Ü×"Ñ"Ð"à
‡w�wˆ{ÔÜ×'Ñ'Ð'Ø	�‰�Ô	 Ü×"Ñ"Ð"Ø	�‰�Ô	Ø�7‰7�8ÔÜ×&Ñ&Ð&Ø�W‰W”[×(Ñ(Ô)Ü×(Ñ(Ð(Ø�W‰W”[×/Ñ/Ô0Ü×(Ñ(Ð(Ø�W‰W�[Ô!Ü×*Ñ*Ð*Ø�W‰W�]Ô#Ü×(Ñ(Ð(ä×&Ñ&Ð&Ø	�‰�‹˜:Ò	%Ü×!Ñ!Ð!ä×%Ñ%Ð%ó    c                  ó    — e Zd ZdZdZdZdZdZy)r   ÚhelloÚismasterÚisWritablePrimaryz
not masterN)Ú__name__Ú
__module__Ú__qualname__ÚCMDÚ
LEGACY_CMDr   r   ÚLEGACY_ERROR© r'   r%   r   r   9   s   „ Ø
€CØ€JØ!€GØ€NØ�Lr'   r   c                  ó  — e Zd ZdZdZd d!d„Zed"d„«       Zed#d„«       Zed$d„«       Z	ed%d„«       Z
ed&d„«       Zed'd	„«       Zed#d
„«       Zed#d„«       Zed#d„«       Zed#d„«       Zed#d„«       Zed(d„«       Zed)d„«       Zed*d„«       Zed(d„«       Zed+d„«       Zed+d„«       Zed&d„«       Zed,d„«       Zed-d„«       Zed.d„«       Zed/d„«       Zed/d„«       Zed+d„«       Zed)d„«       Zed+d„«       Z ed(d„«       Z!y)0ÚHellozHParse a hello response from the server.

    .. versionadded:: 3.12
    )Ú_docÚ_server_typeÚ_is_writableÚ_is_readableÚ
_awaitablec                ó>  — t        |«      | _        || _        | j                  t        j                  t        j
                  t        j                  t        j                  fv | _        | j                  t        j                  k(  xs | j                  | _        || _        y ©N)r&   r6   r5   r
   r   r#   r"   r   r7   Úserver_typer    r8   r9   )Úselfr$   Ú	awaitables      r%   Ú__init__zHello.__init__I   s   € Ü,¨SÓ1ˆÔØ#&ˆŒ	Ø ×-Ñ-Ü×!Ñ!Ü×"Ñ"Ü×ÑÜ×$Ñ$ð	2
ð 
ˆÔð !×,Ñ,´×0GÑ0GÑGÒ\È4×K\ÑK\ˆÔØ#ˆ�r'   c                ó@   — t        j                   | j                  «      S )zUThe complete hello command response document.

        .. versionadded:: 3.4
        )Úcopyr5   ©r=   s    r%   ÚdocumentzHello.documentV   s   € ô �y‰y˜Ÿ™Ó#Ð#r'   c                ó   — | j                   S r;   )r6   rB   s    r%   r<   zHello.server_type^   ó   € à× Ñ Ð r'   c                ó  — t        t        t        j                  t	        j
                  | j                  j                  dg «      | j                  j                  dg «      | j                  j                  dg «      «      «      «      S )z;List of hosts, passives, and arbiters known to this server.ÚhostsÚpassivesÚarbiters)ÚsetÚmapr	   Ú
clean_nodeÚ	itertoolsÚchainr5   r   rB   s    r%   Ú	all_hostszHello.all_hostsb   sd   € ô ÜÜ×!Ñ!Ü—‘Ø—I‘I—M‘M '¨2Ó.Ø—I‘I—M‘M *¨bÓ1Ø—I‘I—M‘M *¨bÓ1óóó	
ð 		
r'   c                ó:   — | j                   j                  di «      S )z&Replica set member tags or empty dict.Útags©r5   r   rB   s    r%   rQ   z
Hello.tagsp   s   € ð �y‰y�}‰}˜V RÓ(Ð(r'   c                ó~   — | j                   j                  d«      r"t        j                  | j                   d   «      S y)z8This server's opinion about who the primary is, or None.ÚprimaryN)r5   r   r	   Úpartition_noderB   s    r%   rT   zHello.primaryu   s1   € ð �9‰9�=‰=˜Ô#Ü×(Ñ(¨¯©°9Ñ)=Ó>Ð>àr'   c                ó8   — | j                   j                  d«      S )zReplica set name or None.r   rR   rB   s    r%   Úreplica_set_namezHello.replica_set_name}   s   € ð �y‰y�}‰}˜YÓ'Ð'r'   c                óV   — | j                   j                  dt        j                  «      S )NÚmaxBsonObjectSize)r5   r   r	   ÚMAX_BSON_SIZErB   s    r%   Úmax_bson_sizezHello.max_bson_size‚   s   € à�y‰y�}‰}Ð0´&×2FÑ2FÓGÐGr'   c                óV   — | j                   j                  dt        j                  «      S )NÚmaxMessageSizeBytes)r5   r   r	   ÚMAX_MESSAGE_SIZErB   s    r%   Úmax_message_sizezHello.max_message_size†   s   € à�y‰y�}‰}Ð2´F×4KÑ4KÓLÐLr'   c                óV   — | j                   j                  dt        j                  «      S )NÚmaxWriteBatchSize)r5   r   r	   ÚMAX_WRITE_BATCH_SIZErB   s    r%   Úmax_write_batch_sizezHello.max_write_batch_sizeŠ   s   € à�y‰y�}‰}Ð0´&×2MÑ2MÓNÐNr'   c                óV   — | j                   j                  dt        j                  «      S )NÚminWireVersion)r5   r   r	   ÚMIN_WIRE_VERSIONrB   s    r%   Úmin_wire_versionzHello.min_wire_versionŽ   ó   € à�y‰y�}‰}Ð-¬v×/FÑ/FÓGÐGr'   c                óV   — | j                   j                  dt        j                  «      S )NÚmaxWireVersion)r5   r   r	   ÚMAX_WIRE_VERSIONrB   s    r%   Úmax_wire_versionzHello.max_wire_version’   rh   r'   c                ó8   — | j                   j                  d«      S )NÚ
setVersionrR   rB   s    r%   Úset_versionzHello.set_version–   ó   € à�y‰y�}‰}˜\Ó*Ð*r'   c                ó8   — | j                   j                  d«      S )NÚ
electionIdrR   rB   s    r%   Úelection_idzHello.election_idš   rp   r'   c                ó8   — | j                   j                  d«      S )Nz$clusterTimerR   rB   s    r%   Úcluster_timezHello.cluster_timež   ó   € à�y‰y�}‰}˜^Ó,Ð,r'   c                ó8   — | j                   j                  d«      S )NÚlogicalSessionTimeoutMinutesrR   rB   s    r%   Úlogical_session_timeout_minutesz%Hello.logical_session_timeout_minutes¢   s   € à�y‰y�}‰}Ð;Ó<Ð<r'   c                ó   — | j                   S r;   )r7   rB   s    r%   Úis_writablezHello.is_writable¦   rE   r'   c                ó   — | j                   S r;   )r8   rB   s    r%   Úis_readablezHello.is_readableª   rE   r'   c                óh   — | j                   j                  d«      }|rt        j                  |«      S y )NÚme)r5   r   r	   rL   )r=   r   s     r%   r   zHello.me®   s+   € à�Y‰Y�]‰]˜4Ó ˆÙÜ×$Ñ$ RÓ(Ð(Ør'   c                óX   — | j                   j                  di «      j                  d«      S )NÚ	lastWriteÚlastWriteDaterR   rB   s    r%   Úlast_write_datezHello.last_write_dateµ   s"   € à�y‰y�}‰}˜[¨"Ó-×1Ñ1°/ÓBÐBr'   c                ó8   — | j                   j                  d«      S )NÚcompressionrR   rB   s    r%   ÚcompressorszHello.compressors¹   s   € à�y‰y�}‰}˜]Ó+Ð+r'   c                ó:   — | j                   j                  dg «      S )z³Supported authentication mechanisms for the current user.

        For example::

            >>> hello.sasl_supported_mechs
            ["SCRAM-SHA-1", "SCRAM-SHA-256"]

        ÚsaslSupportedMechsrR   rB   s    r%   Úsasl_supported_mechszHello.sasl_supported_mechs½   s   € ð �y‰y�}‰}Ð1°2Ó6Ð6r'   c                ó8   — | j                   j                  d«      S )z"The speculativeAuthenticate field.ÚspeculativeAuthenticaterR   rB   s    r%   Úspeculative_authenticatezHello.speculative_authenticateÉ   s   € ð �y‰y�}‰}Ð6Ó7Ð7r'   c                ó8   — | j                   j                  d«      S )NÚtopologyVersionrR   rB   s    r%   Útopology_versionzHello.topology_versionÎ   s   € à�y‰y�}‰}Ð.Ó/Ð/r'   c                ó   — | j                   S r;   )r9   rB   s    r%   r>   zHello.awaitableÒ   s   € à�‰Ðr'   c                ó8   — | j                   j                  d«      S )Nr   rR   rB   s    r%   Ú
service_idzHello.service_idÖ   s   € à�y‰y�}‰}˜[Ó)Ð)r'   c                ó:   — | j                   j                  dd«      S )NÚhelloOkFrR   rB   s    r%   Úhello_okzHello.hello_okÚ   s   € à�y‰y�}‰}˜Y¨Ó.Ð.r'   c                ó8   — | j                   j                  d«      S )NÚconnectionIdrR   rB   s    r%   Úconnection_idzHello.connection_idÞ   rv   r'   N)F)r$   r   r>   ÚboolÚreturnÚNone)rš   r   )rš   Úint)rš   zset[tuple[str, int]])rš   úMapping[str, Any])rš   zOptional[tuple[str, int]])rš   zOptional[str])rš   zOptional[int])rš   zOptional[ObjectId])rš   zOptional[ClusterTime])rš   r™   )rš   zOptional[datetime.datetime])rš   zOptional[list[str]])rš   z	list[str])rš   zOptional[Mapping[str, Any]])"r,   r-   r.   Ú__doc__Ú	__slots__r?   ÚpropertyrC   r<   rO   rQ   rT   rW   r[   r_   rc   rg   rl   ro   rs   ru   ry   r{   r}   r   rƒ   r†   r‰   rŒ   r�   r>   r’   r•   r˜   r2   r'   r%   r4   r4   A   s<  „ ñð
 W€Iô$ð ò$ó ð$ð ò!ó ð!ð ò
ó ð
ð ò)ó ð)ð òó ðð ò(ó ð(ð òHó ðHð òMó ðMð òOó ðOð òHó ðHð òHó ðHð ò+ó ð+ð ò+ó ð+ð ò-ó ð-ð ò=ó ð=ð ò!ó ð!ð ò!ó ð!ð òó ðð òCó ðCð ò,ó ð,ð ò	7ó ð	7ð ò8ó ð8ð ò0ó ð0ð òó ðð ò*ó ð*ð ò/ó ð/ð ò-ó ñ-r'   r4   )r$   r�   rš   rœ   )rž   Ú
__future__r   rA   ÚdatetimerM   Útypingr   r   r   r   Úbson.objectidr   Úpymongor	   Úpymongo.server_typer
   Úpymongo.typingsr   r   r&   r   r4   r2   r'   r%   ú<module>r¨      sJ   ðñ 9Ý "ã Û Û ß 2Ó 2å "Ý Ý +ß 6ó&÷8 ñ  ô_-ˆG�MÑ"õ _-r'   