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

namespace OS\PB\DeviceConfig;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.DeviceConfig.DeviceMode</code>
 */
class DeviceMode
{
    /**
     * Generated from protobuf enum <code>DeviceMode_NotSet = 0;</code>
     */
    const DeviceMode_NotSet = 0;
    /**
     * 0.9 (Default): Device is on production, will connection production server
     *
     * Generated from protobuf enum <code>DeviceMode_Production = 1;</code>
     */
    const DeviceMode_Production = 1;
    /**
     * 0.9 Device will connect to dev server for development purposes
     *
     * Generated from protobuf enum <code>DeviceMode_Developer = 2;</code>
     */
    const DeviceMode_Developer = 2;
    /**
     * 1.4 Device will connect to beta server for pre-release validation
     *
     * Generated from protobuf enum <code>DeviceMode_Beta = 3;</code>
     */
    const DeviceMode_Beta = 3;

    private static $valueToName = [
        self::DeviceMode_NotSet => 'DeviceMode_NotSet',
        self::DeviceMode_Production => 'DeviceMode_Production',
        self::DeviceMode_Developer => 'DeviceMode_Developer',
        self::DeviceMode_Beta => 'DeviceMode_Beta',
    ];

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

