o
    Åîï];  ã                   @   s(   d Z G dd„ deƒZG dd„ deƒZdS )z%Represent a response from the server.c                   @   s`   e Zd ZdZ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dS )ÚResponse©Ú_dataÚ_addressÚ_request_idÚ	_durationÚ_from_commandÚ_docsc                 C   s(   || _ || _|| _|| _|| _|| _dS )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Údocs© r   úB/var/www/html/env/lib/python3.10/site-packages/pymongo/response.pyÚ__init__   s   
zResponse.__init__c                 C   ó   | j S )z!Server response's raw BSON bytes.)r   ©r	   r   r   r   r
   (   ó   zResponse.datac                 C   r   )z"(host, port) of the source server.)r   r   r   r   r   r   -   r   zResponse.addressc                 C   r   )z!The request id of this operation.)r   r   r   r   r   r   2   r   zResponse.request_idc                 C   r   )zThe duration of the operation.)r   r   r   r   r   r   7   r   zResponse.durationc                 C   r   )z.If the response is a result from a db command.)r   r   r   r   r   r   <   r   zResponse.from_commandc                 C   r   )zThe decoded document(s).)r   r   r   r   r   r   A   r   zResponse.docsN)Ú__name__Ú
__module__Ú__qualname__Ú	__slots__r   Úpropertyr
   r   r   r   r   r   r   r   r   r   r      s    




r   c                       s8   e Zd ZdZ‡ fdd„Zedd„ ƒZedd„ ƒZ‡  ZS )ÚExhaustResponse)Ú_socket_infoÚ_poolc	           	         s*   t t| ƒ ||||||¡ || _|| _dS )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.
        N)Úsuperr   r   r   r   )	r	   r
   r   Úsocket_infoÚpoolr   r   r   r   ©Ú	__class__r   r   r   I   s   ü
zExhaustResponse.__init__c                 C   r   )zßThe 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   r   r   r   r   ^   s   zExhaustResponse.socket_infoc                 C   r   )z(The Pool from which the SocketInfo came.)r   r   r   r   r   r    h   r   zExhaustResponse.pool)	r   r   r   r   r   r   r   r    Ú__classcell__r   r   r!   r   r   F   s    
	r   N)Ú__doc__Úobjectr   r   r   r   r   r   Ú<module>   s   4