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

namespace Google\Cloud\Filestore\V1\NetworkConfig;

use UnexpectedValueException;

/**
 * Available connection modes.
 *
 * Protobuf type <code>google.cloud.filestore.v1.NetworkConfig.ConnectMode</code>
 */
class ConnectMode
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>CONNECT_MODE_UNSPECIFIED = 0;</code>
     */
    const CONNECT_MODE_UNSPECIFIED = 0;
    /**
     * Connect via direct peering to the Filestore service.
     *
     * Generated from protobuf enum <code>DIRECT_PEERING = 1;</code>
     */
    const DIRECT_PEERING = 1;
    /**
     * Connect to your Filestore instance using Private Service
     * Access. Private services access provides an IP address range for multiple
     * Google Cloud services, including Filestore.
     *
     * Generated from protobuf enum <code>PRIVATE_SERVICE_ACCESS = 2;</code>
     */
    const PRIVATE_SERVICE_ACCESS = 2;

    private static $valueToName = [
        self::CONNECT_MODE_UNSPECIFIED => 'CONNECT_MODE_UNSPECIFIED',
        self::DIRECT_PEERING => 'DIRECT_PEERING',
        self::PRIVATE_SERVICE_ACCESS => 'PRIVATE_SERVICE_ACCESS',
    ];

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

