Class: AWSCDK::Pinpoint::CfnCampaign::MessageProperty

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

Overview

Specifies the content and settings for a push notification that's sent to recipients of a campaign.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action: nil, body: nil, image_icon_url: nil, image_small_icon_url: nil, image_url: nil, json_body: nil, media_url: nil, raw_content: nil, silent_push: nil, time_to_live: nil, title: nil, url: nil) ⇒ MessageProperty

Returns a new instance of MessageProperty.

Parameters:

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

    The action to occur if a recipient taps the push notification. Valid values are:.

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

    The body of the notification message.

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

    The URL of the image to display as the push notification icon, such as the icon for the app.

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

    The URL of the image to display as the small, push notification icon, such as a small version of the icon for the app.

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

    The URL of an image to display in the push notification.

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

    The JSON payload to use for a silent push notification.

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

    The URL of the image or video to display in the push notification.

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

    The raw, JSON-formatted string to use as the payload for the notification message.

  • silent_push (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether the notification is a silent push notification, which is a push notification that doesn't display on a recipient's device.

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

    The number of seconds that the push notification service should keep the message, if the service is unable to deliver the notification the first time.

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

    The title to display above the notification message on a recipient's device.

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

    The URL to open in a recipient's default mobile browser, if a recipient taps the push notification and the value of the Action property is URL .



1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
# File 'pinpoint/cfn_campaign.rb', line 1817

def initialize(action: nil, body: nil, image_icon_url: nil, image_small_icon_url: nil, image_url: nil, json_body: nil, media_url: nil, raw_content: nil, silent_push: nil, time_to_live: nil, title: nil, url: nil)
  @action = action
  Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action") unless @action.nil?
  @body = body
  Jsii::Type.check_type(@body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "body") unless @body.nil?
  @image_icon_url = image_icon_url
  Jsii::Type.check_type(@image_icon_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageIconUrl") unless @image_icon_url.nil?
  @image_small_icon_url = image_small_icon_url
  Jsii::Type.check_type(@image_small_icon_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageSmallIconUrl") unless @image_small_icon_url.nil?
  @image_url = image_url
  Jsii::Type.check_type(@image_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageUrl") unless @image_url.nil?
  @json_body = json_body
  Jsii::Type.check_type(@json_body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jsonBody") unless @json_body.nil?
  @media_url = media_url
  Jsii::Type.check_type(@media_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "mediaUrl") unless @media_url.nil?
  @raw_content = raw_content
  Jsii::Type.check_type(@raw_content, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "rawContent") unless @raw_content.nil?
  @silent_push = silent_push
  Jsii::Type.check_type(@silent_push, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "silentPush") unless @silent_push.nil?
  @time_to_live = time_to_live
  Jsii::Type.check_type(@time_to_live, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "timeToLive") unless @time_to_live.nil?
  @title = title
  Jsii::Type.check_type(@title, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "title") unless @title.nil?
  @url = url
  Jsii::Type.check_type(@url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "url") unless @url.nil?
end

Instance Attribute Details

#actionString? (readonly)

The action to occur if a recipient taps the push notification. Valid values are:.

  • OPEN_APP – Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.
  • DEEP_LINK – Your app opens and displays a designated user interface in the app. This setting uses the deep-linking features of iOS and Android.
  • URL – The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.


1852
1853
1854
# File 'pinpoint/cfn_campaign.rb', line 1852

def action
  @action
end

#bodyString? (readonly)

The body of the notification message.

The maximum number of characters is 200.



1859
1860
1861
# File 'pinpoint/cfn_campaign.rb', line 1859

def body
  @body
end

#image_icon_urlString? (readonly)

The URL of the image to display as the push notification icon, such as the icon for the app.



1864
1865
1866
# File 'pinpoint/cfn_campaign.rb', line 1864

def image_icon_url
  @image_icon_url
end

#image_small_icon_urlString? (readonly)

The URL of the image to display as the small, push notification icon, such as a small version of the icon for the app.



1869
1870
1871
# File 'pinpoint/cfn_campaign.rb', line 1869

def image_small_icon_url
  @image_small_icon_url
end

#image_urlString? (readonly)

The URL of an image to display in the push notification.



1874
1875
1876
# File 'pinpoint/cfn_campaign.rb', line 1874

def image_url
  @image_url
end

#json_bodyString? (readonly)

The JSON payload to use for a silent push notification.



1879
1880
1881
# File 'pinpoint/cfn_campaign.rb', line 1879

def json_body
  @json_body
end

#media_urlString? (readonly)

The URL of the image or video to display in the push notification.



1884
1885
1886
# File 'pinpoint/cfn_campaign.rb', line 1884

def media_url
  @media_url
end

#raw_contentString? (readonly)

The raw, JSON-formatted string to use as the payload for the notification message.

If specified, this value overrides all other content for the message.



1891
1892
1893
# File 'pinpoint/cfn_campaign.rb', line 1891

def raw_content
  @raw_content
end

#silent_pushBoolean, ... (readonly)

Specifies whether the notification is a silent push notification, which is a push notification that doesn't display on a recipient's device.

Silent push notifications can be used for cases such as updating an app's configuration, displaying messages in an in-app message center, or supporting phone home functionality.



1898
1899
1900
# File 'pinpoint/cfn_campaign.rb', line 1898

def silent_push
  @silent_push
end

#time_to_liveNumeric? (readonly)

The number of seconds that the push notification service should keep the message, if the service is unable to deliver the notification the first time.

This value is converted to an expiration value when it's sent to a push notification service. If this value is 0 , the service treats the notification as if it expires immediately and the service doesn't store or try to deliver the notification again.

This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.



1907
1908
1909
# File 'pinpoint/cfn_campaign.rb', line 1907

def time_to_live
  @time_to_live
end

#titleString? (readonly)

The title to display above the notification message on a recipient's device.



1912
1913
1914
# File 'pinpoint/cfn_campaign.rb', line 1912

def title
  @title
end

#urlString? (readonly)

The URL to open in a recipient's default mobile browser, if a recipient taps the push notification and the value of the Action property is URL .



1917
1918
1919
# File 'pinpoint/cfn_campaign.rb', line 1917

def url
  @url
end

Class Method Details

.jsii_propertiesObject



1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
# File 'pinpoint/cfn_campaign.rb', line 1919

def self.jsii_properties
  {
    :action => "action",
    :body => "body",
    :image_icon_url => "imageIconUrl",
    :image_small_icon_url => "imageSmallIconUrl",
    :image_url => "imageUrl",
    :json_body => "jsonBody",
    :media_url => "mediaUrl",
    :raw_content => "rawContent",
    :silent_push => "silentPush",
    :time_to_live => "timeToLive",
    :title => "title",
    :url => "url",
  }
end

Instance Method Details

#to_jsiiObject



1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
# File 'pinpoint/cfn_campaign.rb', line 1936

def to_jsii
  result = {}
  result.merge!({
    "action" => @action,
    "body" => @body,
    "imageIconUrl" => @image_icon_url,
    "imageSmallIconUrl" => @image_small_icon_url,
    "imageUrl" => @image_url,
    "jsonBody" => @json_body,
    "mediaUrl" => @media_url,
    "rawContent" => @raw_content,
    "silentPush" => @silent_push,
    "timeToLive" => @time_to_live,
    "title" => @title,
    "url" => @url,
  })
  result.compact
end