Class ChallengeRule (3.96.0)

public final class ChallengeRule extends GeneratedMessage implements ChallengeRuleOrBuilder

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

Protobuf type google.cloud.recaptchaenterprise.v1.ChallengeRule

Static Fields

CHALLENGE_FIELD_NUMBER

public static final int CHALLENGE_FIELD_NUMBER
Field Value
Type Description
int

CONDITION_FIELD_NUMBER

public static final int CONDITION_FIELD_NUMBER
Field Value
Type Description
int

NO_CHALLENGE_FIELD_NUMBER

public static final int NO_CHALLENGE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static ChallengeRule getDefaultInstance()
Returns
Type Description
ChallengeRule

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static ChallengeRule.Builder newBuilder()
Returns
Type Description
ChallengeRule.Builder

newBuilder(ChallengeRule prototype)

public static ChallengeRule.Builder newBuilder(ChallengeRule prototype)
Parameter
Name Description
prototype ChallengeRule
Returns
Type Description
ChallengeRule.Builder

parseDelimitedFrom(InputStream input)

public static ChallengeRule parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ChallengeRule
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ChallengeRule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChallengeRule
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static ChallengeRule parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
ChallengeRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ChallengeRule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChallengeRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ChallengeRule parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
ChallengeRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ChallengeRule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChallengeRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ChallengeRule parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ChallengeRule
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ChallengeRule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChallengeRule
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static ChallengeRule parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ChallengeRule
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ChallengeRule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChallengeRule
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static ChallengeRule parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ChallengeRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ChallengeRule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChallengeRule
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<ChallengeRule> parser()
Returns
Type Description
Parser<ChallengeRule>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getChallenge()

public ChallengeRule.ChallengeOutcome getChallenge()

Present a challenge to the user.

.google.cloud.recaptchaenterprise.v1.ChallengeRule.ChallengeOutcome challenge = 3;

Returns
Type Description
ChallengeRule.ChallengeOutcome

The challenge.

getChallengeOrBuilder()

public ChallengeRule.ChallengeOutcomeOrBuilder getChallengeOrBuilder()

Present a challenge to the user.

.google.cloud.recaptchaenterprise.v1.ChallengeRule.ChallengeOutcome challenge = 3;

Returns
Type Description
ChallengeRule.ChallengeOutcomeOrBuilder

getCondition()

public String 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"

string condition = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The condition.

getConditionBytes()

public ByteString getConditionBytes()

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"

string condition = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for condition.

getDefaultInstanceForType()

public ChallengeRule getDefaultInstanceForType()
Returns
Type Description
ChallengeRule

getNoChallenge()

public ChallengeRule.NoChallengeOutcome getNoChallenge()

Do not present a challenge to the user.

.google.cloud.recaptchaenterprise.v1.ChallengeRule.NoChallengeOutcome no_challenge = 2;

Returns
Type Description
ChallengeRule.NoChallengeOutcome

The noChallenge.

getNoChallengeOrBuilder()

public ChallengeRule.NoChallengeOutcomeOrBuilder getNoChallengeOrBuilder()

Do not present a challenge to the user.

.google.cloud.recaptchaenterprise.v1.ChallengeRule.NoChallengeOutcome no_challenge = 2;

Returns
Type Description
ChallengeRule.NoChallengeOutcomeOrBuilder

getOutcomeCase()

public ChallengeRule.OutcomeCase getOutcomeCase()
Returns
Type Description
ChallengeRule.OutcomeCase

getParserForType()

public Parser<ChallengeRule> getParserForType()
Returns
Type Description
Parser<ChallengeRule>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasChallenge()

public boolean hasChallenge()

Present a challenge to the user.

.google.cloud.recaptchaenterprise.v1.ChallengeRule.ChallengeOutcome challenge = 3;

Returns
Type Description
boolean

Whether the challenge field is set.

hasNoChallenge()

public boolean hasNoChallenge()

Do not present a challenge to the user.

.google.cloud.recaptchaenterprise.v1.ChallengeRule.NoChallengeOutcome no_challenge = 2;

Returns
Type Description
boolean

Whether the noChallenge field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public ChallengeRule.Builder newBuilderForType()
Returns
Type Description
ChallengeRule.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

protected ChallengeRule.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ChallengeRule.Builder
Overrides

toBuilder()

public ChallengeRule.Builder toBuilder()
Returns
Type Description
ChallengeRule.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException