<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/device/v1/keyapis_device_device_v1.proto

namespace Keyapis\Device\V1\Preset\FaceRecognition;

use UnexpectedValueException;

/**
 * Тип конфигурации.
 * # Тип: byte
 *
 * Protobuf type <code>keyapis.device.v1.Preset.FaceRecognition.ConfigurationType</code>
 */
class ConfigurationType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>CONFIGURATION_TYPE_UNKNOWN = 0;</code>
     */
    const CONFIGURATION_TYPE_UNKNOWN = 0;
    /**
     * По умолчанию
     *
     * Generated from protobuf enum <code>DEFAULT = 1;</code>
     */
    const PBDEFAULT = 1;

    private static $valueToName = [
        self::CONFIGURATION_TYPE_UNKNOWN => 'CONFIGURATION_TYPE_UNKNOWN',
        self::PBDEFAULT => 'DEFAULT',
    ];

    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)) {
            $pbconst =  __CLASS__. '::PB' . strtoupper($name);
            if (!defined($pbconst)) {
                throw new UnexpectedValueException(sprintf(
                        'Enum %s has no value defined for name %s', __CLASS__, $name));
            }
            return constant($pbconst);
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ConfigurationType::class, \Keyapis\Device\V1\Preset_FaceRecognition_ConfigurationType::class);

