Ë
    õ%9j·+  ã                   óP  — d Z ddlZddlZddlmZmZmZmZmZ 	 ddl	Z	ddlmZ ddlmZ ddlmZ ddlmZ erddl	mZ n	 ddl	mZ  ej(                  e«      Z G d	„ d
ej.                  «      Z G d„ dej0                  «      Zy# e
$ rZ e
d«      e‚dZ[ww xY w# e
ef$ r dZY Œ^w xY w)zBTransport adapter for Asynchronous HTTP Requests based on aiohttp.é    N)ÚAsyncGeneratorÚMappingÚOptionalÚTYPE_CHECKINGÚUnionzjThe aiohttp library is not installed from please install the aiohttp package to use the aiohttp transport.)Ú_helpers)Ú
exceptions)Ú	transport)ÚClientTimeoutc                   óÊ  — e Zd ZdZdej
                  fd„Ze ej                  e
j                  «      defd„«       «       Ze ej                  e
j                  «      deeef   fd„«       «       Z ej                  e
j                  «      ddedeedf   fd	„«       Z ej                  e
j                  «      defd
„«       Z ej                  e
j                  «      d„ «       Zy)ÚResponseaz  
    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                 ó   — || _         y ©N)Ú	_response)Úselfr   s     ú]/var/www/html/truck-me/venv/lib/python3.12/site-packages/google/auth/aio/transport/aiohttp.pyÚ__init__zResponse.__init__9   s	   € Ø!ˆ�ó    Úreturnc                 ó.   — | j                   j                  S r   )r   Ústatus©r   s    r   Ústatus_codezResponse.status_code<   s   € ð �~‰~×$Ñ$Ð$r   c                 ó~   — | j                   j                  j                  «       D ��ci c]  \  }}||“Œ
 c}}S c c}}w r   )r   ÚheadersÚitems)r   ÚkeyÚvalues      r   r   zResponse.headersA   s3   € ð .2¯^©^×-CÑ-C×-IÑ-IÓ-K×L™z˜s E��U‘
ÓLÐLùÓLs   ¨9Ú
chunk_sizeNc                óÞ   K  — 	 | j                   j                  j                  |«      2 3 d {  –—† }|­–— Œ7 Œ
6 y # t        j                  $ r}t        j                  d«      |‚d }~ww xY w­w)Nz'Failed to read from the payload stream.)r   ÚcontentÚiter_chunkedÚaiohttpÚClientPayloadErrorr	   ÚResponseError)r   r    ÚchunkÚexcs       r   r"   zResponse.contentF   st   è ø€ ð	Ø#Ÿ~™~×5Ñ5×BÑBØó ÷ ð �eð ”ðøñ  øô ×)Ñ)ò 	Ü×*Ñ*Ø9óàðûð	üs=   ‚A-„%< ©:­8®:±< ¸:º< »A-¼A*ÁA%Á%A*Á*A-c              ƒ   ó¶   K  — 	 | j                   j                  «       ƒ d {  –—† S 7 Œ# t        j                  $ r}t	        j
                  d«      |‚d }~ww xY w­w)Nz!Failed to read the response body.)r   Úreadr$   ÚClientResponseErrorr	   r&   )r   r(   s     r   r*   zResponse.readR   sQ   è ø€ ð	YØŸ™×,Ñ,Ó.×.Ð.Ð.ùÜ×*Ñ*ò 	YÜ×*Ñ*Ð+NÓOÐUXÐXûð	Yüs0   ‚A„( ¡&¢( ¥A¦( ¨A»AÁAÁAc              ƒ   ó@   K  — | j                   j                  «        y ­wr   )r   Úcloser   s    r   r-   zResponse.closeY   s   è ø€ à�‰×ÑÕùs   ‚)i   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r$   ÚClientResponser   Úpropertyr   Úcopy_docstringr
   r   Úintr   r   Ústrr   r   Úbytesr"   r*   r-   © r   r   r   r   -   s'  „ ñ	ð" ×!7Ñ!7ó "ð Ø€X×Ñ˜Y×/Ñ/Ó0ð%˜Sò %ó 1ó ð%ð Ø€X×Ñ˜Y×/Ñ/Ó0ðM˜  c Ñ*ò Mó 1ó ðMð €X×Ñ˜Y×/Ñ/Ó0ñ	¨ð 	°~ÀeÈTÀkÑ7Rò 	ó 1ð	ð €X×Ñ˜Y×/Ñ/Ó0ðY˜Eò Yó 1ðYð €X×Ñ˜Y×/Ñ/Ó0ñó 1ñr   r   c                   óº   — e Zd ZdZddeej                     fd„Zdddej                  fde
de
dee   d	eee
e
f      d
eeef   dej                   fd„Zdd„Zdd„Zy)ÚRequestaÔ  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_session = 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                 ó    — || _         d| _        y )NF)Ú_sessionÚ_closed)r   r;   s     r   r   zRequest.__init__|   s   € ØˆŒØˆ�r   ÚGETÚurlÚmethodÚbodyr   Útimeoutr   c              ‹   ó  K  — 	 | j                   rt        j                  d«      ‚| j                  st	        j
                  «       | _        t        |t        j                  «      r|}nt	        j                  |¬«      }t        j                  t        ||||«        | j                  j                  ||f|||dœ|¤Žƒ d{  –—† }t        j                  t        |«      ƒ d{  –—†  t        |«      S 7 Œ17 Œ# t        j                  $ r!}	t        j                  d|› d�«      }
|
|	‚d}	~	wt         j"                  $ rJ}	t        |t        j                  «      r|j$                  }n|}t        j"                  d|› d�«      }||	‚d}	~	ww xY w­w)	a÷  
        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   rC   NzFailed to send request to ú.zRequest timed out after z	 seconds.)r>   r	   ÚTransportErrorr=   r$   ÚClientSessionÚ
