a
    `g%                  	   @   s  U 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ZddlZddl	m
Z
 ddlmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z  ddl!Z!ddl"m#Z#m$Z$m%Z%m&Z& ddl'm(Z( dd	l)m*Z*m+Z+m,Z, dd
l-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZN ddlOmPZPmQZQmRZRmSZSmTZT ddlUmVZVmWZWmXZX ddlYmZZZm[Z[m\Z\m]Z]m^Z^ ddl_m`Z` ddlambZbmcZcmdZdmeZemfZfmgZgmhZhmiZi ddl+mjZjmkZkmlZlmmZm ddlnmoZompZpmqZq ddlrmsZsmtZt ddlumvZvmwZwmxZxmyZymzZz dZ{ervddl|m}Z} ndZ}ej~dkrerddlmZ G dd deddZe!jddddG d d! d!Zed"d#d$Zee ed%< eh d&Zed'eQeWZeeQegef ZG d(d) d)ZG d*d+ d+eeeef ee ZeeQ ZeeW ZG d,d- d-Zej~dkrere+jddd.eezekee[ eej ee ed/d0d1Zn0e+jddd.eezekee[ eej eed/d2d1ZdS )3zHTTP Client for asyncio.    N)suppress)TracebackType)TYPE_CHECKINGAny	AwaitableCallable	CoroutineFinal	FrozenSet	GeneratorGenericIterableListMappingOptionalSetTupleType	TypedDictTypeVarUnion)CIMultiDict	MultiDictMultiDictProxyistr)URL   )hdrshttppayload)WebSocketDataQueue)AbstractCookieJar)ClientConnectionErrorClientConnectionResetErrorClientConnectorCertificateErrorClientConnectorDNSErrorClientConnectorErrorClientConnectorSSLErrorClientErrorClientHttpProxyErrorClientOSErrorClientPayloadErrorClientProxyConnectionErrorClientResponseErrorClientSSLErrorConnectionTimeoutErrorContentTypeError
InvalidURLInvalidUrlClientErrorInvalidUrlRedirectClientErrorNonHttpUrlClientErrorNonHttpUrlRedirectClientErrorRedirectClientErrorServerConnectionErrorServerDisconnectedErrorServerFingerprintMismatchServerTimeoutErrorSocketTimeoutErrorTooManyRedirectsWSMessageTypeErrorWSServerHandshakeError)ClientRequestClientResponseFingerprintRequestInfo_merge_ssl_params)DEFAULT_WS_CLIENT_TIMEOUTClientWebSocketResponseClientWSTimeout)HTTP_AND_EMPTY_SCHEMA_SETBaseConnectorNamedPipeConnectorTCPConnectorUnixConnector)	CookieJar)	_SENTINELDEBUGEMPTY_BODY_METHODS	BasicAuthTimeoutHandleget_env_proxy_for_urlsentinelstrip_auth_from_url)WS_KEYHttpVersionWebSocketReaderWebSocketWriter)WSHandshakeError
ws_ext_genws_ext_parse)TraceTraceConfig)JSONEncoderLooseCookiesLooseHeadersQueryStrOrURL)*r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r6   r4   r3   r5   r7   r8   r9   r:   r;   r<   r>   r?   r@   rA   rB   rH   rJ   rK   rI   rE   ClientSessionClientTimeoutrF   requestr=   )
SSLContext      )Unpackc                   @   s~  e Zd ZU eed< eed< eed< eedf ed< eedf ed< ee	e
 df ed< eedf ed< eed	< eed
< ee
edf ed< eedf ed< eed< edeeeged f f ed< eed< eedf ed< eedf ed< ded< eeeef ed< ee
df ed< eedf ed< eee
ef df ed< eedf ed< eedf ed< eedf ed< eedf ed< dS )_RequestOptionsparamsdatajsonNcookiesheadersskip_auto_headersauthallow_redirectsmax_redirectscompresschunked	expect100raise_for_statusread_until_eofproxy
proxy_authz%Union[ClientTimeout, _SENTINEL, None]timeoutsslserver_hostnameproxy_headerstrace_request_ctxread_bufsizeauto_decompressmax_line_sizemax_field_size)__name__
__module____qualname__ra   __annotations__r   r   r_   r`   r   strrP   boolintr   r@   r   rb   rf   rA   r    r   r   \/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/aiohttp/client.pyrk      s2   
 rk   FtotalT)Zauto_attribsfrozenslotsc                   @   sZ   e Zd ZU dZee ed< dZee ed< dZee ed< dZ	ee ed< dZ
