Class: AWSCDK::ElasticLoadBalancingv2::CfnListenerRule::FixedResponseConfigProperty

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

Overview

Specifies information required when returning a custom HTTP response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code:, content_type: nil, message_body: nil) ⇒ FixedResponseConfigProperty

Returns a new instance of FixedResponseConfigProperty.

Parameters:

  • status_code (String)

    The HTTP response code (2XX, 4XX, or 5XX).

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

    The content type.

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

    The message.



971
972
973
974
975
976
977
978
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 971

def initialize(status_code:, content_type: nil, message_body: nil)
  @status_code = status_code
  Jsii::Type.check_type(@status_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statusCode")
  @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)

The content type.

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



991
992
993
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 991

def content_type
  @content_type
end

#message_bodyString? (readonly)

The message.



996
997
998
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 996

def message_body
  @message_body
end

#status_codeString (readonly)

The HTTP response code (2XX, 4XX, or 5XX).



984
985
986
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 984

def status_code
  @status_code
end

Class Method Details

.jsii_propertiesObject



998
999
1000
1001
1002
1003
1004
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 998

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

Instance Method Details

#to_jsiiObject



1006
1007
1008
1009
1010
1011
1012
1013
1014
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1006

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