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

namespace Rv\Analytics\Trackedevents\ForceQuit;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.analytics.trackedevents.ForceQuit.Reason</code>
 */
class Reason
{
    /**
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>HOSTS_FILE = 1;</code>
     */
    const HOSTS_FILE = 1;
    /**
     * Generated from protobuf enum <code>SYSTEM_TIME_SKEW = 2;</code>
     */
    const SYSTEM_TIME_SKEW = 2;
    /**
     * Generated from protobuf enum <code>INVALID_WATERMARK = 3;</code>
     */
    const INVALID_WATERMARK = 3;
    /**
     * Generated from protobuf enum <code>PIRATED_SOFTWARE = 4;</code>
     */
    const PIRATED_SOFTWARE = 4;
    /**
     * Generated from protobuf enum <code>METAL_UNAVAILABLE = 5;</code>
     */
    const METAL_UNAVAILABLE = 5;
    /**
     * Generated from protobuf enum <code>UBIQUITY_DOWNLOAD_ABORTED = 6;</code>
     */
    const UBIQUITY_DOWNLOAD_ABORTED = 6;
    /**
     * Generated from protobuf enum <code>CORE_RUST_CONTROLLER_FAILURE = 7;</code>
     */
    const CORE_RUST_CONTROLLER_FAILURE = 7;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::HOSTS_FILE => 'HOSTS_FILE',
        self::SYSTEM_TIME_SKEW => 'SYSTEM_TIME_SKEW',
        self::INVALID_WATERMARK => 'INVALID_WATERMARK',
        self::PIRATED_SOFTWARE => 'PIRATED_SOFTWARE',
        self::METAL_UNAVAILABLE => 'METAL_UNAVAILABLE',
        self::UBIQUITY_DOWNLOAD_ABORTED => 'UBIQUITY_DOWNLOAD_ABORTED',
        self::CORE_RUST_CONTROLLER_FAILURE => 'CORE_RUST_CONTROLLER_FAILURE',
    ];

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

