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

namespace Google\Cloud\Compute\V1\RouterNatSubnetworkToNat;

use UnexpectedValueException;

/**
 *
 * Protobuf type <code>google.cloud.compute.v1.RouterNatSubnetworkToNat.SourceIpRangesToNat</code>
 */
class SourceIpRangesToNat
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_SOURCE_IP_RANGES_TO_NAT = 0;</code>
     */
    const UNDEFINED_SOURCE_IP_RANGES_TO_NAT = 0;
    /**
     * The primary and all the secondary ranges are allowed to Nat.
     *
     * Generated from protobuf enum <code>ALL_IP_RANGES = 35608496;</code>
     */
    const ALL_IP_RANGES = 35608496;
    /**
     * A list of secondary ranges are allowed to Nat.
     *
     * Generated from protobuf enum <code>LIST_OF_SECONDARY_IP_RANGES = 192289308;</code>
     */
    const LIST_OF_SECONDARY_IP_RANGES = 192289308;
    /**
     * The primary range is allowed to Nat.
     *
     * Generated from protobuf enum <code>PRIMARY_IP_RANGE = 297109954;</code>
     */
    const PRIMARY_IP_RANGE = 297109954;

    private static $valueToName = [
        self::UNDEFINED_SOURCE_IP_RANGES_TO_NAT => 'UNDEFINED_SOURCE_IP_RANGES_TO_NAT',
        self::ALL_IP_RANGES => 'ALL_IP_RANGES',
        self::LIST_OF_SECONDARY_IP_RANGES => 'LIST_OF_SECONDARY_IP_RANGES',
        self::PRIMARY_IP_RANGE => 'PRIMARY_IP_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);
    }
}


