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

namespace Google\Cloud\Compute\V1\Subnetwork;

use UnexpectedValueException;

/**
 * Output only. [Output Only] Possible endpoints of this subnetwork. It can be one of the
 * following:
 *    - VM_ONLY: The subnetwork can be used for creating instances and
 *    IPv6 addresses with VM endpoint type. Such a subnetwork gets external IPv6
 *    ranges from a public delegated prefix and cannot be used to create NetLb.
 *    - VM_AND_FR: The subnetwork can be used for creating both VM
 *    instances and Forwarding Rules. It can also be used to reserve IPv6
 *    addresses with both VM and FR endpoint types. Such a subnetwork gets its
 *    IPv6 range from Google IP Pool directly.
 *
 * Protobuf type <code>google.cloud.compute.v1.Subnetwork.Ipv6GceEndpoint</code>
 */
class Ipv6GceEndpoint
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_IPV6_GCE_ENDPOINT = 0;</code>
     */
    const UNDEFINED_IPV6_GCE_ENDPOINT = 0;
    /**
     * Generated from protobuf enum <code>VM_AND_FR = 41830108;</code>
     */
    const VM_AND_FR = 41830108;
    /**
     * Generated from protobuf enum <code>VM_ONLY = 236773428;</code>
     */
    const VM_ONLY = 236773428;

    private static $valueToName = [
        self::UNDEFINED_IPV6_GCE_ENDPOINT => 'UNDEFINED_IPV6_GCE_ENDPOINT',
        self::VM_AND_FR => 'VM_AND_FR',
        self::VM_ONLY => 'VM_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);
    }
}

