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

namespace Google\Cloud\Compute\V1\VpnGateway;

use UnexpectedValueException;

/**
 * The stack type for this VPN gateway to identify the IP protocols that are
 * enabled. Possible values are: IPV4_ONLY,IPV4_IPV6, IPV6_ONLY. If not specified,IPV4_ONLY is used if the gateway IP version isIPV4, or IPV4_IPV6 if the gateway IP version isIPV6.
 *
 * Protobuf type <code>google.cloud.compute.v1.VpnGateway.StackType</code>
 */
class StackType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_STACK_TYPE = 0;</code>
     */
    const UNDEFINED_STACK_TYPE = 0;
    /**
     * Enable VPN gateway with both IPv4 and IPv6 protocols.
     *
     * Generated from protobuf enum <code>IPV4_IPV6 = 22197249;</code>
     */
    const IPV4_IPV6 = 22197249;
    /**
     * Enable VPN gateway with only IPv4 protocol.
     *
     * Generated from protobuf enum <code>IPV4_ONLY = 22373798;</code>
     */
    const IPV4_ONLY = 22373798;
    /**
     * Enable VPN gateway with only IPv6 protocol.
     *
     * Generated from protobuf enum <code>IPV6_ONLY = 79632100;</code>
     */
    const IPV6_ONLY = 79632100;

    private static $valueToName = [
        self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE',
        self::IPV4_IPV6 => 'IPV4_IPV6',
        self::IPV4_ONLY => 'IPV4_ONLY',
        self::IPV6_ONLY => 'IPV6_ONLY',
    ];

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


