<?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 represents potential reasons for annotating an assessment.
 *
 * Protobuf type <code>google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason</code>
 */
class Reason
{
    /**
     * Default unspecified reason.
     *
     * Generated from protobuf enum <code>REASON_UNSPECIFIED = 0;</code>
     */
    const REASON_UNSPECIFIED = 0;
    /**
     * Indicates a chargeback was issued for the transaction associated with the
     * assessment, with no other details. When possible, specify the type by
     * using CHARGEBACK_FRAUD or CHARGEBACK_DISPUTE instead.
     *
     * Generated from protobuf enum <code>CHARGEBACK = 1;</code>
     */
    const CHARGEBACK = 1;
    /**
     * Indicates a chargeback related to an alleged unauthorized transaction
     * from the perspective of the cardholder (for example, the card number was
     * stolen).
     *
     * Generated from protobuf enum <code>CHARGEBACK_FRAUD = 8;</code>
     */
    const CHARGEBACK_FRAUD = 8;
    /**
     * Indicates a chargeback related to the cardholder having provided their
     * card but allegedly not being satisfied with the purchase
     * (for example, misrepresentation, attempted cancellation).
     *
     * Generated from protobuf enum <code>CHARGEBACK_DISPUTE = 9;</code>
     */
    const CHARGEBACK_DISPUTE = 9;
    /**
     * Indicates the transaction associated with the assessment is suspected of
     * being fraudulent based on the payment method, billing details, shipping
     * address or other transaction information.
     *
     * Generated from protobuf enum <code>PAYMENT_HEURISTICS = 2;</code>
     */
    const PAYMENT_HEURISTICS = 2;
    /**
     * Indicates that the user was served a 2FA challenge. An old assessment
     * with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been
     * overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow.
     * This is equivalent to `FAILED_TWO_FACTOR`.
     *
     * Generated from protobuf enum <code>INITIATED_TWO_FACTOR = 7;</code>
     */
    const INITIATED_TWO_FACTOR = 7;
    /**
     * Indicates that the user passed a 2FA challenge.
     *
     * Generated from protobuf enum <code>PASSED_TWO_FACTOR = 3;</code>
     */
    const PASSED_TWO_FACTOR = 3;
    /**
     * Indicates that the user failed a 2FA challenge.
     *
     * Generated from protobuf enum <code>FAILED_TWO_FACTOR = 4;</code>
     */
    const FAILED_TWO_FACTOR = 4;
    /**
     * Indicates the user provided the correct password.
     *
     * Generated from protobuf enum <code>CORRECT_PASSWORD = 5;</code>
     */
    const CORRECT_PASSWORD = 5;
    /**
     * Indicates the user provided an incorrect password.
     *
     * Generated from protobuf enum <code>INCORRECT_PASSWORD = 6;</code>
     */
    const INCORRECT_PASSWORD = 6;

    private static $valueToName = [
        self::REASON_UNSPECIFIED => 'REASON_UNSPECIFIED',
        self::CHARGEBACK => 'CHARGEBACK',
        self::CHARGEBACK_FRAUD => 'CHARGEBACK_FRAUD',
        self::CHARGEBACK_DISPUTE => 'CHARGEBACK_DISPUTE',
        self::PAYMENT_HEURISTICS => 'PAYMENT_HEURISTICS',
        self::INITIATED_TWO_FACTOR => 'INITIATED_TWO_FACTOR',
        self::PASSED_TWO_FACTOR => 'PASSED_TWO_FACTOR',
        self::FAILED_TWO_FACTOR => 'FAILED_TWO_FACTOR',
        self::CORRECT_PASSWORD => 'CORRECT_PASSWORD',
        self::INCORRECT_PASSWORD => 'INCORRECT_PASSWORD',
    ];

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

