
    (phC                        S r SSKrSSKrSSKJrJrJr   SSKrSSK
Jr  SSK
Jr  SSKJr  SSKJr  \R                   " \5      r " S S	\R&                  5      r " S
 S\R(                  5      rg! \ a  r	\" S5      \	eSr	C	ff = f)zCTransport adapter for Asynchronous HTTP Requests based on aiohttp.
    N)AsyncGeneratorMappingOptionalzjThe aiohttp library is not installed from please install the aiohttp package to use the aiohttp transport.)_helpers)
exceptions)	transportc                      \ rS rSrSrS\R                  4S jr\\	R                  " \R                  5      S\4S j5       5       r\\	R                  " \R                  5      S\\\4   4S j5       5       r\	R                  " \R                  5      SS\S\\S	4   4S
 jj5       r\	R                  " \R                  5      S\4S j5       r\	R                  " \R                  5      S 5       rSrg	)Response%   a^  
Represents an HTTP response and its data. It is returned by ``google.auth.aio.transport.sessions.AsyncAuthorizedSession``.

Args:
    response (aiohttp.ClientResponse): An instance of aiohttp.ClientResponse.

Attributes:
    status_code (int): The HTTP status code of the response.
    headers (Mapping[str, str]): The HTTP headers of the response.
responsec                     Xl         g N	_response)selfr   s     T/var/www/html/venv/lib/python3.13/site-packages/google/auth/aio/transport/aiohttp.py__init__Response.__init__1   s    !    returnc                 .    U R                   R                  $ r   )r   statusr   s    r   status_codeResponse.status_code4   s     ~~$$$r   c                     U R                   R                  R                  5        VVs0 s H  u  pX_M	     snn$ s  snnf r   )r   headersitems)r   keyvalues      r   r   Response.headers9   s5     .2^^-C-C-I-I-KL-Kzs
-KLLLs   :
chunk_sizeNc                   #     U R                   R                  R                  U5        S h  vN nU7v   M   N
 g ! [        R                   a  n[
        R                  " S5      UeS nAff = f7f)Nz'Failed to read from the payload stream.)r   contentiter_chunkedaiohttpClientPayloadErrorr   ResponseError)r   r"   chunkexcs       r   r$   Response.content>   sm     	#~~55BB  e    )) 	**9	s=   A0%= ;9;= ;= A0A-A((A--A0c                    #     U R                   R                  5       I S h  vN $  N! [        R                   a  n[        R
                  " S5      UeS nAff = f7f)Nz!Failed to read the response body.)r   readr&   ClientResponseErrorr   r(   )r   r*   s     r   r-   Response.readJ   sP     	Y,,....** 	Y**+NOUXX	Ys0   A( &( A( AAAAc                 @   #    U R                   R                  5         g 7fr   )r   closer   s    r   r1   Response.closeQ   s     s   r   )i   )__name__
__module____qualname____firstlineno____doc__r&   ClientResponser   propertyr   copy_docstringr   r
   intr   r   strr   r   bytesr$   r-   r1   __static_attributes__ r   r   r
   r
   %   s   	"!7!7 " Y//0%S % 1 % Y//0Mc* M 1 M Y//0	 	~eTk7R 	 1	 Y//0YE Y 1Y Y//0 1r   r
   c                       \ rS rSrSrSS\R                  4S jjrSSS\R                  4S\
S\
S	\\   S
\\\
\
4      S\S\R                  4S jjrSS jrSrg)RequestV   a  Asynchronous Requests request adapter.

This class is used internally for making requests using aiohttp
in a consistent way. If you use :class:`google.auth.aio.transport.sessions.AsyncAuthorizedSession`
you do not need to construct or use this class directly.

This class can be useful if you want to configure a Request callable
with a custom ``aiohttp.ClientSession`` in :class:`AuthorizedSession` or if
you want to manually refresh a :class:`~google.auth.aio.credentials.Credentials` instance::

    import aiohttp
    import google.auth.aio.transport.aiohttp

    # Default example:
    request = google.auth.aio.transport.aiohttp.Request()
    await credentials.refresh(request)

    # Custom aiohttp Session Example:
    session = session=aiohttp.ClientSession(auto_decompress=False)
    request = google.auth.aio.transport.aiohttp.Request(session=session)
    auth_sesion = google.auth.aio.transport.sessions.AsyncAuthorizedSession(auth_request=request)

Args:
    session (aiohttp.ClientSession): An instance :class:`aiohttp.ClientSession` used
        to make HTTP requests. If not specified, a session will be created.

.. automethod:: __call__
Nsessionc                     Xl         SU l        g )NF)_session_closed)r   rC   s     r   r   Request.__init__t   s    r   GETurlmethodbodyr   timeoutr   c                   #     U R                   (       a  [        R                  " S5      eU R                  (       d  [        R
                  " 5       U l        [        R                  " US9n[        R                  " [        X!X45        U R                  R                  " UU4UUUS.UD6I Sh  vN n[        R                  " [        U5      I Sh  vN   [        U5      $  N2 N! [        R                   a!  n	[        R                  " SU S35      n
XeSn	A	f[        R                    a!  n	[        R                   " SU S35      nXeSn	A	ff = f7f)	aW  
Make an HTTP request using aiohttp.

Args:
    url (str): The URL to be requested.
    method (Optional[str]):
        The HTTP method to use for the request. Defaults to 'GET'.
    body (Optional[bytes]):
        The payload or body in HTTP request.
    headers (Optional[Mapping[str, str]]):
        Request headers.
    timeout (float): The number of seconds to wait for a
        response from the server. If not specified or if None, the
        requests default timeout will be used.
    kwargs: Additional arguments passed through to the underlying
        aiohttp :meth:`aiohttp.Session.request` method.

Returns:
    google.auth.aio.transport.Response: The HTTP response.

Raises:
    - google.auth.exceptions.TransportError: If the request fails or if the session is closed.
    - google.auth.exceptions.TimeoutError: If the request times out.
zsession is closed.)total)datar   rL   NzFailed to send request to .zRequest timed out after z	 seconds.)rF   r   TransportErrorrE   r&   ClientSessionClientTimeoutr   request_log_LOGGERrequest_helpers_asyncresponse_log_asyncr
   ClientErrorasyncioTimeoutError)r   rI   rJ   rK   r   rL   kwargsclient_timeoutr   
