o
    ÚtBhŽ  ã                   @   sz   d Z ddlZddlZddlZddlmZ ddlmZ e d¡dkr2e 	d¡j
Zee d¡k r2ed	ƒ‚G d
d„ dejƒZdS )z8Create / interact with Google Cloud Storage connections.é    N)Ú_http)Ú__version__Ú!GOOGLE_API_USE_CLIENT_CERTIFICATEÚtruezgoogle-cloud-corez1.6.0z:google-cloud-core >= 1.6.0 is required to use mTLS featurec                       sB   e Zd ZdZdZdZd‡ fdd„	ZdZ	 dZ	 ‡ fd	d
„Z	‡  Z
S )Ú
Connectiona  A connection to Google Cloud Storage via the JSON REST API. Mutual TLS feature will be
    enabled if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is set to "true".

    :type client: :class:`~google.cloud.storage.client.Client`
    :param client: The client that owns the current connection.

    :type client_info: :class:`~google.api_core.client_info.ClientInfo`
    :param client_info: (Optional) instance used to generate user agent.

    :type api_endpoint: str
    :param api_endpoint: (Optional) api endpoint to use.
    zhttps://storage.googleapis.comz#https://storage.mtls.googleapis.comNc                    sf   t t| ƒ ||¡ |p| j| _| j| _|d u | _t| j	_
| j	jd u r&d| j	_| j	 jd t¡7  _d S )NÚ z gcloud-python/{} )Úsuperr   Ú__init__ÚDEFAULT_API_ENDPOINTÚAPI_BASE_URLÚDEFAULT_API_MTLS_ENDPOINTÚAPI_BASE_MTLS_URLÚALLOW_AUTO_SWITCH_TO_MTLS_URLr   Ú_client_infoÚclient_library_versionÚ
user_agentÚformat)ÚselfÚclientÚclient_infoÚapi_endpoint©Ú	__class__© úq/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/google/cloud/storage/_http.pyr	   1   s   
zConnection.__init__Úv1z*{api_base_url}/storage/{api_version}{path}c                    sj   |  dd ¡}tjtt| ƒjg|¢R i |¤Ž}|r2z
|jdi |¤Ž}W n	 ty+   Y nw |r2||ƒ}|ƒ S )NÚretryr   )ÚpopÚ	functoolsÚpartialr   r   Úapi_requestÚ"get_retry_policy_if_conditions_metÚAttributeError)r   ÚargsÚkwargsr   Úcallr   r   r   r    C   s    ÿzConnection.api_request)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r	   ÚAPI_VERSIONÚAPI_URL_TEMPLATEr    Ú__classcell__r   r   r   r   r       s    r   )r)   r   ÚosÚpkg_resourcesÚgoogle.cloudr   Úgoogle.cloud.storager   ÚgetenvÚget_distributionÚparsed_versionÚreleaseÚparse_versionÚImportErrorÚJSONConnectionr   r   r   r   r   Ú<module>   s   