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

namespace OS\PB;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.AccessButtonType</code>
 */
class AccessButtonType
{
    /**
     * Generated from protobuf enum <code>AccessButton_NotSet = 0;</code>
     */
    const AccessButton_NotSet = 0;
    /**
     * Generated from protobuf enum <code>AccessButton_Red = 1;</code>
     */
    const AccessButton_Red = 1;
    /**
     * Generated from protobuf enum <code>AccessButton_White = 2;</code>
     */
    const AccessButton_White = 2;
    /**
     * Generated from protobuf enum <code>AccessButton_Blue = 4;</code>
     */
    const AccessButton_Blue = 4;
    /**
     * Generated from protobuf enum <code>AccessButton_Green = 8;</code>
     */
    const AccessButton_Green = 8;
    /**
     * Generated from protobuf enum <code>AccessButton_Black = 16;</code>
     */
    const AccessButton_Black = 16;
    /**
     * Generated from protobuf enum <code>AccessButton_Yellow = 32;</code>
     */
    const AccessButton_Yellow = 32;
    /**
     * Generated from protobuf enum <code>AccessButton_Grey = 64;</code>
     */
    const AccessButton_Grey = 64;

    private static $valueToName = [
        self::AccessButton_NotSet => 'AccessButton_NotSet',
        self::AccessButton_Red => 'AccessButton_Red',
        self::AccessButton_White => 'AccessButton_White',
        self::AccessButton_Blue => 'AccessButton_Blue',
        self::AccessButton_Green => 'AccessButton_Green',
        self::AccessButton_Black => 'AccessButton_Black',
        self::AccessButton_Yellow => 'AccessButton_Yellow',
        self::AccessButton_Grey => 'AccessButton_Grey',
    ];

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

