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

namespace Rv\Analytics\Trigger\ActionProp;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.analytics.trigger.ActionProp.AutoClear</code>
 */
class AutoClear
{
    /**
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>DEFAULT_DISABLED = 1;</code>
     */
    const DEFAULT_DISABLED = 1;
    /**
     * Generated from protobuf enum <code>DEFAULT_ENABLED = 2;</code>
     */
    const DEFAULT_ENABLED = 2;
    /**
     * Generated from protobuf enum <code>DISABLED = 3;</code>
     */
    const DISABLED = 3;
    /**
     * Generated from protobuf enum <code>ENABLED = 4;</code>
     */
    const ENABLED = 4;
    /**
     * Generated from protobuf enum <code>DISABLED_OVERRIDE = 5;</code>
     */
    const DISABLED_OVERRIDE = 5;
    /**
     * Generated from protobuf enum <code>ENABLED_OVERRIDE = 6;</code>
     */
    const ENABLED_OVERRIDE = 6;
    /**
     * Generated from protobuf enum <code>CLEAR_ACTION = 7;</code>
     */
    const CLEAR_ACTION = 7;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::DEFAULT_DISABLED => 'DEFAULT_DISABLED',
        self::DEFAULT_ENABLED => 'DEFAULT_ENABLED',
        self::DISABLED => 'DISABLED',
        self::ENABLED => 'ENABLED',
        self::DISABLED_OVERRIDE => 'DISABLED_OVERRIDE',
        self::ENABLED_OVERRIDE => 'ENABLED_OVERRIDE',
        self::CLEAR_ACTION => 'CLEAR_ACTION',
    ];

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

