Class: AWSCDK::Lex::CfnBot::ImageResponseCardProperty

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

Overview

A card that is shown to the user by a messaging platform.

You define the contents of the card, the card is displayed by the platform.

When you use a response card, the response from the user is constrained to the text associated with a button on the card.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title:, buttons: nil, image_url: nil, subtitle: nil) ⇒ ImageResponseCardProperty

Returns a new instance of ImageResponseCardProperty.

Parameters:

  • title (String)

    The title to display on the response card.

  • buttons (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Lex::CfnBot::ButtonProperty>, nil) (defaults to: nil)

    A list of buttons that should be displayed on the response card.

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

    The URL of an image to display on the response card.

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

    The subtitle to display on the response card.



3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
# File 'lex/cfn_bot.rb', line 3053

def initialize(title:, buttons: nil, image_url: nil, subtitle: nil)
  @title = title
  Jsii::Type.check_type(@title, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "title")
  @buttons = buttons
  Jsii::Type.check_type(@buttons, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGV4LkNmbkJvdC5CdXR0b25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "buttons") unless @buttons.nil?
  @image_url = image_url
  Jsii::Type.check_type(@image_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageUrl") unless @image_url.nil?
  @subtitle = subtitle
  Jsii::Type.check_type(@subtitle, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subtitle") unless @subtitle.nil?
end

Instance Attribute Details

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

A list of buttons that should be displayed on the response card.

The arrangement of the buttons is determined by the platform that displays the button.



3077
3078
3079
# File 'lex/cfn_bot.rb', line 3077

def buttons
  @buttons
end

#image_urlString? (readonly)

The URL of an image to display on the response card.

The image URL must be publicly available so that the platform displaying the response card has access to the image.



3084
3085
3086
# File 'lex/cfn_bot.rb', line 3084

def image_url
  @image_url
end

#subtitleString? (readonly)

The subtitle to display on the response card.

The format of the subtitle is determined by the platform displaying the response card.



3091
3092
3093
# File 'lex/cfn_bot.rb', line 3091

def subtitle
  @subtitle
end

#titleString (readonly)

The title to display on the response card.

The format of the title is determined by the platform displaying the response card.



3070
3071
3072
# File 'lex/cfn_bot.rb', line 3070

def title
  @title
end

Class Method Details

.jsii_propertiesObject



3093
3094
3095
3096
3097
3098
3099
3100
# File 'lex/cfn_bot.rb', line 3093

def self.jsii_properties
  {
    :title => "title",
    :buttons => "buttons",
    :image_url => "imageUrl",
    :subtitle => "subtitle",
  }
end

Instance Method Details

#to_jsiiObject



3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
# File 'lex/cfn_bot.rb', line 3102

def to_jsii
  result = {}
  result.merge!({
    "title" => @title,
    "buttons" => @buttons,
    "imageUrl" => @image_url,
    "subtitle" => @subtitle,
  })
  result.compact
end