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

namespace Google\Cloud\AppEngine\V1\VpcAccessConnector;

use UnexpectedValueException;

/**
 * Available egress settings.
 * This controls what traffic is diverted through the VPC Access Connector
 * resource. By default PRIVATE_IP_RANGES will be used.
 *
 * Protobuf type <code>google.appengine.v1.VpcAccessConnector.EgressSetting</code>
 */
class EgressSetting
{
    /**
     * Generated from protobuf enum <code>EGRESS_SETTING_UNSPECIFIED = 0;</code>
     */
    const EGRESS_SETTING_UNSPECIFIED = 0;
    /**
     * Force the use of VPC Access for all egress traffic from the function.
     *
     * Generated from protobuf enum <code>ALL_TRAFFIC = 1;</code>
     */
    const ALL_TRAFFIC = 1;
    /**
     * Use the VPC Access Connector for private IP space from RFC1918.
     *
     * Generated from protobuf enum <code>PRIVATE_IP_RANGES = 2;</code>
     */
    const PRIVATE_IP_RANGES = 2;

    private static $valueToName = [
        self::EGRESS_SETTING_UNSPECIFIED => 'EGRESS_SETTING_UNSPECIFIED',
        self::ALL_TRAFFIC => 'ALL_TRAFFIC',
        self::PRIVATE_IP_RANGES => 'PRIVATE_IP_RANGES',
    ];

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


