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

namespace Google\Cloud\Compute\V1\UsableSubnetwork;

use UnexpectedValueException;

/**
 * The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack.
 *
 * Protobuf type <code>google.cloud.compute.v1.UsableSubnetwork.Ipv6AccessType</code>
 */
class Ipv6AccessType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_IPV6_ACCESS_TYPE = 0;</code>
     */
    const UNDEFINED_IPV6_ACCESS_TYPE = 0;
    /**
     * VMs on this subnet will be assigned IPv6 addresses that are accessible via the Internet, as well as the VPC network.
     *
     * Generated from protobuf enum <code>EXTERNAL = 35607499;</code>
     */
    const EXTERNAL = 35607499;
    /**
     * VMs on this subnet will be assigned IPv6 addresses that are only accessible over the VPC network.
     *
     * Generated from protobuf enum <code>INTERNAL = 279295677;</code>
     */
    const INTERNAL = 279295677;

    private static $valueToName = [
        self::UNDEFINED_IPV6_ACCESS_TYPE => 'UNDEFINED_IPV6_ACCESS_TYPE',
        self::EXTERNAL => 'EXTERNAL',
        self::INTERNAL => 'INTERNAL',
    ];

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


