<?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;

use UnexpectedValueException;

/**
 * Справочник типов трубопроводов
 *
 * Protobuf type <code>keyapis.telemetry_control.v1.Device.PipeType</code>
 */
class PipeType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>PIPE_TYPE_UNKNOWN = 0;</code>
     */
    const PIPE_TYPE_UNKNOWN = 0;
    /**
     * Подающий
     *
     * Generated from protobuf enum <code>INFEED = 1;</code>
     */
    const INFEED = 1;
    /**
     * Циркуляционный
     *
     * Generated from protobuf enum <code>CIRCULATING = 2;</code>
     */
    const CIRCULATING = 2;

    private static $valueToName = [
        self::PIPE_TYPE_UNKNOWN => 'PIPE_TYPE_UNKNOWN',
        self::INFEED => 'INFEED',
        self::CIRCULATING => 'CIRCULATING',
    ];

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

