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

namespace Google\Cloud\Compute\V1\NetworkPeeringConnectionStatusTrafficConfiguration;

use UnexpectedValueException;

/**
 * Which IP version(s) of traffic and routes are being imported or
 * exported between peer networks.
 *
 * Protobuf type <code>google.cloud.compute.v1.NetworkPeeringConnectionStatusTrafficConfiguration.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;
    /**
     * This Peering will allow IPv4 traffic and routes to be
     * exchanged. Additionally if the matching peering is
     * IPV4_IPV6, IPv6 traffic and routes will be exchanged as
     * well.
     *
     * Generated from protobuf enum <code>IPV4_IPV6 = 22197249;</code>
     */
    const IPV4_IPV6 = 22197249;
    /**
     * This Peering will only allow IPv4 traffic and routes to be
     * exchanged, even if the matching peering is IPV4_IPV6.
     *
     * Generated from protobuf enum <code>IPV4_ONLY = 22373798;</code>
     */
    const IPV4_ONLY = 22373798;

    private static $valueToName = [
        self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE',
        self::IPV4_IPV6 => 'IPV4_IPV6',
        self::IPV4_ONLY => 'IPV4_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);
    }
}


