o
    #`^h*'                     @   s   d Z ddlZddlZddlZddlZddlZddlZddlmZm	Z	 ddl
mZmZ eeZG dd dejZG dd deZdS )	z
    LIFF server API

    LIFF Server API.  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
    N)	urlencode
quote_plus)ApiExceptionApiValueErrorc                   @   s&   e Zd Zdd Zdd ZdddZdS )	RESTResponsec                 C   s    || _ |j| _|j| _|| _d S N)aiohttp_responsestatusreasondata)selfrespr    r   X/home/air/shanriGPT/back/venv/lib/python3.10/site-packages/linebot/v3/liff/async_rest.py__init__   s   
zRESTResponse.__init__c                 C   s   | j jS )z3Returns a CIMultiDictProxy of the response headers.)r   headersr   r   r   r   
getheaders%   s   zRESTResponse.getheadersNc                 C   s   | j j||S )z Returns a given response header.)r   r   get)r   namedefaultr   r   r   	getheader)   s   zRESTResponse.getheaderr   )__name__
__module____qualname__r   r   r   r   r   r   r   r      s    r   c                   @   s   e Zd ZdddZdd Z			ddd	Z		dd
dZ		dddZ			dddZ		dddZ				dddZ
		dddZ			dddZdS )RESTClientObject   Nc                 C   sz   |d u r|j }tj|jd}|jr|j|j|jd |js$d|_tj	|_
tj||d}|j| _|j| _tj|dd| _d S )N)cafile)keyfileF)limitsslT)	connector	trust_env)connection_pool_maxsizer    create_default_contextssl_ca_cert	cert_fileload_cert_chainkey_file
verify_sslcheck_hostname	CERT_NONEverify_modeaiohttpTCPConnectorproxyproxy_headersClientSessionpool_manager)r   configuration
pools_sizemaxsizessl_contextr!   r   r   r   r   0   s(   zRESTClientObject.__init__c                    s   | j  I d H  d S r   )r2   closer   r   r   r   r7   N   s   zRESTClientObject.closeTc	                    s  |  }|dv sJ |r|rtd|pi }|pi }i }|p d}	d|vr)d|d< |||	|d}
| jr8| j|
d< | jr@| j|
d< |rN|
d	  d
t| 7  < |dv rtd|d tjrj|duret	|}||
d< n\|d dkrxt
||
d< nN|d dkr|d= t
 }|D ]'}|\}}t|trt|dkr|j||d |d |d d q||| q||
d< nt|tr||
d< nd}td|d| jjdi |
I dH }|r| I dH }t||}td|j d|j  krdksn t|d|S )aO  Execute request

        :param method: http request method
        :param url: http request url
        :param query_params: query parameters in the url
        :param headers: http request headers
        :param body: request json body, for `application/json`
        :param post_params: request post parameters,
                            `application/x-www-form-urlencoded`
                            and `multipart/form-data`
        :param _preload_content: this is a non-applicable field for
                                 the AiohttpClient.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        )GETHEADDELETEPOSTPUTPATCHOPTIONSz9body parameter cannot be used with post_params parameter.i,  zContent-Typezapplication/json)methodurltimeoutr   r/   r0   r@   ?)r;   r<   r=   r>   r:   jsonNr   z!application/x-www-form-urlencodedzmultipart/form-data      r      )valuefilenamecontent_typezCannot prepare a request message for provided
                         arguments. Please check that your arguments match
                         declared content type.)r	   r
   zresponse body: %s   i+  )	http_respr   )upperr   r/   r0   r   research
IGNORECASErC   dumpsr-   FormData
isinstancetuplelen	add_fieldbytesr   r2   requestreadr   loggerdebugr   r	   )r   r?   r@   query_paramsr   bodypost_params_preload_content_request_timeoutrA   argsr   paramkvmsgrr   r   r   rW   Q   sp   








zRESTClientObject.requestc                       | j d|||||dI d H S )Nr8   r   r^   r_   r[   rW   r   r@   r   r[   r^   r_   r   r   r   get_request      zRESTClientObject.get_requestc                    rf   )Nr9   rg   rh   ri   r   r   r   head_request   rk   zRESTClientObject.head_requestc              
      "   | j d|||||||dI d H S )Nr>   r   r[   r]   r^   r_   r\   rh   r   r@   r   r[   r]   r\   r^   r_   r   r   r   options_request      z RESTClientObject.options_requestc              	      s    | j d||||||dI d H S )Nr:   )r   r[   r^   r_   r\   rh   )r   r@   r   r[   r\   r^   r_   r   r   r   delete_request   s   zRESTClientObject.delete_requestc              
      rm   )Nr;   rn   rh   ro   r   r   r   post_request   rq   zRESTClientObject.post_requestc              
      rm   )Nr<   rn   rh   ro   r   r   r   put_request   s   zRESTClientObject.put_requestc              
      rm   )Nr=   rn   rh   ro   r   r   r   patch_request   rq   zRESTClientObject.patch_request)r   N)NNNNTN)NNTN)NNNTN)r   r   r   r   r7   rW   rj   rl   rp   rr   rs   rt   ru   r   r   r   r   r   .   s>    

h



	


r   )__doc__iorC   loggingrM   r    r-   urllib.parser   r   linebot.v3.liff.exceptionsr   r   	getLoggerr   rY   IOBaser   objectr   r   r   r   r   <module>   s   
