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

namespace Google\Cloud\RecaptchaEnterprise\V1\AccountVerificationInfo;

use UnexpectedValueException;

/**
 * Result of the account verification as contained in the verdict token issued
 * at the end of the verification flow.
 *
 * Protobuf type <code>google.cloud.recaptchaenterprise.v1.AccountVerificationInfo.Result</code>
 */
class Result
{
    /**
     * No information about the latest account verification.
     *
     * Generated from protobuf enum <code>RESULT_UNSPECIFIED = 0;</code>
     */
    const RESULT_UNSPECIFIED = 0;
    /**
     * The user was successfully verified. This means the account verification
     * challenge was successfully completed.
     *
     * Generated from protobuf enum <code>SUCCESS_USER_VERIFIED = 1;</code>
     */
    const SUCCESS_USER_VERIFIED = 1;
    /**
     * The user failed the verification challenge.
     *
     * Generated from protobuf enum <code>ERROR_USER_NOT_VERIFIED = 2;</code>
     */
    const ERROR_USER_NOT_VERIFIED = 2;
    /**
     * The site is not properly onboarded to use the account verification
     * feature.
     *
     * Generated from protobuf enum <code>ERROR_SITE_ONBOARDING_INCOMPLETE = 3;</code>
     */
    const ERROR_SITE_ONBOARDING_INCOMPLETE = 3;
    /**
     * The recipient is not allowed for account verification. This can occur
     * during integration but should not occur in production.
     *
     * Generated from protobuf enum <code>ERROR_RECIPIENT_NOT_ALLOWED = 4;</code>
     */
    const ERROR_RECIPIENT_NOT_ALLOWED = 4;
    /**
     * The recipient has already been sent too many verification codes in a
     * short amount of time.
     *
     * Generated from protobuf enum <code>ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5;</code>
     */
    const ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED = 5;
    /**
     * The verification flow could not be completed due to a critical internal
     * error.
     *
     * Generated from protobuf enum <code>ERROR_CRITICAL_INTERNAL = 6;</code>
     */
    const ERROR_CRITICAL_INTERNAL = 6;
    /**
     * The client has exceeded their two factor request quota for this period of
     * time.
     *
     * Generated from protobuf enum <code>ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7;</code>
     */
    const ERROR_CUSTOMER_QUOTA_EXHAUSTED = 7;
    /**
     * The request cannot be processed at the time because of an incident. This
     * bypass can be restricted to a problematic destination email domain, a
     * customer, or could affect the entire service.
     *
     * Generated from protobuf enum <code>ERROR_VERIFICATION_BYPASSED = 8;</code>
     */
    const ERROR_VERIFICATION_BYPASSED = 8;
    /**
     * The request parameters do not match with the token provided and cannot be
     * processed.
     *
     * Generated from protobuf enum <code>ERROR_VERDICT_MISMATCH = 9;</code>
     */
    const ERROR_VERDICT_MISMATCH = 9;

    private static $valueToName = [
        self::RESULT_UNSPECIFIED => 'RESULT_UNSPECIFIED',
        self::SUCCESS_USER_VERIFIED => 'SUCCESS_USER_VERIFIED',
        self::ERROR_USER_NOT_VERIFIED => 'ERROR_USER_NOT_VERIFIED',
        self::ERROR_SITE_ONBOARDING_INCOMPLETE => 'ERROR_SITE_ONBOARDING_INCOMPLETE',
        self::ERROR_RECIPIENT_NOT_ALLOWED => 'ERROR_RECIPIENT_NOT_ALLOWED',
        self::ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED => 'ERROR_RECIPIENT_ABUSE_LIMIT_EXHAUSTED',
        self::ERROR_CRITICAL_INTERNAL => 'ERROR_CRITICAL_INTERNAL',
        self::ERROR_CUSTOMER_QUOTA_EXHAUSTED => 'ERROR_CUSTOMER_QUOTA_EXHAUSTED',
        self::ERROR_VERIFICATION_BYPASSED => 'ERROR_VERIFICATION_BYPASSED',
        self::ERROR_VERDICT_MISMATCH => 'ERROR_VERDICT_MISMATCH',
    ];

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


