
    (ph2                        S r SSKrSSKrSSKrSSKJr  SSKJr  SSKJr  SSK	r
SSKr
SSKr
SSKJr  SSKr
SSKr
SSKJr  SSKJr   SSKr
S	rSrSr " S S\5      r " S S\5      r " S S\5      r " S S\\5      rg! \ a    S
r N<f = f)z@Base classes for client used to interact with Google Cloud APIs.    N)PicklingError)Tuple)Union)environment_vars_determine_default_project)service_accountTFzThis library only supports credentials from google-auth-library-python. See https://google-auth.readthedocs.io/en/latest/ for help on authentication with this library.i,  c                   <    \ rS rSrSrSr\S 5       r\S 5       rSr	g)_ClientFactoryMixin3   zYMixin to allow factories that create credentials.

.. note::

    This class is virtual.
Fc                     SU;   a  [        S5      e[        R                  R                  U5      nU R                  (       a  SU;  a  UR                  S5      US'   XCS'   U " U0 UD6$ )aE  Factory to retrieve JSON credentials while creating client.

:type info: dict
:param info:
    The JSON object with a private key and other credentials
    information (downloaded from the Google APIs console).

:type args: tuple
:param args: Remaining positional arguments to pass to constructor.

:param kwargs: Remaining keyword arguments to pass to constructor.

:rtype: :class:`_ClientFactoryMixin`
:returns: The client created with the retrieved JSON credentials.
:raises TypeError: if there is a conflict with the kwargs
         and the credentials created by the factory.
credentialsz,credentials must not be in keyword argumentsproject
project_id)	TypeErrorr	   Credentialsfrom_service_account_info_SET_PROJECTget)clsinfoargskwargsr   s        O/var/www/html/venv/lib/python3.13/site-packages/google/cloud/client/__init__.pyr   -_ClientFactoryMixin.from_service_account_info=   sj    & F"JKK%11KKDQ&$(HH\$:y! +}D#F##    c                     [         R                  " USSS9 n[        R                  " U5      nSSS5        U R                  " W/UQ70 UD6$ ! , (       d  f       N$= f)ak  Factory to retrieve JSON credentials while creating client.

:type json_credentials_path: str
:param json_credentials_path: The path to a private key file (this file
                              was given to you when you created the
                              service account). This file must contain
                              a JSON object with a private key and
                              other credentials information (downloaded
                              from the Google APIs console).

:type args: tuple
:param args: Remaining positional arguments to pass to constructor.

:param kwargs: Remaining keyword arguments to pass to constructor.

:rtype: :class:`_ClientFactoryMixin`
:returns: The client created with the retrieved JSON credentials.
:raises TypeError: if there is a conflict with the kwargs
         and the credentials created by the factory.
rutf-8)encodingN)ioopenjsonloadr   )r   json_credentials_pathr   r   json_ficredentials_infos         r   from_service_account_json-_ClientFactoryMixin.from_service_account_json[   sT    , WW*C'Bg#yy1 C ,,-=OOOO CBs   A
A N)
__name__
__module____qualname____firstlineno____doc__r   classmethodr   r(   __static_attributes__r*   r   r   r   r   3   s6     L$ $: P Pr   r   c                   d    \ rS rSr% SrSr\\\S4   S4   \	S'    SS jr
S r\S 5       rS	 rS
rg)Clientw   a  Client to bundle configuration needed for API requests.

Stores ``credentials`` and an HTTP object so that subclasses
can pass them along to a connection class.

If no value is passed in for ``_http``, a :class:`requests.Session` object
will be created and authorized with the ``credentials``. If not, the
``credentials`` and ``_http`` need not be related.

Callers and subclasses may seek to use the private key from
``credentials`` to sign data.

Args:
    credentials (google.auth.credentials.Credentials):
        (Optional) The OAuth2 Credentials to use for this client. If not
        passed (and if no ``_http`` object is passed), falls back to the
        default inferred from the environment.
    client_options (google.api_core.client_options.ClientOptions):
        (Optional) Custom options for the client.
    _http (requests.Session):
        (Optional) HTTP object to make requests. Can be any object that
        defines ``request()`` with the same interface as
        :meth:`requests.Session.request`. If not passed, an ``_http``
        object is created that is bound to the ``credentials`` for the
        current object.
        This parameter should be considered private, and could change in
        the future.

Raises:
    google.auth.exceptions.DefaultCredentialsError:
        Raised if ``credentials`` is not specified and the library fails
        to acquire default credentials.
