<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/iap/v1/service.proto

namespace Google\Cloud\Iap\V1\ReauthSettings;

use UnexpectedValueException;

/**
 * Types of reauthentication methods supported by IAP.
 *
 * Protobuf type <code>google.cloud.iap.v1.ReauthSettings.Method</code>
 */
class Method
{
    /**
     * Reauthentication disabled.
     *
     * Generated from protobuf enum <code>METHOD_UNSPECIFIED = 0;</code>
     */
    const METHOD_UNSPECIFIED = 0;
    /**
     * Prompts the user to log in again.
     *
     * Generated from protobuf enum <code>LOGIN = 1;</code>
     */
    const LOGIN = 1;
    /**
     * Deprecated, no longer accepted by IAP APIs.
     *
     * Generated from protobuf enum <code>PASSWORD = 2 [deprecated = true];</code>
     */
    const PASSWORD = 2;
    /**
     * User must use their secure key 2nd factor device.
     *
     * Generated from protobuf enum <code>SECURE_KEY = 3;</code>
     */
    const SECURE_KEY = 3;

    private static $valueToName = [
        self::METHOD_UNSPECIFIED => 'METHOD_UNSPECIFIED',
        self::LOGIN => 'LOGIN',
        self::PASSWORD => 'PASSWORD',
        self::SECURE_KEY => 'SECURE_KEY',
    ];

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


