o
    )=j  ã                   @   s6   d Z ddlmZ ddlmZ eƒ ZG dd„ deƒZdS )zFA client for interacting with Google Cloud Storage using the gRPC API.é    )ÚClientWithProject)Ú_storage_v2c                       sP   e Zd ZdZedddfdddœ‡ fdd„Z				ddd„Zed	d
„ ƒZ‡  Z	S )Ú
GrpcClienta  A client for interacting with Google Cloud Storage using the gRPC API.

    :type project: str or None
    :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, falls back to the default
                        inferred from the environment.

    :type client_info: :class:`~google.api_core.client_info.ClientInfo`
    :param client_info:
        The client info used to send a user-agent string along with API
        requests. If ``None``, then default info will be used. Generally,
        you only need to set this if you're developing your own library
        or partner tool.

    :type client_options: :class:`~google.api_core.client_options.ClientOptions` or :class:`dict`
    :param client_options: (Optional) Client options used to set user options
        on the client. A non-default universe domain or API endpoint should be
        set through client_options.

    :type api_key: string
    :param api_key:
        (Optional) An API key. Mutually exclusive with any other credentials.
        This parameter is an alias for setting `client_options.api_key` and
        will supersede any API key set in the `client_options` parameter.

    :type attempt_direct_path: bool
    :param attempt_direct_path:
        (Optional) Whether to attempt to use DirectPath for gRPC connections.
        This provides a direct, unproxied connection to GCS for lower latency
        and higher throughput, and is highly recommended when running on Google
        Cloud infrastructure. Defaults to ``True``.
    NT)Úapi_keyÚattempt_direct_pathc                   sh   t t| ƒj||d� t|tƒr|r||d< n|d u r#|si nd|i}n|r(||_| j||||d�| _d S )N)ÚprojectÚcredentialsr   )r   Úclient_infoÚclient_optionsr   )Úsuperr   Ú__init__Ú
isinstanceÚdictr   Ú_create_gapic_clientÚ_grpc_client)Úselfr   r   r	   r
   r   r   ©Ú	__class__© újC:\Users\psant\Downloads\Anu Raj Backend\school\venv\Lib\site-packages\google/cloud/storage/grpc_client.pyr   >   s   

€üzGrpcClient.__init__c                 C   s6   t j d¡}|j|d�}|||d�}t j||||d�S )z?Creates and configures the low-level GAPIC `storage_v2` client.Zgrpc)r   )r   Úchannel)r   Ú	transportr	   r
   N)Ú
storage_v2ZStorageClientZget_transport_classZcreate_channel)r   r   r	   r
   r   Ztransport_clsr   r   r   r   r   r   Y   s   üzGrpcClient._create_gapic_clientc                 C   s   | j S )az  The underlying gRPC client.

        This property gives users direct access to the `storage_v2.StorageClient`
         instance. This can be useful for accessing
        newly added or experimental RPCs that are not yet exposed through
        the high-level GrpcClient.

        Returns:
            google.cloud.storage_v2.StorageClient: The configured GAPIC client.
        N)r   )r   r   r   r   Úgrpc_clientn   s   zGrpcClient.grpc_client)NNNT)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_markerr   r   Úpropertyr   Ú__classcell__r   r   r   r   r      s"    (ûø
ûr   N)	r   Zgoogle.cloud.clientr   Zgoogle.cloudr   r   Úobjectr   r   r   r   r   r   Ú<module>   s
   