
    &g'                        S r SSKJr  SSKrSSKrSSKJrJrJr  SSK	J
r
  SSKJr  SSKJr  SSKJr  SS	KJrJr   " S
 S5      rg)zRepresent one server the driver is connected to.

.. seealso:: This module is compatible with both the synchronous and asynchronous PyMongo APIs.
    )annotationsN)AnyMappingOptional)EPOCH_NAIVE)ObjectId)Hello)SERVER_TYPE)ClusterTime_Addressc                     \ rS rSr% SrSr    S+           S,S jjr\S-S j5       r\S.S j5       r	\S/S j5       r
\S0S	 j5       r\S1S
 j5       r\S2S j5       r\S3S j5       r\S.S j5       r\S.S j5       r\S.S j5       r\S.S j5       r\S.S j5       r\S4S j5       r\S5S j5       r\S6S j5       r\S7S j5       r\S3S j5       r\S4S j5       r\S8S j5       r\S9S j5       r\S8S j5       r\S9S j5       r\S:S j5       r\S;S j5       r\S;S j5       r \S;S j5       r!\S;S  j5       r"\S;S! j5       r#\S;S" j5       r$\S<S# j5       r%S=S>S$ jjr&S?S% jr'S?S& jr(S/S' jr)0 r*S(\+S)'   S*r,g)@ServerDescription    a:  Immutable representation of one server.