isinstancer   r   Úrequest_logÚ_LOGGERÚrequestÚ_helpers_asyncÚresponse_log_asyncr   ÚClientErrorÚasyncioÚTimeoutErrorrE   )r   r@   rA   rB   r   rC   ÚkwargsÚclient_timeoutr   Ú
caught_excÚ
client_excÚtimeout_secondsÚtimeout_excs                r   Ú__call__zRequest.__call__€   sp  è ø€ ðD#	.Ø�|Š|Ü ×/Ñ/Ð0DÓEÐEà—=’=Ü '× 5Ñ 5Ó 7�”ä˜'¤7×#8Ñ#8Ô9Ø!(‘ä!(×!6Ñ!6¸WÔ!E�Ü× Ñ ¤¨&°#°t¸WÔEØ2˜TŸ]™]×2Ñ2ØØðð ØØ&ñð ñ÷ ˆHô !×3Ñ3´G¸XÓF×FÐFÜ˜HÓ%Ð%ðøð Gùô ×"Ñ"ò 	-Ü#×2Ñ2Ð5OÐPSÈuÐTUÐ3VÓWˆJØ *Ð,ûä×#Ñ#ò 	.Ü˜'¤7×#8Ñ#8Ô9Ø")§-¡-‘à")�Ü$×1Ñ1Ø*¨?Ð*;¸9ÐEóˆKð  :Ð-ûð	.üsZ   ‚F„B;C5 Â?C1Ã !C5 Ã!C3Ã"C5 Ã0FÃ1C5 Ã3C5 Ã5FÄD$Ä$FÄ:AE?Å?FÆFc              ƒ   ó’   K  — | j                   s.| j                  r"| j                  j                  «       ƒ d{  –—†  d| _         y7 Œ­w)zY
        Close the underlying aiohttp session to release the acquired resources.
        NT)r>   r=   r-   r   s    r   r-   zRequest.closeÇ   s7   è ø€ ð �|Š| §¢Ø—-‘-×%Ñ%Ó'×'Ð'Øˆ�ð (ús   ‚6A¸A¹Ac                 óø  — | j                   rt        j                  d«      ‚| j                  s#t	        j
                  dd¬«      }t        |¬«      S dt        | j                  dd«      dœ}t        | j                  dd«      }|�r|j                  süt        |t        j                  «      rUt	        j                  t        |d	d«      t        |d
