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

namespace Google\Cloud\Compute\V1\Address;

use UnexpectedValueException;

/**
 * The purpose of this resource, which can be one of the following values:
 * - `GCE_ENDPOINT` for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources.
 * - `DNS_RESOLVER` for a DNS resolver address in a subnetwork
 * - `VPC_PEERING` for addresses that are reserved for VPC peer networks.
 * - `NAT_AUTO` for addresses that are external IP addresses automatically reserved for Cloud NAT.
 * - `IPSEC_INTERCONNECT` for addresses created from a private IP range that are reserved for a VLAN attachment in an IPsec encrypted Interconnect configuration. These addresses are regional resources.
 *
 * Protobuf type <code>google.cloud.compute.v1.Address.Purpose</code>
 */
class Purpose
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_PURPOSE = 0;</code>
     */
    const UNDEFINED_PURPOSE = 0;
    /**
     * Generated from protobuf enum <code>DNS_RESOLVER = 207679100;</code>
     */
    const DNS_RESOLVER = 207679100;
    /**
     * Generated from protobuf enum <code>GCE_ENDPOINT = 230515243;</code>
     */
    const GCE_ENDPOINT = 230515243;
    /**
     * Generated from protobuf enum <code>NAT_AUTO = 163666477;</code>
     */
    const NAT_AUTO = 163666477;
    /**
     * Generated from protobuf enum <code>SHARED_LOADBALANCER_VIP = 26012116;</code>
     */
    const SHARED_LOADBALANCER_VIP = 26012116;
    /**
     * Generated from protobuf enum <code>VPC_PEERING = 132364714;</code>
     */
    const VPC_PEERING = 132364714;

    private static $valueToName = [
        self::UNDEFINED_PURPOSE => 'UNDEFINED_PURPOSE',
        self::DNS_RESOLVER => 'DNS_RESOLVER',
        self::GCE_ENDPOINT => 'GCE_ENDPOINT',
        self::NAT_AUTO => 'NAT_AUTO',
        self::SHARED_LOADBALANCER_VIP => 'SHARED_LOADBALANCER_VIP',
        self::VPC_PEERING => 'VPC_PEERING',
    ];

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