eed< dS )rd   Nr   connect	sock_readsock_connect   ceil_threshold)r   r   r   r   r   floatr   r   r   r   r   r   r   r   r   rd      s
   
rd   i,     )r   r   DEFAULT_TIMEOUT>   PUTOPTIONSGETTRACEDELETEHEAD_RetTypec                !       s  e Zd ZU dZeg dZdZeej	 e
d< dZee e
d< dddddddddejeeeejdddededddddd	d	d
d dee ee eej ee ee ee ee eee  ee eee ee ee eee  e!e"e!e#ege$d f f e"e%e&f ee% e"e'e(f e!e!e!ee)e*  e+e+e+e,ddddZ-ed  ddddZ.e/rbee0dd fddZ1e2fe0ddddZ3e4j5dkre6reee7e8 ddddZ9neee0ddddZ9ee:dd d!Z;ddddddddd"dddddddedddddddddddd#eee<e0e0ee ee eee  ee e!e+e"ee!df ee! e!e"de!e#ege$d f f e!ee ee e"e(e&f ee! ee= ee> e"e>e!e?f ee ee ee@ee0f  ee+ ee! ee+ ee+ ed$d%d&ZAeBjCd'eddddddddddddddddd(d)d*eeee e"eDe&f ee% e!e!ee% ee ee e<ee ee ee e"e>e!e?f ee! ee= ee> ee ee e+e+d+d,d-d.ZEeBjCd'eddddddddddddddddd(d)d*eeee e"eDe&f ee% e!e!ee% ee ee e<ee ee ee e"e>e!e?f ee! ee= ee> ee ee e+e+ed,d/d0ZFee d1d2d3d4ZGe4j5dkre6ree7e8 dd5d6d7ZHee7e8 dd5d8d9ZIee7e8 dd5d:d;ZJee7e8 dd5d<d=ZKee7e8 dd5d>d?ZLee7e8 dd5d@dAZMee7e8 dd5dBdCZNnddDee!e0ddEdFd7ZHddDee!e0ddEdGd9ZIddDee!e0ddEdHd;ZJddIee0e0ddJdKd=ZKddIee0e0ddJdLd?ZLddIee0e0ddJdMdAZMee0dd5dNdCZNddOdPdQZOePe!dOdRdSZQePee dOdTdUZRePe dOdVdWZSePeTe+e+f dOdXdYZUePe!dOdZd[ZVeVjWe!dd\d]d[ZVePejdOd^d_ZXePe(dOd`daZYePd1dOdbdcZZePe[e\ dOdddeZ]ePee dOdfdgZ^ePedOdhdiZ_ePe!dOdjdkZ`ePe"e!e#ege$d f f dOdldmZaePe!dOdndoZbePe!dOdpdqZcePe)e* dOdrdsZdddOdtduZeddOdvdwZfeeeg  eeg eeh ddxdydzZid dOd{d|Zjeeeg  eeg eeh ddxd}d~Zk  ZlS )rc   z/First-class interface for making HTTP requests.)	_base_url_base_url_origin_source_traceback
_connector_loop_cookie_jar_connector_owner_default_auth_version_json_serialize_requote_redirect_url_timeout_raise_for_status_auto_decompress
_trust_env_default_headers_skip_auto_headers_request_class_response_class_ws_response_class_trace_configs_read_bufsize_max_line_size_max_field_size_resolve_charset_default_proxy_default_proxy_auth_retry_connectionrequote_redirect_urlNr   r   TF   i  c                 C   s   dS )Nzutf-8r   )rbr   r   r   <lambda>,      zClientSession.<lambda>)	connectorloopro   rp   rz   r{   rq   rr   json_serializerequest_classresponse_classws_response_classversion
cookie_jarconnector_ownerrx   read_timeoutconn_timeoutr|   r   	trust_envr   trace_configsr   r   r   fallback_charset_resolver)base_urlr   r   ro   rp   rz   r{   rq   rr   r   r   r   r   r   r   r   rx   r   r   r|   r   r   r   r   r   r   r   r   returnc                C   s  d | _ |d u r|d ur|j}|p&t }|d u s:t|trX|| _|d u rLd n| | _n&t|| _| j | _| jj	s~J d| jd ur| jj
dstd|tu s|d u rt| _|turtjdtdd tj| j|d| _|d urXtj| j|d| _tjd	tdd nJt|ts.td
t| d|| _|turFtd|d urXtd|d u rlt|d}|j|urtd|| _| rttd| _|d u rt|d}|| _ |r| j !| || _ || _"|	| _#|| _$|
| _%|| _&|| _'|| _(|| _)|| _*|| _+|| _,|r&t-|}nt- }|| _.|d urRt/dd |D | _0nt/ | _0|| _1|| _2|| _3|ptg | _4| j4D ]}|5  q~|| _6|| _7|| _8d| _9d S )Nz Only absolute URLs are supported/z!base_url must have a trailing '/'z8read_timeout is deprecated, use timeout argument instead   
stacklevelr   )r   z8conn_timeout is deprecated, use timeout argument insteadztimeout parameter cannot be of z. type, please use 'timeout=ClientTimeout(...)'zGread_timeout and timeout parameters conflict, please setup timeout.readzJconn_timeout and timeout parameters conflict, please setup timeout.connectr   z0Session and connector has to use same event loopr   c                 s   s   | ]}t |V  qd S Nr   .0ir   r   r   	<genexpr>  r   z)ClientSession.__init__.<locals>.<genexpr>T):r   r   asyncioget_running_loop
isinstancer   r   originr   absolutepathendswith
ValueErrorrS   r   r   warningswarnDeprecationWarningattrevolverd   typerJ   RuntimeError	get_debug	tracebackextract_stacksys	_getframer   rL   r   update_cookiesr   r   r   r   r   r   r   r   r   r   r   r   r   	frozensetr   r   r   r   r   freezer   r   r   r   )selfr   r   r   ro   rp   rz   r{   rq   rr   r   r   r   r   r   r   r   rx   r   r   r|   r   r   r   r   r   r   r   r   real_headerstrace_configr   r   r   __init__  s    $











zClientSession.__init__)clsr   c                 C   s   t jd| jtdd d S )Nz6Inheritance class {} from ClientSession is discouragedr   r   )r   r   formatr   r   )r   r   r   r   __init_subclass__  s    zClientSession.__init_subclass__)namevalr   c                    s2   || j vr tjd|tdd t || d S )Nz8Setting custom ClientSession.{} attribute is discouragedr   r   )ATTRSr   r   r   r   super__setattr__)r   r   r   	__class__r   r   r     s    
zClientSession.__setattr__)	_warningsr   c                 C   sV   | j sRd| i}|jd| tfi | | dd}| jd urF| j|d< | j| d S )NsourcezUnclosed client session zUnclosed client session)Zclient_sessionmessagesource_traceback)closedr   ResourceWarningr   r   call_exception_handler)r   r  kwargscontextr   r   r   __del__  s    



