
    hy                     4    d Z  G d de      Z G d de      Zy)z%Represent a response from the server.c                   v    e Zd ZdZd Zed        Zed        Zed        Zed        Z	ed        Z
ed        Zy	)
Response_data_address_request_id	_duration_from_command_docsc                 X    || _         || _        || _        || _        || _        || _        y)al  Represent a response from the server.

        :Parameters:
          - `data`: A network response message.
          - `address`: (host, port) of the source server.
          - `request_id`: The request id of this operation.
          - `duration`: The duration of the operation.
          - `from_command`: if the response is the result of a db command.
        Nr   )selfdataaddress
request_iddurationfrom_commanddocss          N/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/pymongo/response.py__init__zResponse.__init__   s0     
%!)
    c                     | j                   S )z!Server response's raw BSON bytes.)r   r   s    r   r   zResponse.data&        zzr   c                     | j                   S )z"(host, port) of the source server.)r   r   s    r   r   zResponse.address+   s     }}r   c                     | j                   S )z!The request id of this operation.)r   r   s    r   r   zResponse.request_id0   s     r   c                     | j                   S )zThe duration of the operation.)r   r   s    r   r   zResponse.duration5   s     ~~r   c                     | j                   S )z.If the response is a result from a db command.)r	   r   s    r   r   zResponse.from_command:   s     !!!r   c                     | j                   S )zThe decoded document(s).)r
   r   s    r   r   zResponse.docs?   r   r   N)__name__
__module____qualname__	__slots__r   propertyr   r   r   r   r   r    r   r   r   r      s    [I"           " "  r   r   c                   B     e Zd ZdZ fdZed        Zed        Z xZS )PinnedResponse)_socket_info_more_to_comec	                 R    t         t        |   ||||||       || _        || _        y)a  Represent a response to an exhaust cursor's initial query.

        :Parameters:
          - `data`:  A network response message.
          - `address`: (host, port) of the source server.
          - `socket_info`: The SocketInfo used for the initial query.
          - `pool`: The Pool from which the SocketInfo came.
          - `request_id`: The request id of this operation.
          - `duration`: The duration of the operation.
          - `from_command`: If the response is the result of a db command.
          - `docs`: List of documents.
          - `more_to_come`: Bool indicating whether cursor is ready to be
            exhausted.
        N)superr%   r   r&   r'   )
r   r   r   socket_infor   r   r   r   more_to_come	__class__s
            r   r   zPinnedResponse.__init__H   s3    " 	nd,':xt	
 ()r   c                     | j                   S )zThe SocketInfo used for the initial query.

        The server will send batches on this socket, without waiting for
        getMores from the client, until the result set is exhausted or there
        is an error.
        )r&   r   s    r   r*   zPinnedResponse.socket_info_   s        r   c                     | j                   S )zvIf true, server is ready to send batches on the socket until the
        result set is exhausted or there is an error.)r'   r   s    r   r+   zPinnedResponse.more_to_comei   s     !!!r   )	r   r   r    r!   r   r"   r*   r+   __classcell__)r,   s   @r   r%   r%   E   s5    1I*. ! ! " "r   r%   N)__doc__objectr   r%   r#   r   r   <module>r2      s#    ,0v 0f("X ("r   