§
    TCÄj÷d ã                   ó¼  — d Z ddlZddlmZ ddlZddlm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ZddlZddlZddlmZmZmZmZmZmZmZmZmZ ddlmZ ddlm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) ddl*Z*ddl+m,Z, ddl+m-Z- ddl.Z.ddl/m0Z0 ddl/m1Z1 ddl/m2Z2 ddl3m4Z4 ddl3m5Z5 ddl3m6Z7 ddl3m8Z8 ddl3m9Z9 	 ddl:m;Z< n# e=$ r	 ddl>m;Z< Y nw xY wdZ?	 ddl@Z@dZ?n# eA$ r Y nw xY w	 ddlBZBn# eA$ r dZBY nw xY werddlCmDZD ddlEmFZF ddlGmHZH  e
jI        d¦  «        ZJdZKdZLdZMdZNd ZOd!d"hZPeB€e*jQ        fne*jQ        eBjQ        fZReB€e*jS        fne*jS        eBjS        fZTeB€e*jU        e*jV        fne*jU        e*jV        eBjU        eBjV        fZW G d#„ d$eX¦  «        ZYd%eeZ         fd&„Z[d'e\eZeZf         d%dfd(„Z]d)e4d*e4d%e4fd+„Z^d'e\eZeZf         d,eee_e`f                  d%dfd-„Zad.eZd/eZd%eZfd0„Zbd1eeZdf         d%ee%eZf         fd2„Zcd3e%d%e%fd4„Zdd5eee_e`f                  d%ee_         fd6„Zee G d7„ d8¦  «        ¦   «         Zf G d9„ d:¦  «        Z6d;Zgd<Zhd=Zid ZjdZkd>Zld)ee8         d%e0jm        fd?„Zn G d@„ dAe*jo        ¦  «        Zp G dB„ dCe*jq        ¦  «        Zr G dD„ dE¦  «        ZsdFdEd3e#jt        ju        j%        d%eZfdG„ZvdFdEd3e#jt        ju        j%        d%eZfdH„ZwdS )IzŽBase client for calling HTTP APIs sending and receiving JSON.

The BaseApiClient is intended to be a private module and is subject to change.
é    N)Ú	Generator)Ú	dataclass)	ÚAnyÚAsyncIteratorÚIteratorÚOptionalÚTYPE_CHECKINGÚTupleÚUnionÚcastÚoverload)Úurlparse)Ú
urlunparse)ÚCredentials)Úmtls)Ú
exceptions)Ú	BaseModel)ÚValidationErroré   )Ú_common)Úerrors)Úversion)ÚHttpOptions)ÚHttpOptionsOrDict)ÚHttpResponse)ÚHttpRetryOptions)ÚResourceScope)ÚconnectFT©ÚAuthorizedSession)ÚCIMultiDictProxy)ÚCaseInsensitiveDictzgoogle_genai._api_clienti  € i  @ é   é   ÚusÚeuc                   ó   — e Zd ZdZdS )ÚEphemeralTokenAPIKeyErrorz)Error raised when the API key is invalid.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    ú\C:\Projects\Historical\FacebookAutoPoster\venv\Lib\site-packages\google/genai/_api_client.pyr(   r(   {   s   € € € € € Ø1Ð1Ð1Ð1r.   r(   Úreturnc                  óÊ   — t           j                             dd¦  «        } t           j                             dd¦  «        }| r|rt                               d¦  «         | p|pdS )zµGets the API key from environment variables, prioritizing GOOGLE_API_KEY.

  Returns:
      The API key string if found, otherwise None. Empty string is considered
      invalid.
  ÚGOOGLE_API_KEYNÚGEMINI_API_KEYzEBoth GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.)ÚosÚenvironÚgetÚloggerÚwarning)Úenv_google_api_keyÚenv_gemini_api_keys     r/   Úget_env_api_keyr;   �   sn   € õ ”z—~’~Ð&6¸Ñ=Ô=ÐÝ”z—~’~Ð&6¸Ñ=Ô=ÐØð Ð.ð Ý
‡N‚NØOñô ð ð 
Ð	9Ð1Ð	9°TÐ9r.   Úheadersc                 ó¨  — dt           j        › �}dt          j                              ¦   «         d         z   }|› d|› �}d| v r|| d         vr|› d�| d         z   | d<   n(d| v r|| d         vr| d         › d|› �| d<   n	d| vr|| d<   d| v r|| d         vr|› d�| d         z   | d<   dS d| v r|| d         vr| d         › d|› �| d<   dS d| vr|| d<   dS dS )z1Appends the telemetry header to the headers dict.zgoogle-genai-sdk/z
gl-python/r   ú z
user-agentzx-goog-api-clientN)r   Ú__version__ÚsysÚsplit)r<   Úlibrary_labelÚlanguage_labelÚversion_header_values       r/   Úappend_library_version_headersrE   ’   s�  € à;¥gÔ&9Ð;Ð;€-Ø¥#¤+×"3Ò"3Ñ"5Ô"5°aÔ"8Ñ8€.Ø)Ð<Ð<¨NÐ<Ð<Ðà�gÐÐØ
˜w |Ô4Ð
4Ð
4à3Ð6Ð6Ð6¸ÀÔ9NÑN€GˆLÑÐØ�wÐÐ >¸ÀÔ9NÐ#NÐ#NØ& |Ô4ÐGÐG°~ÐGÐG€GˆLÑÐØ˜7Ð"Ð"Ø0€GˆLÑà˜WÐ$Ð$Ø
˜wÐ':Ô;Ð
;Ð
;ð  Ð"Ð"Ð" WÐ-@Ô%AÑAð ÐÑ Ð Ð ð ˜WÐ$Ð$Ø
 Ð(;Ô <Ð
<Ð
<ð Ð&Ô'Ð:Ð:¨.Ð:Ð:ð ÐÑ Ð Ð ð  'Ð)Ð)Ø#7€GÐÑ Ð Ð ð *Ð)r.   ÚoptionsÚpatch_optionsc           	      óz  — |                       ¦   «         }|j        pi }|j        pi }i |¥|¥|_        t          j                             ¦   «         }|D ]M}|dk    rŒ	t          ||d ¦  «        }|�t          |||¦  «         Œ.t          ||t          | |¦  «        ¦  «         ŒN|j        �t          |j        ¦  «         |S )Nr<   )Ú
model_copyr<   r   Úmodel_fieldsÚkeysÚgetattrÚsetattrrE   )rF   rG   Úcopy_optionÚoptions_headersÚpatch_options_headersÚhttp_options_keysÚkeyÚpatch_values           r/   Úpatch_http_optionsrT   ²   sé   € ð ×"Ò"Ñ$Ô$€+àÔ'Ð-¨2€/Ø'Ô/Ð5°2ÐðØðàð€+Ôõ
 "Ô.×3Ò3Ñ5Ô5Ðàð 7ð 7€cØ
ˆiÒÐØÝ˜-¨¨dÑ3Ô3€KØÐÝˆk˜3 Ñ,Ô,Ð,Ð,åˆk˜3¥¨°Ñ 5Ô 5Ñ6Ô6Ð6Ð6àÔÐ$Ý" ;Ô#6Ñ7Ô7Ð7Ø	Ðr.   Útimeout_in_secondsc                 ób   — |r*d| vr(t          t          j        |¦  «        ¦  «        | d<   dS dS dS )z8Populates the server timeout header in the headers dict.zX-Server-TimeoutN)ÚstrÚmathÚceil)r<   rU   s     r/   Úpopulate_server_timeout_headerrZ   Î   sN   € ð ð EÐ.°gÐ=Ð=Ý"%¥d¤iÐ0BÑ&CÔ&CÑ"DÔ"D€GÐÑÐÐðEð EÐ=Ð=r.   Úbase_urlÚpathc                 ó  — t          | ¦  «        }|j                             d¦  «        r|j        d d…         n|j        }|                     d¦  «        r
|dd …         n|}t	          |                     |dz   |z   ¬¦  «        ¦  «        S )Nú/éÿÿÿÿr   )r\   )r   r\   ÚendswithÚ
startswithr   Ú_replace)r[   r\   Úparsed_baseÚ	base_paths       r/   Újoin_url_pathre   Ö   s’   € Ý˜Ñ"Ô"€+ð 
Ô	×	"Ò	" 3Ñ	'Ô	'ð€kÔ�s˜�sÔÐàÔð ð
 —_’_ SÑ)Ô)Ð	3ˆˆaˆbˆbŒˆ¨t€$Ý	�K×(Ò(¨i¸#©oÀÑ.DÐ(ÑEÔEÑ	FÔ	FÐFr.   Úprojectc                 ó|   — t           j                             dg¬¦  «        \  }}| s|} | st          d¦  «        ‚|| fS )z-Loads google auth credentials and project id.z.https://www.googleapis.com/auth/cloud-platform)Úscopesz@Could not resolve project using application default credentials.)ÚgoogleÚauthÚdefaultÚ
ValueError)rf   ÚcredentialsÚloaded_project_ids      r/   Ú	load_authro   á   sc   € å#)¤;×#6Ò#6Ø>Ð?ð $7ñ $ô $Ñ €+Ð ð 
ð  Ø€Gà	ð Ý
ØJñô ð ð 
�gÐ	Ðr.   rm   c                 óL   — ddl m} |                       |¦   «         ¦  «         | S )Nr   )ÚRequest)Úgoogle.auth.transport.requestsrq   Úrefresh)rm   rq   s     r/   Úrefresh_authrt   ò   s4   € Ø4Ð4Ð4Ð4Ð4Ð4Ø×Ò�g�g‘i”iÑ Ô Ð Ø	Ðr.   Útimeoutc                 ó   — | r| dz  }nd}|S )z Converts the timeout to seconds.g     @�@Nr-   )ru   rU   s     r/   Úget_timeout_in_secondsrw   ø   s(   € ð ð ð ! 6Ñ)ÐÐàÐØ	Ðr.   c                   ó‚   — e Zd ZU eeef         ed<   eed<   eed<   eeeef         ef         ed<   dZ	e
e         ed<   dS )ÚHttpRequestr<   ÚurlÚmethodÚdataNru   )r)   r*   r+   ÚdictrW   Ú__annotations__r   ÚobjectÚbytesru   r   Úfloatr-   r.   r/   ry   ry     sk   € € € € € € à��S�Œ>ÐÐÑØ
€(€(�(Ø
€+€+�+Øˆd�3˜�;Ô Ð&Ô'Ð'Ð'Ñ'Ø!€'ˆ8�EŒ?Ð!Ð!Ñ!Ð!Ð!r.   ry   c            	       óz  — e Zd Z	 	 ddeeeef         ej        ddf         deeef         deee	f         fd„Z
dd	„Zdefd
„Zedefd„¦   «         Zdeeddf         fd„Zdee         fd„Zdeee	ef         ddf         fd„Zdeeef         ddfd„Zdee         fd„Zdee         fd„Zededefd„¦   «         ZdS )r   Nr<   zCIMultiDictProxy[str]r"   Úresponse_streamÚbyte_streamc                 ó  ‡— t          ‰t          ¦  «        r‰| _        nÌt          ‰t          ¦  «        r&ˆfd„‰                     ¦   «         D ¦   «         | _        n‘t          j        ¦   «         x}	 �>t          ‰|j        j        ¦  «        r$d„ ‰ 	                    ¦   «         D ¦   «         | _        n=t          ‰¦  «        j        dk    r%ˆfd„‰                     ¦   «         D ¦   «         | _        d| _        || _        || _        d S )Nc                 ób   •— i | ]+}|d                       ‰                     |¦  «        ¦  «        “Œ,S ©z, )ÚjoinÚget_list©Ú.0rR   r<   s     €r/   ú
<dictcomp>z)HttpResponse.__init__.<locals>.<dictcomp>  sB   ø€ ð ð ð Ø47ˆ#ˆt�yŠy˜×)Ò)¨#Ñ.Ô.Ñ/Ô/ðð ð r.   c                 ó   — i | ]\  }}||“Œ	S r-   r-   )r‹   rR   Úvalues      r/   rŒ   z)HttpResponse.__init__.<locals>.<dictcomp>&  s   € ÐCÐCÐC¡Z S¨%�c˜5ÐCÐCÐCr.   r!   c                 ób   •— i | ]+}|d                       ‰                     |¦  «        ¦  «        “Œ,S r‡   )rˆ   ÚgetallrŠ   s     €r/   rŒ   z)HttpResponse.__init__.<locals>.<dictcomp>(  s@   ø€ ð ð ð Ø25ˆ#ˆt�yŠy˜Ÿš¨Ñ,Ô,Ñ-Ô-ðð ð r.   éÈ   )Ú
isinstancer}   r<   Ú_HTTPX_HEADERS_TYPESrK   r   Úloaded_requestsÚ
structuresr"   ÚitemsÚtyper)   Ústatus_coderƒ   r„   )Úselfr<   rƒ   r„   Úrequests_modules    `   r/   Ú__init__zHttpResponse.__init__  s(  ø€ õ �'�4Ñ Ô ð Ø€d„l€lÝ	�GÕ1Ñ	2Ô	2ð ðð ð ð Ø;B¿<º<¹>¼>ðñ ô €d„l€lõ #Ô2Ñ4Ô4Ð4ˆØð
å Ø�Ô+Ô?ñô ð
ð
 DÐC°7·=²=±?´?ÐCÑCÔC€d„l€lÝ	ˆg‰ŒÔ	Ð#5Ò	5Ð	5ðð ð ð Ø9@¿º¹¼ðñ ô €d„lð  €DÔØ*€DÔØ"€DÔÐÐr.   r0   c                 ó8   — |                       ¦   «         | _        | S ©N)Úasync_segmentsÚsegment_iterator©r™   s    r/   Ú	__aiter__zHttpResponse.__aiter__1  s   € Ø ×/Ò/Ñ1Ô1€DÔØ€Kr.   c              ƒ   óp   K  — 	 | j                              ¦   «         ƒ d {V —†S # t          $ r t          ‚w xY wr�   )rŸ   Ú	__anext__ÚStopIterationÚStopAsyncIterationr    s    r/   r£   zHttpResponse.__anext__5  sS   è è € ðØÔ(×2Ò2Ñ4Ô4Ð4Ð4Ð4Ð4Ð4Ð4Ð4øÝð ð ð ÝÐðøøøs   „# £5c                 ó¦   — t          | j        t          ¦  «        sd S | j        r| j        d         sdS |                      | j        d         ¦  «        S )Nr   Ú )r’   rƒ   ÚlistÚ_load_json_from_responser    s    r/   ÚjsonzHttpResponse.json;  sY   € õ �dÔ*­DÑ1Ô1ð ØˆTØÔð  tÔ';¸AÔ'>ð ØˆRØ×(Ò(¨Ô)=¸aÔ)@ÑAÔAÐAr.   c              #   ó
  K  — t          | j        t          ¦  «        r'| j        D ]}|r|                      |¦  «        ni V — Œd S | j        €
g E d {V —† d S |                      ¦   «         D ]}|                      |¦  «        V — Œd S r�   )r’   rƒ   r¨   r©   Ú_iter_response_stream)r™   Úchunks     r/   ÚsegmentszHttpResponse.segmentsG  sÄ   è è € Ý�$Ô&­Ñ-Ô-ð 	3àÔ'ð Dð Dˆ%Ø6;ÐCˆd×+Ò+¨EÑ2Ô2Ð2ÀÐCÐCÐCÐCðDð Dà	Ô	Ð	%Ø€m€m€m€m€m€m€m€m€mð ×-Ò-Ñ/Ô/ð 3ð 3ˆ%Ø×+Ò+¨EÑ2Ô2Ð2Ð2Ð2Ð2ð3ð 3r.   c                ó*  K  — t          | j        t          ¦  «        r(| j        D ]}|r|                      |¦  «        ni W V — Œd S | j        €g 2 3 d {V —†}|W V — Œ6 d S |                      ¦   «         2 3 d {V —†}|                      |¦  «        W V — Œ 6 d S r�   )r’   rƒ   r¨   r©   Ú_aiter_response_stream)r™   r­   Úcs      r/   rž   zHttpResponse.async_segmentsS  s  è è € Ý�$Ô&­Ñ-Ô-ð 
3àÔ'ð Dð Dˆ%Ø6;ÐCˆd×+Ò+¨EÑ2Ô2Ð2ÀÐCÐCÐCÐCÐCðDð Dà	Ô	Ð	%Øð ð ð ð ð ð ð �Øˆˆˆˆˆð �R�Rð ×4Ò4Ñ6Ô6ð 3ð 3ð 3ð 3ð 3ð 3ð 3�Ø×+Ò+¨EÑ2Ô2Ð2Ð2Ð2Ð2Ð2ð 7Ð6Ð6s   ÁAÁ2Bc              #   ó˜   K  — t          | j        t          ¦  «        r| j        E d {V —† d S | j        €
g E d {V —† d S t          d¦  «        ‚)Nz8Byte segments are not supported for streaming responses.)r’   r„   r¨   rl   r    s    r/   Úbyte_segmentszHttpResponse.byte_segments`  so   è è € Ý�$Ô"¥DÑ)Ô)ð àÔ!Ð!Ð!Ð!Ð!Ð!Ð!Ð!Ð!Ð!Ø	Ô	Ð	!Ø€m€m€m€m€m€m€m€m€måØ
Dñô ð r.   Úresponse_payloadc                 ó”   — t          | d¦  «         t          | ¦  «        D ]'}t          j        t	          | |¦  «        ¦  «        ||<   Œ(d S )NrŸ   )ÚdelattrÚdirÚcopyÚdeepcopyrL   )r™   r´   Ú	attributes      r/   Ú_copy_to_dictzHttpResponse._copy_to_dictk  sX   € åˆDÐ$Ñ%Ô%Ð%Ý˜‘Y”Yð Lð Lˆ	Ý$(¤Mµ'¸$À	Ñ2JÔ2JÑ$KÔ$KÐ�yÑ!Ð!ðLð Lr.   c              #   óü  K  — t          j        ¦   «         }t          | j        t          ¦  «        sF|�t          | j        |j        ¦  «        s*t          dt          | j        ¦  «        j        › d�¦  «        ‚d}d}g }t          | j        t          ¦  «        r| j         	                    ¦   «         }n| j         	                    d¬¦  «        }|D ]�}|s|rd 
                    |¦  «        V — g }Œ |                     d	¦  «        r+|                     |t          d	¦  «        d…         ¦  «         Œ`|D ]}|d
