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

namespace Google\Cloud\RecaptchaEnterprise\V1\RiskAnalysis;

use UnexpectedValueException;

/**
 * Reasons contributing to the risk analysis verdict.
 *
 * Protobuf type <code>google.cloud.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason</code>
 */
class ClassificationReason
{
    /**
     * Default unspecified type.
     *
     * Generated from protobuf enum <code>CLASSIFICATION_REASON_UNSPECIFIED = 0;</code>
     */
    const CLASSIFICATION_REASON_UNSPECIFIED = 0;
    /**
     * Interactions matched the behavior of an automated agent.
     *
     * Generated from protobuf enum <code>AUTOMATION = 1;</code>
     */
    const AUTOMATION = 1;
    /**
     * The event originated from an illegitimate environment.
     *
     * Generated from protobuf enum <code>UNEXPECTED_ENVIRONMENT = 2;</code>
     */
    const UNEXPECTED_ENVIRONMENT = 2;
    /**
     * Traffic volume from the event source is higher than normal.
     *
     * Generated from protobuf enum <code>TOO_MUCH_TRAFFIC = 3;</code>
     */
    const TOO_MUCH_TRAFFIC = 3;
    /**
     * Interactions with the site were significantly different than expected
     * patterns.
     *
     * Generated from protobuf enum <code>UNEXPECTED_USAGE_PATTERNS = 4;</code>
     */
    const UNEXPECTED_USAGE_PATTERNS = 4;
    /**
     * Too little traffic has been received from this site thus far to generate
     * quality risk analysis.
     *
     * Generated from protobuf enum <code>LOW_CONFIDENCE_SCORE = 5;</code>
     */
    const LOW_CONFIDENCE_SCORE = 5;
    /**
     * The request matches behavioral characteristics of a carding attack.
     *
     * Generated from protobuf enum <code>SUSPECTED_CARDING = 6;</code>
     */
    const SUSPECTED_CARDING = 6;
    /**
     * The request matches behavioral characteristics of chargebacks for fraud.
     *
     * Generated from protobuf enum <code>SUSPECTED_CHARGEBACK = 7;</code>
     */
    const SUSPECTED_CHARGEBACK = 7;

    private static $valueToName = [
        self::CLASSIFICATION_REASON_UNSPECIFIED => 'CLASSIFICATION_REASON_UNSPECIFIED',
        self::AUTOMATION => 'AUTOMATION',
        self::UNEXPECTED_ENVIRONMENT => 'UNEXPECTED_ENVIRONMENT',
        self::TOO_MUCH_TRAFFIC => 'TOO_MUCH_TRAFFIC',
        self::UNEXPECTED_USAGE_PATTERNS => 'UNEXPECTED_USAGE_PATTERNS',
        self::LOW_CONFIDENCE_SCORE => 'LOW_CONFIDENCE_SCORE',
        self::SUSPECTED_CARDING => 'SUSPECTED_CARDING',
        self::SUSPECTED_CHARGEBACK => 'SUSPECTED_CHARGEBACK',
    ];

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

