Class: AWSCDK::Pinpoint::CfnCampaign::DefaultButtonConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
pinpoint/cfn_campaign.rb

Overview

Specifies the default behavior for a button that appears in an in-app message.

You can optionally add button configurations that specifically apply to iOS, Android, or web browser users.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(background_color: nil, border_radius: nil, button_action: nil, link: nil, text: nil, text_color: nil) ⇒ DefaultButtonConfigurationProperty

Returns a new instance of DefaultButtonConfigurationProperty.

Parameters:

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

    The background color of a button, expressed as a hex color code (such as #000000 for black).

  • border_radius (Numeric, nil) (defaults to: nil)

    The border radius of a button.

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

    The action that occurs when a recipient chooses a button in an in-app message.

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

    The destination (such as a URL) for a button.

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

    The text that appears on a button in an in-app message.

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

    The color of the body text in a button, expressed as a hex color code (such as #000000 for black).



1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
# File 'pinpoint/cfn_campaign.rb', line 1197

def initialize(background_color: nil, border_radius: nil, button_action: nil, link: nil, text: nil, text_color: nil)
  @background_color = background_color
  Jsii::Type.check_type(@background_color, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "backgroundColor") unless @background_color.nil?
  @border_radius = border_radius
  Jsii::Type.check_type(@border_radius, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "borderRadius") unless @border_radius.nil?
  @button_action = button_action
  Jsii::Type.check_type(@button_action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "buttonAction") unless @button_action.nil?
  @link = link
  Jsii::Type.check_type(@link, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "link") unless @link.nil?
  @text = text
  Jsii::Type.check_type(@text, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "text") unless @text.nil?
  @text_color = text_color
  Jsii::Type.check_type(@text_color, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "textColor") unless @text_color.nil?
end

Instance Attribute Details

#background_colorString? (readonly)

The background color of a button, expressed as a hex color code (such as #000000 for black).



1216
1217
1218
# File 'pinpoint/cfn_campaign.rb', line 1216

def background_color
  @background_color
end

#border_radiusNumeric? (readonly)

The border radius of a button.



1221
1222
1223
# File 'pinpoint/cfn_campaign.rb', line 1221

def border_radius
  @border_radius
end

#button_actionString? (readonly)

The action that occurs when a recipient chooses a button in an in-app message.

You can specify one of the following:

  • LINK – A link to a web destination.
  • DEEP_LINK – A link to a specific page in an application.
  • CLOSE – Dismisses the message.


1232
1233
1234
# File 'pinpoint/cfn_campaign.rb', line 1232

def button_action
  @button_action
end

The destination (such as a URL) for a button.



1237
1238
1239
# File 'pinpoint/cfn_campaign.rb', line 1237

def link
  @link
end

#textString? (readonly)

The text that appears on a button in an in-app message.



1242
1243
1244
# File 'pinpoint/cfn_campaign.rb', line 1242

def text
  @text
end

#text_colorString? (readonly)

The color of the body text in a button, expressed as a hex color code (such as #000000 for black).



1247
1248
1249
# File 'pinpoint/cfn_campaign.rb', line 1247

def text_color
  @text_color
end

Class Method Details

.jsii_propertiesObject



1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
# File 'pinpoint/cfn_campaign.rb', line 1249

def self.jsii_properties
  {
    :background_color => "backgroundColor",
    :border_radius => "borderRadius",
    :button_action => "buttonAction",
    :link => "link",
    :text => "text",
    :text_color => "textColor",
  }
end

Instance Method Details

#to_jsiiObject



1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
# File 'pinpoint/cfn_campaign.rb', line 1260

def to_jsii
  result = {}
  result.merge!({
    "backgroundColor" => @background_color,
    "borderRadius" => @border_radius,
    "buttonAction" => @button_action,
    "link" => @link,
    "text" => @text,
    "textColor" => @text_color,
  })
  result.compact
end