<?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.DeviceExecuteProcess</code>
 */
class DeviceExecuteProcess
{
    /**
     * Generated from protobuf enum <code>Execute_NotSet = 0;</code>
     */
    const Execute_NotSet = 0;
    /**
     * Causes onedevice to compacting/consolidate its database
     *
     * Generated from protobuf enum <code>Execute_Database_Compact = 10;</code>
     */
    const Execute_Database_Compact = 10;
    /**
     * Causes onedevice to check the integrity of its database
     *
     * Generated from protobuf enum <code>Execute_Database_Integrity = 11;</code>
     */
    const Execute_Database_Integrity = 11;
    /**
     * Causes onedevice to compact the queues
     *
     * Generated from protobuf enum <code>Execute_Queuing_Compact = 20;</code>
     */
    const Execute_Queuing_Compact = 20;
    /**
     * Causes onedevice to run an integrity check on the queues
     *
     * Generated from protobuf enum <code>Execute_Queuing_Integrity = 21;</code>
     */
    const Execute_Queuing_Integrity = 21;
    /**
     * Causes onedevice to generate metrics 
     *
     * Generated from protobuf enum <code>Execute_Metrics_Generate = 30;</code>
     */
    const Execute_Metrics_Generate = 30;

    private static $valueToName = [
        self::Execute_NotSet => 'Execute_NotSet',
        self::Execute_Database_Compact => 'Execute_Database_Compact',
        self::Execute_Database_Integrity => 'Execute_Database_Integrity',
        self::Execute_Queuing_Compact => 'Execute_Queuing_Compact',
        self::Execute_Queuing_Integrity => 'Execute_Queuing_Integrity',
        self::Execute_Metrics_Generate => 'Execute_Metrics_Generate',
    ];

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

