o
    3Ih                     @   s\   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 G dd dZ
G dd	 d	Zd
S )    )dumps)Optional)
deprecated)BoundedAttributes)
Attributesc                	   @   s   e Zd ZdZdZed		ddedee dee fdd	Zd
d Z	dd Z
dd Zdd Zedee fddZedee fddZedefddZdS )InstrumentationInfozImmutable information about an instrumentation library module.

    See `opentelemetry.trace.TracerProvider.get_tracer` for the meaning of these
    properties.
    _name_version_schema_urlzEYou should use InstrumentationScope. Deprecated since version 1.11.1.Nnameversion
schema_urlc                 C   s"   || _ || _|d u rd}|| _d S )N r   )selfr   r   r    r   f/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/opentelemetry/sdk/util/instrumentation.py__init__    s
   	
zInstrumentationInfo.__init__c                 C   s(   t | j d| j d| j d| j dS N(z, ))type__name__r	   r
   r   r   r   r   r   __repr__/   s   (zInstrumentationInfo.__repr__c                 C      t | j| j| jfS Nhashr	   r
   r   r   r   r   r   __hash__2      zInstrumentationInfo.__hash__c                 C   s0   t |t | u o| j| j| jf|j|j|jfkS r   )r   r	   r
   r   r   valuer   r   r   __eq__5   s   zInstrumentationInfo.__eq__c                 C   s4   t |t | ur
tS | j| j| jf|j|j|jfk S r   )r   NotImplementedr	   r
   r   r!   r   r   r   __lt__<   s   zInstrumentationInfo.__lt__returnc                 C      | j S r   r   r   r   r   r   r   E      zInstrumentationInfo.schema_urlc                 C   r'   r   r
   r   r   r   r   r   I   r)   zInstrumentationInfo.versionc                 C   r'   r   r	   r   r   r   r   r   M   r)   zInstrumentationInfo.name)NN)r   
__module____qualname____doc__	__slots__r   strr   r   r   r   r#   r%   propertyr   r   r   r   r   r   r   r      s2    	r   c                   @   s   e Zd ZdZdZ			d dedee dee dee ddf
d	d
ZdefddZ	de
fddZdedefddZdedefddZedee fddZedee fddZedefddZedefddZd!dee
 defddZdS )"InstrumentationScopezA logical unit of the application code with which the emitted telemetry can be
    associated.

    See `opentelemetry.trace.TracerProvider.get_tracer` for the meaning of these
    properties.
    )r	   r
   r   _attributesNr   r   r   
attributesr&   c                 C   s.   || _ || _|d u rd}|| _t|d| _d S )Nr   )r4   )r	   r
   r   r   r3   )r   r   r   r   r4   r   r   r   r   \   s   zInstrumentationScope.__init__c              
   C   s0   t | j d| j d| j d| j d| j d
S r   )r   r   r	   r
   r   r3   r   r   r   r   r   j   s   0zInstrumentationScope.__repr__c                 C   r   r   r   r   r   r   r   r   m   r    zInstrumentationScope.__hash__r"   c                 C   s6   t |tstS | j| j| j| jf|j|j|j|jfkS r   
isinstancer2   r$   r	   r
   r   r3   r!   r   r   r   r#   p      
zInstrumentationScope.__eq__c                 C   s6   t |tstS | j| j| j| jf|j|j|j|jfk S r   r5   r!   r   r   r   r%      r7   zInstrumentationScope.__lt__c                 C   r'   r   r(   r   r   r   r   r      r)   zInstrumentationScope.schema_urlc                 C   r'   r   r*   r   r   r   r   r      r)   zInstrumentationScope.versionc                 C   r'   r   r+   r   r   r   r   r      r)   zInstrumentationScope.namec                 C   r'   r   )r3   r   r   r   r   r4      r)   zInstrumentationScope.attributes   indentc                 C   s0   t | j| j| jt| jrt| jnd d|dS )N)r   r   r   r4   )r9   )r   r	   r
   r   boolr3   dict)r   r9   r   r   r   to_json   s   zInstrumentationScope.to_json)NNN)r8   )r   r,   r-   r.   r/   r0   r   r   r   r   intr   objectr:   r#   r%   r1   r   r   r   r4   r<   r   r   r   r   r2   R   s<    
r2   N)jsonr   typingr   typing_extensionsr   opentelemetry.attributesr   opentelemetry.util.typesr   r   r2   r   r   r   r   <module>   s   ;