<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: access.proto

namespace OS\PB;

use UnexpectedValueException;

/**
 * \@brief   Each AccessMethod is tied to an AccessRights. The AccessRights defines the permissions that the AccessMethod has.
 *          Access Methods usually are two types, one of variable length such as string or bytes, or based on a UID 
 *          Hashing is on the full 8 bytes with UID whereas bytes or string is based on its length 
 *          UID must be unique system wide in OneSpace. 
 *
 * Protobuf type <code>OS.PB.AccessMethodUID</code>
 */
class AccessMethodUID
{
    /**
     * Generated from protobuf enum <code>AccessMethodUID_NotSet = 0;</code>
     */
    const AccessMethodUID_NotSet = 0;

    private static $valueToName = [
        self::AccessMethodUID_NotSet => 'AccessMethodUID_NotSet',
    ];

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

