o
    ²3Ihë	  ã                   @   sF   d dl Z d dlZd dlZe e¡ZG dd„ de jƒZG dd„ dƒZdS )é    Nc                   @   s    e Zd ZdZdZ	 dZ	 dZdS )Ú
StatusCodez@Represents the canonical set of status codes of a finished Span.r   é   é   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚUNSETÚOKÚERROR© r   r   úZ/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/opentelemetry/trace/status.pyr      s    r   c                   @   s~   e Zd ZdZejdfdedeje fdd„Z	e
defdd	„ƒZe
deje fd
d„ƒZe
defdd„ƒZe
defdd„ƒZdS )ÚStatuszãRepresents the status of a finished Span.

    Args:
        status_code: The canonical status code that describes the result
            status of the operation.
        description: An optional description of the status.
    NÚstatus_codeÚdescriptionc                 C   sJ   || _ d | _|r t|tƒst d¡ d S |tjur t d¡ d S || _d S )Nz-Invalid status description type, expected strzJdescription should only be set when status_code is set to StatusCode.ERROR)Ú_status_codeÚ_descriptionÚ
isinstanceÚstrÚloggerÚwarningr   r   )Úselfr   r   r   r   r   Ú__init__,   s   


ÿ
zStatus.__init__Úreturnc                 C   ó   | j S )z8Represents the canonical status code of a finished Span.)r   ©r   r   r   r   r   @   ó   zStatus.status_codec                 C   r   )zStatus description)r   r   r   r   r   r   E   r   zStatus.descriptionc                 C   s   | j p| jtju S )z:Returns false if this represents an error, true otherwise.)Úis_unsetr   r   r
   r   r   r   r   Úis_okJ   s   zStatus.is_okc                 C   s   | j tju S )z'Returns true if unset, false otherwise.)r   r   r	   r   r   r   r   r   O   s   zStatus.is_unset)r   r   r   r   r   r	   ÚtypingÚOptionalr   r   Úpropertyr   r   Úboolr   r   r   r   r   r   r   #   s"    
ýþ
ýr   )	ÚenumÚloggingr   Ú	getLoggerr   r   ÚEnumr   r   r   r   r   r   Ú<module>   s   