k    r|dz  }Œ|dk    r|dz  }Œ||z  }|dk    r|V — d}ŒŽ|r|V — |rd 
                    |¦  «        V — dS dS )z,Iterates over chunks retrieved from the API.NzFExpected self.response_stream to be an httpx.Response object, but got ú.r§   r   T)Údecode_unicodeú
údata: Ú{r   Ú})r   r”   r’   rƒ   Ú_HTTPX_RESPONSE_TYPESÚResponseÚ	TypeErrorr—   r)   Ú
iter_linesrˆ   ra   ÚappendÚlen)r™   rš   r­   ÚbalanceÚdata_bufferrƒ   Úliner±   s           r/   r¬   z"HttpResponse._iter_response_streamq  sñ  è è € åÔ-Ñ/Ô/€Oå�4Ô'Õ)>Ñ?Ô?ð
ð Ð'Ý˜4Ô/°Ô1IÑJÔJð (õ ð<Ý˜$Ô.Ñ/Ô/Ô8ð<ð <ð <ñô ð ð
 €EØ€GØ€KÝ�$Ô&Õ(=Ñ>Ô>ð MØÔ,×7Ò7Ñ9Ô9€o€oàÔ,×7Ò7ÀtÐ7ÑLÔL€oØð ð ˆØð Øð 	Ø—	’	˜+Ñ&Ô&Ð
&Ð
&Ð
&Øˆ+Øð 
�Š˜Ñ	"Ô	"ð Ø×Ò˜4¥ H¡¤  Ô/Ñ0Ô0Ð0Øð
 ð ð ˆ!Ø�Š8ˆ8Ø
�Q‰,ˆ'ˆ'Ø�#ŠXˆXØ
�Q‰,ˆ'øàˆt�m€eØ	�AŠˆØˆˆˆØˆøð ð Ø€k€k€kØð #Ø�IŠI�kÑ"Ô"Ð"Ð"Ð"Ð"Ð"ð#ð #r.   c                ó€  K  — t          | j        t          ¦  «        p%t          ot          | j        t          j        ¦  «        }|s*t          dt          | j        ¦  «        j        › d�¦  «        ‚d}d}g }t          | j        t          ¦  «        �r	 | j        }| 	                    ¦   «         2 3 d{V —†}|s|rd 
                    |¦  «        W V — g }Œ&|                     d¦  «        r+|                     |t          d¦  «        d…         ¦  «         Œf|D ]}|dk    r|d	z  }Œ|d
k    r|d	z  }Œ||z  }|dk    r|W V — d}Œ•6 |r|W V — |rd 
                    |¦  «        W V — |                     ¦   «         ƒ d{V —† dS # |                     ¦   «         ƒ d{V —† w xY wt          �r–t          | j        t          j        ¦  «        �rx	 	 	 | j        j                             t"          ¬¦  «        ƒ d{V —†}n4# t          $ r' | j        j                             ¦   «         ƒ d{V —†}Y nw xY w|sn¶|                     d¦  «                             ¦   «         }|s|rd 
                    |¦  «        W V — g }Œ«|                     d¦  «        r+|                     |t          d¦  «        d…         ¦  «         Œë|D ]}|dk    r|d	z  }Œ|d
k    r|d	z  }Œ||z  }|dk    r|W V — d}�Œ|r|W V — |rd 
                    |¦  «        W V — | j                             ¦   «          dS # | j                             ¦   «          w xY wdS dS )z;Asynchronously iterates over chunks retrieved from the API.z`Expected self.response_stream to be an httpx.Response or aiohttp.ClientResponse object, but got r½   r§   r   Nr¿   rÀ   rÁ   r   rÂ   T)Úmax_line_lengthúutf-8)r’   rƒ   rÃ   Úhas_aiohttpÚaiohttpÚClientResponserÅ   r—   r)   Úaiter_linesrˆ   ra   rÇ   rÈ   ÚacloseÚcontentÚreadlineÚREAD_BUFFER_SIZEÚdecodeÚrstripÚrelease)	r™   Úis_valid_responser­   rÉ   rÊ   rƒ   rË   r±   Ú
line_bytess	            r/   r°   z#HttpResponse._aiter_response_stream¨  s’  è è € å"ØÔÕ3ñô ð õ 	ÐP�
 4Ô#7½Ô9OÑPÔPð ð
 ð Ýð5å�4Ô'Ñ(Ô(Ô1ð5ð 5ð 5ñô ð ð €EØ€GØ€Kå�$Ô&Õ(=Ñ>Ô>ñ X'ð"'Ø#Ô3ˆØ)×5Ò5Ñ7Ô7ð 	ð 	ð 	ð 	ð 	ð 	ð 	�$Øð Øð Ø—I’I˜kÑ*Ô*Ð*Ð*Ð*Ð*ØˆkØð �_Š_˜XÑ&Ô&ð Ø×Ò˜t¥C¨¡M¤M N NÔ3Ñ4Ô4Ð4Øð
 ð ð ˆaØ�CŠxˆxØ˜‰lˆgˆgØ�c’�Ø˜‰lˆgøà
�4‰-ˆ%Ø˜Š\ˆ\ØˆKˆKˆKˆKØˆEøð1 8ð4 ð 	Øˆ+ˆ+ˆ+ˆ+Øð 	'Ø—	’	˜+Ñ&Ô&Ð
&Ð
&Ð
&Ð
&ð ×$Ò$Ñ&Ô&Ð&Ð&Ð&Ð&Ð&Ð&Ð&Ð&Ð&øˆo×$Ò$Ñ&Ô&Ð&Ð&Ð&Ð&Ð&Ð&Ð&Ð&øøøõ 
ñ 2'�ØÔ�gÔ4ñô ñ 2'ð/'ð&	ðGØ#Ô3Ô;×DÒDÝ 0ð  Eñ  ô  ð ð ð ð ð ð ˆJˆJøõ ð Gð Gð Gð  $Ô3Ô;×DÒDÑFÔFÐFÐFÐFÐFÐFÐFˆJˆJˆJðGøøøð ð Øà×"Ò" 7Ñ+Ô+×2Ò2Ñ4Ô4ˆ$Øð Øð Ø—I’I˜kÑ*Ô*Ð*Ð*Ð*Ð*ØˆkØð �_Š_˜XÑ&Ô&ð Ø×Ò˜t¥C¨¡M¤M N NÔ3Ñ4Ô4Ð4Øð
 ð ð ˆaØ�CŠxˆxØ˜‰lˆgˆgØ�c’�Ø˜‰lˆgøà
�4‰-ˆ%Ø˜Š\ˆ\ØˆKˆKˆKˆKØˆEñM&	ðP ð 	Øˆ+ˆ+ˆ+ˆ+Øð 	'Ø—	’	˜+Ñ&Ô&Ð
&Ð
&Ð
&Ð
&ð 	Ô×$Ò$Ñ&Ô&Ð&Ð&Ð&øˆÔ×$Ò$Ñ&Ô&Ð&Ð&øøøðe2'ð 2'ð 2'ð 2'sJ   ÂE? Â,EÂ2B1E? Å?FÇL Ç	+G5 Ç4L Ç5.H&È#L È%H&È&CL ÌL9Úresponsec                 óŠ   — 	 t          j        |¦  «        S # t           j        $ r}t          j        d|› �¦  «        |‚d}~ww xY w)zFLoads JSON from the response, or raises an error if the parsing fails.z0Failed to parse response as JSON. Raw response: N)rª   ÚloadsÚJSONDecodeErrorr   ÚUnknownApiResponseError)ÚclsrÜ   Úes      r/   r©   z%HttpResponse._load_json_from_response  s\   € ðÝŒZ˜Ñ!Ô!Ð!øÝÔð ð ð ÝÔ*Ø
G¸XÐ
GÐ
Gñô àðøøøøðøøøs   ‚ –A¥=½A)NN)r0   r   )r)   r*   r+   r   r}   rW   ÚhttpxÚHeadersr   r€   r›   r¡   r£   Úpropertyrª   r   r®   r   rž   r³   r   r»   r   r¬   r°   Úclassmethodr©   r-   r.   r/   r   r     sù  € € € € € ð *.Ø'+ð#ð #àØ
ˆs�CˆxŒ.Ø
Œ-Ø
!Ø
ð!ôð#ð ˜S #˜X”ð#ð ˜˜e˜Ô$ð#ð #ð #ð #ðBð ð ð ð˜sð ð ð ð ð ð	B�Cð 	Bð 	Bð 	Bñ „8ð	Bð
3˜	 # t¨T /Ô2ð 
3ð 
3ð 
3ð 
3ð3 M°#Ô$6ð 3ð 3ð 3ð 3ð	˜Y u¨U°C¨ZÔ'8¸$ÀÐ'DÔEð 	ð 	ð 	ð 	ðL¨D°°f°Ô,=ð LÀ$ð Lð Lð Lð Lð5# X¨c¤]ð 5#ð 5#ð 5#ð 5#ðnj'¨M¸#Ô,>ð j'ð j'ð j'ð j'ðX ð¨cð °cð ð ð ñ „;ðð ð r.   r   é   g      ð?g      N@)i˜  i­  iô  iö  i÷  iø  c                 óÈ  ‡— | €t          j        d¦  «        ddœS | j        dk    rd| _        t          j        | j        pt          ¦  «        }| j        pt
          Št          j        ˆfd„¦  «        }t          j        | j        pt          | j
        pt          | j        pt          | j        pt          ¬¦  «        }||d|t          j        t"          t$          j        ¦  «        dœS )	a  Returns the retry args for the given http retry options.

  Args:
    options: The http retry options to use for the retry configuration. If None,
      the 'never retry' stop strategy will be used.

  Returns:
    The arguments passed to the tenacity.(Async)Retrying constructor.
  Nr   T)ÚstopÚreraiser   c                 ót   •— t          | t          j        ¦  «        r	| j        ‰v pt          | t          ¦  «        S r�   )r’   r   ÚAPIErrorÚcodeÚ_HTTPX_TRANSIENT_EXC)râ   Úretriable_codess    €r/   ú<lambda>zretry_args.<locals>.<lambda>C  s5   ø€ •˜A�vœÑ/Ô/ÐM°A´F¸oÐ4Mð -Ý	�AÕ+Ñ	,Ô	,ð r.   )ÚinitialÚmaxÚexp_baseÚjitter)ré   Úretryrê   ÚwaitÚbefore_sleep)ÚtenacityÚstop_after_attemptÚattemptsÚ_RETRY_ATTEMPTSÚhttp_status_codesÚ_RETRY_HTTP_STATUS_CODESÚretry_if_exceptionÚwait_exponential_jitterÚinitial_delayÚ_RETRY_INITIAL_DELAYÚ	max_delayÚ_RETRY_MAX_DELAYró   Ú_RETRY_EXP_BASErô   Ú_RETRY_JITTERÚbefore_sleep_logr7   ÚloggingÚINFO)rF   ré   rõ   rö   rï   s       @r/   Ú
retry_argsr	  2  sú   ø€ ð €_ÝÔ/°Ñ2Ô2¸tÐDÐDÐDØÔ˜ÒÐØ€GÔÝ	Ô	$ WÔ%5Ð%H½Ñ	IÔ	I€$ØÔ-ÐIÕ1I€/Ý
Ô
%ð-ð -ð -ð -ñô €%õ 
Ô	)ØÔ#Ð;Õ';Ø
Ô
Ð
/Õ/ØÔÐ2¥?ØŒ^Ð,�}ð	
ñ 
ô 
€$ð ØØØÝÔ/µ½¼ÑEÔEð
ð 
ð r.   c                   ó4   ‡ — e Zd ZdZdeddfˆ fd„Zdd„Zˆ xZS )ÚSyncHttpxClientzSync httpx client.Úkwargsr0   Nc                 óf   •— |                      dd¦  «          t          ¦   «         j        di |¤Ž dS ©zInitializes the httpx client.Úfollow_redirectsTNr-   ©Ú
setdefaultÚsuperr›   ©r™   r  Ú	__class__s     €r/   r›   zSyncHttpxClient.__init__X  ó=   ø€ à
×ÒÐ(¨$Ñ/Ô/Ð/Ø…E�G„GÔÐÐ�vÐÐÐÐÐr.   c                 óˆ   — 	 | j         rdS n# t          $ r Y nw xY w	 |                      ¦   «          dS # t          $ r Y dS w xY w)zCloses the httpx client.N)Ú	is_closedÚ	ExceptionÚcloser    s    r/   Ú__del__zSyncHttpxClient.__del__]  ss   € ðØ	Œð Øˆðøåð ð ð Ø
€dðøøøðØ
‡j‚j�l„l€l€l€løÝð ð ð Ø
€d€dðøøøs   ‚ Œ
˜�3 ³
AÁ A©r0   N©r)   r*   r+   r,   r   r›   r  Ú__classcell__©r  s   @r/   r  r  U  se   ø€ € € € € ØÐð˜sð  tð ð ð ð ð ð ð

ð 
ð 
ð 
ð 
ð 
ð 
ð 
r.   r  c                   ó4   ‡ — e Zd ZdZdeddfˆ fd„Zdd„Zˆ xZS )ÚAsyncHttpxClientzAsync httpx client.r  r0   Nc                 óf   •— |                      dd¦  «          t          ¦   «         j        di |¤Ž dS r  r  r  s     €r/   r›   zAsyncHttpxClient.__init__m  r  r.   c                 óÐ   — 	 | j         rd S n# t          $ r Y nw xY w	 t          j        ¦   «                              |                      ¦   «         ¦  «         d S # t          $ r Y d S w xY wr�   )r  r  ÚasyncioÚget_running_loopÚcreate_taskrÓ   r    s    r/   r  zAsyncHttpxClient.__del__r  s�   € ðØ	Œð Øˆðøåð ð ð Ø
€dðøøøðÝÔÑ Ô ×,Ò,¨T¯[ª[©]¬]Ñ;Ô;Ð;Ð;Ð;øÝð ð ð Ø
€d€dðøøøs   ‚ Œ
˜�8A Á
A%Á$A%r  r  r  s   @r/   r   r   j  se   ø€ € € € € ØÐð˜sð  tð ð ð ð ð ð ð
	ð 	ð 	ð 	ð 	ð 	ð 	ð 	r.   r   c                   óþ  — e Zd ZU dZdZee         ed<   dZee	         ed<   	 	 	 	 	 	 dFdee         dee	         dee
