o
    g                     @   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		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_urlz1.11.1z#You should use InstrumentationScope)versionreasonNnamer   
schema_urlc                 C   s"   || _ || _|d u rd}|| _d S )N r   )selfr   r   r    r   ]/var/www/visachat/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__0      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__3   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   C      zInstrumentationInfo.schema_urlc                 C   r(   r   r
   r   r   r   r   r   G   r*   zInstrumentationInfo.versionc                 C   r(   r   r	   r   r   r   r   r   K   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      s.    
	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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   )r5   )r	   r
   r   r   r4   )r   r   r   r   r5   r   r   r   r   Z   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   r4   r   r   r   r   r   h   s   0zInstrumentationScope.__repr__c                 C   r   r   r   r   r   r   r   r    k   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   
isinstancer3   r%   r	   r
   r   r4   r"   r   r   r   r$   n      
zInstrumentationScope.__eq__c                 C   s6   t |tstS | j| j| j| jf|j|j|j|jfk S r   r6   r"   r   r   r   r&   }   r8   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   )r4   r   r   r   r   r5      r*   zInstrumentationScope.attributes   c                 C   s0   t | j| j| jt| jrt| jnd d|dS )N)r   r   r   r5   )indent)r   r	   r
   r   boolr4   dict)r   r:   r   r   r   to_json   s   zInstrumentationScope.to_json)NNN)r9   )r   r-   r.   r/   r0   r1   r   r   r   r   intr    objectr;   r$   r&   r2   r   r   r   r5   r=   r   r   r   r   r3   P   s<    
r3   N)jsonr   typingr   r   opentelemetry.attributesr   opentelemetry.util.typesr   r   r3   r   r   r   r   <module>   s   9