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

namespace Deviceapis\Device\V1\EncryptionProfile;

use UnexpectedValueException;

/**
 * Тип
 *
 * Protobuf type <code>deviceapis.device.v1.EncryptionProfile.Type</code>
 */
class Type
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>TYPE_UNKNOWN = 0;</code>
     */
    const TYPE_UNKNOWN = 0;
    /**
     * Тип SL3
     *
     * Generated from protobuf enum <code>SL3 = 1;</code>
     */
    const SL3 = 1;
    /**
     * Тип SL1
     *
     * Generated from protobuf enum <code>SL1 = 2;</code>
     */
    const SL1 = 2;

    private static $valueToName = [
        self::TYPE_UNKNOWN => 'TYPE_UNKNOWN',
        self::SL3 => 'SL3',
        self::SL1 => 'SL1',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Type::class, \Deviceapis\Device\V1\EncryptionProfile_Type::class);

