Class: Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1FirewallAction

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

An individual action. Each action represents what to do if a policy matches.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRecaptchaenterpriseV1FirewallAction

Returns a new instance of GoogleCloudRecaptchaenterpriseV1FirewallAction.



498
499
500
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 498

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

Instance Attribute Details

#allowGoogle::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1FirewallActionAllowAction

An allow action continues processing a request unimpeded. Corresponds to the JSON property allow



472
473
474
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 472

def allow
  @allow
end

#blockGoogle::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1FirewallActionBlockAction

A block action serves an HTTP error code a prevents the request from hitting the backend. Corresponds to the JSON property block



478
479
480
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 478

def block
  @block
end

#redirectGoogle::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1FirewallActionRedirectAction

A redirect action returns a 307 (temporary redirect) response, pointing the user to a ReCaptcha interstitial page to attach a token. Corresponds to the JSON property redirect



484
485
486
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 484

def redirect
  @redirect
end

#set_headerGoogle::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1FirewallActionSetHeaderAction

A set header action sets a header and forwards the request to the backend. This can be used to trigger custom protection implemented on the backend. Corresponds to the JSON property setHeader



490
491
492
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 490

def set_header
  @set_header
end

#substituteGoogle::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1FirewallActionSubstituteAction

A substitute action transparently serves a different page than the one requested. Corresponds to the JSON property substitute



496
497
498
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 496

def substitute
  @substitute
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



503
504
505
506
507
508
509
# File 'lib/google/apis/recaptchaenterprise_v1/classes.rb', line 503

def update!(**args)
  @allow = args[:allow] if args.key?(:allow)
  @block = args[:block] if args.key?(:block)
  @redirect = args[:redirect] if args.key?(:redirect)
  @set_header = args[:set_header] if args.key?(:set_header)
  @substitute = args[:substitute] if args.key?(:substitute)
end