File: //var/opt/nydus/ops/mysql/opentelemetry/trace/__pycache__/status.cpython-39.pyc
a
�,�h� � @ sF d dl Z d dlZd dlZe�e�ZG dd� de j�ZG dd� d�ZdS )� Nc @ s e Zd ZdZdZdZdZdS )�
StatusCodez@Represents the canonical set of status codes of a finished Span.r � � N)�__name__�
__module__�__qualname__�__doc__�UNSET�OK�ERROR� r r �S/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/opentelemetry/trace/status.pyr s
r c @ s| e Zd ZdZejdfeeje d�dd�Z e
ed�dd��Ze
eje d�d d
��Ze
e
d�dd��Ze
e
d�d
d��ZdS )�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 |tjur@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
�zStatus.__init__)�returnc C s | j S )z8Represents the canonical status code of a finished Span.)r �r r r r
r @ s zStatus.status_codec C s | j S )zStatus description)r r r r r
r E s zStatus.descriptionc C s | j p| jtju S )z:Returns false if this represents an error, true otherwise.)�is_unsetr r r
r r r r
�is_okJ s zStatus.is_okc C s | j tju S )z'Returns true if unset, false otherwise.)r r r r r r r
r O s zStatus.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