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

namespace Google\Cloud\Compute\V1\BfdStatus;

use UnexpectedValueException;

/**
 * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880
 *
 * Protobuf type <code>google.cloud.compute.v1.BfdStatus.LocalState</code>
 */
class LocalState
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_LOCAL_STATE = 0;</code>
     */
    const UNDEFINED_LOCAL_STATE = 0;
    /**
     * Generated from protobuf enum <code>ADMIN_DOWN = 128544690;</code>
     */
    const ADMIN_DOWN = 128544690;
    /**
     * Generated from protobuf enum <code>DOWN = 2104482;</code>
     */
    const DOWN = 2104482;
    /**
     * Generated from protobuf enum <code>INIT = 2252048;</code>
     */
    const INIT = 2252048;
    /**
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 470755401;</code>
     */
    const STATE_UNSPECIFIED = 470755401;
    /**
     * Generated from protobuf enum <code>UP = 2715;</code>
     */
    const UP = 2715;

    private static $valueToName = [
        self::UNDEFINED_LOCAL_STATE => 'UNDEFINED_LOCAL_STATE',
        self::ADMIN_DOWN => 'ADMIN_DOWN',
        self::DOWN => 'DOWN',
        self::INIT => 'INIT',
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::UP => 'UP',
    ];

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