j        j        j                 dee	         dee	         d	ee         fd
„Zdefd„Zdefd„Zdedefd„Zedeeef         ddfd„¦   «         Zedee         fd„¦   «         Zdefd„Ze	 dGdededeej        ej        f         fd„¦   «         Ze	 dGdededej        fd„¦   «         Ze	 dGdededej        fd„¦   «         Z defd„Z!de	fd„Z"de	fd„Z#de$j%        fd„Z&de'e	ef         fd„Z(	 dHde	de	d ee	e)f         d	ee         de*f
d!„Z+	 dGd"e*d#ede,fd$„Z-	 	 dId"e*d	ee         d#ede,fd%„Z.	 dGd"e*d#ede,fd&„Z/	 	 dId"e*d	ee         d#ede,fd'„Z0dej        fd(„Z1	 dHde	de	d ee	e)f         d	ee         de2f
d)„Z3	 dHde	de	d ee	e)f         d	ee         de4e2ddf         f
d*„Z5	 dHde	de	d ee	e)f         d	ee         de2f
d+„Z6	 dHde	de	d ee	e)f         d	ee         def
d,„Z7dd-œd.e'e	e8j9        f         d/e	d0e:d	ee         de,f
d1„Z;dd-œd2e8j9        d/e	d0e:d	ee         de,f
d3„Z<e=ddd4d5œde	d	ee         d6dd7e:de>f
d8„¦   «         Z?e=dd4d9œde	d	ee         d6e'e	e@jA        e	         e8j9        f         d7e:ddf
d:„¦   «         Z?ddd4d5œde	d	ee         d6ee'e	e@jA        e	         e8j9        f                  d7e:dee>         f
d;„Z?dd-œd.e'e	e8j9        f         d/e	d0e:d	ee         de,f
d<„ZBdd-œd2e'e8j9        eCjD        e         f         d/e	d0e:d	ee         de,f
d=„ZEe=ddd4d5œde	d	ee         d6dd7e:de>f
d>„¦   «         ZFe=dd4d9œde	d	ee         d6e'e	e@jA        e	         e8j9        f         d7e:ddf
d?„¦   «         ZFddd4d5œde	d	ee         d6ee'e	e@jA        e	         e8j9        f                  d7e:dee>         f
d@„ZFdAejG        ddfdB„ZHdJdC„ZIdJdD„ZJdJdE„ZKdS )KÚBaseApiClientz8Client for calling HTTP APIs sending and receiving JSON.NÚvertexaiÚcustom_base_urlÚapi_keyrm   rf   ÚlocationÚhttp_optionsc                 óì  — || _         d | _        | j         €¥t          j                             dd ¦  «        }t          j                             dd ¦  «        }d }	|�|                     ¦   «         dv }	d }
|�|                     ¦   «         dv }
|	�|
�|	|
k    rt          j        d¦  «         |	�|	| _         n	|
�|
| _         |s|r| j         st          d¦  «        ‚|r|rt          d¦  «        ‚t          ¦   «         }t          |t          ¦  «        r8	 t          j        |¦  «        }n@# t          $ r}t          d¦  «        |‚d }~ww xY w|rt          j        |t          ¦  «        r|}|j        r|j        st          d¦  «        ‚t          j                             d	d ¦  «        }t          j                             d
d ¦  «        }t%          ¦   «         }|p|| _        |p|| _        |p|| _        || _        t          ¦   «         | _        t1          j        ¦   «         | _        i | _        | j         �r,|r$|r"t8                               d¦  «         d | _        nŠ|r1|s/|s-|s|r)t8                               d¦  «         d | _        d | _        nW|s|r&|s$|r"t8                               d¦  «         d | _        n-|s+|s)|s'|s|r#|r!t8                               d¦  «         d | _        |j        r|j        nd | _        | j        s7| j        s0| j        sd| _        n!| j                             d¦  «        rd| _        | j        s4| j        s-| j        s&t?          d ¬¦  «        \  }| _        | j        s|| _        | j        r| j        p| j        }|s| j        st          d¦  «        ‚| j        r| j        r| j        dk    r| j        sd| j        _        n‡| j        t@          v r| j        sd| j        › d�| j        _        n\| j        r@| j                             d¦  «        s&|r|s"|s | j        | j        _        d | _        d | _        nd| j        › d�| j        _        d| j        _!        n.| j        st          d¦  «        ‚d| j        _        d| j        _!        ddi| j        _"        | j        r>| j         #                    ¦   «         | _        | j        j"        �| j        | j        j"        d<   |rtI          | j        |¦  «        | _        n%| j        j"        �tK          | j        j"        ¦  «         |  &                    | j        tO          | j         ¦  «        ¬¦  «        \  }}|| _(        d | _)        | j        j*        r| j        j*        | _+        ntY          d'i |¤Ž| _+        | j        j-        r| j        j-        | _.        nt_          d'i |¤Ž| _.        i | _0        |  1                    ¦   «         r­	 d d l2}|  3                    | j        tO          | j         ¦  «        ¬¦  «        | _4        |  5                    ¦   «         rPd!| j4        d"<   | j        j6        €to          d#¦  «        nto          | j        j6        ¦  «        | j4        d$<   d%| j4        d&<   n# tp          $ r Y nw xY wts          | j        j:        ¦  «        }|  ;                    | j        tO          | j         ¦  «        ¬¦  «        | _<        t{          j>        d'i |¤Ž| _?        t{          j@        d'i |¤Ž| _A        d S )(NÚGOOGLE_GENAI_USE_ENTERPRISEÚGOOGLE_GENAI_USE_VERTEXAI)ÚtrueÚ1zŸWarning: Both GOOGLE_GENAI_USE_ENTERPRISE and GOOGLE_GENAI_USE_VERTEXAI are set with conflicting values. The value of GOOGLE_GENAI_USE_ENTERPRISE will be used.z-Gemini API does not support project/location.zICredentials and API key are mutually exclusive in the client initializer.zInvalid http_optionsz9base_url must be set when base_url_resource_scope is set.ÚGOOGLE_CLOUD_PROJECTÚGOOGLE_CLOUD_LOCATIONzoThe user provided Google Cloud credentials will take precedence over the API key from the environment variable.zrThe user provided Vertex AI API key will take precedence over the project/location from the environment variables.zqThe user provided project/location will take precedence over the Vertex AI API key from the environment variable.zyThe project/location from the environment variables will take precedence over the API key from the environment variables.Úglobalz.googleapis.com©rf   z<Project or API key must be set when using the Vertex AI API.z"https://aiplatform.googleapis.com/zhttps://aiplatform.z.rep.googleapis.com/zhttps://z-aiplatform.googleapis.com/Úv1beta1z†No API key was provided. Please pass a valid API key. Learn how to create an API key at https://ai.google.dev/gemini-api/docs/api-key.z*https://generativelanguage.googleapis.com/Úv1betazContent-Typezapplication/jsonzx-goog-api-key©r(  r   TÚsslÚinfÚmax_allowed_timer   Útotal_attemptsr-   )Br(  r)  r4   r5   r6   ÚlowerÚwarningsÚwarnrl   r   r’   r}   Úmodel_validater   r   Úis_duck_type_ofÚbase_url_resource_scoper[   r;   rf   r+  r*  Ú_credentialsÚ_http_optionsÚ	threadingÚLockÚ_sync_auth_lockÚ_async_auth_locksr7   Úinfor`   ro   Ú_MULTI_REGIONAL_LOCATIONSÚapi_versionr<   ÚstriprT   rE   Ú_ensure_httpx_ssl_ctxÚboolÚ_async_httpx_client_argsÚ_authorized_sessionÚhttpx_clientÚ_httpx_clientr  Úhttpx_async_clientÚ_async_httpx_clientr   Ú_aiohttp_sessionsÚ_use_aiohttprÐ   Ú_ensure_aiohttp_ssl_ctxÚ"_async_client_session_request_argsÚ_use_google_auth_asyncru   r�   ÚImportErrorr	  Úretry_optionsÚ_ensure_websocket_ssl_ctxÚ_websocket_ssl_ctxrø   ÚRetryingÚ_retryÚAsyncRetryingÚ_async_retry)r™   r(  r*  rm   rf   r+  r,  Úenv_enterprise_strÚenv_vertexai_strÚenv_enterpriseÚenv_vertexaiÚvalidated_http_optionsrâ   Úenv_projectÚenv_locationÚenv_api_keyÚhas_sufficient_authÚclient_argsÚasync_client_argsrÐ   Úretry_kwargss                        r/   r›   zBaseApiClient.__init__„  sÂ  € ð €D„MØ€DÔØ„}ÐÝœ:Ÿ>š>Ð*GÈÑNÔNÐÝœŸšÐ(CÀTÑJÔJÐà€nØ	Ð	'Ø+×1Ò1Ñ3Ô3°}ÐDˆà€lØ	Ð	%Ø'×-Ò-Ñ/Ô/°=Ð@ˆð Ð
$ØÐ&Ø Ò,Ð,åŒðBñ	
ô 	
ð 	
ð 
Ð	#Ø&ˆŒˆØÐ#Ø$ˆŒð 	ð H�8ð H T¤]ð HÝÐFÑGÔGÐGàð �wð åðñô ð õ )™]œ]ÐÝ�,¥Ñ%Ô%ð ,ð8Ý!,Ô!;¸LÑ!IÔ!IÐÐøÝð 8ð 8ð 8ÝÐ/Ñ0Ô0°aÐ7øøøøð8øøøà	ð ,�'Ô1°,ÅÑLÔLð ,Ø+Ðð 	Ô6ðà&Ô/ðõ
 Ø
Eñô ð õ
 ”*—.’.Ð!7¸Ñ>Ô>€KÝ”:—>’>Ð"9¸4Ñ@Ô@€LÝ!Ñ#Ô#€KØÐ)˜k€D„LØÐ, €D„MØÐ)˜k€D„Là#€DÔÝ$™œ€DÔõ %œ>Ñ+Ô+€DÔØLN€DÔð „}ñ m0Ø	ð '˜ð 'å�ŠðAñ	
ô 	
ð 	
ð ˆŒˆà
ð àð ð ð ð ð	 ð +ð	 õ 	�ŠðBñ	
ô 	
ð 	
ð ˆŒØˆŒˆØð �xð ¨ð °[ð å�ŠðBñ	
ô 	
ð 	
ð ˆŒˆàðàðð ðð ð	ð +ð	ð
 ðõ 	�ŠðMñ	
ô 	
ð 	
ð ˆŒð $Ô,ðÐ
 Ô
)Ð
)àð Ôð Œmð#à”,ð#ð Ô#ð 	#Ø"ˆ$Œ-ˆ-ØÔ!×*Ò*Ð+<Ñ=Ô=ð 	#Ø"ˆ$Œ-ð Œlð*à”,ð*ð Ô&ð*õ
 %.°dÐ$;Ñ$;Ô$;Ñ!ˆ�T”\ØÔ ð 	*Ø)ˆ$Ô
à!œ\Ð;¨d¬mÐLÀÄÐà ð 
¨Ô)=ð 
åØJñ
ô 
ð 	
ð Œ<ð
Ø $¤ð
Ø26´-À8Ò2KÐ2KØÔ$ð 3Là&KˆÔÔ#Ð#à
Œ-Õ4Ð
4Ð
4ØÔ&ð 5ð F $¤-ÐEÐEÐEð 	ÔÔ#Ð#ð Ô
ð
àÔ&×/Ò/Ð0AÑBÔBð
ð ð
ð 'ð
ð ,3ð
ð '+Ô&:ˆÔÔ#àˆŒØˆŒˆð B�t”}ÐAÐAÐAð 	ÔÔ#ð (1€dÔÔ$Ð$àŒ\ð 
Ýð>ñ
ô 
ð 	
ð
 %Q€dÔÔ!Ø'/€dÔÔ$à"0Ð2DÐ!E€DÔÔØ„|ð DØ”\×'Ò'Ñ)Ô)€d„lØ	Ô	Ô	#Ð	/Ø7;´|ˆÔÔ"Ð#3Ñ4àð CÝ-Ø
Ô
Ð4ñô €dÔÐð 
Ô	Ô	#Ð	/Ý& tÔ'9Ô'AÑBÔBÐBà%)×%?Ò%?ØÔÝ�d”mÑ$Ô$ð &@ñ &ô &Ñ"€KÐ"ð %6€DÔ!Ø>B€DÔàÔÔ&ð :ØÔ-Ô:€dÔÐå*Ð9Ð9¨[Ð9Ð9€dÔàÔÔ,ð GØ!%Ô!3Ô!F€dÔÐå!1Ð!FÐ!FÐ4EÐ!FÐ!F€dÔð .0€DÔØ×ÒÑÔð ðØˆˆˆð ×(Ò(ØÔ"Ý˜dœmÑ,Ô,ð )ñ ô ð 	Ô/ð ×&Ò&Ñ(Ô(ð 	HØ;?ˆ$Ô
1°%Ñ
8ð Ô!Ô)Ð1õ INØñIô Ið Iå7<ØÔ Ô(ñ8ô 8ð Ô
1Ð2DÑ
Eð
 GHˆ$Ô
1Ð2BÑ
CøøÝð ð ð Øˆðøøøõ ˜dÔ0Ô>Ñ?Ô?€LØ"×<Ò<ØÔÝ�d”mÑ$Ô$ð =ñ ô €DÔõ Ô#Ð3Ð3 lÐ3Ð3€D„KÝ Ô.Ð>Ð>°Ð>Ð>€DÔÐÐs+   ÄD! Ä!
E Ä+D;Ä;E ×BY, Ù,
Y9Ù8Y9r0   c                 óÖ   — t          t          d¦  «        sdS t          | j        o>t          j        ¦   «         o+t          j        ¦   «         o| j        j        p| j        j         ¦  «        S )NÚshould_use_client_certF)	Úhasattrr   rN  r(  ro  Úhas_default_client_cert_sourcerD  rQ  rk  r    s    r/   Ú_use_google_auth_syncz#BaseApiClient._use_google_auth_syncˆ  ss   € Ý•4Ð1Ñ2Ô2ð ØˆUÝØŒð 	
ÝÔ'Ñ)Ô)ð	
åÔ/Ñ1Ô1ð	
ð ÔÔ+ÐM¨tÔ/AÔ/Mð
ñ	ô ð r.   c                 óF  — 	 dd l }|                     d¦  «        }|j        }d}n# t          t          f$ r d}Y nw xY wt          t          oP|oN| j        oGt          t          d¦  «        o2t          j
        ¦   «         ot          j        ¦   «         o| j        j         ¦  «        S )Nr   úgoogle.auth.aio.credentialsTFro  )Ú	importlibÚimport_moduler   rZ  ÚAttributeErrorrN  rÏ   r(  rp  r   ro  rq  rD  rS  )r™   ru  Úaio_creds_moduleÚ_Úhas_google_auth_aios        r/   rY  z$BaseApiClient._use_google_auth_async”  sÜ   € ð"ØÐÐÐà"×0Ò0Ð1NÑOÔOÐØ
Ô
&€aØ ÐÐøÝ�Ð(ð "ð "ð "Ø!ÐÐÐð"øøøõ Ýð 	6Øð	6àŒMð	6õ •DÐ2Ñ3Ô3ð	6õ Ô'Ñ)Ô)ð		6õ
 Ô/Ñ1Ô1ð	6ð Ô"Ô5Ð5ñô ð s   ‚"% ¥;º;Úsessionc                 óÊ   — t          |d¦  «        rt          |j        ¦  «        S t          |d¦  «        r.t          |j        d¦  «        rt          |j        j        ¦  «        S dS )z&Returns True if the session is closed.ÚclosedÚ_auth_requestÚ_closedF)rp  rN  r}  r~  r  )r™   r{  s     r/   Ú_is_session_closedz BaseApiClient._is_session_closed¨  sj   € åˆw˜Ñ!Ô!ð "Ý�'”.Ñ!Ô!Ð!åˆw˜Ñ(Ô(ð 1­WØÔ˜yñ.ô .ð 1õ �'Ô'Ô/Ñ0Ô0Ð0Øˆ5r.   Úentriesc                 ó*   — d„ | D ¦   «         D ]}| |= ŒdS )a  Drops entries of a loop-keyed cache whose event loop has been closed.

    Servers that run every request on a fresh loop (ADK's sync `Runner.run()`,
    used by Agent Engine, calls `asyncio.run()` per request) would otherwise
    grow these caches without bound, pinning one aiohttp session, connector and
    set of sockets per request served. A session on a closed loop cannot be
    awaited shut, but dropping the last reference to it lets the garbage
    collector release the connector and its sockets.
    c                 ó:   — g | ]}|                      ¦   «         ¯|‘ŒS r-   )r  )r‹   Úloops     r/   ú
<listcomp>z>BaseApiClient._discard_closed_loop_entries.<locals>.<listcomp>¾  s'   € Ð>Ð>Ð>˜$¨T¯^ª^Ñ-=Ô-=Ð>�Ð>Ð>Ð>r.   Nr-   )r�  r„  s     r/   Ú_discard_closed_loop_entriesz*BaseApiClient._discard_closed_loop_entries³  s4   € ð ?Ð> 'Ð>Ñ>Ô>ð ð ˆØ
�$ˆ-ˆ-ðð r.   c                 ó°   — | j         j        r| j         j        S 	 t          j        ¦   «         }| j                             |¦  «        S # t          $ r Y dS w xY w)zUReturns the aiohttp client session for the current loop (for backward compatibility).N)rD  Úaiohttp_clientr#  r$  rU  r6   ÚRuntimeError©r™   r„  s     r/   Ú_aiohttp_sessionzBaseApiClient._aiohttp_sessionÁ  sj   € ð
 ÔÔ(ð /ØÔÔ.Ð.ðÝÔ%Ñ'Ô'€dØÔ#×'Ò'¨Ñ-Ô-Ð-øÝð ð ð ØˆTˆTðøøøs   š,A Á
AÁAc              ƒ   ó,  K  — | j         j        r| j         j        S t          j        ¦   «         }| j        5  |                      | j        ¦  «         | j                             |¦  «        }|�|                      |¦  «        rd}ddd¦  «         n# 1 swxY w Y   |€ø|  	                    ¦   «         rl	 ddl
}|                     d¦  «        j        }|                     d¦  «        j        } G d„ d|¦  «        } | || ¦  «        ¦  «        }n]# t          $ r Y nQw xY w G d„ dt          j        ¦  «        } G d	„ d
t          j        ¦  «        } | |d¬¦  «        dt$          ¬¦  «        }|r)| j        5  || j        |<   ddd¦  «         n# 1 swxY w Y   |S )z#Returns the aiohttp client session.Nr   rt  z"google.auth.aio.transport.sessionsc            
       ól   ‡ — e Zd ZdZdˆ fd„Zdedededeeef         d	d