zClientSession.__del__rg   _RequestContextManager)methodurlr
  r   c                 K   s   d S r   r   r   r  r  r
  r   r   r   re     s    zClientSession.requestc                 K   s   t | j||fi |S )zPerform HTTP request.)r  _requestr  r   r   r   re     s    )
str_or_urlr   c                 C   s0   t |}| jd u r|S |jr J | j|S d S r   )r   r   r   join)r   r  r  r   r   r   
_build_url  s
    

zClientSession._build_url
   )rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   
verify_sslfingerprintssl_contextr}   r~   r   r   r   r   r   r   )r  r  rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r  r  r  r}   r~   r   r   r   r   r   r   r   c          :         s
	   j rtdt||||}|d ur6|d ur6tdn|d urNtj| jd}t|tsl|d urlt	
dt d}g }  j}!|pi } |}z |}"W n. ty }# zt||#W Y d }#~#n
d }#~#0 0  jd usJ |"j jjvrt|"|d urdd |D  jB }$n jr j}$nd }$|d u r2 j}|d u rB j}|d u rRd }nH |}zt|}W n0 ty }# zt||#W Y d }#~#n
d }#~#0 0 |tu r j}%nt|tst|d}%n|}%t j|%j|%jd	}&|&  }'|d u r j!}|d u r j"}|d u r j#}|d u r$ j$} fd
d j%D }(|(D ] })|)&||"'||I d H  q>|&( }*z0|*n  j)o|t*v }+t+|"\}"},|"j,s|rt-nt}-|-|"| s|	r|,rtd|	d u s| r|,d ur|,}	|	d u r j.r j/r j0|"1 kr j.}	|d ur>|	d ur>t2j3|v r>td j45|"}.|d urt6 j4j7d}/|/8| |/5|"}0|0r|.9|0 |d urt|}n> j:rt;t< t=|"\}}W d    n1 s0    Y   j>||"|||$||.|	|!||| j j?|||* |d ur|nd|||( j@d}1z jjA|1|(|%dI d H }2W n8 tBjCyx }3 ztDd|" |3W Y d }3~3n
d }3~30 0 |2jEd usJ |2jFd usJ |2jFjG|*|tHv |||%jI| jjJ||d	 zlzH|1K|2I d H }4z|4 |2I d H  W n tLy   |4M   Y n0 W n tLy*   |2M   Y n0 W n tNtOfyX   |+rRd}+Y q Y nb tPyl    Y nN tQy }3 z4|3jRd u rt|3tBjCr tN|3jS |3W Y d }3~3n
d }3~30 0 |4jT }rֈ j48||4jU |4jVdv r|
r|(D ]"})|)W||"'|||4I d H  q|d7 }| X|4 |rN||krN|4M  tY| d jZt[| |4jVdkrh|4j\t2j]ks|4jVdv r|4j\t2j^krt2j_}d }|`t2jar|bt2ja |4jc`t2jdp|4jc`t2je}5|5d u rԐqn|4f  zt|5 jg d}6W n2 ty" }# zt-|5d|#W Y d }#~#n
d }#~#0 0 |6j}7|7thvrF|4M  ti|5n|7sV|"j|6}6z|61 }8W n2 ty }9 zt-|6d|9W Y d }9~9n
d }9~90 0 |"1 |8krd }	|bt2j3d  |6}"i }|4f  qqҐqW d    n1 s0    Y  |d u r jk}|d u rn(tl|r(||4I d H  n|r6|4m  |'d urd|4jnd ur\|4jno|'jp n|'p  t[| |4_q|(D ]"})|)r||"'|||4I d H  qr|4W S  tL	y }# zP|&M  |'r|'p  d }'|(D ]"})|)s||"'|||#I d H  qʂ W Y d }#~#n
d }#~#0 0 d S )NzSession is closedz9data and json parameters can not be used at the same time)dumpszChunk size is deprecated #1615r   c                 S   s   h | ]}t |qS r   r   r   r   r   r   	<setcomp>!  s   z)ClientSession._request.<locals>.<setcomp>r   )r   c                    s    g | ]}t  ||jd qS ))r   )r\   Ztrace_config_ctx)r   r   r   r   r   r   
<listcomp>Q  s   
z*ClientSession._request.<locals>.<listcomp>z<Cannot combine AUTH argument with credentials encoded in URLzTCannot combine AUTHORIZATION header with AUTH argument or credentials encoded in URL)quote_cookieT)rl   rp   rq   rm   ro   rr   r   ru   rv   rw   r   r   rz   r{   timersessionr}   r~   r   tracesr   )r   r|   zConnection timeout to host )	r  Zskip_payloadry   r   r   r   Ztimeout_ceil_thresholdr   r   F)-  .  /  i3  i4  r   r#  )r!  r"  )encodedzHServer attempted redirecting to a location that does not look like a URLzInvalid redirect URL origin)tr  r   rC   r   r   ZJsonPayloadr   r   r   r   r   r   r   _prepare_headersr  r2   r   schemeZallowed_protocol_schema_setr4   r   r   r   r   r1   rS   r   rd   rQ   r   r   r   startr   r   r   r   r   Zsend_request_startZupdate_queryr  r   IDEMPOTENT_METHODSrT   Zraw_hostr3   r   r   r   r   r   ZAUTHORIZATIONr   Zfilter_cookiesrL   r  r   loadr   r   LookupErrorrR   r   r   r   r   r   TimeoutErrorr/   	transportprotocolZset_response_paramsrO   r   Z_timeout_ceil_thresholdsendBaseExceptioncloser*   r8   r(   OSErrorerrnoargs_cookiesr  statusZsend_request_redirectappendr<   request_infotupler  	METH_HEAD	METH_POSTMETH_GETgetZCONTENT_LENGTHpoprp   ZLOCATIONURIreleaser   rG   r5   r  r   callablerx   
connectionZadd_callbackcancelZ_historyZsend_request_endZsend_request_exception):r   r  r  rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r  r  r  r}   r~   r   r   r   r   r   r   Z	redirectshistoryr   r  eZskip_headersZreal_timeouttmhandler   tracer  Zretry_persistent_connectionZauth_from_urlZerr_exc_clsZall_cookiesZtmp_cookie_jarZreq_cookiesreqconnexcrespZr_urlZparsed_redirect_urlr&  Zredirect_originZorigin_val_errr   r  r   r    s(   )
 




 




	






