Class: AWSCDK::WAFv2::CfnWebACL::CustomResponseBodyProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
wa_fv2/cfn_web_acl.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.



2088
2089
2090
2091
2092
2093
# File 'wa_fv2/cfn_web_acl.rb', line 2088

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 .



2103
2104
2105
# File 'wa_fv2/cfn_web_acl.rb', line 2103

def content
  @content
end

#content_typeString (readonly)

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



2108
2109
2110
# File 'wa_fv2/cfn_web_acl.rb', line 2108

def content_type
  @content_type
end

Class Method Details

.jsii_propertiesObject



2110
2111
2112
2113
2114
2115
# File 'wa_fv2/cfn_web_acl.rb', line 2110

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

Instance Method Details

#to_jsiiObject



2117
2118
2119
2120
2121
2122
2123
2124
# File 'wa_fv2/cfn_web_acl.rb', line 2117

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