f
d„Ze	d	e
fd„¦   «         Zˆ xZS )úHBaseApiClient._get_aiohttp_session.<locals>._RefreshableAsyncCredentialszJAdapter to use the client's sync credentials in an AsyncAuthorizedSession.Úclientr'  c                 óV   •— t          ¦   «                              ¦   «          || _        d S r�   )r  r›   Ú_client)r™   r�  r  s     €r/   r›   zQBaseApiClient._get_aiohttp_session.<locals>._RefreshableAsyncCredentials.__init__è  s$   ø€ Ý‰gŒg×ÒÑ Ô Ð Ø#ˆdŒlˆlˆlr.   Úrequestr{   rz   r<   r0   Nc              “   óÂ   K  — | j                              ¦   «         ƒ d {V —†}d|› �|d<   | j         j        r'| j         j        j        r| j         j        j        |d<   d S d S d S )NúBearer ÚAuthorizationúx-goog-user-project)r‘  Ú_async_access_tokenrC  Úquota_project_id)r™   r’  r{   rz   r<   Útokens         r/   Úbefore_requestzWBaseApiClient._get_aiohttp_session.<locals>._RefreshableAsyncCredentials.before_requestì  sŽ   è è € ð !œL×<Ò<Ñ>Ô>Ð>Ð>Ð>Ð>Ð>Ð>ˆeØ):°5Ð):Ð):ˆg�oÑ&à”,Ô+ðà”lÔ/Ô@ðð
 ”LÔ-Ô>ð Ð-Ñ.Ð.Ð.ð	ð ð ð r.   c                 óB   — | j         j        sdS | j         j        j         S ©NF)r‘  rC  Úexpiredr    s    r/   ÚvalidzNBaseApiClient._get_aiohttp_session.<locals>._RefreshableAsyncCredentials.validý  s%   € à”\Ô.ð Ø�uØœÔ2Ô:Ð:Ð:r.   )r�  r'  )r)   r*   r+   r,   r›   r   rW   r}   rš  rå   rN  rž  r  r  s   @r/   Ú_RefreshableAsyncCredentialsrŽ  å  s¶   ø€ € € € € Ø\Ð\ð$ð $ð $ð $ð $ð $ðàðð ðð ð	ð
 ˜c 3˜hœðð ðð ð ð ð" ð;˜tð ;ð ;ð ;ñ ŒXð;ð ;ð ;ð ;ð ;r.   rŸ  c                   ó"   — e Zd Zefdeddfd„ZdS )ú@BaseApiClient._get_aiohttp_session.<locals>.AiohttpClientSessionÚ	_warningsr0   Nc                 óH   — | j         s| ddœ}| j        �| j        |d<   d S d S d S )NzUnclosed client session)Úclient_sessionÚmessageÚsource_traceback)r}  Ú_source_traceback)r™   r¢  Úcontexts      r/   r  zHBaseApiClient._get_aiohttp_session.<locals>.AiohttpClientSession.__del__
  sR   € Ø”;ð Eà$(Ø6ðð ˆgð Ô'Ð3Ø.2Ô.D�Ð*Ñ+Ð+Ð+ðEð Eð
 4Ð3r.   ©r)   r*   r+   r>  r   r  r-   r.   r/   ÚAiohttpClientSessionr¡    sG   € € € € € à-5ð Eð E sð E¸$ð Eð Eð Eð Eð Eð Er.   rª  c                   ó"   — e Zd Zefdeddfd„ZdS )ú?BaseApiClient._get_aiohttp_session.<locals>.AiohttpTCPConnectorr¢  r0   Nc                 óÊ   — | j         rd S | j        sd S d„ | j                             ¦   «         D ¦   «         }|                      ¦   «          | |ddœ}| j        �| j        |d<   d S d S )Nc                 ó,   — g | ]}t          |¦  «        ‘ŒS r-   )Úrepr)r‹   r±   s     r/   r…  z[BaseApiClient._get_aiohttp_session.<locals>.AiohttpTCPConnector.__del__.<locals>.<listcomp>  s   € Ð;Ð;Ð; •T˜!‘W”WÐ;Ð;Ð;r.   zUnclosed connector)Ú	connectorÚconnectionsr¥  r¦  )r  Ú_connsÚvaluesÚ_closer§  )r™   r¢  Úconnsr¨  s       r/   r  zGBaseApiClient._get_aiohttp_session.<locals>.AiohttpTCPConnector.__del__  sŠ   € ØŒ|ð ØˆfØ”;ð ØˆfØ;Ð; d¤k×&8Ò&8Ñ&:Ô&:Ð;Ñ;Ô;ˆEà�KŠK‰MŒMˆMà!Ø$Ø/ðð ˆGð
 Ô%Ð1Ø,0Ô,BˆgÐ(Ñ)Ð)Ð)ð 2Ð1r.   r©  r-   r.   r/   ÚAiohttpTCPConnectorr¬    sG   € € € € € à-5ð Cð C sð C¸$ð Cð Cð Cð Cð Cð Cr.   r¶  )ÚlimitT)r°  Ú	trust_envÚread_bufsize)rD  rˆ  r#  r$  rG  r†  rU  r6   r€  rY  ru  rv  r   ÚAsyncAuthorizedSessionrZ  rÐ   ÚClientSessionÚTCPConnectorrÖ   )	r™   r„  r{  ru  ÚAsyncCredentialsrº  rŸ  rª  r¶  s	            r/   Ú_get_aiohttp_sessionz"BaseApiClient._get_aiohttp_sessionÎ  s·  è è € ð ÔÔ(ð /ØÔÔ.Ð.åÔ#Ñ%Ô%€Dà	Ô	ð ð Ø
×'Ò'¨Ô(>Ñ?Ô?Ð?ØÔ&×*Ò*¨4Ñ0Ô0€gØ	Ð	 ×!8Ò!8¸Ñ!AÔ!AÐ	Øˆð	ð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð €Ø	×	$Ò	$Ñ	&Ô	&ð M
ð&	Ø
Ð
Ð
Ð
à&×4Ò4Ð5RÑSÔSÔ_Ð
Ø#,×#:Ò#:Ð;_Ñ#`Ô#`Ô#wÐ
 ð;ð ;ð ;ð ;ð ;Ð-=ñ ;ô ;ð ;ð< +Ð*Ð+GÐ+GÈÑ+MÔ+MÑNÔNˆ'ˆ'øÝð 	ð 	ð 	Ø
ˆ$ð	øøøð		Eð 		Eð 		Eð 		Eð 		E¥7Ô#8ñ 		Eô 		Eð 		Eð	Cð 	Cð 	Cð 	Cð 	C¥'Ô"6ñ 	Cô 	Cð 	Cð& 'Ð&Ø)Ð)°Ð2Ñ2Ô2ØÝ)ð
ñ 
ô 
ˆð 
ð 1ØÔ!ð 	1ð 	1Ø)0ˆ$Ô
  Ñ
&ð	1ð 	1ð 	1ñ 	1ô 	1ð 	1ð 	1ð 	1ð 	1ð 	1ð 	1øøøð 	1ð 	1ð 	1ð 	1ð €Ns7   µABÂBÂBÂ1AD Ä
DÄDÅ2F	Æ	FÆFFrF   c                 óš  ‡— dŠ| j         }| j        }|r|                     ‰¦  «        n|r|                     ‰¦  «        nd}|€¼|rVt          t          dd¦  «        }|�>	  |¦   «         }n2# t
          $ r%}t                               d|¦  «         Y d}~nd}~ww xY w|€bt          j	        t          j                             dt          j        ¦   «         ¦  «        t          j                             d¦  «        ¬¦  «        }dt          t          j                 d	t          j        d
t          j        fˆfd„} |||¦  «         |||¦  «        fS )a,  Ensures the SSL context is present in the HTTPX client args.

    Creates a default SSL context if one is not provided.

    Args:
      options: The http options to check for SSL context.
      vertexai: Whether Vertex AI is enabled.

    Returns:
      A tuple of sync/async httpx client args.
    ÚverifyNÚget_default_ssl_contextú6Failed to get default SSL context from google-auth: %sÚSSL_CERT_FILEÚSSL_CERT_DIR©ÚcafileÚcapathÚargsÚctxr0   c                 ó*  •— | pi                       ¦   «         } |                      ‰¦  «        s|| ‰<   d| vrd| d<   |                       ¦   «         }|                      ¦   «         D ]/}|t          j        t          j        j        ¦  «        j        vr||= Œ0|S )á-  Sets the SSL context in the client args if not set.

      Does not override the SSL context if it is already set.

      Args:
        args: The client args to to check for SSL context.
        ctx: The SSL context to set.

      Returns:
        The client args with the SSL context included.
      ru   N)r¸   r6   ÚinspectÚ	signaturerã   ÚClientr›   Ú
parameters©rÈ  rÉ  Úcopied_argsrR   rÀ  s       €r/   Ú
_maybe_setz7BaseApiClient._ensure_httpx_ssl_ctx.<locals>._maybe_setb  s    ø€ ð ˆj�b×ÒÑ Ô €dØ�XŠX�fÑÔð ØˆˆV‰Ø	˜$Ð	Ð	ØˆˆY‰à—I’I‘K”K€kØ×!Ò!Ñ#Ô#ð ð ˆ#Ø•gÔ'­¬Ô(=Ñ>Ô>ÔIÐIÐIØ˜#ÐøØÐr.   )rk  rl  r6   rL   r   r  r7   r8   r9  Úcreate_default_contextr4   r5   ÚcertifiÚwherer   r   Ú
StringDictÚ
SSLContext)	rF   r(  rÈ  Ú
async_argsrÉ  Ú
get_ctx_fnrâ   rÒ  rÀ  s	           @r/   rM  z#BaseApiClient._ensure_httpx_ssl_ctx3  s”  ø€ ð" €FØÔ€DØÔ*€Jð ð	ˆ�Š�ÑÔÐð ð�Z—^’^ FÑ+Ô+Ð+àð ð €{ð
 
ð XÝ�TÐ#<¸dÑCÔCˆ
ØÐ!ðXØ�*‘,”,ˆCˆCøÝð Xð Xð XÝ�NŠNÐSÐUVÑWÔWÐWÐWÐWÐWÐWÐWøøøøðXøøøð 
ˆÝÔ(Ý”:—>’> /µ7´=±?´?ÑCÔCÝ”:—>’> .Ñ1Ô1ð
ñ 
ô 
ˆð
Ý•wÔ)Ô*ðåŒ^ðõ 
Ô	ðð ð ð ð ð ð8 	ˆ
�4˜ÑÔØˆ
�:˜sÑ#Ô#ðð s   Á
A* Á*
BÁ4BÂBc                 óF  ‡— dŠ| j         }|r|                     ‰¦  «        nd}|€¼|rVt          t          dd¦  «        }|�>	  |¦   «         }n2# t          $ r%}t
                               d|¦  «         Y d}~nd}~ww xY w|€bt          j        t          j
                             dt          j        ¦   «         ¦  «        t          j
                             d¦  «        ¬¦  «        }dt          t          j                 d	t          j        d
t          j        fˆfd„} |||¦  «        S )á1  Ensures the SSL context is present in the async client args.

    Creates a default SSL context if one is not provided.

    Args:
      options: The http options to check for SSL context.
      vertexai: Whether Vertex AI is enabled.

    Returns:
      An async aiohttp ClientSession._request args.
    r9  NrÁ  rÂ  rÃ  rÄ  rÅ  rÈ  rÉ  r0   c                 ó  •— | r|                       ‰¦  «        s| pi                      ¦   «         } || ‰<   |                      ¦   «         }|                     ¦   «         D ]/}|t          j        t          j        j        ¦  «        j        vr||= Œ0|S )rË  )r6   r¸   rÌ  rÍ  rÐ   r»  Ú_requestrÏ  rÐ  s       €r/   rÒ  z9BaseApiClient._ensure_aiohttp_ssl_ctx.<locals>._maybe_set¥  s�   ø€ ð ð ˜Ÿš &Ñ)Ô)ð Ø�
˜× Ò Ñ"Ô"ˆØˆˆV‰à—I’I‘K”K€kØ×!Ò!Ñ#Ô#ð ð ˆ#àÝÔ$¥WÔ%:Ô%CÑDÔDÔOðPð Pð ˜#ÐøØÐr.   ©rl  r6   rL   r   r  r7   r8   r9  rÓ  r4   r5   rÔ  rÕ  r   r   rÖ  r×  ©rF   r(  rØ  rÉ  rÙ  râ   rÒ  rÀ  s          @r/   rW  z%BaseApiClient._ensure_aiohttp_ssl_ctx‚  sO  ø€ ð  €FØÔ*€JØ$.Ð
8ˆ*�.Š.˜Ñ
 Ô
 Ð
 °D€Cà
€{Ø	ð XÝ�TÐ#<¸dÑCÔCˆ
ØÐ!ðXØ�*‘,”,ˆCˆCøÝð Xð Xð XÝ�NŠNÐSÐUVÑWÔWÐWÐWÐWÐWÐWÐWøøøøðXøøøð 
ˆÝÔ(Ý”:—>’> /µ7´=±?´?ÑCÔCÝ”:—>’> .Ñ1Ô1ð
ñ 
ô 
ˆð
Ý•wÔ)Ô*ðåŒ^ðõ 
Ô	ðð ð ð ð ð ð8 ˆ:�j #Ñ&Ô&Ð&ó   Á
A Á
A;ÁA6Á6A;c                 óF  ‡— dŠ| j         }|r|                     ‰¦  «        nd}|€¼|rVt          t          dd¦  «        }|�>	  |¦   «         }n2# t          $ r%}t
                               d|¦  «         Y d}~nd}~ww xY w|€bt          j        t          j
                             dt          j        ¦   «         ¦  «        t          j
                             d¦  «        ¬¦  «        }dt          t          j                 d	t          j        d
t          j        fˆfd„} |||¦  «        S )rÛ  r9  NrÁ  rÂ  rÃ  rÄ  rÅ  rÈ  rÉ  r0   c                 ó  •— | r|                       ‰¦  «        s| pi                      ¦   «         } || ‰<   |                      ¦   «         }|                     ¦   «         D ]+}|t          j        t          ¦  «        j        vr	|dk    r||= Œ,|S )rË  r9  )r6   r¸   rÌ  rÍ  Ú
ws_connectrÏ  rÐ  s       €r/   rÒ  z;BaseApiClient._ensure_websocket_ssl_ctx.<locals>._maybe_setì  s–   ø€ ð ð ˜Ÿš &Ñ)Ô)ð Ø�
˜× Ò Ñ"Ô"ˆØˆˆV‰à—I’I‘K”K€kØ×!Ò!Ñ#Ô#ð ð ˆ#Ø•gÔ'­
Ñ3Ô3Ô>Ð>Ð>À3È%Â<À<Ø˜#ÐøØÐr.   rÞ  rß  s          @r/   r\  z'BaseApiClient._ensure_websocket_ssl_ctxÃ  sQ  ø€ ð" €FØÔ*€JØ$.Ð
8ˆ*�.Š.˜Ñ
 Ô
 Ð
 °D€Cà
€{ð 
ð XÝ�TÐ#<¸dÑCÔCˆ
ØÐ!ðXØ�*‘,”,ˆCˆCøÝð Xð Xð XÝ�NŠNÐSÐUVÑWÔWÐWÐWÐWÐWÐWÐWøøøøðXøøøð 
ˆÝÔ(Ý”:—>’> /µ7´=±?´?ÑCÔCÝ”:—>’> .Ñ1Ô1ð
ñ 
ô 
ˆð
Ý•wÔ)Ô*ðåŒ^ðõ 
Ô	ðð ð ð ð ð ð2 ˆ:�j #Ñ&Ô&Ð&rà  c                 ór   — t           o0| j        j        pi                      d¦  «        d u o| j        j        d u S )NÚ	transport)rÏ   rD  rl  r6   rS  r    s    r/   rV  zBaseApiClient._use_aiohttp  sJ   € õ 	ð 	<ØÔÔ1Ð7°R×<Ò<¸[ÑIÔIØðð	<ð ÔÔ2°dÐ:ð	r.   c                 óÎ   — | j         r| j        p| j        }| j        r	|s| j        S t	          | j        j        ¦  «        }|                     d¬¦  «                             ¦   «         S )NÚwss)Úscheme)	rf   r+  r*  r)  r   rD  r[   rb   Úgeturl)r™   rj  Ú	url_partss      r/   Ú_websocket_base_urlz!BaseApiClient._websocket_base_url  sl   € Øœ<Ð9¨D¬MÐJ¸d¼lÐØÔð "Ð$7ð "ð Ô!Ð!Ý˜Ô+Ô4Ñ5Ô5€IØ×Ò UÐÑ+Ô+×2Ò2Ñ4Ô4Ð4r.   c                 óþ   — | j         5  | j        s+t          | j        ¬¦  «        \  | _        }| j        s|| _        | j        r!t	          | | j        ¦  «        cddd¦  «         S t          d¦  «        ‚# 1 swxY w Y   dS )z/Retrieves the access token for the credentials.r5  Nú0Could not resolve API token from the environment)rG  rC  ro   rf   Úget_token_from_credentialsr‰  )r™   rf   s     r/   Ú_access_tokenzBaseApiClient._access_token  sæ   € à	Ô	ð 	Oð 	OØÔð !Ý%.°t´|Ð%DÑ%DÔ%DÑ"ˆÔ˜7ØŒ|ð 	!Ø ˆ$Œ,à	Ô	ð OÝ)¨$°Ô0AÑBÔBð	Oð 	Oð 	Oð 	Oñ 	Oô 	Oð 	Oð 	Oõ ÐMÑNÔNÐNð	Oð 	Oð 	Oð 	Oøøøð 	Oð 	Oð 	Oð 	Oð 	Oð 	Os   ˆAA2Á#A2Á2A6Á9A6c              ƒ   ó  K  — t          j        ¦   «         }| j        5  |                      | j        ¦  «         || j        vrt          j        ¦   «         | j        |<   | j        |         cddd¦  «         S # 1 swxY w Y   dS )a  Lazily initializes and returns an asyncio.Lock for async authentication.

    This method ensures that a single `asyncio.Lock` instance is created and
    shared among all asynchronous operations that require authentication
    within the same event loop.
    N)r#  r$  rG  r†  rH  rF  rŠ  s     r/   Ú_get_async_auth_lockz"BaseApiClient._get_async_auth_lock'  sÆ   è è € õ Ô#Ñ%Ô%€DØ	Ô	ð *ð *Ø
