Class: AWSCDK::ElasticLoadBalancingv2::FixedResponseOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
elastic_load_balancingv2/fixed_response_options.rb

Overview

Options for ListenerAction.fixedResponse().

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content_type: nil, message_body: nil) ⇒ FixedResponseOptions

Returns a new instance of FixedResponseOptions.

Parameters:

  • content_type (String, nil) (defaults to: nil)

    Content Type of the response.

  • message_body (String, nil) (defaults to: nil)

    The response body.



9
10
11
12
13
14
# File 'elastic_load_balancingv2/fixed_response_options.rb', line 9

def initialize(content_type: nil, message_body: nil)
  @content_type = content_type
  Jsii::Type.check_type(@content_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "contentType") unless @content_type.nil?
  @message_body = message_body
  Jsii::Type.check_type(@message_body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "messageBody") unless @message_body.nil?
end

Instance Attribute Details

#content_typeString? (readonly)

Note:

Default: - Automatically determined

Content Type of the response.

Valid Values: text/plain | text/css | text/html | application/javascript | application/json

Returns:

  • (String, nil)


22
23
24
# File 'elastic_load_balancingv2/fixed_response_options.rb', line 22

def content_type
  @content_type
end

#message_bodyString? (readonly)

Note:

Default: - No body

The response body.

Returns:

  • (String, nil)


27
28
29
# File 'elastic_load_balancingv2/fixed_response_options.rb', line 27

def message_body
  @message_body
end

Class Method Details

.jsii_propertiesObject



29
30
31
32
33
34
# File 'elastic_load_balancingv2/fixed_response_options.rb', line 29

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

Instance Method Details

#to_jsiiObject



36
37
38
39
40
41
42
43
# File 'elastic_load_balancingv2/fixed_response_options.rb', line 36

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