o
    oi	                     @   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   _/var/www/html/pca-backend/venv/lib/python3.10/site-packages/mysql/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 )StatuszRepresents 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   
