1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Specifies the default settings and content for a message template that can be used in messages that are sent through a push notification channel.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DefaultPushNotificationTemplate {
/// <p>The action to occur if a recipient taps a push notification that's based on the message template. Valid values are:</p>
/// <ul>
/// <li>
/// <p>OPEN_APP - Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.</p></li>
/// <li>
/// <p>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.</p></li>
/// <li>
/// <p>URL - The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.</p></li>
/// </ul>
pub action: ::std::option::Option<crate::types::Action>,
/// <p>The message body to use in push notifications that are based on the message template.</p>
pub body: ::std::option::Option<::std::string::String>,
/// <p>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/.</p>
/// <p>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.</p>
pub sound: ::std::option::Option<::std::string::String>,
/// <p>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.</p>
pub title: ::std::option::Option<::std::string::String>,
/// <p>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.</p>
pub url: ::std::option::Option<::std::string::String>,
}
impl DefaultPushNotificationTemplate {
/// <p>The action to occur if a recipient taps a push notification that's based on the message template. Valid values are:</p>
/// <ul>
/// <li>
/// <p>OPEN_APP - Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.</p></li>
/// <li>
/// <p>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.</p></li>
/// <li>
/// <p>URL - The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.</p></li>
/// </ul>
pub fn action(&self) -> ::std::option::Option<&crate::types::Action> {
self.action.as_ref()
}
/// <p>The message body to use in push notifications that are based on the message template.</p>
pub fn body(&self) -> ::std::option::Option<&str> {
self.body.as_deref()
}
/// <p>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/.</p>
/// <p>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.</p>
pub fn sound(&self) -> ::std::option::Option<&str> {
self.sound.as_deref()
}
/// <p>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.</p>
pub fn title(&self) -> ::std::option::Option<&str> {
self.title.as_deref()
}
/// <p>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.</p>
pub fn url(&self) -> ::std::option::Option<&str> {
self.url.as_deref()
}
}
impl DefaultPushNotificationTemplate {
/// Creates a new builder-style object to manufacture [`DefaultPushNotificationTemplate`](crate::types::DefaultPushNotificationTemplate).
pub fn builder() -> crate::types::builders::DefaultPushNotificationTemplateBuilder {
crate::types::builders::DefaultPushNotificationTemplateBuilder::default()
}
}
/// A builder for [`DefaultPushNotificationTemplate`](crate::types::DefaultPushNotificationTemplate).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DefaultPushNotificationTemplateBuilder {
pub(crate) action: ::std::option::Option<crate::types::Action>,
pub(crate) body: ::std::option::Option<::std::string::String>,
pub(crate) sound: ::std::option::Option<::std::string::String>,
pub(crate) title: ::std::option::Option<::std::string::String>,
pub(crate) url: ::std::option::Option<::std::string::String>,
}
impl DefaultPushNotificationTemplateBuilder {
/// <p>The action to occur if a recipient taps a push notification that's based on the message template. Valid values are:</p>
/// <ul>
/// <li>
/// <p>OPEN_APP - Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.</p></li>
/// <li>
/// <p>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.</p></li>
/// <li>
/// <p>URL - The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.</p></li>
/// </ul>
pub fn action(mut self, input: crate::types::Action) -> Self {
self.action = ::std::option::Option::Some(input);
self
}
/// <p>The action to occur if a recipient taps a push notification that's based on the message template. Valid values are:</p>
/// <ul>
/// <li>
/// <p>OPEN_APP - Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.</p></li>
/// <li>
/// <p>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.</p></li>
/// <li>
/// <p>URL - The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.</p></li>
/// </ul>
pub fn set_action(mut self, input: ::std::option::Option<crate::types::Action>) -> Self {
self.action = input;
self
}
/// <p>The action to occur if a recipient taps a push notification that's based on the message template. Valid values are:</p>
/// <ul>
/// <li>
/// <p>OPEN_APP - Your app opens or it becomes the foreground app if it was sent to the background. This is the default action.</p></li>
/// <li>
/// <p>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.</p></li>
/// <li>
/// <p>URL - The default mobile browser on the recipient's device opens and loads the web page at a URL that you specify.</p></li>
/// </ul>
pub fn get_action(&self) -> &::std::option::Option<crate::types::Action> {
&self.action
}
/// <p>The message body to use in push notifications that are based on the message template.</p>
pub fn body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.body = ::std::option::Option::Some(input.into());
self
}
/// <p>The message body to use in push notifications that are based on the message template.</p>
pub fn set_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.body = input;
self
}
/// <p>The message body to use in push notifications that are based on the message template.</p>
pub fn get_body(&self) -> &::std::option::Option<::std::string::String> {
&self.body
}
/// <p>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/.</p>
/// <p>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.</p>
pub fn sound(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.sound = ::std::option::Option::Some(input.into());
self
}
/// <p>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/.</p>
/// <p>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.</p>
pub fn set_sound(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.sound = input;
self
}
/// <p>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/.</p>
/// <p>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.</p>
pub fn get_sound(&self) -> &::std::option::Option<::std::string::String> {
&self.sound
}
/// <p>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.</p>
pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.title = ::std::option::Option::Some(input.into());
self
}
/// <p>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.</p>
pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.title = input;
self
}
/// <p>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.</p>
pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
&self.title
}
/// <p>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.</p>
pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.url = ::std::option::Option::Some(input.into());
self
}
/// <p>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.</p>
pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.url = input;
self
}
/// <p>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.</p>
pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
&self.url
}
/// Consumes the builder and constructs a [`DefaultPushNotificationTemplate`](crate::types::DefaultPushNotificationTemplate).
pub fn build(self) -> crate::types::DefaultPushNotificationTemplate {
crate::types::DefaultPushNotificationTemplate {
action: self.action,
body: self.body,
sound: self.sound,
title: self.title,
url: self.url,
}
}
}