Class: AWSCDK::Pinpoint::CfnInAppTemplate::DefaultButtonConfigurationProperty

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

Overview

Specifies the default behavior of 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).



744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'pinpoint/cfn_in_app_template.rb', line 744

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).



763
764
765
# File 'pinpoint/cfn_in_app_template.rb', line 763

def background_color
  @background_color
end

#border_radiusNumeric? (readonly)

The border radius of a button.



768
769
770
# File 'pinpoint/cfn_in_app_template.rb', line 768

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.


779
780
781
# File 'pinpoint/cfn_in_app_template.rb', line 779

def button_action
  @button_action
end

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



784
785
786
# File 'pinpoint/cfn_in_app_template.rb', line 784

def link
  @link
end

#textString? (readonly)

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



789
790
791
# File 'pinpoint/cfn_in_app_template.rb', line 789

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).



794
795
796
# File 'pinpoint/cfn_in_app_template.rb', line 794

def text_color
  @text_color
end

Class Method Details

.jsii_propertiesObject



796
797
798
799
800
801
802
803
804
805
# File 'pinpoint/cfn_in_app_template.rb', line 796

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



807
808
809
810
811
812
813
814
815
816
817
818
# File 'pinpoint/cfn_in_app_template.rb', line 807

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