:param address: A (host, port) pair
:param hello: Optional Hello instance
:param round_trip_time: Optional float
:param error: Optional, the last error attempting to connect to the server
:param round_trip_time: Optional float, the min latency from the most recent samples
)_address_server_type
_all_hosts_tags_replica_set_name_primary_max_bson_size_max_message_size_max_write_batch_size_min_wire_version_max_wire_version_round_trip_time_min_round_trip_time_me_is_writable_is_readable_ls_timeout_minutes_error_set_version_election_id_cluster_time_last_write_date_last_update_time_topology_versionNc                   Xl         U(       d  [        0 5      nUR                  U l        UR                  U l        UR                  U l        UR                  U l	        UR                  U l        UR                  U l        UR                  U l        UR                   U l        UR$                  U l        UR(                  U l        UR,                  U l        UR0                  U l        UR4                  U l        UR8                  U l        UR<                  U l        UR@                  U l!        X0l"        XPl#        URH                  U l%        [L        RN                  " 5       U l(        X@l)        URT                  U l+        U(       a8  [Y        USS 5      n[[        U[\        5      (       a  UR_                  S5      U l+        U   UR`                  (       a)  UR`                  [b        -
  nURe                  5       U l3        g S U l3        g )NdetailstopologyVersion)4r   r	   server_typer   	all_hostsr   tagsr   replica_set_namer   primaryr   max_bson_sizer   max_message_sizer   max_write_batch_sizer   min_wire_versionr   max_wire_versionr   set_versionr"   election_idr#   cluster_timer$   is_writabler   is_readabler   logical_session_timeout_minutesr    r   r   mer   time	monotonicr&   r!   topology_versionr'   getattr
isinstancedictgetlast_write_dater   total_secondsr%   )selfaddresshelloround_trip_timeerrormin_round_trip_timer)   deltas           _C:\Suresh\moveshuttle\MDcreated\moveengine\venv\Lib\site-packages\pymongo/server_description.py__init__ServerDescription.__init__E   s     "IE!--//ZZ
!&!7!7#11!&!7!7%*%?%?"!&!7!7!&!7!7!--!--"//!--!--#(#H#H  /$7!88!%!1!&!7!7eY5G'4(()05F)G&  ))K7E$)$7$7$9D!$(D!    c                    U R                   $ )z(The address (host, port) of this server.)r   rE   s    rL   rF   ServerDescription.addresst        }}rO   c                    U R                   $ )zThe type of this server.)r   rQ   s    rL   r+   ServerDescription.server_typey   s        rO   c                <    [         R                  U R                     $ )zCThe server type as a human readable string.

.. versionadded:: 3.4
)r
   _fieldsr   rQ   s    rL   server_type_name"ServerDescription.server_type_name~   s     ""4#4#455rO   c                    U R                   $ )z;List of hosts, passives, and arbiters known to this server.)r   rQ   s    rL   r,   ServerDescription.all_hosts   s     rO   c                    U R                   $ N)r   rQ   s    rL   r-   ServerDescription.tags   s    zzrO   c                    U R                   $ )zReplica set name or None.)r   rQ   s    rL   r.   "ServerDescription.replica_set_name   s     %%%rO   c                    U R                   $ )z8This server's opinion about who the primary is, or None.)r   rQ   s    rL   r/   ServerDescription.primary   rS   rO   c                    U R                   $ r]   )r   rQ   s    rL   r0   ServerDescription.max_bson_size   s    """rO   c                    U R                   $ r]   )r   rQ   s    rL   r1   "ServerDescription.max_message_size       %%%rO   c                    U R                   $ r]   )r   rQ   s    rL   r2   &ServerDescription.max_write_batch_size   s    )))rO   c                    U R                   $ r]   )r   rQ   s    rL   r3   "ServerDescription.min_wire_version   rg   rO   c                    U R                   $ r]   r   rQ   s    rL   r4   "ServerDescription.max_wire_version   rg   rO   c                    U R                   $ r]   )r"   rQ   s    rL   r5   ServerDescription.set_version          rO   c                    U R                   $ r]   )r#   rQ   s    rL   r6   ServerDescription.election_id   rq   rO   c                    U R                   $ r]   )r$   rQ   s    rL   r7   ServerDescription.cluster_time   s    !!!rO   c                f    [         R                  " S[        SS9  U R                  U R                  4$ )NzL'election_tuple' is deprecated, use  'set_version' and 'election_id' instead   )
stacklevel)warningswarnDeprecationWarningr"   r#   rQ   s    rL   election_tuple ServerDescription.election_tuple   s0    Z	

   $"3"333rO   c                    U R                   $ r]   )r   rQ   s    rL   r;   ServerDescription.me   s    xxrO   c                    U R                   $ r]   )r    rQ   s    rL   r:   1ServerDescription.logical_session_timeout_minutes   s    '''rO   c                    U R                   $ r]   )r%   rQ   s    rL   rC   !ServerDescription.last_write_date   s    $$$rO   c                    U R                   $ r]   )r&   rQ   s    rL   last_update_time"ServerDescription.last_update_time   rg   rO   c                    U R                   U R                  ;   a  U R                  U R                      $ U R                  $ )z$The current average latency or None.)r   _host_to_round_trip_timer   rQ   s    rL   rH   !ServerDescription.round_trip_time   s7     ==D99900??$$$rO   c                    U R                   $ )z-The min latency from the most recent samples.)r   rQ   s    rL   rJ   %ServerDescription.min_round_trip_time   s     (((rO   c                    U R                   $ )z<The last error attempting to connect to the server, or None.)r!   rQ   s    rL   rI   ServerDescription.error   s     {{rO   c                    U R                   $ r]   )r   rQ   s    rL   r8   ServerDescription.is_writable   rq   rO   c                    U R                   $ r]   )r   rQ   s    rL   r9   ServerDescription.is_readable   rq   rO   c                <    U R                   [        R                  :H  $ r]   )r   r
   MongosrQ   s    rL   mongosServerDescription.mongos   s      K$6$666rO   c                <    U R                   [        R                  :g  $ r]   )r+   r
   UnknownrQ   s    rL   is_server_type_known&ServerDescription.is_server_type_known   s    ;#6#666rO   c                    U R                   [        R                  [        R                  4;   =(       d    U R                   [        R                  :H  $ )0Checks if this server supports retryable writes.)r   r
   r   	RSPrimaryLoadBalancerrQ   s    rL   retryable_writes_supported,ServerDescription.retryable_writes_supported   sA     +"4"4k6K6K!LL;+":"::	;rO   c                     U R                   S:  $ )r      rm   rQ   s    rL   retryable_reads_supported+ServerDescription.retryable_reads_supported   s     %%**rO   c                    U R                   $ r]   )r'   rQ   s    rL   r>   "ServerDescription.topology_version  rg   rO   c                P    [        U R                  US9nU R                  Ul        U$ )N)rI   )r   rF   r>   r'   )rE   rI   unknowns      rL   
to_unknownServerDescription.to_unknown  s%    #DLL>$($9$9!rO   c                t   [        U[        5      (       Ga  U R                  UR                  :H  =(       Ga|    U R                  UR
                  :H  =(       Ga[    U R                  UR                  :H  =(       Ga:    U R                  UR                  :H  =(       Ga    U R                  UR                  :H  =(       a    U R                  UR                  :H  =(       a    U R                  UR                  :H  =(       a    U R                   UR"                  :H  =(       a    U R$                  UR&                  :H  =(       ay    U R(                  UR*                  :H  =(       aY    U R,                  UR.                  :H  =(       a9    U R0                  UR2                  :H  =(       a    U R4                  UR6                  :H  $ [8        $ r]   )r@   r   r   rF   r   r+   r   r3   r   r4   r   r;   r   r,   r   r-   r   r.   r"   r5   r#   r6   r   r/   r    r:   r!   rI   NotImplementedrE   others     rL   __eq__ServerDescription.__eq__
  sm   e.//%--/ 1 1&&%*;*;;1 1++u/E/EE1 1 ++u/E/EE1 1 XX)	1
 __71 ZZ5::-1 ++u/E/EE1 &&%*;*;;1 &&%*;*;;1 ]]emm31 --1V1VV1 [[EKK/  rO   c                    X:X  + $ r]    r   s     rL   __ne__ServerDescription.__ne__  s      rO   c                    SnU R                   (       a  SU R                   < 3nSR                  U R                  R                  U R                  U R
                  U R                  U5      $ )N z, error=z"<{} {} server_type: {}, rtt: {}{}>)rI   format	__class____name__rF   rX   rH   )rE   errmsgs     rL   __repr__ServerDescription.__repr__!  sZ    ::

~.F3::NN##LL!!  
 	
rO   rA   r   )r   r   r$   r#   r!   r   r   r&   r%   r    r   r   r   r   r   r   r   r   r   r   r   r"   r   r'   )NNNg        )rF   r   rG   zOptional[Hello]rH   Optional[float]rI   Optional[Exception]rJ   floatreturnNone)r   r   )r   int)r   str)r   zset[tuple[str, int]])r   zMapping[str, Any])r   zOptional[str])r   zOptional[tuple[str, int]])r   zOptional[int])r   zOptional[ObjectId])r   zOptional[ClusterTime])r   z(tuple[Optional[int], Optional[ObjectId]])r   r   )r   r   )r   r   )r   bool)r   zOptional[Mapping[str, Any]]r]   )rI   r   r   r   )r   r   r   r   )-r   
__module____qualname____firstlineno____doc__	__slots__rM   propertyrF   r+   rX   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r|   r;   r:   rC   r   rH   rJ   rI   r8   r9   r   r   r   r   r>   r   r   r   r   r   __annotations____static_attributes__r   rO   rL   r   r       s   I< "&+/%)%(-)-) -) )	-)
 #-) #-) 
-)^   ! ! 6 6     & &   # # & & * * & & & & ! ! ! ! " " 4 4   ( ( % % & & % % ) )   ! ! ! ! 7 7 7 7 ; ; + + & &
(!

 &(d'rO   r   )r   
__future__r   r<   ry   typingr   r   r   bsonr   bson.objectidr   pymongo.hellor	   pymongo.server_typer
   pymongo.typingsr   r   r   r   rO   rL   <module>r      s6    #   ) )  "  + 1N( N(rO   