
    Áj
                        d dl mZ d dlmZmZmZ d dlmZmZ ddl	m
Z
 ddlmZ erd dlZd d	lmZ ej$                  Zd
Z G d dee         Zes e       ZddddZddddZddddZy)    )annotations)TYPE_CHECKINGAnycast)ClassVaroverride   )MissingDependencyError   )	LazyProxyN)Credentialsz.https://www.googleapis.com/auth/cloud-platformc                  .    e Zd ZU dZded<   edd       Zy)GoogleAuthProxyTzClassVar[bool]should_cachec                b    	 dd l }|j                  S # t        $ r}t        dd      |d }~ww xY w)Nr   vertexgoogle-authextralibrary)google.authImportErrorr
   auth)selfgoogleerrs      I/tmp/pip-target-k_scjv0h/lib/python/anthropic/lib/_extras/_google_auth.py__load__zGoogleAuthProxy.__load__   s;    	Y {{  	Y(xOUXX	Ys    	.).N)returnr   )__name__
__module____qualname__r   __annotations__r   r        r   r   r      s    #'L.' r%   r   r   r   c                \    	 ddl m}  |       S # t        $ r}t        | d      |d }~ww xY w)Nr   )Requestr   r   )google.auth.transport.requestsr(   r   r
   )r   r(   r   s      r   _requestr*   &   s8    R: 9  R$5-HcQRs    	+&+c                    	 ddl }|j                  j	                  t
        g      \  }}t        t        |      j                  t        |              t        d|      |fS # t        $ r}t        | d      |d}~ww xY w)u  Load Application Default Credentials with the ``cloud-platform`` scope and
    mint an initial access token.

    Returns the credentials object and the project they resolve to (``None`` for
    plain user ADC). Blocking — async callers wrap with :func:`anthropic._utils.asyncify`.

    ``extra`` names the pip extra that the install hint in :class:`MissingDependencyError`
    points at when ``google-auth`` isn't installed; callers pass the extra for their client.
    r   Nr   r   )scopesr&   GoogleCredentials)
r   r   r
   r   defaultCLOUD_PLATFORM_SCOPEr   r   refreshr*   )r   r   r   credentialsprojects        r   load_default_credentialsr3   .   s}    R ";;..7K6L.MKk""8%#89#[17::  R$5-HcQRs   A! !	A=*A88A=c               V    t        t        |       j                  t        |             y)u   Refresh ``credentials`` in place via ``google.auth.transport.requests``.

    Blocking — async callers wrap with :func:`anthropic._utils.asyncify`.
    r&   N)r   r   r0   r*   )r1   r   s     r   refresh_credentialsr5   B   s    
 	k""8%#89r%   )r   strr   r   )r   r6   r   z$tuple[GoogleCredentials, str | None])r1   r-   r   r6   r   None)
__future__r   typingr   r   r   typing_extensionsr   r   _commonr
   _utilsr   r   r   google.auth.credentialsr   r-   r   google_authr/   r   r*   r3   r5   r$   r%   r   <module>r?      so    " + + 0 + H++K
 H 
in 
 !#K &  .6 ;( IQ :r%   