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

namespace Google\Cloud\BareMetalSolution\V2\NfsShare;

use UnexpectedValueException;

/**
 * The possible mount permissions.
 *
 * Protobuf type <code>google.cloud.baremetalsolution.v2.NfsShare.MountPermissions</code>
 */
class MountPermissions
{
    /**
     * Permissions were not specified.
     *
     * Generated from protobuf enum <code>MOUNT_PERMISSIONS_UNSPECIFIED = 0;</code>
     */
    const MOUNT_PERMISSIONS_UNSPECIFIED = 0;
    /**
     * NFS share can be mount with read-only permissions.
     *
     * Generated from protobuf enum <code>READ = 1;</code>
     */
    const READ = 1;
    /**
     * NFS share can be mount with read-write permissions.
     *
     * Generated from protobuf enum <code>READ_WRITE = 2;</code>
     */
    const READ_WRITE = 2;

    private static $valueToName = [
        self::MOUNT_PERMISSIONS_UNSPECIFIED => 'MOUNT_PERMISSIONS_UNSPECIFIED',
        self::READ => 'READ',
        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(MountPermissions::class, \Google\Cloud\BareMetalSolution\V2\NfsShare_MountPermissions::class);

