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

namespace Rv\Analytics\Trigger\ActionTimer;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.analytics.trigger.ActionTimer.Type</code>
 */
class Type
{
    /**
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>START_SET_CONFIGURATION = 1;</code>
     */
    const START_SET_CONFIGURATION = 1;
    /**
     * Generated from protobuf enum <code>START = 2;</code>
     */
    const START = 2;
    /**
     * Generated from protobuf enum <code>STOP = 3;</code>
     */
    const STOP = 3;
    /**
     * Generated from protobuf enum <code>RESET = 4;</code>
     */
    const RESET = 4;
    /**
     * Generated from protobuf enum <code>STOP_SET_CONFIGURATION = 5;</code>
     */
    const STOP_SET_CONFIGURATION = 5;
    /**
     * Generated from protobuf enum <code>INCREMENT = 6;</code>
     */
    const INCREMENT = 6;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::START_SET_CONFIGURATION => 'START_SET_CONFIGURATION',
        self::START => 'START',
        self::STOP => 'STOP',
        self::RESET => 'RESET',
        self::STOP_SET_CONFIGURATION => 'STOP_SET_CONFIGURATION',
        self::INCREMENT => 'INCREMENT',
    ];

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

