
    	]j                     D    d Z ddlmZ ddlmZ  e       Z G d de      Zy)zFA client for interacting with Google Cloud Storage using the gRPC API.    )ClientWithProject)_storage_v2c                   T     e Zd ZdZedddfddd fdZ	 	 	 	 ddZed        Z x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                    t         t        |   ||       t        |t              r|r||d<   n|	|si nd|i}n	|r||_        | j                  ||||      | _        y )N)projectcredentialsr   )r   client_infoclient_optionsr   )superr   __init__
isinstancedictr   _create_gapic_client_grpc_client)selfr
   r   r   r   r   r   	__class__s          J/root/env/lib/python3.12/site-packages/google/cloud/storage/grpc_client.pyr   zGrpcClient.__init__>   ss     	j$(k(Rnd+,3y)#'.RY4HN%,N" 55##) 3	 6 
    c                     t         j                  j                  d      }|j                  |      } |||      }t        j                  ||||      S )z?Creates and configures the low-level GAPIC `storage_v2` client.grpc)r   )r   channel)r   	transportr   r   )
storage_v2StorageClientget_transport_classcreate_channel)r   r   r   r   r   transport_clsr   r   s           r   r   zGrpcClient._create_gapic_clientY   sY     #00DDVL..CV.W!k7K	''##)	
 	
r   c                     | 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.
        )r   )r   s    r   grpc_clientzGrpcClient.grpc_clientn   s        r   )NNNT)
__name__
__module____qualname____doc___markerr   r   propertyr"   __classcell__)r   s   @r   r   r      sP    $P 
  
:  
* ! !r   r   N)	r&   google.cloud.clientr   google.cloudr   r   objectr'   r    r   r   <module>r.      s'    M 1 2
(c!" c!r   