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

namespace Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures;

use UnexpectedValueException;

/**
 * Specifies whether static route creation is allowed.
 *
 * Protobuf type <code>google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowStaticRoutes</code>
 */
class AllowStaticRoutes
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_ALLOW_STATIC_ROUTES = 0;</code>
     */
    const UNDEFINED_ALLOW_STATIC_ROUTES = 0;
    /**
     * Generated from protobuf enum <code>STATIC_ROUTES_ALLOWED = 409048964;</code>
     */
    const STATIC_ROUTES_ALLOWED = 409048964;
    /**
     * Generated from protobuf enum <code>STATIC_ROUTES_BLOCKED = 225212360;</code>
     */
    const STATIC_ROUTES_BLOCKED = 225212360;

    private static $valueToName = [
        self::UNDEFINED_ALLOW_STATIC_ROUTES => 'UNDEFINED_ALLOW_STATIC_ROUTES',
        self::STATIC_ROUTES_ALLOWED => 'STATIC_ROUTES_ALLOWED',
        self::STATIC_ROUTES_BLOCKED => 'STATIC_ROUTES_BLOCKED',
    ];

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

