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

namespace Rv\Analytics\Trigger\Action\Timer;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.analytics.Trigger.Action.Timer.Type</code>
 */
class Type
{
    /**
     * Generated from protobuf enum <code>TYPE_UNKNOWN = 0;</code>
     */
    const TYPE_UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>TYPE_START_SET_CONFIGURATION = 1;</code>
     */
    const TYPE_START_SET_CONFIGURATION = 1;
    /**
     * Generated from protobuf enum <code>TYPE_START = 2;</code>
     */
    const TYPE_START = 2;
    /**
     * Generated from protobuf enum <code>TYPE_STOP = 3;</code>
     */
    const TYPE_STOP = 3;
    /**
     * Generated from protobuf enum <code>TYPE_RESET = 4;</code>
     */
    const TYPE_RESET = 4;
    /**
     * Generated from protobuf enum <code>TYPE_STOP_SET_CONFIGURATION = 5;</code>
     */
    const TYPE_STOP_SET_CONFIGURATION = 5;
    /**
     * Generated from protobuf enum <code>TYPE_INCREMENT = 6;</code>
     */
    const TYPE_INCREMENT = 6;

    private static $valueToName = [
        self::TYPE_UNKNOWN => 'TYPE_UNKNOWN',
        self::TYPE_START_SET_CONFIGURATION => 'TYPE_START_SET_CONFIGURATION',
        self::TYPE_START => 'TYPE_START',
        self::TYPE_STOP => 'TYPE_STOP',
        self::TYPE_RESET => 'TYPE_RESET',
        self::TYPE_STOP_SET_CONFIGURATION => 'TYPE_STOP_SET_CONFIGURATION',
        self::TYPE_INCREMENT => 'TYPE_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);
    }
}