d«      t        |dd«      t        |dd«      t        |dd«      ¬«      |d<   n�t        t        dd«      r[t        |t        t        d«      «      rAt        |dd«      }|rSt	        j                  |t        |d
d«      t        |dd«      ¬«      |d<   n!t        j                  dt        |«      › �«      ‚t        | j                  dd«      }|rt        |«      |d<   dD ]$  \  }}t        | j                  |d«      }|€Œ |||<   Œ& t        t	        j
                  di |¤Ž¬«      S )a‡  Creates an independent copy of this request adapter.

        Clones the connection settings, trace configurations, and session defaults
        (headers, cookies, basic auth, and timeouts).

        Only standard `aiohttp.TCPConnector` and `aiohttp.UnixConnector` connectors
        are supported. The DNS resolver is not copied to avoid closing shared resolver
        resources.

        Returns:
            google.auth.aio.transport.aiohttp.Request: A new request adapter.

        Raises:
            google.auth.exceptions.TransportError: If the transport is closed, or if the
                session uses an unsupported connector.
        z Cannot clone a closed transport.FT)Úauto_decompressÚ	trust_env)r;   Ú
_trust_envÚ
_connectorNÚ_sslÚ_limitéd   Ú_limit_per_hostr   Ú_force_closeÚ_local_addr)ÚsslÚlimitÚlimit_per_hostÚforce_closeÚ
local_addrÚ	connectorÚUnixConnectorÚ_path)Úpathrg   ri   z(Unsupported connector type for cloning: Ú_trace_configsÚtrace_configs))Ú_default_headersr   )Ú_cookie_jarÚ
cookie_jar)Ú_default_authÚauth)Ú_timeoutrC   )Ú_json_serializeÚjson_serializer8   )r>   r	   rH   r=   r$   rI   r:   ÚgetattrÚclosedrJ   ÚTCPConnectorrl   ÚtypeÚlist)	r   Únew_sessionÚsession_kwargsÚorig_connectorrn   rp   Ú	attr_nameÚ
kwarg_nameÚvals	            r   Ú_clonezRequest._cloneÏ   sê  € ð" �<Š<Ü×+Ñ+Ð,NÓOÐOà�}Š}Ü!×/Ñ/Ø %ØôˆKô  ;Ô/Ð/ð  %Ü  §¡°¸dÓCñ 
ˆô ! §¡°¸dÓCˆÚ .×"7Ò"7Ü˜.¬'×*>Ñ*>Ô?ô /6×.BÑ.BÜ °¸Ó=Ü! .°(¸CÓ@Ü#*¨>Ð;LÈaÓ#PÜ '¨¸ÈÓ NÜ& ~°}ÀdÓKô/�˜{Ò+ô œ /°4Ô8¼ZØ¤¬°Ó Aô>ô ˜~¨w¸Ó=�ÙÜ29×2GÑ2GØ!Ü% n°hÀÓDÜ$+¨N¸NÈEÓ$Rô3�N ;Ò/ô !×/Ñ/Ø>¼tÀNÓ?SÐ>TÐUóð ô
   §¡Ð/?ÀÓFˆÙÜ.2°=Ó.AˆN˜?Ñ+ð&
ò 		1Ñ!ˆI�zô ˜$Ÿ-™-¨°DÓ9ˆCØ‰Ø-0�˜zÒ*ð		1ô œw×4Ñ4ÑF°~ÑFÔGÐGr   r   )r   N)r   r:   )r.   r/   r0   r1   r   r$   rI   r   r
   Ú_DEFAULT_TIMEOUT_SECONDSr6   r7   r   r   Úfloatr   r   rY   r-   r„   r8   r   r   r:   r:   ^   s§   „ ññ: ¨×)>Ñ)>Ñ ?ó ð Ø $Ø/3Ø/8×/QÑ/QñE.àðE.ð ðE.ð �u‰oð	E.ð
 ˜' # s (Ñ+Ñ,ðE.ð �u˜mÐ+Ñ,ðE.ð 
×	Ñ	óE.óNôNHr   r:   )r1   rQ   ÚloggingÚtypingr   r   r   r   r   r$   ÚImportErrorrU   Úgoogle.authr   r	   Úgoogle.auth.aiorN   r
   r   ÚAttributeErrorÚ	getLoggerr.   rL   r   r:   r8   r   r   ú<module>rŽ      s¸   ðñ Iã Û ß JÕ JðÛõ !Ý "Ý 6Ý %áÞ%ðÝ)ð ˆ'×
Ñ
˜HÓ
%€ô.ˆy×!Ñ!ô .ôbHˆi×Ñõ HøðO ò Ù
Øtóàðûðûð  ˜Ð(ò ØŠðús)   šB Á B ÂBÂ	BÂBÂ	B%Â$B%