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

namespace Keyapis\TelemetryAlerting\V1\Trigger;

use UnexpectedValueException;

/**
 * Справочник типов энергоресурсов, собираемых ТУ
 *
 * Protobuf type <code>keyapis.telemetry_alerting.v1.Trigger.MetricType</code>
 */
class MetricType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>METRIC_TYPE_UNKNOWN = 0;</code>
     */
    const METRIC_TYPE_UNKNOWN = 0;
    /**
     * Горячая вода
     *
     * Generated from protobuf enum <code>HOT_WATER = 1;</code>
     */
    const HOT_WATER = 1;
    /**
     * Холодная вода
     *
     * Generated from protobuf enum <code>COLD_WATER = 2;</code>
     */
    const COLD_WATER = 2;
    /**
     * Теплоэнергия
     *
     * Generated from protobuf enum <code>HEAT = 3;</code>
     */
    const HEAT = 3;
    /**
     * Газ
     *
     * Generated from protobuf enum <code>GAS = 4;</code>
     */
    const GAS = 4;
    /**
     * Электроэнергия
     *
     * Generated from protobuf enum <code>ELECTRICITY = 5;</code>
     */
    const ELECTRICITY = 5;

    private static $valueToName = [
        self::METRIC_TYPE_UNKNOWN => 'METRIC_TYPE_UNKNOWN',
        self::HOT_WATER => 'HOT_WATER',
        self::COLD_WATER => 'COLD_WATER',
        self::HEAT => 'HEAT',
        self::GAS => 'GAS',
        self::ELECTRICITY => 'ELECTRICITY',
    ];

    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(MetricType::class, \Keyapis\TelemetryAlerting\V1\Trigger_MetricType::class);

