<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: GoogleAuth.proto

namespace App\Protobuf\GoogleAuth\Payload;

use UnexpectedValueException;

/**
 * Protobuf type <code>app.Protobuf.GoogleAuth.Payload.OtpType</code>
 */
class OtpType
{
    /**
     * Generated from protobuf enum <code>OTP_TYPE_UNSPECIFIED = 0;</code>
     */
    const OTP_TYPE_UNSPECIFIED = 0;
    /**
     * Generated from protobuf enum <code>OTP_TYPE_HOTP = 1;</code>
     */
    const OTP_TYPE_HOTP = 1;
    /**
     * Generated from protobuf enum <code>OTP_TYPE_TOTP = 2;</code>
     */
    const OTP_TYPE_TOTP = 2;

    private static $valueToName = [
        self::OTP_TYPE_UNSPECIFIED => 'OTP_TYPE_UNSPECIFIED',
        self::OTP_TYPE_HOTP => 'OTP_TYPE_HOTP',
        self::OTP_TYPE_TOTP => 'OTP_TYPE_TOTP',
    ];

    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(OtpType::class, \App\Protobuf\GoogleAuth\Payload_OtpType::class);

