<?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 type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL.
 *
 * Protobuf type <code>google.cloud.compute.v1.Address.AddressType</code>
 */
class AddressType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_ADDRESS_TYPE = 0;</code>
     */
    const UNDEFINED_ADDRESS_TYPE = 0;
    /**
     * A publicly visible external IP address.
     *
     * Generated from protobuf enum <code>EXTERNAL = 35607499;</code>
     */
    const EXTERNAL = 35607499;
    /**
     * A private network IP address, for use with an Instance or Internal Load Balancer forwarding rule.
     *
     * Generated from protobuf enum <code>INTERNAL = 279295677;</code>
     */
    const INTERNAL = 279295677;
    /**
     * Generated from protobuf enum <code>UNSPECIFIED_TYPE = 53933922;</code>
     */
    const UNSPECIFIED_TYPE = 53933922;

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

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


