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.



561
562
563
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 561

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



544
545
546
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 544

def challenge
  @challenge
end

#conditionString

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" Corresponds to the JSON property condition

Returns:

  • (String)


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

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



559
560
561
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 559

def no_challenge
  @no_challenge
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



566
567
568
569
570
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 566

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