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

namespace Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings;

use UnexpectedValueException;

/**
 * Enum that represents the integration types for web keys.
 *
 * Protobuf type <code>google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType</code>
 */
class IntegrationType
{
    /**
     * Default type that indicates this enum hasn't been specified. This is not
     * a valid IntegrationType, one of the other types must be specified
     * instead.
     *
     * Generated from protobuf enum <code>INTEGRATION_TYPE_UNSPECIFIED = 0;</code>
     */
    const INTEGRATION_TYPE_UNSPECIFIED = 0;
    /**
     * Only used to produce scores. It doesn't display the "I'm not a robot"
     * checkbox and never shows captcha challenges.
     *
     * Generated from protobuf enum <code>SCORE = 1;</code>
     */
    const SCORE = 1;
    /**
     * Displays the "I'm not a robot" checkbox and may show captcha challenges
     * after it is checked.
     *
     * Generated from protobuf enum <code>CHECKBOX = 2;</code>
     */
    const CHECKBOX = 2;
    /**
     * Doesn't display the "I'm not a robot" checkbox, but may show captcha
     * challenges after risk analysis.
     *
     * Generated from protobuf enum <code>INVISIBLE = 3;</code>
     */
    const INVISIBLE = 3;

    private static $valueToName = [
        self::INTEGRATION_TYPE_UNSPECIFIED => 'INTEGRATION_TYPE_UNSPECIFIED',
        self::SCORE => 'SCORE',
        self::CHECKBOX => 'CHECKBOX',
        self::INVISIBLE => 'INVISIBLE',
    ];

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

