<?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 PSC creation is allowed.
 *
 * Protobuf type <code>google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowPsc</code>
 */
class AllowPsc
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_ALLOW_PSC = 0;</code>
     */
    const UNDEFINED_ALLOW_PSC = 0;
    /**
     * Generated from protobuf enum <code>PSC_ALLOWED = 171559657;</code>
     */
    const PSC_ALLOWED = 171559657;
    /**
     * Generated from protobuf enum <code>PSC_BLOCKED = 524593965;</code>
     */
    const PSC_BLOCKED = 524593965;

    private static $valueToName = [
        self::UNDEFINED_ALLOW_PSC => 'UNDEFINED_ALLOW_PSC',
        self::PSC_ALLOWED => 'PSC_ALLOWED',
        self::PSC_BLOCKED => 'PSC_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);
    }
}

