Google Cloud Recaptcha Enterprise V1 Client - Class ChallengeRule (2.5.3)

Reference documentation and code samples for the Google Cloud Recaptcha Enterprise V1 Client class ChallengeRule.

A rule to configure the behavior of reCAPTCHA for conditionally presenting a challenge.

Generated from protobuf message google.cloud.recaptchaenterprise.v1.ChallengeRule

Namespace

Google \ Cloud \ RecaptchaEnterprise \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ condition string

Optional. A CEL condition that must be met for this rule to apply. If unspecified, the rule applies unconditionally. The following fields can be referenced in the condition: * * score * * user_ip_address * * user_asn * * user_agent * * verified_bots.name * * verified_bots.bot_type Examples: * * score < 0.5 * * user_ip_address == "123.45.67.89" * * user_agent.contains("Chrome") * * score < 0.5 && user_ip_address == "123.45.67.89"

↳ no_challenge ChallengeRule\NoChallengeOutcome

Do not present a challenge to the user.

↳ challenge ChallengeRule\ChallengeOutcome

Present a challenge to the user.

getCondition

Optional. A CEL condition that must be met for this rule to apply.

If unspecified, the rule applies unconditionally. The following fields can be referenced in the condition:

  • score
  • user_ip_address
  • user_asn
  • user_agent
  • verified_bots.name
  • verified_bots.bot_type Examples:
  • score < 0.5
  • user_ip_address == "123.45.67.89"
  • user_agent.contains("Chrome")
  • score < 0.5 && user_ip_address == "123.45.67.89"
Returns
Type Description
string

setCondition

Optional. A CEL condition that must be met for this rule to apply.

If unspecified, the rule applies unconditionally. The following fields can be referenced in the condition:

  • score
  • user_ip_address
  • user_asn
  • user_agent
  • verified_bots.name
  • verified_bots.bot_type Examples:
  • score < 0.5
  • user_ip_address == "123.45.67.89"
  • user_agent.contains("Chrome")
  • score < 0.5 && user_ip_address == "123.45.67.89"
Parameter
Name Description
var string
Returns
Type Description
$this

getNoChallenge

Do not present a challenge to the user.

Returns
Type Description
ChallengeRule\NoChallengeOutcome|null

hasNoChallenge

setNoChallenge

Do not present a challenge to the user.

Parameter
Name Description
var ChallengeRule\NoChallengeOutcome
Returns
Type Description
$this

getChallenge

Present a challenge to the user.

Returns
Type Description
ChallengeRule\ChallengeOutcome|null

hasChallenge

setChallenge

Present a challenge to the user.

Parameter
Name Description
var ChallengeRule\ChallengeOutcome
Returns
Type Description
$this

getOutcome

Returns
Type Description
string