<?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;

/**
 * Configures subnet mask resolution for this subnetwork.
 *
 * Protobuf type <code>google.cloud.compute.v1.Subnetwork.ResolveSubnetMask</code>
 */
class ResolveSubnetMask
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_RESOLVE_SUBNET_MASK = 0;</code>
     */
    const UNDEFINED_RESOLVE_SUBNET_MASK = 0;
    /**
     * All ranges assigned to the VM NIC will respond to ARP.
     *
     * Generated from protobuf enum <code>ARP_ALL_RANGES = 445655380;</code>
     */
    const ARP_ALL_RANGES = 445655380;
    /**
     * Only the primary range of the VM NIC will respond to ARP.
     *
     * Generated from protobuf enum <code>ARP_PRIMARY_RANGE = 120210048;</code>
     */
    const ARP_PRIMARY_RANGE = 120210048;

    private static $valueToName = [
        self::UNDEFINED_RESOLVE_SUBNET_MASK => 'UNDEFINED_RESOLVE_SUBNET_MASK',
        self::ARP_ALL_RANGES => 'ARP_ALL_RANGES',
        self::ARP_PRIMARY_RANGE => 'ARP_PRIMARY_RANGE',
    ];

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

