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

namespace OS\PB\AccessRequest;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.AccessRequest.AccessRequestFlags</code>
 */
class AccessRequestFlags
{
    /**
     * Generated from protobuf enum <code>AccessRequestFlags_NotSet = 0;</code>
     */
    const AccessRequestFlags_NotSet = 0;
    /**
     * 0001
     *
     * Generated from protobuf enum <code>AccessEnrol_StopOnFirst = 1;</code>
     */
    const AccessEnrol_StopOnFirst = 1;
    /**
     * 0010
     *
     * Generated from protobuf enum <code>AccessEnrol_SendProgress = 2;</code>
     */
    const AccessEnrol_SendProgress = 2;
    /**
     * 0011
     *
     * Generated from protobuf enum <code>AccessEnrol_StopOnFirst_SendProgress = 3;</code>
     */
    const AccessEnrol_StopOnFirst_SendProgress = 3;

    private static $valueToName = [
        self::AccessRequestFlags_NotSet => 'AccessRequestFlags_NotSet',
        self::AccessEnrol_StopOnFirst => 'AccessEnrol_StopOnFirst',
        self::AccessEnrol_SendProgress => 'AccessEnrol_SendProgress',
        self::AccessEnrol_StopOnFirst_SendProgress => 'AccessEnrol_StopOnFirst_SendProgress',
    ];

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