×'Ò'¨Ô(>Ñ?Ô?Ð?Ø	�TÔ+Ð	+Ð	+Ý'.¤|¡~¤~ˆÔ˜tÑ$ØÔ# DÔ)ð	*ð *ð *ð *ñ *ô *ð *ð *ð *ð *ð *ð *øøøð *ð *ð *ð *ð *ð *s   �AA5Á5A9Á<A9c              ƒ   óŠ  K  — | j         sŠ|                      ¦   «         ƒ d{V —†}|4 ƒd{V —† | j         s<t          j        t          | j        ¬¦  «        ƒ d{V —†\  | _         }| j        s|| _        	 ddd¦  «        ƒd{V —† n# 1 ƒd{V —†swxY w Y   | j         rt          | | j         ¦  «        ƒ d{V —†S t          d¦  «        ‚)z>Retrieves the access token for the credentials asynchronously.Nr5  rí  )rC  rñ  r#  Ú	to_threadro   rf   Ú async_get_token_from_credentialsr‰  )r™   Úasync_auth_lockrf   s      r/   r—  z!BaseApiClient._async_access_token5  s¨  è è € àÔð #Ø"×7Ò7Ñ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9€oØ ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð Ô ð 	#å-4Ô->Ý ¤ð.ñ .ô .ð (ð (ð (ð (ð (ð (Ñ
$ˆ$Ô
˜Wð ”ð #Ø"ˆDŒLÐ"ð	#ð 	#ð 	#ñ 	#ô 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#øøøð 	#ð 	#ð 	#ð 	#ð Ôð MÝ3Ø
Ø
Ô
ñô ð ð ð ð ð ð ð õ
 ÐKÑLÔLÐLs   ¬ABÂ
BÂBÚhttp_methodr\   Úrequest_dictc                 óü  — d„ |                      ¦   «         D ¦   «         }|D ]}||= Œ|rSt          |t          ¦  «        rt          | j        |¦  «        }n/t          | j        t          j        |¦  «        ¦  «        }n| j        }d}| j        r|dk    r|                     d¦  «        rd}| j        rW|                     d¦  «        sB|s@| j        s| j	        r2| j
        r|j        t          j        k    sd| j        › d| j	        › d�|z   }|j        €d|› �}	n|j        › d|› �}	|j        �|j        st!          d	¦  «        ‚|j        }
t#          |d
¦  «        r!|j        rt'          j        ||j        ¦  «         |
}| j
        r| j        r| j	        s| j        r7|j        t          j        k    rt-          |
|¦  «        }n=t-          |
|	¦  «        }n,| j
        r%|j        t          j        k    rt-          |
|¦  «        }| j        r)| j                             d¦  «        rt/          d¦  «        ‚t1          |j        ¦  «        }|j        €t!          d¦  «        ‚t7          |j        |¦  «         t9          |||j        ||¬¦  «        S )Nc                 ó<   — g | ]}|                      d ¦  «        ¯|‘ŒS )ry  )ra   )r‹   rR   s     r/   r…  z0BaseApiClient._build_request.<locals>.<listcomp>T  s)   € ÐPÐPÐP˜c¸C¿NºNÈ3Ñ<OÔ<OÐP�cÐPÐPÐPr.   Fr6   zpublishers/Tz	projects/z/locations/r^   zBase URL must be set.Ú
extra_bodyzauth_tokens/z4Ephemeral tokens can only be used with the live API.zRequest headers must be set.©r{   rz   r<   r|   ru   )rK   r’   r   rT   rD  r@  r(  ra   rf   r+  r)  rB  r   Ú
COLLECTIONrK  r[   rl   rp  rú  r   Úrecursive_dict_updater*  re   r(   rw   ru   r<   rZ   ry   )r™   rö  r\   r÷  r,  Úkeys_to_deleterR   Úpatched_http_optionsÚquery_vertex_base_modelsÚversioned_pathr[   rz   rU   s                r/   Ú_build_requestzBaseApiClient._build_requestL  sQ  € ð QÐP \×%6Ò%6Ñ%8Ô%8ÐPÑPÔP€NØð ð ˆØ
�sÐ
Ð
àð 0Ý	�L¥+Ñ	.Ô	.ð 
Ý1ØÔØñ 
ô  
ÐÐõ
  2ØÔ¥Ô :¸<Ñ HÔ Hñ 
ô  
ÐÐð "Ô/Ðà$ÐàŒð&à˜5Ò Ð Ø�OŠO˜MÑ*Ô*ð !ð "&ÐàŒðJà—’ Ñ,Ô,ðJð )ðJð Œ\ð	Jð "œ]ð	Jð Ô ðJð %Ô<ÝÔ'ò(ð (ð C˜œÐBÐB°$´-ÐBÐBÐBÀTÑI€dàÔ'Ð/Ø!˜4�z�z€n€nà.Ô:ÐCÐC¸TÐCÐC€nð 	Ô%Ð-Ø#Ô,ð 	.õ Ð.Ñ/Ô/Ð/à%Ô.€hõ 	Ð$ lÑ3Ô3ðà Ô+ðõ Ô#Ø
Ð,Ô7ñô ð ð €CàÔ ð*àŒLð*à!œ]ð*ð Œ<ð*ð Ô
6ÝÔ%ò&ð &õ ˜H dÑ+Ô+ˆˆåØØñ
ô 
ˆˆð
 	Ôð*à Ô8½MÔ<TÒTÐTå˜( DÑ)Ô)€cà„|ð ˜œ×/Ò/°Ñ?Ô?ð Ý%Ø
@ñô ð õ 0Ð0DÔ0LÑMÔMÐàÔ#Ð+ÝÐ5Ñ6Ô6Ð6Ý"ØÔ$Ð&8ñô ð õ ØØØ$Ô,ØØ"ðñ ô ð r.   Úhttp_requestÚstreamc                 ó¸  — d }| j         r~| j        s| j        rp| j        sid|                      ¦   «         › �|j        d<   | j        r | j        j        r| j        j        |j        d<   |j        rt          j
        |j        ¦  «        nd }nK|j        rDt          |j        t          ¦  «        s#|j        rt          j
        |j        ¦  «        nd }n|j        }|                      ¦   «         rèt          |j        ¦  «        }| j        €Jddlm}  || j        d¬¦  «        | _        t'          j        ¦   «         }| j                             |¦  «         | j        j        r5d|v r1d	|v r|                     d
d¦  «        }n|                     dd¦  «        }| j                             |j                             ¦   «         |||j        |j        |¬¦  «        }nO| j                             |j        |j        ||j        |j        ¬¦  «        }| j                             ||¬¦  «        }t>          j          !                    |¦  «         tE          |j        |r|n|j#        g¦  «        S )Nr”  r•  r–  r   r   r   ©Úmax_refresh_attemptsúgoogleapis.comÚsandboxúsandbox.googleapis.comúmtls.sandbox.googleapis.comúmtls.googleapis.com©r{   rz   r|   r<   ru   r  ©r{   rz   rÔ   r<   ru   ©r  )$r(  rf   r+  r*  rï  r<   rC  r˜  r|   rª   Údumpsr’   r€   rr  rW   rz   rP  rr   r    r   Údefault_client_cert_sourceÚconfigure_mtls_channelÚ_is_mtlsÚreplacer’  r{   Úupperru   rR  Úbuild_requestÚsendr   rì   Úraise_for_responser   Útext)	r™   r  r  r|   rz   r    Úclient_cert_sourcerÜ   Úhttpx_requests	            r/   Ú_request_oncezBaseApiClient._request_once·  s¯  € ð
 )-€Dà„}ð #˜$œ,ð #¨$¬-ð #ÀÄð #Ø.N¸×8JÒ8JÑ8LÔ8LÐ.NÐ.N€lÔ˜?Ñ+Ø	Ô	ð 
˜tÔ0ÔAð 
àÔÔ.ð 	ÔÐ2Ñ3ð /;Ô.?ÐI�TŒZ˜Ô)Ñ*Ô*Ð*ÀT€d€dà	Ô	ð #Ý˜,Ô+­UÑ3Ô3ð 	#Ø2>Ô2CÐM•”˜LÔ-Ñ.Ô.Ð.Èˆ$ˆ$àÔ"ˆ$à×!Ò!Ñ#Ô#ð $GÝ�Ô Ñ!Ô!€cØ	Ô	!Ð	)ØDÐDÐDÐDÐDÐDà#4Ð#4ØÔØ!"ð$
ñ $
ô $
ˆÔ õ "Ô<Ñ>Ô>ÐØÔ ×7Ò7Øñ	
ô 	
ð 	
ð 
Ô	!Ô	*ð EÐ/?À3Ð/FÐ/FØ˜ÐÐØ—’Ø&Ð(Eñô ˆ#ˆ#ð —’Ð,Ð.CÑDÔDˆ#ØÔ)×1Ò1ØÔ$×*Ò*Ñ,Ô,ØØØÔ&ØÔ&Øð 2ñ ô €h€hð Ô(×6Ò6ØÔ$ØÔØØÔ&ØÔ&ð 7ñ ô €mð Ô#×(Ò(¨¸vÐ(ÑFÔF€hÝ
„O×&Ò& xÑ0Ô0Ð0ÝØÔ fÐA˜(˜(°8´=°/ñô ð r.   c                 ó   — |rat          |t          ¦  «        rt          di |¤Žn|}|j        r7t	          |j        ¦  «        }t          j        di |¤Ž} || j        ||¦  «        S |                      | j        ||¦  «        S ©Nr-   )	r’   r}   r   r[  r	  rø   r^  r  r_  ©r™   r  r,  r  Úparameter_modelrm  rõ   s          r/   rÝ  zBaseApiClient._requestö  sž   € ð ð 
?õ ˜¥dÑ+Ô+ð�+Ð
%Ð
%˜Ð
%Ð
%Ð
%àð ð 
Ô	&ð ?Ý! /Ô"?Ñ@Ô@ˆÝÔ!Ð1Ð1 LÐ1Ð1ˆØˆu�TÔ'¨°vÑ>Ô>Ð>à�;Š;�tÔ)¨<¸Ñ@Ô@Ð@r.   c              ƒ   óR  K  — d }| j         ra| j        s| j        rS| j        sLd|                      ¦   «         ƒ d {V —†› �|j        d<   | j        r | j        j        r| j        j        |j        d<   |j        rNt          |j        t          ¦  «        s-t          j        |j        ¦  «                             d¦  «        }n|j        }|�rú|                      ¦   «         �rV|                      ¦   «         ƒ d {V —†}|j        }|                      ¦   «         rjt%          j        ¦   «         }|                     |¦  «        ƒ d {V —† |j        r5d|v r1d|v r|                     dd¦  «        }n|                     dd	¦  «        }	  |j        d|j        ||j        |t3          j        |j        ¬
¦  «        dœ| j        ¤Žƒ d {V —†}�n## t2          j        t2          j        t2          j        t2          j         tB          j"        f$ rä}tG          j$        dtK          j&        dd¦  «        z   ¦  «        ƒ d {V —† tN           (                    d|z  ¦  «         |  )                    | j*        tW          | j         ¦  «        ¬¦  «        | _        |                      ¦   «         ƒ d {V —†} |j        d|j        ||j        |t3          j        |j        ¬
¦  «        dœ| j        ¤Žƒ d {V —†}Y d }~nd }~ww xY wtX          j-         .                    |¦  «        ƒ d {V —† t_          |d¦  «        r|j0        }tc          |j        |¦  «        S | j2         3                    |j        |j        ||j        |j        ¬¦  «        }	| j2         4                    |	|¬¦  «        ƒ d {V —†}
tX          j-         .                    |
¦  «        ƒ d {V —† tc          |
j        |
¦  «        S |                      ¦   «         �rÜ|                      ¦   «         ƒ d {V —†}|j        }|                      ¦   «         rjt%          j        ¦   «         }|                     |¦  «        ƒ d {V —† |j        r5d|v r1d|v r|                     dd¦  «        }n|                     dd	¦  «        }	  |j        d|j        ||j        |t3          j        |j        ¬
¦  «        dœ| j        ¤Žƒ d {V —†}tX          j-         .                    |¦  «        ƒ d {V —† |}t_          |d¦  «        r|j0        }tc          |j        | 5                    ¦   «         ƒ d {V —†g¦  «        S # t2          j        t2          j        t2          j        t2          j         tB          j"        f$ �rP}tG          j$        dtK          j&        dd¦  «        z   ¦  «        ƒ d {V —† tN           (                    d|z  ¦  «         |  )                    | j*        tW          | j         ¦  «        ¬¦  «        | _        |                      ¦   «         ƒ d {V —†} |j        d|j        ||j        |t3          j        |j        ¬
¦  «        dœ| j        ¤Žƒ d {V —†}tX          j-         .                    |¦  «        ƒ d {V —† |}t_          |d¦  «        r|j0        }tc          |j        | 5                    ¦   «         ƒ d {V —†g¦  «        cY d }~S d }~ww xY w| j2                             |j        |j        |j        ||j        ¬¦  «        ƒ d {V —†}
tX          j-         .                    |
¦  «        ƒ d {V —† tc          |
j        |
j5        g¦  «        S )Nr”  r•  r–  rÎ   r  r	  r
  r  r  ©Útotalrû  r   r   é	   z!Retrying due to aiohttp error: %sr8  Ú	_responser  r  ©r{   rz   r<   rÔ   ru   r-   )6r(  rf   r+  r*  r—  r<   rC  r˜  r|   r’   r€   rª   r  ÚencoderV  r¾  rz   rY  r   r  r  r  r  r’  r{   rÐ   ÚClientTimeoutru   rX  ÚClientConnectorErrorÚClientConnectorDNSErrorÚClientOSErrorÚServerDisconnectedErrorÚauth_exceptionsÚTransportErrorr#  ÚsleepÚrandomÚrandintr7   rI  rW  rD  rN  r   rì   Úraise_for_async_responserp  r%  r   rT  r  r  r  )r™   r  r  r|   r{  rz   r  rÜ   râ   r  Úclient_responseÚunwrapped_responseÚunwrapped_retry_responses                r/   Ú_async_request_oncez!BaseApiClient._async_request_once
  sQ	  è è € ð !€Dð „}ð 
˜$œ,ð 
¨$¬-ð 
ÀÄð 
à
6˜$×2Ò2Ñ4Ô4Ð4Ð4Ð4Ð4Ð4Ð4Ð
6Ð
6ð Ô˜?Ñ+ð 
Ô	ð 
˜tÔ0ÔAð 
àÔÔ.ð 	ÔÐ2Ñ3ð Ôð !Ý˜Ô)­5Ñ1Ô1ð !ÝŒz˜,Ô+Ñ,Ô,×3Ò3°GÑ<Ô<ˆˆàÔ ˆàñ WMØ	×	Ò	Ñ	Ô	ñ GFØ×1Ò1Ñ3Ô3Ð3Ð3Ð3Ð3Ð3Ð3ˆØÔˆØ×&Ò&Ñ(Ô(ð 	IÝ#Ô>Ñ@Ô@Ð
Ø×.Ò.Ø ñô ð ð ð ð ð ð ð ð Ôð IÐ"2°cÐ"9Ð"9Ø˜CÐÐØ—K’KØ*Ð,Iñô ˆcˆcð —K’KÐ 0Ð2GÑHÔHˆcð"	Ø*˜7œ?ð Ø!Ô(ØØ"Ô*ØÝÔ+°,Ô2FÐGÑGÔGðð ð Ô7ðð ð ð ð ð ð ð ˆ(‰(øõ Ô(ÝÔ+ÝÔ!ÝÔ+ÝÔ*ð
ð 	ð 	ð 	õ ”˜a¥&¤.°°AÑ"6Ô"6Ñ6Ñ7Ô7Ð
7Ð
7Ð
7Ð
7Ð
7Ð
7Ð
7Ý
�+Š+Ð9¸AÑ=Ñ
>Ô
>Ð
>ð ×*Ò*ØÔ$Ý ¤Ñ.Ô.ð +ñ ô ð Ô
1ð ×3Ò3Ñ5Ô5Ð5Ð5Ð5Ð5Ð5Ð5ˆ'Ø*˜7œ?ð Ø!Ô(ØØ"Ô*ØÝÔ+°,Ô2FÐGÑGÔGðð ð Ô7ðð ð ð ð ð ð ð ˆ(ˆ(ˆ(ˆ(ˆ(ˆ(øøøøð%	øøøõ6 Œo×6Ò6°xÑ@Ô@Ð@Ð@Ð@Ð@Ð@Ð@Ð@Ý�8˜[Ñ)Ô)ð 	(ð Ô'ˆ(Ý˜HÔ,¨hÑ7Ô7Ð7ð Ô0×>Ò>ØÔ&ØÔ ØØ Ô(Ø Ô(ð ?ñ 
ô 
ˆð !%Ô 8× =Ò =ØØð !>ñ !
ô !
ð 
ð 
ð 
ð 
ð 
ð 
ˆõ Œo×6Ò6°ÑGÔGÐGÐGÐGÐGÐGÐGÐGÝ˜OÔ3°_ÑEÔEÐEà	×	Ò	Ñ	Ô	ñ MMØ×1Ò1Ñ3Ô3Ð3Ð3Ð3Ð3Ð3Ð3ˆØÔˆØ×&Ò&Ñ(Ô(ð 	IÝ#Ô>Ñ@Ô@Ð
Ø×.Ò.Ø ñô ð ð ð ð ð ð ð ð Ôð IÐ"2°cÐ"9Ð"9Ø˜CÐÐØ—K’KØ*Ð,Iñô ˆcˆcð —K’KÐ 0Ð2GÑHÔHˆcð3	Ø*˜7œ?ð Ø!Ô(ØØ"Ô*ØÝÔ+°,Ô2FÐGÑGÔGðð ð Ô7ðð ð ð ð ð ð ð ˆ(õ ”×8Ò8¸ÑBÔBÐ
BÐ
BÐ
BÐ
BÐ
BÐ
BÐ
BØ$,Ð
ÝÐ'¨Ñ5Ô5ð >Ø!3Ô!=ÐåØ Ô(Ð1C×1HÒ1HÑ1JÔ1JÐ+JÐ+JÐ+JÐ+JÐ+JÐ+JÐ*Kñô ð øõ Ô(ÝÔ+ÝÔ!ÝÔ+ÝÔ*ð
ð "	ñ "	ð "	õ ”˜a¥&¤.°°AÑ"6Ô"6Ñ6Ñ7Ô7Ð
7Ð
7Ð
7Ð
7Ð
7Ð
7Ð
7Ý
�+Š+Ð9¸AÑ=Ñ
>Ô
>Ð
>ð ×*Ò*ØÔ$Ý ¤Ñ.Ô.ð +ñ ô ð Ô
1ð ×3Ò3Ñ5Ô5Ð5Ð5Ð5Ð5Ð5Ð5ˆ'Ø*˜7œ?ð Ø!Ô(ØØ"Ô*ØÝÔ+°,Ô2FÐGÑGÔGðð ð Ô7ðð ð ð ð ð ð ð ˆ(õ ”×8Ò8¸ÑBÔBÐ
BÐ
BÐ
BÐ
BÐ
BÐ
BÐ
BØ*2Ð
"ÝÐ-¨{Ñ;Ô;ð JØ'?Ô'IÐ$åØ&Ô.Ø-×2Ò2Ñ4Ô4Ð4Ð4Ð4Ð4Ð4Ð4Ð5ñô ð ð ð ð ð ð øøøøð?"	øøøðJ !%Ô 8× @Ò @ØÔ&ØÔ Ø Ô(ØØ Ô(ð !Añ !
ô !
ð 
ð 
ð 
ð 
ð 
ð 
ˆõ Œo×6Ò6°ÑGÔGÐGÐGÐGÐGÐGÐGÐGÝ˜OÔ3°oÔ6JÐ5KÑLÔLÐLs:   Å:A F< Æ<<KÇ8CKËKÑ4B+T  Ô =Z-ÕEZ(Ú"Z-Ú(Z-c              ƒ   ó  K  — |rgt          |t          ¦  «        rt          di |¤Žn|}|j        r=t	          |j        ¦  «        }t          j        di |¤Ž} || j        ||¦  «        ƒ d {V —†S |                      | j        ||¦  «        ƒ d {V —†S r  )	r’   r}   r   r[  r	  rø   r`  r6  ra  r  s          r/   Ú_async_requestzBaseApiClient._async_request·  sÝ   è è € ð ð 
Kõ ˜¥dÑ+Ô+ð�+Ð
%Ð
%˜Ð
%Ð
%Ð
%àð ð 
Ô	&ð KÝ! /Ô"?Ñ@Ô@ˆÝÔ&Ð6Ð6¨Ð6Ð6ˆØ�U˜4Ô3°\À6ÑJÔJÐJÐJÐJÐJÐJÐJÐJØ×"Ò"ØÔ  ,°ñô ð ð ð ð ð ð ð r.   c                 ó|   — t          | j        t          ¦  «        r| j                             ¦   «         }n| j        }|S r�   )r’   rD  r   Ú
model_dump)r™   Úcopieds     r/   Úget_read_only_http_optionsz(BaseApiClient.get_read_only_http_optionsÌ  s:   € Ý�$Ô$¥iÑ0Ô0ð "ØÔ!×,Ò,Ñ.Ô.€f€fàÔ!€fØ€Mr.   c                 óº   — |                       ||||¦  «        }|                      ||d¬¦  «        }|j        r|j        d         nd}t          |j        |¬¦  «        S )NFr  r   r§   ©r<   Úbody)r  rÝ  rƒ   ÚSdkHttpResponser<   )r™   rö  r\   r÷  r,  r  rÜ   Úresponse_bodys           r/   r’  zBaseApiClient.requestÓ  sp   € ð ×&Ò&Ø�T˜<¨ñô €Lð �}Š}˜\¨<Àˆ}ÑFÔF€Hà'/Ô'?ÐGˆÔ  Ô#Ð#ÀRð õ  8Ô#3¸-ÐHÑHÔHÐHr.   c              #   óD  K  — |                       ||||¦  «        }|                      ||d¬¦  «        }|                     ¦   «         D ]Ø}t          j        |¦  «        }	 |                     d¦  «        r\t          j        |¦  «        }	t          j         	                    |	 
                    di ¦  «         
                    d¦  «        |	|¦  «         n7# t          j        j        $ r  t                               d|z  ¦  «         Y nw xY wt          |j        |¬¦  «        V — ŒÙd S )NTr  ú	{"error":Úerrorrí   ú1Failed to decode chunk that contains an error: %sr>  )r  rÝ  r®   rª   r  ra   rÞ   r   rì   Úraise_errorr6   Údecoderrß   r7   Údebugr@  r<   )
r™   rö  r\   r÷  r,  r  Úsession_responser­   Ú
chunk_dumpÚ
chunk_jsons
             r/   Úrequest_streamedzBaseApiClient.request_streamedã  sK  è è € ð ×&Ò&Ø�T˜<¨ñô €Lð —}’} \°<È�}ÑMÔMÐØ!×*Ò*Ñ,Ô,ð Oð OˆÝ”:˜eÑ$Ô$€jðØ× Ò  Ñ-Ô-ð 	Ý”z *Ñ-Ô-ˆ*Ý
Œ/×
%Ò
%Ø�nŠn˜W bÑ)Ô)×-Ò-¨fÑ5Ô5ØØñô ð øøõ
 Œ\Ô)ð ð ð Ý�ŠØ?À*ÑLñ	
ô 	
ð 	
ð 	ˆð	øøøõ
 Ð$4Ô$<À:ÐNÑNÔNÐNÐNÐNÐNðOð Os   ÁA1CÃ1DÄDc              ƒ   óÊ   K  — |                       ||||¦  «        }|                      ||d¬¦  «        ƒ d {V —†}|j        r|j        d         nd}t          |j        |¬¦  «        S )NF©r  r,  r  r   r§   r>  )r  r8  rƒ   r@  r<   )r™   rö  r\   r÷  r,  r  ÚresultrA  s           r/   Úasync_requestzBaseApiClient.async_request   s˜   è è € ð ×&Ò&Ø�T˜<¨ñô €Lð ×&Ò&Ø!°ÀUð 'ñ ô ð ð ð ð ð ð €Fð 28Ô1GÐO�FÔ*¨1Ô-Ð-ÈR€MÝ 6¤>¸ÐFÑFÔFÐFr.   c              ƒ   ó’   ‡K  — |                       ||||¦  «        }|                      ||d¬¦  «        ƒ d {V —†Šˆfd„} |¦   «         S )NTrN  c                 óÜ  •K  — ‰2 3 d {V —†} t          j        | ¦  «        }	 |                     d¦  «        rbt          j        |¦  «        }t          j                             |                     di ¦  «                             d¦  «        |‰¦  «        ƒ d {V —† n7# t           j        j	        $ r  t                               d|z  ¦  «         Y nw xY wt          ‰j        |¬¦  «        W V — Œå6 d S )NrC  rD  rí   rE  r>  )rª   r  ra   rÞ   r   rì   Úraise_error_asyncr6   rG  rß   r7   rH  r@  r<   )r­   rJ  rK  rÜ   s      €r/   Úasync_generatorz=BaseApiClient.async_request_streamed.<locals>.async_generator   sA  øè è € Ø!ð Ið Ið Ið Ið Ið Ið I�Ý”Z Ñ&Ô&ˆ
ð	Ø×"Ò" ;Ñ/Ô/ð Ýœ JÑ/Ô/ˆJÝ”/×3Ò3Ø—’˜w¨Ñ+Ô+×/Ò/°Ñ7Ô7ØØñô ð ð ð ð ð ð ð øøõ
 Œ|Ô+ð 	ð 	ð 	Ý
�,Š,ØAÀJÑNñô ð ð ˆ$ð		øøøõ
  hÔ&6¸ZÐHÑHÔHÐHÐHÐHÐHÐHð "˜˜s   †C+¢A7BÂ1CÃC)r  r8  )r™   rö  r\   r÷  r,  r  rT  rÜ   s          @r/   Úasync_request_streamedz$BaseApiClient.async_request_streamed  s–   øè è € ð ×&Ò&Ø�T˜<¨ñô €Lð ×(Ò(Ø!°ÀTð )ñ ô ð ð ð ð ð ð €HðIð Ið Ið Ið Ið$ ˆ?ÑÔÐr.   ©r,  Ú	file_pathÚ
upload_urlÚupload_sizec                óî   — t          |t          j        ¦  «        r|                      ||||¬¦  «        S t	          |d¦  «        5 }|                      ||||¬¦  «        cddd¦  «         S # 1 swxY w Y   dS )a%  Transfers a file to the given URL.

    Args:
      file_path: The full path to the file or a file like object inherited from
        io.BytesIO. If the local file path is not found, an error will be
        raised.
      upload_url: The URL to upload the file to.
      upload_size: The size of file content to be uploaded, this will have to
        match the size requested in the resumable upload request.
      http_options: The http options to use for the request.

    returns:
          The HttpResponse object from the finalize request.
    rV  ÚrbN)r’   ÚioÚIOBaseÚ