,"






(




zClientSession._requestr   r   i  @ r  	protocolsr|   receive_timeout	autocloseautoping	heartbeatrr   r   rl   rp   rz   r{   r}   r  r  r  r~   r   ru   max_msg_size_WSRequestContextManager)r  r  rM  r|   rN  rO  rP  rQ  rr   r   rl   rp   rz   r{   r}   r  r  r  r~   r   ru   rR  r   c                C   s:   t | j|||||||||	|
||||||||||||dS )zInitiate websocket connection.rL  )rS  _ws_connect)r   r  r  rM  r|   rN  rO  rP  rQ  rr   r   rl   rp   rz   r{   r}   r  r  r  r~   r   ru   rR  r   r   r   
ws_connect`  s4    zClientSession.ws_connectc          ,         s  |t ur4t|tr|}q8tjdtdd t|d}nt}|d ur^tjdtdd tj||d}|d u rnt	 }nt	|}t
jdt
jdt
jd	i}| D ]\}}||| qttd
}| |t
j< |rd||t
j< |
d ur|
|t
j< |rt|d}||t
j< |d u r&tjdtdd d}t||||}| j||||d|	|||||dI d H }zX|jdkrt|j|j d|j|j!d|j!"t
jd# dkrt|j|j d|j|j!d|j!"t
jd# dkrt|j|j d|j|j!d|j!"t
j$d}tt%&|t' (  } || kr<t|j|j d|j|j!dd }!|rt
j|j!v rdd |j!t
j )dD }"|"D ]}#|#|v rt|#}! qqtd}$|r|j!"t
j}%|%r
zt*|%\}}$W nH t+y }& z.t|j|j |&j,d |j|j!d|&W Y d }&~&n
d }&~&0 0 nd}d}$|j-}'|'d us&J |'j.}(|(d us:J |j/d u rNd |(_0n|(j0d urjt1|j/|(j0|(_0|'j2})|)d us~J t3|(d| j4d}*|(5t6|*||* t7|(|)d||$d}+W n t8y   |9   Y n$0 | j:|*|+|!||||| j4|||$dS d S ) Nzeparameter 'timeout' of type 'float' is deprecated, please use 'timeout=ClientWSTimeout(ws_close=...)'r   r   )Zws_closezofloat parameter 'receive_timeout' is deprecated, please use parameter 'timeout=ClientWSTimeout(ws_receive=...)')
ws_receiveZ	websocketZUpgradeZ13   ,)ru   z+ssl=None is deprecated, please use ssl=TrueTF)	rl   rp   ry   rr   rz   r{   r}   r~   r   e   zInvalid response status)r  r5  rp    zInvalid upgrade headerupgradezInvalid connection headerzInvalid challenge responsec                 S   s   g | ]}|  qS r   )strip)r   protor   r   r   r  &  s   z-ClientSession._ws_connect.<locals>.<listcomp>r   r   r   )Zuse_maskru   
notakeover)rQ  ru   Zclient_notakeover);rS   r   rF   r   r   r   rD   r   r   r   r   UPGRADEZ
CONNECTIONZSEC_WEBSOCKET_VERSIONitems
setdefaultbase64	b64encodeosurandomdecodeZSEC_WEBSOCKET_KEYr  ZSEC_WEBSOCKET_PROTOCOLZORIGINrZ   ZSEC_WEBSOCKET_EXTENSIONSrC   re   r5  r>   r7  rC  rp   r<  lowerZSEC_WEBSOCKET_ACCEPThashlibsha1rU   digestsplitr[   rY   r3  rA  r-  rV  r   maxr,  r    r   
set_parserrW   rX   r/  r0  r   ),r   r  r  rM  r|   rN  rO  rP  rQ  rr   r   rl   rp   rz   r{   r}   r  r  r  r~   r   ru   rR  Z
ws_timeoutr   default_headerskeyvalueZsec_keyZextstrrK  Zr_keymatchr-  Zresp_protocolsr]  r^  Zcompress_hdrsrJ  rI  Z
conn_protor,  readerwriterr   r   r   rT    s6   




	
	


zClientSession._ws_connectzCIMultiDict[str])rp   r   c                 C   sh   t | j}|rdt|ttfs$t |}t }| D ]0\}}||v rP||| q2|||< || q2|S )z3Add default headers and transform it to CIMultiDict)r   r   r   r   r   setr`  add)r   rp   resultZadded_namesro  rp  r   r   r   r%  o  s    
zClientSession._prepare_headers)r  r
  r   c                 K   s   d S r   r   r   r  r
  r   r   r   r<    s    zClientSession.getc                 K   s   d S r   r   rw  r   r   r   options  s    zClientSession.optionsc                 K   s   d S r   r   rw  r   r   r   head  s    zClientSession.headc                 K   s   d S r   r   rw  r   r   r   post  s    zClientSession.postc                 K   s   d S r   r   rw  r   r   r   put  s    zClientSession.putc                 K   s   d S r   r   rw  r   r   r   patch  s    zClientSession.patchc                 K   s   d S r   r   rw  r   r   r   delete  s    zClientSession.delete)rs   )r  rs   r
  r   c                K   s   t | jtj|fd|i|S )zPerform HTTP GET request.rs   )r  r  r   r;  r   r  rs   r
  r   r   r   r<    s    c                K   s   t | jtj|fd|i|S )zPerform HTTP OPTIONS request.rs   )r  r  r   ZMETH_OPTIONSr~  r   r   r   rx    s    c                K   s   t | jtj|fd|i|S )zPerform HTTP HEAD request.rs   )r  r  r   r9  r~  r   r   r   ry    s    )rm   )r  rm   r
  r   c                K   s   t | jtj|fd|i|S )zPerform HTTP POST request.rm   )r  r  r   r:  r   r  rm   r
  r   r   r   rz    s    c                K   s   t | jtj|fd|i|S )zPerform HTTP PUT request.rm   )r  r  r   ZMETH_PUTr  r   r   r   r{    s    c                K   s   t | jtj|fd|i|S )zPerform HTTP PATCH request.rm   )r  r  r   Z
