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

namespace Google\Cloud\NetApp\V1;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.cloud.netapp.v1.AccessType</code>
 */
class AccessType
{
    /**
     * Unspecified Access Type
     *
     * Generated from protobuf enum <code>ACCESS_TYPE_UNSPECIFIED = 0;</code>
     */
    const ACCESS_TYPE_UNSPECIFIED = 0;
    /**
     * Read Only
     *
     * Generated from protobuf enum <code>READ_ONLY = 1;</code>
     */
    const READ_ONLY = 1;
    /**
     * Read Write
     *
     * Generated from protobuf enum <code>READ_WRITE = 2;</code>
     */
    const READ_WRITE = 2;
    /**
     * None
     *
     * Generated from protobuf enum <code>READ_NONE = 3;</code>
     */
    const READ_NONE = 3;

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

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