_upload_fdÚopen)r™   rW  rX  rY  r,  Úfiles         r/   Úupload_filezBaseApiClient.upload_file4  sÎ   € õ, �)�RœYÑ'Ô'ð 
Ø�_Š_Ø
�Z ¸<ð ñ ô ð õ �	˜4Ñ Ô ð 
 DØ�ŠØ�*˜k¸ð ñ 
ô 
ð
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
øøøð 
ð 
ð 
ð 
ð 
ð 
s   ÁA*Á*A.Á1A.r`  c                óú  — d}|r|n| j         }t          |t          ¦  «        r|                     d¦  «        nt	          |dd¦  «        }|rLt          |¦  «        }t          |¦  «        }t          |                     |j        |j	        ¬¦  «        ¦  «        }	 | 
                    t          ¦  «        }	d}
|	rt          |	¦  «        }
d}|
|z   |k    r|dz  }t          |t          ¦  «        r|                     d¦  «        n|j        }|€2t          | j         t          ¦  «        r| j         j        n| j         j        }t          |¦  «        }t          |t          ¦  «        r|                     d	i ¦  «        nt	          |d	i ¦  «        pi }|rt          |¦  «        ni }|                     |t!          |¦  «        t!          |
¦  «        d
œ¦  «         t#          ||¦  «         d}|t$          k     rp| j                             d|||	|¬¦  «        }|j                             d¦  «        rn6t,          t.          |z  z  }|dz  }t1          j        |¦  «         |t$          k     °p||
z  }|j                             d¦  «        dk    rn||k    rt5          d¦  «        ‚�Œýt6          j                             |¦  «         |j                             d¦  «        dk    rt5          d¦  «        ‚t=          |j        |j        g¬¦  «        S )aµ  Transfers a file to the given URL.

    Args:
      file: A file like object inherited from io.BytesIO.
      upload_url: The URL to upload the file to.
      upload_size: The size of file content to be uploaded, this will have to
        match the size requested in the resumable upload request.
      http_options: The http options to use for the request.

    returns:
          The HttpResponse object from the finalize request.
    r   r[   N©rè  ÚnetlocTÚuploadú
, finalizeru   r<   ©zX-Goog-Upload-CommandzX-Goog-Upload-OffsetzContent-LengthÚPOSTr&  úx-goog-upload-statusr   ÚactiveúFAll content has been uploaded, but the upload status is not finalized.Úfinalú6Failed to upload file: Upload status is not finalized.©rƒ   ) rD  r’   r}   r6   rL   r   r   rb   rè  rd  ÚreadÚ
CHUNK_SIZErÈ   ru   rw   ÚupdaterW   rZ   ÚMAX_RETRY_COUNTrR  r’  r<   ÚINITIAL_RETRY_DELAYÚDELAY_MULTIPLIERÚtimer/  rl   r   rì   r  r   r  )r™   r`  rX  rY  r,  Úoffsetr[   rc   Úparsed_uploadÚ
file_chunkÚ
chunk_sizeÚupload_commandru   rU   Úuser_headersÚupload_headersÚretry_countrÜ   Údelay_secondss                      r/   r^  zBaseApiClient._upload_fdT  s[  € ð( €FØ#/ÐG�<�<°TÔ5G€Lõ �l¥DÑ)Ô)ð	5ˆ×Ò˜Ñ$Ô$Ð$å�\ :¨tÑ4Ô4ð ð
 ð Ý˜XÑ&Ô&€kÝ˜zÑ*Ô*€mÝØ
×
 Ò
 Ø Ô'°Ô0Bð !ñ ô ñô €jð8
Ø—9’9�ZÑ(Ô(€jØ€jØ	ð %Ý˜‘_”_ˆ
Ø€nà	�fÑ	 Ò	+Ð	+Ø˜,Ñ&ˆõ ˜¥dÑ+Ô+ð$ˆ,×
Ò
˜9Ñ
%Ô
%Ð
%àÔ#ð ð
 
ˆõ ˜$Ô,­dÑ3Ô3ð,ˆDÔÔ&Ð&àÔ#Ô+ð 	õ
 2°'Ñ:Ô:Ðõ ˜¥dÑ+Ô+ð<ˆ,×
Ò
˜9 bÑ
)Ô
)Ð
)å˜ i°Ñ4Ô4Ð:¸ð ð
 .:ÐA•t˜LÑ)Ô)Ð)¸r€nØ×ÒØ#1Ý"% f¡+¤+Ý 
™OœOðð ñ 	ô 	ð 	õ
 % ^Ð5GÑHÔHÐHØ€kØ�/Ò)Ð)ØÔ%×-Ò-ØØØ"ØØ&ð .ñ 
ô 
ˆð Ô×ÒÐ 6Ñ7Ô7ð 	Ø
Ý+Õ/?ÀÑ/LÑMˆØ�qÑˆÝŒ
�=Ñ!Ô!Ð!ð �/Ò)Ð)ð �
Ñ€fØ	Ô	×	Ò	Ð4Ñ	5Ô	5¸Ò	AÐ	AØØ	˜Ò	Ð	Ýðñ
ô 
ð 	
ñk8
õr „O×&Ò& xÑ0Ô0Ð0ØÔ×ÒÐ2Ñ3Ô3°wÒ>Ð>ÝÐOÑPÔPÐPÝ˜Ô(¸8¼=¸/ÐJÑJÔJÐJr.   i   )r,  Údestinationry  r  ry  c                ó   — d S r�   r-   ©r™   r\   r,  r  ry  s        r/   Údownload_filezBaseApiClient.download_file·  ó	   € ð €Cr.   )r,  ry  c                ó   — d S r�   r-   r�  s        r/   r‚  zBaseApiClient.download_fileÂ  rƒ  r.   c                ó°  ‡— ‰�Qt          ‰t          t          j        f¦  «        s0t	          ‰d¦  «        s t          dt          ‰¦  «        › d�¦  «        ‚|                      d|i |¬¦  «        }d}|j        r;t          |j        t          ¦  «        st          j        |j        ¦  «        }n|j        }dt          t                   ddfˆfd	„}|                      ¦   «         �rÑt          |j        ¦  «        }| j        €Jd
dlm}	  |	| j        d¬¦  «        | _        t'          j        ¦   «         }
| j                             |
¦  «         | j        j        r5d|v r1d|v r|                     dd¦  «        }n|                     dd¦  «        }‰�°| j                             |j                             ¦   «         |||j        |j        d¬¦  «        }	 t:          j                             |¦  «          ||                      |¬¦  «        ¦  «         | !                    ¦   «          n# | !                    ¦   «          w xY wdS | j                             |j                             ¦   «         |||j        |j        ¬¦  «        }t:          j                             |¦  «         tE          t          |j#        ¦  «        S ‰�¾| j$         %                    |j        |j        ||j        |j        ¬¦  «        }| j$         &                    |d¬¦  «        }	 t:          j                             |¦  «          || '                    |¬¦  «        ¦  «         | !                    ¦   «          n# | !                    ¦   «          w xY wdS | j$                             |j        |j        ||j        |j        ¬¦  «        }t:          j                             |¦  «         | (                    ¦   «         S )aU  Downloads the file data.

    Args:
      path: The request path with query params.
      http_options: The http options to use for the request.
      destination: Optional local file path or writable stream.
      chunk_size: The chunk size in bytes to stream.

    Returns:
      The file bytes if destination is None, otherwise None.
    NÚwriteúUnsupported destination type: ú<. Expected str, os.PathLike, or a writable file-like object.r6   ©r\   r÷  r,  Úchunksr0   c                 ó6  •— t          ‰t          t          j        f¦  «        rFt	          ‰d¦  «        5 }| D ]}|                     |¦  «         Œ	 d d d ¦  «         d S # 1 swxY w Y   d S ‰�*t          ‰d¦  «        r| D ]}‰                     |¦  «         Œd S d S d S ©NÚwbr†  )r’   rW   r4   ÚPathLiker_  r†  rp  )rŠ  Úfr­   r  s      €r/   Ú_write_chunksz2BaseApiClient.download_file.<locals>._write_chunksó  s  ø€ Ý	�K¥#¥r¤{Ð!3Ñ	4Ô	4ð #Ý�+˜tÑ$Ô$ð 	¨Øð ð ˆeØ�GŠG�E‰NŒNˆNˆNðð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð 	ð 	ð Ð"¥w¨{¸GÑ'DÔ'DÐ"Øð 	#ð 	#ˆEØ
