Class: Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1ChallengeRule

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/recaptchaenterprise_v1/classes.rb,
lib/google/apis/recaptchaenterprise_v1/representations.rb,
lib/google/apis/recaptchaenterprise_v1/representations.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRecaptchaenterpriseV1ChallengeRule

Returns a new instance of GoogleCloudRecaptchaenterpriseV1ChallengeRule.



557
558
559
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 557

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#challengeGoogle::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1ChallengeRuleChallengeOutcome

An outcome that indicates that a challenge of a specified difficulty should be presented to the user. Corresponds to the JSON property challenge



540
541
542
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 540

def challenge
  @challenge
end

#conditionString

Optional. A CEL condition that must be met for this rule to apply. 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" Corresponds to the JSON property condition

Returns:

  • (String)


550
551
552
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 550

def condition
  @condition
end

#no_challengeGoogle::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1ChallengeRuleNoChallengeOutcome

An outcome that indicates that no challenge should be presented to the user. Corresponds to the JSON property noChallenge



555
556
557
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 555

def no_challenge
  @no_challenge
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



562
563
564
565
566
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 562

def update!(**args)
  @challenge = args[:challenge] if args.key?(:challenge)
  @condition = args[:condition] if args.key?(:condition)
  @no_challenge = args[:no_challenge] if args.key?(:no_challenge)
end