METH_PATCHr  r   r   r   r|    s    c                 K   s   t | jtj|fi |S )zPerform HTTP DELETE request.)r  r  r   ZMETH_DELETErw  r   r   r   r}    s    r   c                    s0   | j s,| jdur&| jr&| j I dH  d| _dS )zMClose underlying connector.

        Release all acquired resources.
        N)r  r   r   r0  r   r   r   r   r0    s    zClientSession.closec                 C   s   | j du p| j jS )z@Is client session closed.

        A readonly property.
        N)r   r  r  r   r   r   r    s    zClientSession.closedc                 C   s   | j S )z(Connector instance used for the session.r   r  r   r   r   r     s    zClientSession.connectorc                 C   s   | j S )zThe session cookies.)r   r  r   r   r   r      s    zClientSession.cookie_jarc                 C   s   | j S )z"The session HTTP protocol version.)r   r  r   r   r   r     s    zClientSession.versionc                 C   s   | j S ))Do URL requoting on redirection handling.)r   r  r   r   r   r   
  s    z"ClientSession.requote_redirect_url)r   r   c                 C   s   t jdtdd || _dS )r  z=session.requote_redirect_url modification is deprecated #2778r   r   N)r   r   r   r   )r   r   r   r   r   r     s    c                 C   s   t jdtdd | jS )zSession's loop.z"client.loop property is deprecatedr   r   )r   r   r   r   r  r   r   r   r     s    zClientSession.loopc                 C   s   | j S )zTimeout for the session.)r   r  r   r   r   r|   !  s    zClientSession.timeoutc                 C   s   | j S )z*The default headers of the client session.)r   r  r   r   r   rp   &  s    zClientSession.headersc                 C   s   | j S )z2Headers for which autogeneration should be skipped)r   r  r   r   r   rq   +  s    zClientSession.skip_auto_headersc                 C   s   | j S )z2An object that represents HTTP Basic Authorization)r   r  r   r   r   rr   0  s    zClientSession.authc                 C   s   | j S )zJson serializer callable)r   r  r   r   r   r   5  s    zClientSession.json_serializec                 C   s   | j S )z-Should connector be closed on session closing)r   r  r   r   r   r   :  s    zClientSession.connector_ownerc                 C   s   | j S )zGShould `ClientResponse.raise_for_status()` be called for each response.)r   r  r   r   r   rx   ?  s    zClientSession.raise_for_statusc                 C   s   | j S )z7Should the body response be automatically decompressed.)r   r  r   r   r   r   F  s    zClientSession.auto_decompressc                 C   s   | j S )z
        Should proxies information from environment or netrc be trusted.

        Information is from HTTP_PROXY / HTTPS_PROXY environment variables
        or ~/.netrc file if present.
        )r   r  r   r   r   r   K  s    zClientSession.trust_envc                 C   s   | j S )z7A list of TraceConfig instances used for client tracing)r   r  r   r   r   r   U  s    zClientSession.trace_configsc                 C   s
   d| _ dS )zwDetach connector from session without closing the former.

        Session is switched to closed state anyway.
        Nr  r  r   r   r   detachZ  s    zClientSession.detachc                 C   s   t dd S )NzUse async with instead)	TypeErrorr  r   r   r   	__enter__a  s    zClientSession.__enter__)exc_typeexc_valexc_tbr   c                 C   s   d S r   r   r   r  r  r  r   r   r   __exit__d  s    zClientSession.__exit__c                    s   | S r   r   r  r   r   r   