N.SCOPEc                 @   [        U[        5      (       a)  [        R                  R                  R                  U5      nUc(  [        R                  R                  R                  5       nU(       a:  UR                  (       a)  [        R                  R                  R                  S5      e[        (       aR  UR                  (       aA  U(       d  UR                  (       a)  [        R                  R                  R                  S5      eU(       aB  [        U[        R                  R                  R                  5      (       d  [        [         5      eUR"                  =(       d    U R$                  nU(       d  Uc  UR                  (       a+  [        R                  R'                  UR                  US9u  pOk[        (       aA  UR                  b4  [        R                  R                  R                  UR                  5      nO[        R                  R)                  US9u  p[        R                  R                  R+                  XS9U l        UR.                  (       a*  U R,                  R1                  UR.                  5      U l        X l        UR4                  U l        g )NzK'credentials' and 'client_options.credentials_file' are mutually exclusive.zh'client_options.api_key' is mutually exclusive with 'credentials' and 'client_options.credentials_file'.)scopes)
isinstancedictgoogleapi_coreclient_options	from_dictClientOptionscredentials_file
exceptionsDuplicateCredentialArgsHAS_GOOGLE_AUTH_API_KEYapi_keyauthr   r   
ValueError_GOOGLE_AUTH_CREDENTIALS_HELPr7   r5   load_credentials_from_filedefaultwith_scopes_if_required_credentialsquota_project_idwith_quota_project_http_internalclient_cert_source_client_cert_source)selfr   _httpr<   r7   _s         r   __init__Client.__init__   s   nd++#__;;EEnUN!#__;;IIKN>:://,,DD] 
 $#&& ? ?//,,DDz  z00<< 
  
 :;;&&4$** ,..!'!G!G"33F "H "Q )(^-C-C-O$kk11==n>T>TU!'!4!4F!4!C"KK33KK L 
 ** $ 1 1 D D//!D $#1#D#D r   c                 :    [        SR                  SS/5      5      e)z1Explicitly state that clients are not pickleable.
z4Pickling client objects is explicitly not supported.z>Clients have non-trivial state that is local and unpickleable.)r   joinrP   s    r   __getstate__Client.__getstate__   s&    IIJT
 	
r   c                    U R                   cj  [        R                  R                  R                  R                  U R                  [        S9U l         U R                   R                  U R                  5        U R                   $ )ziGetter for object used for HTTP transport.

:rtype: :class:`~requests.Session`
:returns: An HTTP object.
)refresh_timeout)
rM   r:   rD   	transportrequestsAuthorizedSessionrJ   _CREDENTIALS_REFRESH_TIMEOUTconfigure_mtls_channelrO   rX   s    r   rQ   Client._http   sm     &"(++"7"7"@"@"R"R!! < #S #D 66t7O7OP"""r   c                 T    U R                   b  U R                   R                  5         gg)zClean up transport, if set.

Suggested use:

.. code-block:: python

   import contextlib

   with contextlib.closing(client):  # closes on exit
       do_something_with(client)
N)rM   closerX   s    r   rd   Client.close   s'     *%%' +r   )rO   rJ   rM   )NNN)r+   r,   r-   r.   r/   r5   r   r   str__annotations__rS   rY   propertyrQ   rd   r1   r*   r   r   r3   r3   w   sP     D +/E5sCx$&'.
0Ed	
 # #(r   r3   c                   2    \ rS rSrSrSS jr\S 5       rSrg)_ClientProjectMixin   a=  Mixin to allow setting the project on the client.

:type project: str
:param project:
    (Optional) the project which the client acts on behalf of. If not
    passed, falls back to the default inferred from the environment.

:type credentials: :class:`google.auth.credentials.Credentials`
:param credentials:
    (Optional) credentials used to discover a project, if not passed.

:raises: :class:`EnvironmentError` if the project is neither passed in nor
         set on the credentials or in the environment. :class:`ValueError`
         if the project value is invalid.
Nc                    UcG  [         R                  " [        R                  [         R                  " [        R                  5      5      nUc  Ub  [        USS 5      nUc  U R                  U5      nUc  [        S5      e[        U[        5      (       a  UR                  S5      n[        U[        5      (       d  [        S5      eXl        g )Nr   zHProject was not passed and could not be determined from the environment.r   zProject must be a string.)osgetenvr   PROJECTLEGACY_PROJECTgetattr_determine_defaultEnvironmentErrorr8   bytesdecoderf   rE   r   )rP   r   r   s      r   rS   _ClientProjectMixin.__init__  s    
 ?ii ((		*99:G ?{6k<>G?--g6G?"3 
 gu%%nnW-G'3''899r   c                     [        U 5      $ )z'Helper:  use default project detection.r   r   s    r   rr   &_ClientProjectMixin._determine_default.  s     *'22r   rx   )NN)	r+   r,   r-   r.   r/   rS   staticmethodrr   r1   r*   r   r   rj   rj      s!     B 3 3r   rj   c                   &    \ rS rSrSrSrSS jrSrg)ClientWithProjecti4  aW  Client that also stores a project.

:type project: str
:param project: the project which the client acts on behalf of. If not
                passed falls back to the default inferred from the
                environment.

:type credentials: :class:`~google.auth.credentials.Credentials`
:param credentials: (Optional) The OAuth2 Credentials to use for this
                    client. If not passed (and if no ``_http`` object is
                    passed), falls back to the default inferred from the
                    environment.

:type _http: :class:`~requests.Session`
:param _http: (Optional) HTTP object to make requests. Can be any object
              that defines ``request()`` with the same interface as
              :meth:`~requests.Session.request`. If not passed, an
              ``_http`` object is created that is bound to the
              ``credentials`` for the current object.
              This parameter should be considered private, and could
              change in the future.

:raises: :class:`ValueError` if the project is neither passed in nor
         set in the environment.
TNc                 T    [         R                  XUS9  [        R                  XX4S9  g )N)r   r   )r   r<   rQ   )rj   rS   r3   )rP   r   r   r<   rQ   s        r   rS   ClientWithProject.__init__Q  s+    $$T$T. 	 	
r   r*   )NNNN)r+   r,   r-   r.   r/   r   rS   r1   r*   r   r   r|   r|   4  s    4 L
r   r|   )r/   r!   r#   rm   pickler   typingr   r   google.api_core.client_optionsr:   google.api_core.exceptionsgoogle.authr   google.auth.credentialsgoogle.auth.transport.requestsgoogle.cloud._helpersr   google.oauth2r	   google.auth.api_keyrB   ImportErrorrF   r`   objectr   r3   rj   r|   r*   r   r   <module>r      s    G 	  	     % !  (  % < )$"4   # AP& APHB(  B(J53& 53p!
 3 !
_  $#$s   B   B
B