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

namespace Google\Cloud\RecaptchaEnterprise\V1\IpOverrideData;

use UnexpectedValueException;

/**
 * Enum that represents the type of IP override.
 *
 * Protobuf type <code>google.cloud.recaptchaenterprise.v1.IpOverrideData.OverrideType</code>
 */
class OverrideType
{
    /**
     * Default override type that indicates this enum hasn't been specified.
     *
     * Generated from protobuf enum <code>OVERRIDE_TYPE_UNSPECIFIED = 0;</code>
     */
    const OVERRIDE_TYPE_UNSPECIFIED = 0;
    /**
     * Allowlist the IP address; i.e. give a `risk_analysis.score` of 0.9 for
     * all valid assessments.
     *
     * Generated from protobuf enum <code>ALLOW = 1;</code>
     */
    const ALLOW = 1;

    private static $valueToName = [
        self::OVERRIDE_TYPE_UNSPECIFIED => 'OVERRIDE_TYPE_UNSPECIFIED',
        self::ALLOW => 'ALLOW',
    ];

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