×
Ò
˜EÑ
"Ô
"Ð
"Ð
"ð #Ð"Ð"Ð"ð	#ð 	#s   ³AÁA Á#A r   r   r   r  r  r	  r
  r  r  Tr  ©ry  ©r{   rz   r|   r<   ru   r  r  ))r’   rW   r4   rŽ  rp  rl   r—   r  r|   r€   rª   r  r   rr  rz   rP  rr   r    rC  r   r  r  r  r  r’  r{   r  r<   ru   r   rì   r  Úiter_contentr  r   rÔ   rR  r  r  Ú
iter_bytesro  )r™   r\   r,  r  ry  r  r|   r�  rz   r    r  rÜ   r  s      `         r/   r‚  zBaseApiClient.download_fileÍ  s6  ø€ ð& Ð¥zØ•c�2œ;Ð'ñ(ô (Ðå�k 7Ñ+Ô+ð õ ðG­4°Ñ+<Ô+<ð Gð Gð Gñô ð ð
 ×&Ò&Ø�D r¸ð 'ñ ô €Lð )-€DØÔð !Ý˜Ô)­5Ñ1Ô1ð !ÝŒz˜,Ô+Ñ,Ô,ˆˆàÔ ˆð#�h¥uœoð #°$ð #ð #ð #ð #ð #ð #ð ×!Ò!Ñ#Ô#ñ FÝ�Ô Ñ!Ô!€cØ	Ô	!Ð	)ØDÐDÐDÐDÐDÐDà#4Ð#4ØÔØ!"ð$
ñ $
ô $
ˆÔ õ "Ô<Ñ>Ô>ÐØÔ ×7Ò7Øñ	
ô 	
ð 	
ð 
Ô	!Ô	*ð EÐ/?À3Ð/FÐ/FØ˜ÐÐØ—’Ø&Ð(Eñô ˆ#ˆ#ð —’Ð,Ð.CÑDÔDˆ#Ø	Ð	 ØÔ+×3Ò3ØÔ&×,Ò,Ñ.Ô.ØØØ Ô(Ø Ô(Øð 4ñ 
ô 
ˆð	Ý
Œ/×
,Ò
,¨XÑ
6Ô
6Ð
6Ø
ˆ-˜×-Ò-¸Ð-ÑDÔDÑ
EÔ
EÐ
Eà
�.Š.Ñ
Ô
Ð
Ð
øˆ(�.Š.Ñ
Ô
Ð
Ð
øøøØˆtàÔ+×3Ò3ØÔ&×,Ò,Ñ.Ô.ØØØ Ô(Ø Ô(ð 4ñ 
ô 
ˆõ 	Œ×*Ò*¨8Ñ4Ô4Ð4Ý•E˜8Ô+Ñ,Ô,Ð,à	Ð	 ØÔ*×8Ò8ØÔ&ØÔ ØØ Ô(Ø Ô(ð 9ñ 
ô 
ˆð Ô%×*Ò*¨=ÀÐ*ÑFÔFˆð	Ý
Œ/×
,Ò
,¨XÑ
6Ô
6Ð
6Ø
ˆ-˜×+Ò+°zÐ+ÑBÔBÑ
CÔ
CÐ
Cà
�.Š.Ñ
Ô
Ð
Ð
øˆ(�.Š.Ñ
Ô
Ð
Ð
øøøØˆtàÔ%×-Ò-ØÔ&ØÔ ØØ Ô(Ø Ô(ð .ñ 
ô 
ˆõ 	Œ×*Ò*¨8Ñ4Ô4Ð4Ø�}Š}‰ŒÐs   Ç>H ÈH4Ì>M ÍM-c             ƒ   óp  K  — t          |t          j        ¦  «        r|                      ||||¬¦  «        ƒ d{V —†S t	          j        |¦  «        }|                     d¦  «        ƒ d{V —†}|4 ƒd{V —† |                      ||||¬¦  «        ƒ d{V —†cddd¦  «        ƒd{V —† S # 1 ƒd{V —†swxY w Y   dS )aü  Transfers a file asynchronously to the given URL.

    Args:
      file_path: The full path to the file. If the local file path is not found,
        an error will be raised.
      upload_url: The URL to upload the file to.
      upload_size: The size of file content to be uploaded, this will have to
        match the size requested in the resumable upload request.
      http_options: The http options to use for the request.

    returns:
          The HttpResponse object from the finalize request.
    rV  Nr[  )r’   r\  r]  Ú_async_upload_fdÚanyioÚPathr_  )r™   rW  rX  rY  r,  r`  Úfds          r/   Úasync_upload_filezBaseApiClient.async_upload_fileD  s•  è è € õ* �)�RœYÑ'Ô'ð 

Ø×(Ò(Ø
�Z ¸<ð )ñ ô ð ð ð ð ð ð ð õ ŒZ˜	Ñ"Ô"€dØ—’˜4‘”Ð Ð Ð Ð Ð Ð €bØð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
Ø×*Ò*Ø�
˜K°lð +ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
øøøð 
ð 
ð 
ð 
ð 
ð 
s   Á3B%Â%
B/Â2B/c          	   ƒ   ó¼  K  — d}|r|n| j         }t          |t          ¦  «        r|                     d¦  «        nt	          |dd¦  «        }|rLt          |¦  «        }t          |¦  «        }t          |                     |j        |j	        ¬¦  «        ¦  «        }|  
                    ¦   «         �rô|                      ¦   «         ƒ d{V —†}		 t          |t          j        ¦  «        r|                     t          ¦  «        }
n |                     t          ¦  «        ƒ d{V —†}
d}|
rt!          |
¦  «        }d}||z   |k    r|dz  }t          |t          ¦  «        r|                     d¦  «        n|j        }|€2t          | j         t          ¦  «        r| j         j        n| j         j        }t%          |¦  «        }t          |t          ¦  «        r|                     d	i ¦  «        nt	          |d	i ¦  «        pi }|rt          |¦  «        ni }|                     |t)          |¦  «        t)          |¦  «        d
œ¦  «         t+          ||¦  «         d}d}|t,          k     rŠ|	                     d||
|t1          j        |¬¦  «        ¬¦  «        ƒ d{V —†}|j                             d¦  «        rn<t6          t8          |z  z  }|dz  }t;          j        |¦  «        ƒ d{V —† |t,          k     °Š||z  }|�|j                             d¦  «        dk    rn||k    rt?          d¦  «        ‚�ŒVt@          j!         "                    |¦  «        ƒ d{V —† |�-|j                             d¦  «        dk    rt?          d¦  «        ‚tG          |j        | $                    ¦   «         ƒ d{V —†g¬¦  «        S 	 t          |t          j        ¦  «        r|                     t          ¦  «        }
n |                     t          ¦  «        ƒ d{V —†}
d}|
rt!          |
¦  «        }d}||z   |k    r|dz  }t          |t          ¦  «        r|                     d¦  «        n|j        }|€2t          | j         t          ¦  «        r| j         j        n| j         j        }t%          |¦  «        }t          |t          ¦  «        r|                     d	i ¦  «        nt	          |d	i ¦  «        pi }|rt          |¦  «        ni }|                     |t)          |¦  «        t)          |¦  «        d
œ¦  «         t+          ||¦  «         d}d}|t,          k     r| j%                             d||
||¬¦  «        ƒ d{V —†}|�"|j        r|j                             d¦  «        rn6t6          t8          |z  z  }|dz  }tM          j        |¦  «         |t,          k     °||z  }|�|j                             d¦  «        dk    rn||k    rt?          d¦  «        ‚�ŒKt@          j!         "                    |¦  «        ƒ d{V —† |�-|j                             d¦  «        dk    rt?          d¦  «        ‚tG          |j        |j$        g¬¦  «        S )aÅ  Transfers a file asynchronously to the given URL.

    Args:
      file: A file like object inherited from io.BytesIO.
      upload_url: The URL to upload the file to.
      upload_size: The size of file content to be uploaded, this will have to
        match the size requested in the resumable upload request.
      http_options: The http options to use for the request.

    returns:
          The HttpResponse object from the finalized request.
    r   r[   Nrc  Tre  rf  ru   r<   rg  rh  r"  r’  zX-Goog-Upload-Statusr   rj  rk  rl  rm  rn  r  ri  )'rD  r’   r}   r6   rL   r   r   rb   rè  rd  rV  r¾  r\  r]  ro  rp  rÈ   ru   rw   rq  rW   rZ   rr  r’  rÐ   r(  r<   rs  rt  r#  r/  rl   r   rì   r2  r   r  rT  ru  )r™   r`  rX  rY  r,  rv  r[   rc   rw  r{  rx  ry  rz  ru   rU   r{  r|  r}  rÜ   r~  r3  s                        r/   r–  zBaseApiClient._async_upload_fde  s®  è è € ð( €FØ#/ÐG�<�<°TÔ5G€Lõ �l¥DÑ)Ô)ð	5ˆ×Ò˜Ñ$Ô$Ð$å�\ :¨tÑ4Ô4ð ð
 ð Ý˜XÑ&Ô&€kÝ˜zÑ*Ô*€mÝØ
×
 Ò
 Ø Ô'°Ô0Bð !ñ ô ñô €jð ×ÒÑÔñ dØ×/Ò/Ñ1Ô1Ð1Ð1Ð1Ð1Ð1Ð1€gðBÝ�d�BœIÑ&Ô&ð 	3Ø—y’y¥Ñ,Ô,ˆ*ˆ*à!ŸYšY¥zÑ2Ô2Ð2Ð2Ð2Ð2Ð2Ð2ˆ*Øˆ
Øð 	'Ý˜:‘”ˆ*Ø!ˆà˜Ñ +Ò-Ð-Ø
˜LÑ
(ˆ.õ ˜<­Ñ.Ô.ð'ˆL×Ò˜YÑ'Ô'Ð'àÔ&ð 	ð
 ˆ?õ ˜DÔ.µÑ5Ô5ð.ˆdÔ Ô(Ð(àÔ%Ô-ð õ
 4°GÑ<Ô<Ðõ ˜,­Ñ-Ô-ð>ˆL×Ò˜Y¨Ñ+Ô+Ð+å˜,¨	°2Ñ6Ô6Ð<¸"ð 	ð
 0<ÐC�˜lÑ+Ô+Ð+ÀˆØ×ÒØ%3Ý$'¨¡K¤KÝ! *™oœoð
ð 
ñ 	ô 	ð 	õ
 	' ~Ð7IÑJÔJÐJàˆØˆØ�OÒ+Ð+Ø"Ÿ?š?ØØØØ$ÝÔ+Ð2DÐEÑEÔEð +ñ ô ð ð ð ð ð ð ˆ(ð Ô×!Ò!Ð"8Ñ9Ô9ð ØÝ-Õ1AÀ;Ñ1NÑOˆ-Ø
˜Ñ
ˆ+Ý”˜mÑ,Ô,Ð
,Ð
,Ð
,Ð
,Ð
,Ð
,Ð
,ð �OÒ+Ð+ð 	�*ÑˆàÐ ØÔ ×$Ò$Ð%;Ñ<Ô<ÀÒHÐHà
à˜&Ò Ð Ýðñô ð ñBõH ŒO×4Ò4°XÑ>Ô>Ð>Ð>Ð>Ð>Ð>Ð>Ð>à
Ð
ØÔ×"Ò"Ð#9Ñ:Ô:¸gÒEÐEåØDñ
ô 
ð 	
õ Ø
Ô
°8·=²=±?´?Ð-BÐ-BÐ-BÐ-BÐ-BÐ-BÐ,Cðñ ô ð ð
EÝ�d�BœIÑ&Ô&ð 	3Ø—y’y¥Ñ,Ô,ˆ*ˆ*à!ŸYšY¥zÑ2Ô2Ð2Ð2Ð2Ð2Ð2Ð2ˆ*Øˆ
Øð 	'Ý˜:‘”ˆ*Ø!ˆà˜Ñ +Ò-Ð-Ø
˜LÑ
(ˆ.õ ˜,­Ñ-Ô-ð&ˆL×Ò˜YÑ'Ô'Ð'àÔ%ð 	ð
 ˆ?õ ˜DÔ.µÑ5Ô5ð.ˆdÔ Ô(Ð(àÔ%Ô-ð õ
 4°GÑ<Ô<Ðõ ˜,­Ñ-Ô-ð>ˆL×Ò˜Y¨Ñ+Ô+Ð+å˜,¨	°2Ñ6Ô6Ð<¸"ð 	ð
 0<ÐC�˜lÑ+Ô+Ð+ÀˆØ×ÒØ%3Ý$'¨¡K¤KÝ! *™oœoð
ð 
ñ 	ô 	ð 	õ
 	' ~Ð7IÑJÔJÐJàˆØˆØ�OÒ+Ð+Ø"&Ô":×"BÒ"BØØØ Ø$Ø(ð #Cñ #ô #ð ð ð ð ð ð ˆ/ð Ð)Ø!Ô)ð *à!Ô)×-Ò-Ð.DÑEÔEð *ð Ý-Õ1AÀ;Ñ1NÑOˆ-Ø
˜Ñ
ˆ+Ý
Œ*�]Ñ
#Ô
#Ð
#ð! �OÒ+Ð+ð$ 	�*ÑˆàÐ'ØÔ'×+Ò+Ð,BÑCÔCÀxÒOÐOà
à˜&Ò Ð Ýðñô ð ñEEõN ŒO×4Ò4°_ÑEÔEÐEÐEÐEÐEÐEÐEÐEà
Ð
%ØÔ%×)Ò)Ð*@ÑAÔAÀWÒLÐLåØDñ
ô 
ð 	
õ Ø
Ô
!°OÔ4HÐ3Iðñ ô ð r.   c             ƒ   ó
   K  — d S r�   r-   r�  s        r/   Úasync_download_filez!BaseApiClient.async_download_file0	  ó   è è € ð €Cr.   c             ƒ   ó
   K  — d S r�   r-   r�  s        r/   r�  z!BaseApiClient.async_download_file;	  rž  r.   c          
   ƒ   ó€  ‡K  — ‰�Qt          ‰t          t          j        f¦  «        s0t	          ‰d¦  «        s t          dt          ‰¦  «        › d�¦  «        ‚|                      d|i |¬¦  «        }d}|j        rNt          |j        t          ¦  «        s-t          j        |j        ¦  «                             d¦  «        }n|j        }dt          t                   d	dfˆfd
„}|                      ¦   «         �rú|                      ¦   «         ƒ d{V —†}|j        }	|                      ¦   «         rjt%          j        ¦   «         }
|                     |
¦  «        ƒ d{V —† |j        r5d|	v r1d|	v r|	                     dd¦  «        }	n|	                     dd¦  «        }	 |j        d|j        |	|j        |t5          j        |j        ¬¦  «        dœ| j        ¤Žƒ d{V —†}‰�™	 t<          j                              |¦  «        ƒ d{V —† t	          |d¦  «        r|j!        }n|} ||j"         #                    |¦  «        ¦  «        ƒ d{V —† | $                    ¦   «          n# | $                    ¦   «          w xY wdS 	 t<          j                              |¦  «        ƒ d{V —† tK          t          | &                    ¦   «         ƒ d{V —†¦  «        | $                    ¦   «          S # | $                    ¦   «          w xY w‰�Ü| j'         (                    |j        |j        ||j        |j        ¬¦  «        }| j'         )                    |d¬¦  «        ƒ d{V —†}	 t<          j                              |¦  «        ƒ d{V —†  || *                    |¬¦  «        ¦  «        ƒ d{V —† | +                    ¦   «         ƒ d{V —† n# | +                    ¦   «         ƒ d{V —† w xY wdS | j'                             |j        |j        |j        ||j        ¬¦  «        ƒ d{V —†}t<          j                              |¦  «        ƒ d{V —† | &                    ¦   «         S )ad  Downloads the file data asynchronously.

    Args:
      path: The request path with query params.
      http_options: The http options to use for the request.
      destination: Optional local file path or writable stream.
      chunk_size: The chunk size in bytes to stream.

    Returns:
      The file bytes if destination is None, otherwise None.
    Nr†  r‡  rˆ  r6   r‰  rÎ   rŠ  r0   c              “   óŠ  •K  — t          ‰t          t          j        f¦  «        rLt	          ‰d¦  «        5 }| 2 3 d {V —†}|                     |¦  «         Œ6 	 d d d ¦  «         d S # 1 swxY w Y   d S ‰�Nt          ‰d¦  «        r@| 2 3 d {V —†}‰                     |¦  «        }t          j        |¦  «        r|ƒ d {V —† Œ96 d S d S d S rŒ  )	r’   rW   r4   rŽ  r_  r†  rp  rÌ  Úisawaitable)rŠ  r�  r­   Úresr  s       €r/   r�  z8BaseApiClient.async_download_file.<locals>._write_chunksl	  s_  øè è € Ý	�K¥#¥r¤{Ð!3Ñ	4Ô	4ð Ý�+˜tÑ$Ô$ð 	¨Ø#ð ð ð ð ð ð ð �EØ�GŠG�E‰NŒNˆNˆNð $˜Vð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð 	ð 	ð Ð"¥w¨{¸GÑ'DÔ'DÐ"Ø!ð 	ð 	ð 	ð 	ð 	ð 	ð 	�%Ø×!Ò! %Ñ(Ô(ˆ#ÝÔ  Ñ%Ô%ð ØˆIˆIˆIˆIˆIˆIˆIøð "˜6˜6ð #Ð"Ð"Ð"s!   µA$¸A¾A$Á$A(Á+A(ÂB>r  r	  r
  r  r  r"  rû  r%  r  Tr  r‘  r&  r-   ),r’   rW   r4   rŽ  rp  rl   r—   r  r|   r€   rª   r  r'  r   rV  r¾  rz   rY  r   r  r  r  r  r’  r{   r<   rÐ   r(  ru   rX  r   rì   r2  r%  rÔ   Úiter_chunkedr  r   ro  rT  r  r  Úaiter_bytesrÓ   )r™   r\   r,  r  ry  r  r|   r�  r{  rz   r  rÜ   Úraw_responser  r3  s      `           r/   r�  z!BaseApiClient.async_download_fileF	  s‘  øè è € ð& Ð¥zØ•c�2œ;Ð'ñ(ô (Ðå�k 7Ñ+Ô+ð õ ðG­4°Ñ+<Ô+<ð Gð Gð Gñô ð ð
 ×&Ò&Ø�D r¸ð 'ñ ô €Lð !€DØÔð !Ý˜Ô)­5Ñ1Ô1ð !ÝŒz˜,Ô+Ñ,Ô,×3Ò3°GÑ<Ô<ˆˆàÔ ˆð	¥Mµ%Ô$8ð 	¸Tð 	ð 	ð 	ð 	ð 	ð 	ð ×ÒÑÔñ G&Ø×/Ò/Ñ1Ô1Ð1Ð1Ð1Ð1Ð1Ð1€gØÔ€cØ	×	$Ò	$Ñ	&Ô	&ð GÝ!Ô<Ñ>Ô>ÐØ×,Ò,Øñ
