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

namespace Deviceapis\Device\V1\Ticker;

use UnexpectedValueException;

/**
 * Режим строки
 *
 * Protobuf type <code>deviceapis.device.v1.Ticker.ModeType</code>
 */
class ModeType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>MODE_TYPE_UNKNOWN = 0;</code>
     */
    const MODE_TYPE_UNKNOWN = 0;
    /**
     * Выключен
     *
     * Generated from protobuf enum <code>OFF = 1;</code>
     */
    const OFF = 1;
    /**
     * Бегущая строка
     *
     * Generated from protobuf enum <code>RUNNING_LINE = 2;</code>
     */
    const RUNNING_LINE = 2;
    /**
     * Строка одна за другой
     *
     * Generated from protobuf enum <code>LINE_1_BY_1 = 3;</code>
     */
    const LINE_1_BY_1 = 3;

    private static $valueToName = [
        self::MODE_TYPE_UNKNOWN => 'MODE_TYPE_UNKNOWN',
        self::OFF => 'OFF',
        self::RUNNING_LINE => 'RUNNING_LINE',
        self::LINE_1_BY_1 => 'LINE_1_BY_1',
    ];

    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(ModeType::class, \Deviceapis\Device\V1\Ticker_ModeType::class);

