Class: AWSCDK::WAFv2::CfnRuleGroup::CustomResponseBodyProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
wa_fv2/cfn_rule_group.rb

Overview

The response body to use in a custom response to a web request.

This is referenced by key from CustomResponse CustomResponseBodyKey .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content:, content_type:) ⇒ CustomResponseBodyProperty

Returns a new instance of CustomResponseBodyProperty.

Parameters:

  • content (String)

    The payload of the custom response.

  • content_type (String)

    The type of content in the payload that you are defining in the Content string.



1417
1418
1419
1420
1421
1422
# File 'wa_fv2/cfn_rule_group.rb', line 1417

def initialize(content:, content_type:)
  @content = content
  Jsii::Type.check_type(@content, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "content")
  @content_type = content_type
  Jsii::Type.check_type(@content_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "contentType")
end

Instance Attribute Details

#contentString (readonly)

The payload of the custom response.

You can use JSON escape strings in JSON content. To do this, you must specify JSON content in the ContentType setting.

For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .



1432
1433
1434
# File 'wa_fv2/cfn_rule_group.rb', line 1432

def content
  @content
end

#content_typeString (readonly)

The type of content in the payload that you are defining in the Content string.



1437
1438
1439
# File 'wa_fv2/cfn_rule_group.rb', line 1437

def content_type
  @content_type
end

Class Method Details

.jsii_propertiesObject



1439
1440
1441
1442
1443
1444
# File 'wa_fv2/cfn_rule_group.rb', line 1439

def self.jsii_properties
  {
    :content => "content",
    :content_type => "contentType",
  }
end

Instance Method Details

#to_jsiiObject



1446
1447
1448
1449
1450
1451
1452
1453
# File 'wa_fv2/cfn_rule_group.rb', line 1446

def to_jsii
  result = {}
  result.merge!({
    "content" => @content,
    "contentType" => @content_type,
  })
  result.compact
end