ô 
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð Ôð 	GÐ 0°CÐ 7Ð 7Ø˜#ÐÐØ—+’+Ø(Ð*Gñô ˆCˆCð —+’+Ð.Ð0EÑFÔFˆCØ&�w”ð ØÔ$ØØÔ&ØÝÔ'¨lÔ.BÐCÑCÔCðð ð Ô3ðð ð ð ð ð ð ð €hð 
Ð	 ð	Ý”×8Ò8¸ÑBÔBÐ
BÐ
BÐ
BÐ
BÐ
BÐ
BÐ
BÝ�X˜{Ñ+Ô+ð $Ø#Ô-ˆLˆLà#ˆLØ�˜lÔ2×?Ò?À
ÑKÔKÑLÔLÐ
LÐ
LÐ
LÐ
LÐ
LÐ
LÐ
Là
�.Š.Ñ
Ô
Ð
Ð
øˆ(�.Š.Ñ
Ô
Ð
Ð
øøøØˆtð	Ý”×8Ò8¸ÑBÔBÐ
BÐ
BÐ
BÐ
BÐ
BÐ
BÐ
BÝ•e 8§=¢=¡?¤?Ð2Ð2Ð2Ð2Ð2Ð2Ñ3Ô3à
�.Š.Ñ
Ô
Ð
Ð
øˆ(�.Š.Ñ
Ô
Ð
Ð
øøøð 
Ð	 ØÔ0×>Ò>ØÔ&ØÔ ØØ Ô(Ø Ô(ð ?ñ 
ô 
ˆð !%Ô 8× =Ò =ØØð !>ñ !
ô !
ð 
ð 
ð 
ð 
ð 
ð 
ˆð	)Ý”×8Ò8¸ÑIÔIÐ
IÐ
IÐ
IÐ
IÐ
IÐ
IÐ
IØ�Ø×)Ò)°ZÐ)Ñ@Ô@ñô ð ð ð ð ð ð ð ð  ×&Ò&Ñ(Ô(Ð
(Ð
(Ð
(Ð
(Ð
(Ð
(Ð
(Ð
(ø�×&Ò&Ñ(Ô(Ð
(Ð
(Ð
(Ð
(Ð
(Ð
(Ð
(Ð
(øøøØˆtà $Ô 8× @Ò @ØÔ&ØÔ Ø Ô(ØØ Ô(ð !Añ !
ô !
ð 
ð 
ð 
ð 
ð 
ð 
ˆõ Œo×6Ò6°ÑGÔGÐGÐGÐGÐGÐGÐGÐGØ×#Ò#Ñ%Ô%Ð%s'   ÇA(I ÉI+É1AK ËK-ÍA
N- Î-O	Úresponse_modelc                 ó   — d S r�   r-   )r™   r§  s     r/   Ú_verify_responsezBaseApiClient._verify_responseÃ	  s   € Ø€Dr.   c                 ó¢   — | j         j        s | j        r| j                             ¦   «          | j        r| j                             ¦   «          dS dS )zCloses the API client.N)rD  rQ  rR  r  rP  r    s    r/   r  zBaseApiClient.closeÆ	  sa   € ð ÔÔ*ð !¨tÔ/Að !Ø
Ô×ÒÑ Ô Ð ØÔð 'Ø
Ô×$Ò$Ñ&Ô&Ð&Ð&Ð&ð'ð 'r.   c              ƒ   ó  K  — | j         j        s| j                             ¦   «         ƒ d{V —† | j        rÍ| j         j        sÃ	 t          j        ¦   «         }n# t          $ r d}Y nw xY wt          | j         
                    ¦   «         ¦  «        D ]w\  }}||k    r|                     ¦   «         ƒ d{V —† Œ&|                     ¦   «         r9	 t          j        |                     ¦   «         |¦  «         Œc# t          $ r Y Œow xY wŒtdS dS dS )zCloses the API async client.N)rD  rS  rT  rÓ   rU  rˆ  r#  r$  r‰  r¨   r–   r  Ú
is_runningÚrun_coroutine_threadsafe)r™   Úcurrent_loopr„  r{  s       r/   rÓ   zBaseApiClient.acloseÏ	  s`  è è € ð ÔÔ0ð .ØÔ$×+Ò+Ñ-Ô-Ð-Ð-Ð-Ð-Ð-Ð-Ð-ØÔð  dÔ&8Ô&Gð ðÝÔ/Ñ1Ô1ˆˆøÝð ð ð Øˆˆˆðøøøõ   Ô 6× <Ò <Ñ >Ô >Ñ?Ô?ð ð ‰-ˆ$�Ø�<ÒÐØ—’‘”Ð
Ð
Ð
Ð
Ð
Ð
Ð
Ð
Ø�_Š_ÑÔð 	ðÝÔ,¨W¯]ª]©_¬_¸dÑCÔCÐCÐCøÝð ð ð ØˆDðøøøð	ðð ð ð ðð s$   ÁA ÁA%Á$A%Ã	'C1Ã1
C>Ã=C>c                 óþ   — 	 | j         j        s|                      ¦   «          n# t          $ r Y nw xY w	 t	          j        ¦   «                              |                      ¦   «         ¦  «         dS # t          $ r Y dS w xY w)z�Closes the API client when the object is garbage collected.

    ADK uses this client so cannot rely on the genai.[Async]Client.__del__
    for cleanup.
    N)rD  rQ  r  r  r#  r$  r%  rÓ   r    s    r/   r  zBaseApiClient.__del__ä	  s•   € ðØÔÔ,ð Ø�
Š
‰ŒˆøøÝð ð ð Ø
€dðøøøðÝÔÑ Ô ×,Ò,¨T¯[ª[©]¬]Ñ;Ô;Ð;Ð;Ð;øÝð ð ð Ø
€d€dðøøøs   ‚ # £
0¯0´8A. Á.
A<Á;A<)NNNNNN)Fr�   rœ  r  )Lr)   r*   r+   r,   r(  r   rN  r~   r)  rW   ri   rj   rm   r   r   r›   rr  rY  r   r€  Ústaticmethodr}   r†  rå   r‹  r¾  r   r
   r   rÖ  rM  rW  r\  rV  rë  rï  r#  rF  rñ  r   r—  r   ry   r  r   r  rÝ  r6  r8  r<  r@  r’  r   rL  rP  rU  r\  r]  Úintra  r^  r   r€   r‚  r4   rŽ  rš  r—  Ú	AsyncFiler–  r�  r   r©  r  rÓ   r  r-   r.   r/   r'  r'  ~  sˆ  € € € € € € Ø@Ð@à!€(ˆH�TŒNÐ!Ð!Ñ!Ø#'€/�8˜C”=Ð'Ð'Ñ'ð "&Ø#ØCGØ#Ø $Ø26ðB?ð B?à˜”ðB?ð ˜Œ}ðB?ð ˜FœKÔ3Ô?Ô@ð	B?ð
 ˜Œ}ðB?ð ˜”ðB?ð Ð.Ô/ðB?ð B?ð B?ð B?ðH
 Tð 
ð 
ð 
ð 
ð dð ð ð ð ð(	¨ð 	°ð 	ð 	ð 	ð 	ð ð¨D°°c°¬Nð ¸tð ð ð ñ „<ðð ð
à�„}ð
ð 
ð 
ñ „8ð
ðcà
ðcð cð cð cðJ ð ðLð LØðLàðLð ˆWÔ Ô!3Ð3Ô4ðLð Lð Lñ „<ðLð\ ð ð>'ð >'Øð>'àð>'ð Ôð>'ð >'ð >'ñ „<ð>'ð@ ð ðA'ð A'ØðA'àðA'ð ÔðA'ð A'ð A'ñ „<ðA'ðF˜Dð ð ð ð ð5 3ð 5ð 5ð 5ð 5ðO˜Sð Oð Oð Oð Oð*¨'¬,ð *ð *ð *ð *ðM¨¨s°C¨x¬ð Mð Mð Mð Mð8 37ðið iàðið ðið ˜˜f˜Ô%ð	ið
 Ð.Ô/ðið ðið ið ið ið\ ð=ð =àð=ð ð=ð ð	=ð =ð =ð =ðD 37Øð	Að AàðAð Ð.Ô/ðAð ð	Að
 ðAð Að Að Að* 7<ðkMð kMØ%ðkMØ/3ðkMàðkMð kMð kMð kMð` 37Øð	ð àðð Ð.Ô/ðð ð	ð
 ðð ð ð ð*¨'Ô*<ð ð ð ð ð 37ðIð IàðIð ðIð ˜˜f˜Ô%ð	Ið
 Ð.Ô/ðIð ðIð Ið Ið Ið* 37ðOð OàðOð ðOð ˜˜f˜Ô%ð	Oð
 Ð.Ô/ðOð � $¨Ð,Ô-ðOð Oð Oð OðD 37ðGð GàðGð ðGð ˜˜f˜Ô%ð	Gð
 Ð.Ô/ðGð ðGð Gð Gð Gð, 37ð!ð !àð!ð ð!ð ˜˜f˜Ô%ð	!ð
 Ð.Ô/ð!ð ð!ð !ð !ð !ðR 37ð
ð 
ð 
à�s˜BœI�~Ô&ð
ð ð
ð ð	
ð Ð.Ô/ð
ð ð
ð 
ð 
ð 
ðL 37ðaKð aKð aKàŒIðaKð ðaKð ð	aKð Ð.Ô/ðaKð ðaKð aKð aKð aKðF ð
 37ØØ#ðð ð àðð Ð.Ô/ð	ð
 ðð ðð ðð ð ñ „8ðð ð
 37à#ðð ð àðð Ð.Ô/ð	ð
 ˜˜bœk¨#Ô.°´	Ð9Ô:ðð ðð ðð ð ñ „8ðð 37ØGKØ#ðuð uð uàðuð Ð.Ô/ð	uð
 ˜E # r¤{°3Ô'7¸¼Ð"BÔCÔDðuð ðuð �„ðuð uð uð uðz 37ð
ð 
ð 
à�s˜BœI�~Ô&ð
ð ð
ð ð	
ð Ð.Ô/ð
ð ð
ð 
ð 
ð 
ðN 37ðIð Ið Ià�"”)˜Uœ_¨SÔ1Ð1Ô2ðIð ðIð ð	Ið Ð.Ô/ðIð ðIð Ið Ið IðV ð
 37ØØ#ðð ð àðð Ð.Ô/ð	ð
 ðð ðð ðð ð ñ „8ðð ð
 37à#ðð ð àðð Ð.Ô/ð	ð
 ˜˜bœk¨#Ô.°´	Ð9Ô:ðð ðð ðð ð ñ „8ðð 37ØGKØ#ðx&ð x&ð x&àðx&ð Ð.Ô/ð	x&ð
 ˜E # r¤{°3Ô'7¸¼Ð"BÔCÔDðx&ð ðx&ð �„ðx&ð x&ð x&ð x&ðz	¨WÔ->ð 	À4ð 	ð 	ð 	ð 	ð'ð 'ð 'ð 'ðð ð ð ð*ð ð ð ð ð r.   r'  r�  c                 óv   — |j         s|j        st          |¦  «         |j        st          d¦  «        ‚|j        S )ú=Refreshes the authentication token for the given credentials.rí  )r�  r™  rt   r‰  )r�  rm   s     r/   rî  rî  ÷	  sK   € ð
 Ôð  Ô 1ð å�ÑÔÐØ	Ô	ð KÝ
ÐIÑ
JÔ
JÐJØ	Ô	Ðr.   c              ƒ   óD  K  — |j         s|j        st|                      ¦   «         ƒ d{V —†}|4 ƒd{V —† |j         s|j        s t          j        t
          |¦  «        ƒ d{V —† ddd¦  «        ƒd{V —† n# 1 ƒd{V —†swxY w Y   |j        st          d¦  «        ‚|j        S )r´  Nrí  )r�  r™  rñ  r#  ró  rt   r‰  )r�  rm   rõ  s      r/   rô  rô  
  sU  è è € ð
 Ôð ; Ô 1ð ;à"×7Ò7Ñ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9€OØð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;Ø	Ô	ð ; KÔ$5ð ;åÔ¥¨kÑ:Ô:Ð:Ð:Ð:Ð:Ð:Ð:Ð:ð;ð ;ð ;ñ ;ô ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;øøøð ;ð ;ð ;ð ;ð
 
Ô	ð KÝ
ÐIÑ
JÔ
JÐJà	Ô	Ðs   ³/A4Á4
A>ÂA>)xr,   r#  Úcollections.abcr   r¸   Údataclassesr   rÌ  r\  rª   r  rX   r4   r0  r9  r@   rE  ru  Útypingr   r   r   r   r	   r
   r   r   r   Úurllib.parser   r   r>  r—  rÔ  Úgoogle.authri   Úgoogle.auth.credentialsr   Úgoogle.auth.transportr   r   r-  rã   Úpydanticr   r   rø   r§   r   r   r   Útypesr   r   r   r@  r   r   Úwebsockets.asyncio.clientr   rã  ÚModuleNotFoundErrorÚwebsockets.clientrÏ   rÐ   rZ  Úhttpx2rr   r    Ú	multidictr!   Úrequests.structuresr"   Ú	getLoggerr7   rp  rÖ   rr  rs  rt  rJ  rÄ   rÃ   rä   r“   ÚTimeoutExceptionÚConnectErrorrî   rl   r(   rW   r;   r}   rE   rT   r�   r±  rZ   re   ro   rt   rw   ry   rû   r  r  r  r  rý   rÖ  r	  rÎ  r  ÚAsyncClientr   r'  rj   rm   rî  rô  r-   r.   r/   ú<module>rÉ     sV  ðð"ð ð
 €€€Ø %Ð %Ð %Ð %Ð %Ð %Ø €€€Ø !Ð !Ð !Ð !Ð !Ð !Ø €€€Ø 	€	€	€	Ø €€€Ø €€€Ø €€€Ø 	€	€	€	Ø €€€Ø 
€
€
€
Ø 
€
€
€
Ø Ð Ð Ð Ø €€€Ø fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fÐ fØ !Ð !Ð !Ð !Ð !Ð !Ø #Ð #Ð #Ð #Ð #Ð #Ø €€€à €€€Ø €€€Ø Ð Ð Ð Ø Ð Ð Ð Ø /Ð /Ð /Ð /Ð /Ð /Ø &Ð &Ð &Ð &Ð &Ð &Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø €€€Ø Ð Ð Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $Ø €€€à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø #Ð #Ð #Ð #Ð #Ð #Ø  Ð  Ð  Ð  Ð  Ð  ð6Ø=Ð=Ð=Ð=Ð=Ð=Ð=øØð 6ð 6ð 6à5Ð5Ð5Ð5Ð5Ð5Ð5Ð5ð6øøøð
 €ðØ€.€.€.à€+€+øØð ð ð Ø€$ðøøøðØ€-€-€-€-øØð ð ð Ø€&€&€&ðøøøð ð 6Ø>Ð>Ð>Ð>Ð>Ð>Ø(Ð(Ð(Ð(Ð(Ð(Ø5Ð5Ð5Ð5Ð5Ð5ð 
ˆÔ	Ð5Ñ	6Ô	6€Ø€
ØÐ Ø€ØÐ ØÐ à! 4˜LÐ ð  ˜€U„^ÐÐ¨e¬n¸f¼oÐ-Nð ð ˜€U„]ÐÐ¨U¬]¸F¼NÐ,Kð ð
 €~ð Ô˜UÔ/Ð0Ð0ð 	ÔØÔØÔØÔð	
ð ð2ð 2ð 2ð 2ð 2 
ñ 2ô 2ð 2ð:˜ #œð :ð :ð :ð :ð"8¨D°°c°¬Nð 8¸tð 8ð 8ð 8ð 8ð@ØðØ)4ðàðð ð ð ð8EØ�#�s�(Œ^ðEØ19¸%ÀÀsÀ
Ô:KÔ1LðEà	ðEð Eð Eð EðG˜Cð G sð G¨sð Gð Gð Gð Gð˜%  T 	Ô*ð ¨u°[À#Ð5EÔ/Fð ð ð ð ð"˜kð ¨kð ð ð ð ð
Ø�e˜E 3˜JÔ'Ô(ð
àˆe„_ð
ð 
ð 
ð 
ð ð"ð "ð "ð "ð "ñ "ô "ñ „ð"ðNð Nð Nð Nð Nñ Nô Nð Nðj €ØÐ ØÐ Ø€Ø€ðÐ ð ˜Ð!1Ô2ð  °wÔ7Ið  ð  ð  ð  ðFð ð ð ð �e”lñ ô ð ð*ð ð ð ð �uÔ(ñ ô ð ð(vð vð vð vð vñ vô vð vðr;
Øð
à”Ô(Ô4ð
ð 	ð
ð 
ð 
ð 
ðØðà”Ô(Ô4ðð 	ðð ð ð ð ð s6   ÃC ÃC%Ã$C%Ã+C2 Ã2C:Ã9C:Ã>D ÄDÄD