<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto

namespace Opentelemetry\Proto\Trace\V1\Status;

use UnexpectedValueException;

/**
 * Protobuf type <code>opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode</code>
 */
class DeprecatedStatusCode
{
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_OK = 0;</code>
     */
    const DEPRECATED_STATUS_CODE_OK = 0;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_CANCELLED = 1;</code>
     */
    const DEPRECATED_STATUS_CODE_CANCELLED = 1;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2;</code>
     */
    const DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3;</code>
     */
    const DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4;</code>
     */
    const DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_NOT_FOUND = 5;</code>
     */
    const DEPRECATED_STATUS_CODE_NOT_FOUND = 5;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6;</code>
     */
    const DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7;</code>
     */
    const DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8;</code>
     */
    const DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9;</code>
     */
    const DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_ABORTED = 10;</code>
     */
    const DEPRECATED_STATUS_CODE_ABORTED = 10;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11;</code>
     */
    const DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12;</code>
     */
    const DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13;</code>
     */
    const DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_UNAVAILABLE = 14;</code>
     */
    const DEPRECATED_STATUS_CODE_UNAVAILABLE = 14;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_DATA_LOSS = 15;</code>
     */
    const DEPRECATED_STATUS_CODE_DATA_LOSS = 15;
    /**
     * Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16;</code>
     */
    const DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16;

    private static $valueToName = [
        self::DEPRECATED_STATUS_CODE_OK => 'DEPRECATED_STATUS_CODE_OK',
        self::DEPRECATED_STATUS_CODE_CANCELLED => 'DEPRECATED_STATUS_CODE_CANCELLED',
        self::DEPRECATED_STATUS_CODE_UNKNOWN_ERROR => 'DEPRECATED_STATUS_CODE_UNKNOWN_ERROR',
        self::DEPRECATED_STATUS_CODE_INVALID_ARGUMENT => 'DEPRECATED_STATUS_CODE_INVALID_ARGUMENT',
        self::DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED => 'DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED',
        self::DEPRECATED_STATUS_CODE_NOT_FOUND => 'DEPRECATED_STATUS_CODE_NOT_FOUND',
        self::DEPRECATED_STATUS_CODE_ALREADY_EXISTS => 'DEPRECATED_STATUS_CODE_ALREADY_EXISTS',
        self::DEPRECATED_STATUS_CODE_PERMISSION_DENIED => 'DEPRECATED_STATUS_CODE_PERMISSION_DENIED',
        self::DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED => 'DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED',
        self::DEPRECATED_STATUS_CODE_FAILED_PRECONDITION => 'DEPRECATED_STATUS_CODE_FAILED_PRECONDITION',
        self::DEPRECATED_STATUS_CODE_ABORTED => 'DEPRECATED_STATUS_CODE_ABORTED',
        self::DEPRECATED_STATUS_CODE_OUT_OF_RANGE => 'DEPRECATED_STATUS_CODE_OUT_OF_RANGE',
        self::DEPRECATED_STATUS_CODE_UNIMPLEMENTED => 'DEPRECATED_STATUS_CODE_UNIMPLEMENTED',
        self::DEPRECATED_STATUS_CODE_INTERNAL_ERROR => 'DEPRECATED_STATUS_CODE_INTERNAL_ERROR',
        self::DEPRECATED_STATUS_CODE_UNAVAILABLE => 'DEPRECATED_STATUS_CODE_UNAVAILABLE',
        self::DEPRECATED_STATUS_CODE_DATA_LOSS => 'DEPRECATED_STATUS_CODE_DATA_LOSS',
        self::DEPRECATED_STATUS_CODE_UNAUTHENTICATED => 'DEPRECATED_STATUS_CODE_UNAUTHENTICATED',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DeprecatedStatusCode::class, \Opentelemetry\Proto\Trace\V1\Status_DeprecatedStatusCode::class);

