Class: AWSCDK::Pinpoint::CfnInAppTemplate::InAppMessageContentProperty

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

Overview

Specifies the configuration of an in-app message, including its header, body, buttons, colors, and images.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(background_color: nil, body_config: nil, header_config: nil, image_url: nil, primary_btn: nil, secondary_btn: nil) ⇒ InAppMessageContentProperty

Returns a new instance of InAppMessageContentProperty.

Parameters:



888
889
890
891
892
893
894
895
896
897
898
899
900
901
# File 'pinpoint/cfn_in_app_template.rb', line 888

def initialize(background_color: nil, body_config: nil, header_config: nil, image_url: nil, primary_btn: nil, secondary_btn: nil)
  @background_color = background_color
  Jsii::Type.check_type(@background_color, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "backgroundColor") unless @background_color.nil?
  @body_config = body_config.is_a?(Hash) ? ::AWSCDK::Pinpoint::CfnInAppTemplate::BodyConfigProperty.new(**body_config.transform_keys(&:to_sym)) : body_config
  Jsii::Type.check_type(@body_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19waW5wb2ludC5DZm5JbkFwcFRlbXBsYXRlLkJvZHlDb25maWdQcm9wZXJ0eSJ9XX19")), "bodyConfig") unless @body_config.nil?
  @header_config = header_config.is_a?(Hash) ? ::AWSCDK::Pinpoint::CfnInAppTemplate::HeaderConfigProperty.new(**header_config.transform_keys(&:to_sym)) : header_config
  Jsii::Type.check_type(@header_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19waW5wb2ludC5DZm5JbkFwcFRlbXBsYXRlLkhlYWRlckNvbmZpZ1Byb3BlcnR5In1dfX0=")), "headerConfig") unless @header_config.nil?
  @image_url = image_url
  Jsii::Type.check_type(@image_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageUrl") unless @image_url.nil?
  @primary_btn = primary_btn.is_a?(Hash) ? ::AWSCDK::Pinpoint::CfnInAppTemplate::ButtonConfigProperty.new(**primary_btn.transform_keys(&:to_sym)) : primary_btn
  Jsii::Type.check_type(@primary_btn, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19waW5wb2ludC5DZm5JbkFwcFRlbXBsYXRlLkJ1dHRvbkNvbmZpZ1Byb3BlcnR5In1dfX0=")), "primaryBtn") unless @primary_btn.nil?
  @secondary_btn = secondary_btn.is_a?(Hash) ? ::AWSCDK::Pinpoint::CfnInAppTemplate::ButtonConfigProperty.new(**secondary_btn.transform_keys(&:to_sym)) : secondary_btn
  Jsii::Type.check_type(@secondary_btn, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19waW5wb2ludC5DZm5JbkFwcFRlbXBsYXRlLkJ1dHRvbkNvbmZpZ1Byb3BlcnR5In1dfX0=")), "secondaryBtn") unless @secondary_btn.nil?
end

Instance Attribute Details

#background_colorString? (readonly)

The background color for an in-app message banner, expressed as a hex color code (such as #000000 for black).



907
908
909
# File 'pinpoint/cfn_in_app_template.rb', line 907

def background_color
  @background_color
end

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

An object that contains configuration information about the header or title text of the in-app message.



912
913
914
# File 'pinpoint/cfn_in_app_template.rb', line 912

def body_config
  @body_config
end

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

An object that contains configuration information about the header or title text of the in-app message.



917
918
919
# File 'pinpoint/cfn_in_app_template.rb', line 917

def header_config
  @header_config
end

#image_urlString? (readonly)

The URL of the image that appears on an in-app message banner.



922
923
924
# File 'pinpoint/cfn_in_app_template.rb', line 922

def image_url
  @image_url
end

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

An object that contains configuration information about the primary button in an in-app message.



927
928
929
# File 'pinpoint/cfn_in_app_template.rb', line 927

def primary_btn
  @primary_btn
end

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

An object that contains configuration information about the secondary button in an in-app message.



932
933
934
# File 'pinpoint/cfn_in_app_template.rb', line 932

def secondary_btn
  @secondary_btn
end

Class Method Details

.jsii_propertiesObject



934
935
936
937
938
939
940
941
942
943
# File 'pinpoint/cfn_in_app_template.rb', line 934

def self.jsii_properties
  {
    :background_color => "backgroundColor",
    :body_config => "bodyConfig",
    :header_config => "headerConfig",
    :image_url => "imageUrl",
    :primary_btn => "primaryBtn",
    :secondary_btn => "secondaryBtn",
  }
end

Instance Method Details

#to_jsiiObject



945
946
947
948
949
950
951
952
953
954
955
956
# File 'pinpoint/cfn_in_app_template.rb', line 945

def to_jsii
  result = {}
  result.merge!({
    "backgroundColor" => @background_color,
    "bodyConfig" => @body_config,
    "headerConfig" => @header_config,
    "imageUrl" => @image_url,
    "primaryBtn" => @primary_btn,
    "secondaryBtn" => @secondary_btn,
  })
  result.compact
end