o
    û/‚iü  ã                   @   s‚   U d Z ddlZddlmZ ddlmZ e ¡ Zej	Z
eedf ed< z	ddlZej	ZW n ey6   dZY nw G dd„ deƒZdS )z­Helpers for providing client information.

Client information is used to send information about the calling client,
such as the library and Python version, to API services.
é    N)ÚUnion)ÚversionÚ_GRPC_VERSIONc                   @   s2   e Zd ZdZeeedddddfdd„Zdd„ ZdS )Ú
ClientInfoa5  Client information used to generate a user-agent for API calls.

    This user-agent information is sent along with API calls to allow the
    receiving service to do analytics on which versions of Python and Google
    libraries are being used.

    Args:
        python_version (str): The Python interpreter version, for example,
            ``'3.9.6'``.
        grpc_version (Optional[str]): The gRPC library version.
        api_core_version (str): The google-api-core library version.
        gapic_version (Optional[str]): The version of gapic-generated client
            library, if the library was generated by gapic.
        client_library_version (Optional[str]): The version of the client
            library, generally used if the client library was not generated
            by gapic or if additional functionality was built on top of
            a gapic client library.
        user_agent (Optional[str]): Prefix to the user agent header. This is
            used to supply information such as application name or partner tool.
            Recommended format: ``application-or-tool-ID/major.minor.version``.
        rest_version (Optional[str]): A string with labeled versions of the
            dependencies used for REST transport.
        protobuf_runtime_version (Optional[str]): The protobuf runtime version.
    Nc	           	      C   s4   || _ || _|| _|| _|| _|| _|| _|| _d S )N)Úpython_versionÚgrpc_versionÚapi_core_versionÚgapic_versionÚclient_library_versionÚ
user_agentÚrest_versionÚprotobuf_runtime_version)	Úselfr   r   r   r	   r
   r   r   r   © r   úO/var/www/passon-env/lib/python3.10/site-packages/google/api_core/client_info.pyÚ__init__A   s   
zClientInfo.__init__c                 C   s–   d}| j dur|d7 }|d7 }| jdur|d7 }| jdur!|d7 }|d7 }| jdur.|d7 }| jdur7|d	7 }| jdur@|d
7 }|jdi | j¤Ž ¡ S )z3Returns the user-agent string for this client info.Ú Nz{user_agent} zgl-python/{python_version} zgrpc/{grpc_version} zrest/{rest_version} zgax/{api_core_version} zgapic/{gapic_version} zgccl/{client_library_version} zpb/{protobuf_runtime_version} r   )	r   r   r   r	   r
   r   ÚformatÚ__dict__Ústrip)r   Úuar   r   r   Úto_user_agentU   s    





zClientInfo.to_user_agent)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_PY_VERSIONr   Ú_API_CORE_VERSIONr   r   r   r   r   r   r   '   s    
÷r   )r   ÚplatformÚtypingr   Úgoogle.api_corer   r   r   r   Ú__version__r   ÚstrÚ__annotations__Úgrpcr   ÚImportErrorÚobjectr   r   r   r   r   Ú<module>   s   
ÿ