Class: AWSCDK::Lex::CfnBot::MessageProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lex/cfn_bot.rb

Overview

The object that provides message text and its type.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(custom_payload: nil, image_response_card: nil, plain_text_message: nil, ssml_message: nil) ⇒ MessageProperty

Returns a new instance of MessageProperty.

Parameters:



3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
# File 'lex/cfn_bot.rb', line 3908

def initialize(custom_payload: nil, image_response_card: nil, plain_text_message: nil, ssml_message: nil)
  @custom_payload = custom_payload.is_a?(Hash) ? ::AWSCDK::Lex::CfnBot::CustomPayloadProperty.new(**custom_payload.transform_keys(&:to_sym)) : custom_payload
  Jsii::Type.check_type(@custom_payload, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19sZXguQ2ZuQm90LkN1c3RvbVBheWxvYWRQcm9wZXJ0eSJ9XX19")), "customPayload") unless @custom_payload.nil?
  @image_response_card = image_response_card.is_a?(Hash) ? ::AWSCDK::Lex::CfnBot::ImageResponseCardProperty.new(**image_response_card.transform_keys(&:to_sym)) : image_response_card
  Jsii::Type.check_type(@image_response_card, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19sZXguQ2ZuQm90LkltYWdlUmVzcG9uc2VDYXJkUHJvcGVydHkifV19fQ==")), "imageResponseCard") unless @image_response_card.nil?
  @plain_text_message = plain_text_message.is_a?(Hash) ? ::AWSCDK::Lex::CfnBot::PlainTextMessageProperty.new(**plain_text_message.transform_keys(&:to_sym)) : plain_text_message
  Jsii::Type.check_type(@plain_text_message, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19sZXguQ2ZuQm90LlBsYWluVGV4dE1lc3NhZ2VQcm9wZXJ0eSJ9XX19")), "plainTextMessage") unless @plain_text_message.nil?
  @ssml_message = ssml_message.is_a?(Hash) ? ::AWSCDK::Lex::CfnBot::SSMLMessageProperty.new(**ssml_message.transform_keys(&:to_sym)) : ssml_message
  Jsii::Type.check_type(@ssml_message, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19sZXguQ2ZuQm90LlNTTUxNZXNzYWdlUHJvcGVydHkifV19fQ==")), "ssmlMessage") unless @ssml_message.nil?
end

Instance Attribute Details

#custom_payloadAWSCDK::IResolvable, ... (readonly)

A message in a custom format defined by the client application.



3923
3924
3925
# File 'lex/cfn_bot.rb', line 3923

def custom_payload
  @custom_payload
end

#image_response_cardAWSCDK::IResolvable, ... (readonly)

A message that defines a response card that the client application can show to the user.



3928
3929
3930
# File 'lex/cfn_bot.rb', line 3928

def image_response_card
  @image_response_card
end

#plain_text_messageAWSCDK::IResolvable, ... (readonly)

A message in plain text format.



3933
3934
3935
# File 'lex/cfn_bot.rb', line 3933

def plain_text_message
  @plain_text_message
end

#ssml_messageAWSCDK::IResolvable, ... (readonly)

A message in Speech Synthesis Markup Language (SSML).



3938
3939
3940
# File 'lex/cfn_bot.rb', line 3938

def ssml_message
  @ssml_message
end

Class Method Details

.jsii_propertiesObject



3940
3941
3942
3943
3944
3945
3946
3947
# File 'lex/cfn_bot.rb', line 3940

def self.jsii_properties
  {
    :custom_payload => "customPayload",
    :image_response_card => "imageResponseCard",
    :plain_text_message => "plainTextMessage",
    :ssml_message => "ssmlMessage",
  }
end

Instance Method Details

#to_jsiiObject



3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
# File 'lex/cfn_bot.rb', line 3949

def to_jsii
  result = {}
  result.merge!({
    "customPayload" => @custom_payload,
    "imageResponseCard" => @image_response_card,
    "plainTextMessage" => @plain_text_message,
    "ssmlMessage" => @ssml_message,
  })
  result.compact
end