Class: AWSCDK::Pinpoint::CfnPushTemplate::DefaultPushNotificationTemplateProperty

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

Overview

Specifies the default settings and content for a message template that can be used in messages that are sent through a push notification channel.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action: nil, body: nil, sound: nil, title: nil, url: nil) ⇒ DefaultPushNotificationTemplateProperty

Returns a new instance of DefaultPushNotificationTemplateProperty.

Parameters:

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

    The action to occur if a recipient taps a push notification that's based on the message template.

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

    The message body to use in push notifications that are based on the message template.

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

    The sound to play when a recipient receives a push notification that's based on the message template.

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

    The title to use in push notifications that are based on the message template.

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

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



843
844
845
846
847
848
849
850
851
852
853
854
# File 'pinpoint/cfn_push_template.rb', line 843

def initialize(action: nil, body: nil, sound: 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?
  @sound = sound
  Jsii::Type.check_type(@sound, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sound") unless @sound.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 a push notification that's based on the message template.

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 the iOS and Android platforms.
  • URL – The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.


866
867
868
# File 'pinpoint/cfn_push_template.rb', line 866

def action
  @action
end

#bodyString? (readonly)

The message body to use in push notifications that are based on the message template.



871
872
873
# File 'pinpoint/cfn_push_template.rb', line 871

def body
  @body
end

#soundString? (readonly)

The sound to play when a recipient receives a push notification that's based on the message template.

You can use the default stream or specify the file name of a sound resource that's bundled in your app. On an Android platform, the sound file must reside in /res/raw/ .

For an iOS platform, this value is the key for the name of a sound file in your app's main bundle or the Library/Sounds folder in your app's data container. If the sound file can't be found or you specify default for the value, the system plays the default alert sound.



880
881
882
# File 'pinpoint/cfn_push_template.rb', line 880

def sound
  @sound
end

#titleString? (readonly)

The title to use in push notifications that are based on the message template.

This title appears above the notification message on a recipient's device.



887
888
889
# File 'pinpoint/cfn_push_template.rb', line 887

def title
  @title
end

#urlString? (readonly)

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



892
893
894
# File 'pinpoint/cfn_push_template.rb', line 892

def url
  @url
end

Class Method Details

.jsii_propertiesObject



894
895
896
897
898
899
900
901
902
# File 'pinpoint/cfn_push_template.rb', line 894

def self.jsii_properties
  {
    :action => "action",
    :body => "body",
    :sound => "sound",
    :title => "title",
    :url => "url",
  }
end

Instance Method Details

#to_jsiiObject



904
905
906
907
908
909
910
911
912
913
914
# File 'pinpoint/cfn_push_template.rb', line 904

def to_jsii
  result = {}
  result.merge!({
    "action" => @action,
    "body" => @body,
    "sound" => @sound,
    "title" => @title,
    "url" => @url,
  })
  result.compact
end