caught_exc
client_exctimeout_excs               r   __call__Request.__call__x   s0    D	.|| //0DEE== ' 5 5 7$22AN  &tE!]]22 &  H !33GXFFFH%% G "" 	-#225OPSuTU3VWJ,## 	.$11*7)9=K -		.sY   EB'C" +C,"C" C C" EC"  C" "E
6DE
)EE

Ec                    #    U R                   (       d3  U R                  (       a"  U R                  R                  5       I Sh  vN   SU l         g N7f)zI
Close the underlying aiohttp session to release the acquired resources.
NT)rF   rE   r1   r   s    r   r1   Request.close   s6      ||--%%''' (s   A AAA)rF   rE   r   )r   N)r3   r4   r5   r6   r7   r&   rR   r   r   _DEFAULT_TIMEOUT_SECONDSr<   r   r=   r   floatr
   ra   r1   r>   r?   r   r   rA   rA   V   s    : 5 5   $/3";;>.>. >. uo	>.
 '#s(+,>. >. 
		>.@r   rA   )r7   rZ   loggingtypingr   r   r   r&   ImportErrorr^   google.authr   r   google.auth.aiorW   r   	getLoggerr3   rU   r
   rA   r?   r   r   <module>rm      s      4 4 ! " 6 %


H
%.y!! .bhi h}  
ts   A/ /B5	A>>B