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

namespace Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest;

use UnexpectedValueException;

/**
 * Enum that reprensents the types of annotations.
 *
 * Protobuf type <code>google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation</code>
 */
class Annotation
{
    /**
     * Default unspecified type.
     *
     * Generated from protobuf enum <code>ANNOTATION_UNSPECIFIED = 0;</code>
     */
    const ANNOTATION_UNSPECIFIED = 0;
    /**
     * Provides information that the event turned out to be legitimate.
     *
     * Generated from protobuf enum <code>LEGITIMATE = 1;</code>
     */
    const LEGITIMATE = 1;
    /**
     * Provides information that the event turned out to be fraudulent.
     *
     * Generated from protobuf enum <code>FRAUDULENT = 2;</code>
     */
    const FRAUDULENT = 2;
    /**
     * Provides information that the event was related to a login event in which
     * the user typed the correct password.
     *
     * Generated from protobuf enum <code>PASSWORD_CORRECT = 3;</code>
     */
    const PASSWORD_CORRECT = 3;
    /**
     * Provides information that the event was related to a login event in which
     * the user typed the incorrect password.
     *
     * Generated from protobuf enum <code>PASSWORD_INCORRECT = 4;</code>
     */
    const PASSWORD_INCORRECT = 4;

    private static $valueToName = [
        self::ANNOTATION_UNSPECIFIED => 'ANNOTATION_UNSPECIFIED',
        self::LEGITIMATE => 'LEGITIMATE',
        self::FRAUDULENT => 'FRAUDULENT',
        self::PASSWORD_CORRECT => 'PASSWORD_CORRECT',
        self::PASSWORD_INCORRECT => 'PASSWORD_INCORRECT',
    ];

    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(Annotation::class, \Google\Cloud\RecaptchaEnterprise\V1\AnnotateAssessmentRequest_Annotation::class);

