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

namespace Google\Cloud\Compute\V1\RouterBgpPeer;

use UnexpectedValueException;

/**
 * The status of the BGP peer connection. If set to FALSE, any active session with the peer is terminated and all associated routing information is removed. If set to TRUE, the peer connection can be established with routing information. The default is TRUE.
 *
 * Protobuf type <code>google.cloud.compute.v1.RouterBgpPeer.Enable</code>
 */
class Enable
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_ENABLE = 0;</code>
     */
    const UNDEFINED_ENABLE = 0;
    /**
     * Generated from protobuf enum <code>FALSE = 66658563;</code>
     */
    const FALSE = 66658563;
    /**
     * Generated from protobuf enum <code>TRUE = 2583950;</code>
     */
    const TRUE = 2583950;

    private static $valueToName = [
        self::UNDEFINED_ENABLE => 'UNDEFINED_ENABLE',
        self::FALSE => 'FALSE',
        self::TRUE => 'TRUE',
    ];

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


