<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: osdp.proto

namespace OS\PB;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.OSDPLEDColor</code>
 */
class OSDPLEDColor
{
    /**
     * Generated from protobuf enum <code>OSDPLED_None = 0;</code>
     */
    const OSDPLED_None = 0;
    /**
     * Generated from protobuf enum <code>OSDPLED_Red = 1;</code>
     */
    const OSDPLED_Red = 1;
    /**
     * Generated from protobuf enum <code>OSDPLED_Green = 2;</code>
     */
    const OSDPLED_Green = 2;
    /**
     * Generated from protobuf enum <code>OSDPLED_Amber = 3;</code>
     */
    const OSDPLED_Amber = 3;
    /**
     * Generated from protobuf enum <code>OSDPLED_Blue = 4;</code>
     */
    const OSDPLED_Blue = 4;

    private static $valueToName = [
        self::OSDPLED_None => 'OSDPLED_None',
        self::OSDPLED_Red => 'OSDPLED_Red',
        self::OSDPLED_Green => 'OSDPLED_Green',
        self::OSDPLED_Amber => 'OSDPLED_Amber',
        self::OSDPLED_Blue => 'OSDPLED_Blue',
    ];

    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);
    }
}

