Class: AWSCDK::ElasticLoadBalancingv2::CfnListener::FixedResponseConfigProperty

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



1054
1055
1056
1057
1058
1059
1060
1061
# File 'elastic_load_balancingv2/cfn_listener.rb', line 1054

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



1074
1075
1076
# File 'elastic_load_balancingv2/cfn_listener.rb', line 1074

def content_type
  @content_type
end

#message_bodyString? (readonly)

The message.



1079
1080
1081
# File 'elastic_load_balancingv2/cfn_listener.rb', line 1079

def message_body
  @message_body
end

#status_codeString (readonly)

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



1067
1068
1069
# File 'elastic_load_balancingv2/cfn_listener.rb', line 1067

def status_code
  @status_code
end

Class Method Details

.jsii_propertiesObject



1081
1082
1083
1084
1085
1086
1087
# File 'elastic_load_balancingv2/cfn_listener.rb', line 1081

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

Instance Method Details

#to_jsiiObject



1089
1090
1091
1092
1093
1094
1095
1096
1097
# File 'elastic_load_balancingv2/cfn_listener.rb', line 1089

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