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

namespace Google\Cloud\RecaptchaEnterprise\V1\Event;

use UnexpectedValueException;

/**
 * Setting that controls Fraud Prevention assessments.
 *
 * Protobuf type <code>google.cloud.recaptchaenterprise.v1.Event.FraudPrevention</code>
 */
class FraudPrevention
{
    /**
     * Default, unspecified setting. If opted in for automatic detection,
     * `fraud_prevention_assessment` is returned based on the request.
     * Otherwise, `fraud_prevention_assessment` is returned if
     * `transaction_data` is present in the `Event` and Fraud Prevention is
     * enabled in the Google Cloud console.
     *
     * Generated from protobuf enum <code>FRAUD_PREVENTION_UNSPECIFIED = 0;</code>
     */
    const FRAUD_PREVENTION_UNSPECIFIED = 0;
    /**
     * Enable Fraud Prevention for this assessment, if Fraud Prevention is
     * enabled in the Google Cloud console.
     *
     * Generated from protobuf enum <code>ENABLED = 1;</code>
     */
    const ENABLED = 1;
    /**
     * Disable Fraud Prevention for this assessment, regardless of opt-in
     * status or Google Cloud console settings.
     *
     * Generated from protobuf enum <code>DISABLED = 2;</code>
     */
    const DISABLED = 2;

    private static $valueToName = [
        self::FRAUD_PREVENTION_UNSPECIFIED => 'FRAUD_PREVENTION_UNSPECIFIED',
        self::ENABLED => 'ENABLED',
        self::DISABLED => 'DISABLED',
    ];

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