__aenter__m  s    zClientSession.__aenter__c                    s   |   I d H  d S r   )r0  r  r   r   r   	__aexit__p  s    zClientSession.__aexit__)N)mr   r   r   __doc__r   r   r   r   r   StackSummaryr   r   rH   rn   r  r?   r@   rE   r   HttpVersion11rS   rb   r   AbstractEventLoopr_   r`   rP   r   r   r^   r   rV   r!   r   r   r   r   r   rM   objectrd   r   r]   r   _CharsetResolverr   r   rN   r   r   r   r  r   version_infor   rj   rk   re   r   r  ra   bytesrf   rA   r   r  r   r;  rF   rU  rT  r%  r<  rx  ry  rz  r{  r|  r}  r0  propertyr  r   r   r   r   r   setterr   r|   rp   r
   r   rq   rr   r   r   rx   r   r   r   r  r  r/  r   r  r  r  __classcell__r   r   r  r   rc      s  
" 



 



   
:
 Z			
		
	
rc   c                   @   s   e Zd ZdZeddef ddddZddddd	Zeedd
ddZ	ddddZ
eedef dddZeedef dddZedddZeee  ee ee ddddZdS )_BaseRequestContextManager)_coro_respasyncio.Future[Any]N)coror   c                 C   s
   || _ d S r   )r  )r   r  r   r   r   r   }  s    z#_BaseRequestContextManager.__init__)argr   c                 C   s   | j |S r   )r  r.  )r   r  r   r   r   r.    s    z_BaseRequestContextManager.send)r3  r
  r   c                 O   s   | j j|i |S r   )r  throw)r   r3  r
  r   r   r   r    s    z _BaseRequestContextManager.throwr  c                 C   s
   | j  S r   )r  r0  r  r   r   r   r0    s    z _BaseRequestContextManager.closec                 C   s   | j  }|S r   )r  	__await__)r   retr   r   r   r    s    
z$_BaseRequestContextManager.__await__c                 C   s   |   S r   )r  r  r   r   r   __iter__  s    z#_BaseRequestContextManager.__iter__c                    s   | j I d H | _| j I d H S r   )r  r  r  r  r   r   r   r    s    z%_BaseRequestContextManager.__aenter__r  rJ  tbr   c                    s   | j |||I d H  d S r   )r  r  r   r  rJ  r  r   r   r   r    s    z$_BaseRequestContextManager.__aexit__)r   r   r   	__slots__r   r   r   r.  r   r  r0  r   r  r  r  r   r   r/  r   r  r   r   r   r   r  y  s   
r  c                   @   s^   e Zd ZdZeddef eddddZeddd	Ze	e
e  e	e e	e dd
ddZdS )_SessionRequestContextManagerr  r  _sessionr  N)r  r  r   c                 C   s   || _ d | _|| _d S r   r  )r   r  r  r   r   r   r     s    z&_SessionRequestContextManager.__init__r  c                    sB   z| j I d H | _W n$ ty6   | j I d H   Y n0 | jS d S r   )r  r  r/  r  r0  r  r   r   r   r    s    z(_SessionRequestContextManager.__aenter__r  c                    s,   | j d usJ | j   | j I d H  d S r   )r  r0  r  r  r   r   r   r    s    
z'_SessionRequestContextManager.__aexit__)r   r   r   r  r   r@   rc   r   r  r   r   r/  r   r  r   r   r   r   r    s   	
r  )r   r   r   )r  r  r   r   r   r
  r   c                K   s   d S r   r   )r  r  r   r   r   r
  r   r   r   re     s    re   c                K   sZ   d}|du rd}t |dd}t||dd||dt||d}t|j| |fi ||S )aB  Constructs and sends a request.

        Returns response object.
        method - HTTP method
        url - request url
        params - (optional) Dictionary or bytes to be sent in the query
        string of the new request
        data - (optional) Dictionary, bytes, or file-like object to
        send in the body of the request
        json - (optional) Any json compatible python object
        headers - (optional) Dictionary of HTTP Headers to send with
        the request
        cookies - (optional) Dict object to send with the request
        auth - (optional) BasicAuth named tuple represent HTTP Basic Auth
        auth - aiohttp.helpers.BasicAuth
        allow_redirects - (optional) If set to False, do not follow
        redirects
        version - Request HTTP version.
        compress - Set to True if request has to be compressed
        with deflate encoding.
        chunked - Set to chunk size for chunked transfer encoding.
        expect100 - Expect 100-continue response from server.
        connector - BaseConnector sub-class instance to support
        connection pooling.
        read_until_eof - Read response until eof if response
        does not have Content-Length header.
        loop - Optional event loop.
        timeout - Optional ClientTimeout settings structure, 5min
        total timeout by default.
        Usage::
        >>> import aiohttp
        >>> async with aiohttp.request('GET', 'http://python.org/') as resp:
        ...    print(resp)
        ...    data = await resp.read()
        <ClientResponse(https://www.python.org/) [200 OK]>
        FNT)r   Zforce_closero   r|   )r   ro   r   r|   r   r   )rJ   rc   r=  rS   r  r  )r  r  r   r   r   r
  r   r  r   r   r   re     s     -

	)r  r   rb  rh  rn   rd  r   r   r   
contextlibr   typesr   typingr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   Z	multidictr   r   r   r   Zyarlr   rZ  r   r   r   Z_websocket.readerr    abcr!   Zclient_exceptionsr"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   Zclient_reqrepr?   r@   rA   rB   rC   Z	client_wsrD   rE   rF   r   rG   rH   rI   rJ   rK   	cookiejarrL   helpersrM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   Zhttp_websocketrY   rZ   r[   tracingr\   r]   Ztypedefsr^   r_   r`   ra   rb   __all__r}   rf   r  rj   rk   srd   r   r   r   r(  r   r  r   r  rc   r  r  rS  r  r  r  re   r   r   r   r   <module>   s   T|(
3          $!