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

namespace Google\Cloud\Filestore\V1\NfsExportOptions;

use UnexpectedValueException;

/**
 * The access mode.
 *
 * Protobuf type <code>google.cloud.filestore.v1.NfsExportOptions.AccessMode</code>
 */
class AccessMode
{
    /**
     * AccessMode not set.
     *
     * Generated from protobuf enum <code>ACCESS_MODE_UNSPECIFIED = 0;</code>
     */
    const ACCESS_MODE_UNSPECIFIED = 0;
    /**
     * The client can only read the file share.
     *
     * Generated from protobuf enum <code>READ_ONLY = 1;</code>
     */
    const READ_ONLY = 1;
    /**
     * The client can read and write the file share (default).
     *
     * Generated from protobuf enum <code>READ_WRITE = 2;</code>
     */
    const READ_WRITE = 2;

    private static $valueToName = [
        self::ACCESS_MODE_UNSPECIFIED => 'ACCESS_MODE_UNSPECIFIED',
        self::READ_ONLY => 'READ_ONLY',
        self::READ_WRITE => 'READ_WRITE',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AccessMode::class, \Google\Cloud\Filestore\V1\NfsExportOptions_AccessMode::class);

