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

namespace OS\PB;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.DeviceStatus</code>
 */
class DeviceStatus
{
    /**
     * Generated from protobuf enum <code>Device_Normal = 0;</code>
     */
    const Device_Normal = 0;
    /**
     * Generated from protobuf enum <code>Device_DFU = 1;</code>
     */
    const Device_DFU = 1;
    /**
     * Generated from protobuf enum <code>Device_Unconfigured = 2;</code>
     */
    const Device_Unconfigured = 2;
    /**
     * Generated from protobuf enum <code>Device_Offline = 4;</code>
     */
    const Device_Offline = 4;
    /**
     * Generated from protobuf enum <code>Device_SIMError = 8;</code>
     */
    const Device_SIMError = 8;
    /**
     * Generated from protobuf enum <code>Device_DFU_Unconfigured = 3;</code>
     */
    const Device_DFU_Unconfigured = 3;
    /**
     * Generated from protobuf enum <code>Device_DFU_Offline = 5;</code>
     */
    const Device_DFU_Offline = 5;
    /**
     * Generated from protobuf enum <code>Device_Unconfigured_Offline = 6;</code>
     */
    const Device_Unconfigured_Offline = 6;
    /**
     * Generated from protobuf enum <code>Device_DFU_Unconfigured_Offline = 7;</code>
     */
    const Device_DFU_Unconfigured_Offline = 7;
    /**
     * Generated from protobuf enum <code>Device_DFU_SIMError = 9;</code>
     */
    const Device_DFU_SIMError = 9;
    /**
     * Generated from protobuf enum <code>Device_Unconfigured_SIMError = 10;</code>
     */
    const Device_Unconfigured_SIMError = 10;
    /**
     * Generated from protobuf enum <code>Device_DFU_Unconfigured_SIMError = 11;</code>
     */
    const Device_DFU_Unconfigured_SIMError = 11;
    /**
     * Generated from protobuf enum <code>Device_Offline_SIMError = 12;</code>
     */
    const Device_Offline_SIMError = 12;
    /**
     * Generated from protobuf enum <code>Device_Unconfigured_Offline_SIMError = 14;</code>
     */
    const Device_Unconfigured_Offline_SIMError = 14;
    /**
     * Generated from protobuf enum <code>Device_DFU_Unconfigured_Offline_SIMError = 15;</code>
     */
    const Device_DFU_Unconfigured_Offline_SIMError = 15;

    private static $valueToName = [
        self::Device_Normal => 'Device_Normal',
        self::Device_DFU => 'Device_DFU',
        self::Device_Unconfigured => 'Device_Unconfigured',
        self::Device_Offline => 'Device_Offline',
        self::Device_SIMError => 'Device_SIMError',
        self::Device_DFU_Unconfigured => 'Device_DFU_Unconfigured',
        self::Device_DFU_Offline => 'Device_DFU_Offline',
        self::Device_Unconfigured_Offline => 'Device_Unconfigured_Offline',
        self::Device_DFU_Unconfigured_Offline => 'Device_DFU_Unconfigured_Offline',
        self::Device_DFU_SIMError => 'Device_DFU_SIMError',
        self::Device_Unconfigured_SIMError => 'Device_Unconfigured_SIMError',
        self::Device_DFU_Unconfigured_SIMError => 'Device_DFU_Unconfigured_SIMError',
        self::Device_Offline_SIMError => 'Device_Offline_SIMError',
        self::Device_Unconfigured_Offline_SIMError => 'Device_Unconfigured_Offline_SIMError',
        self::Device_DFU_Unconfigured_Offline_SIMError => 'Device_DFU_Unconfigured_Offline_SIMError',
    ];

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

