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

namespace OS\PB;

use UnexpectedValueException;

/**
 * \@brief   A representation of the field ids used to determine the access method type
 *
 * Protobuf type <code>OS.PB.AccessMethodType</code>
 */
class AccessMethodType
{
    /**
     * Generated from protobuf enum <code>AccessMethod_UnknownOrAny = 0;</code>
     */
    const AccessMethod_UnknownOrAny = 0;
    /**
     * Generated from protobuf enum <code>AccessMethod_CardTag = 2;</code>
     */
    const AccessMethod_CardTag = 2;
    /**
     * Generated from protobuf enum <code>AccessMethod_Phone = 3;</code>
     */
    const AccessMethod_Phone = 3;
    /**
     * Generated from protobuf enum <code>AccessMethod_CodeHop = 4;</code>
     */
    const AccessMethod_CodeHop = 4;
    /**
     * Generated from protobuf enum <code>AccessMethod_Biometric = 7;</code>
     */
    const AccessMethod_Biometric = 7;
    /**
     * Generated from protobuf enum <code>AccessMethod_NumberPlate = 9;</code>
     */
    const AccessMethod_NumberPlate = 9;
    /**
     * Generated from protobuf enum <code>AccessMethod_PinCode = 10;</code>
     */
    const AccessMethod_PinCode = 10;

    private static $valueToName = [
        self::AccessMethod_UnknownOrAny => 'AccessMethod_UnknownOrAny',
        self::AccessMethod_CardTag => 'AccessMethod_CardTag',
        self::AccessMethod_Phone => 'AccessMethod_Phone',
        self::AccessMethod_CodeHop => 'AccessMethod_CodeHop',
        self::AccessMethod_Biometric => 'AccessMethod_Biometric',
        self::AccessMethod_NumberPlate => 'AccessMethod_NumberPlate',
        self::AccessMethod_PinCode => 'AccessMethod_PinCode',
    ];

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

