<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/compute/v1/compute.proto

namespace Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower;

use UnexpectedValueException;

/**
 * The status of the current value when compared to the warning and alarm levels for the receiving or transmitting transceiver. Possible states include:
 * - OK: The value has not crossed a warning threshold.
 * - LOW_WARNING: The value has crossed below the low warning threshold.
 * - HIGH_WARNING: The value has crossed above the high warning threshold.
 * - LOW_ALARM: The value has crossed below the low alarm threshold.
 * - HIGH_ALARM: The value has crossed above the high alarm threshold.
 *
 * Protobuf type <code>google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State</code>
 */
class State
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_STATE = 0;</code>
     */
    const UNDEFINED_STATE = 0;
    /**
     * Generated from protobuf enum <code>HIGH_ALARM = 305363284;</code>
     */
    const HIGH_ALARM = 305363284;
    /**
     * Generated from protobuf enum <code>HIGH_WARNING = 220984799;</code>
     */
    const HIGH_WARNING = 220984799;
    /**
     * Generated from protobuf enum <code>LOW_ALARM = 316659046;</code>
     */
    const LOW_ALARM = 316659046;
    /**
     * Generated from protobuf enum <code>LOW_WARNING = 338793841;</code>
     */
    const LOW_WARNING = 338793841;
    /**
     * Generated from protobuf enum <code>OK = 2524;</code>
     */
    const OK = 2524;

    private static $valueToName = [
        self::UNDEFINED_STATE => 'UNDEFINED_STATE',
        self::HIGH_ALARM => 'HIGH_ALARM',
        self::HIGH_WARNING => 'HIGH_WARNING',
        self::LOW_ALARM => 'LOW_ALARM',
        self::LOW_WARNING => 'LOW_WARNING',
        self::OK => 'OK',
    ];

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


