o
    ºªRhë  ã                   @   s\   d Z ddlmZ ddlmZmZmZ ddlmZ G dd„ deeƒƒZ	G dd„ deeƒƒZ
d	S )
z!linebot.async_http_client module.é    )Úunicode_literals)ÚABCMetaÚabstractmethodÚabstractproperty)Úwith_metaclassc                   @   sX   e Zd ZdZdZefdd„Zeddd„ƒZeddd	„ƒZedd
d„ƒZ	eddd„ƒZ
dS )ÚAsyncHttpClientz$Abstract Base Classes of HttpClient.é   c                 C   s
   || _ dS )aŒ  __init__ method.

        :param timeout: (optional) How long to wait for the server
            to send data before giving up, as a float,
            or a (connect timeout, read timeout) float tuple.
            Default is :py:attr:`DEFAULT_TIMEOUT`
        :type timeout: float | tuple(float, float)
        :rtype: T <= :py:class:`HttpResponse`
        :return: HttpResponse instance
        N)Útimeout)Úselfr	   © r   ú[/home/air/sanwanet/backup_V2/venv/lib/python3.10/site-packages/linebot/async_http_client.pyÚ__init__   s   
zAsyncHttpClient.__init__Nc                 Ã   ó   t ‚)a!  GET request.

        :param str url: Request url
        :param dict headers: (optional) Request headers
        :param dict params: (optional) Request query parameter
        :param timeout: (optional), How long to wait for the server
            to send data before giving up, as a float,
            or a (connect timeout, read timeout) float tuple.
            Default is :py:attr:`self.timeout`
        :type timeout: float | tuple(float, float)
        :rtype: T <= :py:class:`HttpResponse`
        :return: HttpResponse instance
        ©ÚNotImplementedError)r
   ÚurlÚheadersÚparamsr	   r   r   r   Úget*   ó   €zAsyncHttpClient.getc                 Ã   r   )a>  POST request.

        :param str url: Request url
        :param dict headers: (optional) Request headers
        :param data: (optional) Dictionary, bytes, or file-like object to send in the body
        :param timeout: (optional), How long to wait for the server
            to send data before giving up, as a float,
            or a (connect timeout, read timeout) float tuple.
            Default is :py:attr:`self.timeout`
        :type timeout: float | tuple(float, float)
        :rtype: T <= :py:class:`HttpResponse`
        :return: HttpResponse instance
        r   ©r
   r   r   Údatar	   r   r   r   Úpost;   r   zAsyncHttpClient.postc                 Ã   r   )a@  DELETE request.

        :param str url: Request url
        :param dict headers: (optional) Request headers
        :param data: (optional) Dictionary, bytes, or file-like object to send in the body
        :param timeout: (optional), How long to wait for the server
            to send data before giving up, as a float,
            or a (connect timeout, read timeout) float tuple.
            Default is :py:attr:`self.timeout`
        :type timeout: float | tuple(float, float)
        :rtype: T <= :py:class:`HttpResponse`
        :return: HttpResponse instance
        r   r   r   r   r   ÚdeleteL   r   zAsyncHttpClient.deletec                 Ã   r   )aB  PUT request.

        :param str url: Request url
        :param dict headers: (optional) Request headers
        :param data: (optional) Dictionary, bytes, or file-like object to send in the body
        :param timeout: (optional), How long to wait for the server
            to send data before giving up, as a float,
            or a (connect timeout, read timeout) float tuple.
            Default is :py:attr:`self.timeout`
        :type timeout: float | tuple(float, float)
        :rtype: :py:class:`AsyncHttpResponse`
        :return: AsyncHttpResponse instance
        r   r   r   r   r   Úput]   r   zAsyncHttpClient.put)NNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚDEFAULT_TIMEOUTr   r   r   r   r   r   r   r   r   r   r      s    r   c                   @   sZ   e Zd Z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d„ƒZdS )ÚAsyncHttpResponsezHttpResponse.c                 C   ó   t ‚)zGet status code.r   ©r
   r   r   r   Ústatus_coder   ó   zAsyncHttpResponse.status_codec                 C   r!   )zGet headers.r   r"   r   r   r   r   w   r$   zAsyncHttpResponse.headersc                 Ã   r   )z"Get response body as text-decoded.r   r"   r   r   r   Útext|   ó   €zAsyncHttpResponse.textc                 Ã   r   )zGet response body as binary.r   r"   r   r   r   Úcontent   r&   zAsyncHttpResponse.contentc                 C   r!   )z"Get response body as json-decoded.r   r"   r   r   r   Újson†   r$   zAsyncHttpResponse.jsoné   c                 C   r!   )zXGet response body as iterator content (stream).

        :param int chunk_size:
        r   )r
   Ú
chunk_sizer   r   r   Úiter_content‹   s   zAsyncHttpResponse.iter_contentN)r)   )r   r   r   r   r   r#   r   r%   r'   r(   r   r+   r   r   r   r   r    o   s    




r    N)r   Ú
__future__r   Úabcr   r   r   Úfuture.utilsr   r   r    r   r   r   r   Ú<module>   s   W