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

namespace Keyapis\TelemetryControl\V1\Building;

use UnexpectedValueException;

/**
 * Справочник МРФ (Макрорегионы)
 *
 * Protobuf type <code>keyapis.telemetry_control.v1.Building.MrfType</code>
 */
class MrfType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>MRF_TYPE_UNKNOWN = 0;</code>
     */
    const MRF_TYPE_UNKNOWN = 0;
    /**
     * Центр
     *
     * Generated from protobuf enum <code>TSENTR = 1;</code>
     */
    const TSENTR = 1;
    /**
     * Юг
     *
     * Generated from protobuf enum <code>YUG = 2;</code>
     */
    const YUG = 2;
    /**
     * Урал
     *
     * Generated from protobuf enum <code>URAL = 3;</code>
     */
    const URAL = 3;
    /**
     * Сибирь
     *
     * Generated from protobuf enum <code>SIBIR = 4;</code>
     */
    const SIBIR = 4;
    /**
     * Северо-Запад
     *
     * Generated from protobuf enum <code>SEVERO_ZAPAD = 5;</code>
     */
    const SEVERO_ZAPAD = 5;
    /**
     *Дальний Восток
     *
     * Generated from protobuf enum <code>DALNIY_VOSTOK = 6;</code>
     */
    const DALNIY_VOSTOK = 6;
    /**
     * Волга
     *
     * Generated from protobuf enum <code>VOLGA = 7;</code>
     */
    const VOLGA = 7;

    private static $valueToName = [
        self::MRF_TYPE_UNKNOWN => 'MRF_TYPE_UNKNOWN',
        self::TSENTR => 'TSENTR',
        self::YUG => 'YUG',
        self::URAL => 'URAL',
        self::SIBIR => 'SIBIR',
        self::SEVERO_ZAPAD => 'SEVERO_ZAPAD',
        self::DALNIY_VOSTOK => 'DALNIY_VOSTOK',
        self::VOLGA => 'VOLGA',
    ];

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

