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

namespace Keyapis\TelemetryControl\V1\Device\MetricPoint;

use UnexpectedValueException;

/**
 * Справочник типов статусов
 *
 * Protobuf type <code>keyapis.telemetry_control.v1.Device.MetricPoint.StatusType</code>
 */
class StatusType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>STATUS_TYPE_UNKNOWN = 0;</code>
     */
    const STATUS_TYPE_UNKNOWN = 0;
    /**
     * Активная
     *
     * Generated from protobuf enum <code>ACTIVE = 1;</code>
     */
    const ACTIVE = 1;
    /**
     * Не активная
     *
     * Generated from protobuf enum <code>WRONG = 2 [deprecated = true, (.google.api.value_visibility) = {</code>
     */
    const WRONG = 2;
    /**
     * Архивная
     *
     * Generated from protobuf enum <code>ARCHIVE = 3;</code>
     */
    const ARCHIVE = 3;

    private static $valueToName = [
        self::STATUS_TYPE_UNKNOWN => 'STATUS_TYPE_UNKNOWN',
        self::ACTIVE => 'ACTIVE',
        self::WRONG => 'WRONG',
        self::ARCHIVE => 'ARCHIVE',
    ];

    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(StatusType::class, \Keyapis\TelemetryControl\V1\Device_MetricPoint_StatusType::class);

