1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/pinpoint/Pinpoint_EXPORTS.h> 8 #include <aws/pinpoint/model/Action.h> 9 #include <aws/core/utils/memory/stl/AWSString.h> 10 #include <utility> 11 12 namespace Aws 13 { 14 namespace Utils 15 { 16 namespace Json 17 { 18 class JsonValue; 19 class JsonView; 20 } // namespace Json 21 } // namespace Utils 22 namespace Pinpoint 23 { 24 namespace Model 25 { 26 27 /** 28 * <p>Specifies the default settings and content for a message template that can be 29 * used in messages that are sent through a push notification 30 * channel.</p><p><h3>See Also:</h3> <a 31 * href="http://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DefaultPushNotificationTemplate">AWS 32 * API Reference</a></p> 33 */ 34 class AWS_PINPOINT_API DefaultPushNotificationTemplate 35 { 36 public: 37 DefaultPushNotificationTemplate(); 38 DefaultPushNotificationTemplate(Aws::Utils::Json::JsonView jsonValue); 39 DefaultPushNotificationTemplate& operator=(Aws::Utils::Json::JsonView jsonValue); 40 Aws::Utils::Json::JsonValue Jsonize() const; 41 42 43 /** 44 * <p>The action to occur if a recipient taps a push notification that's based on 45 * the message template. Valid values are:</p> <ul><li><p>OPEN_APP - Your app opens 46 * or it becomes the foreground app if it was sent to the background. This is the 47 * default action.</p></li> <li><p>DEEP_LINK - Your app opens and displays a 48 * designated user interface in the app. This setting uses the deep-linking 49 * features of the iOS and Android platforms.</p></li> <li><p>URL - The default 50 * mobile browser on the recipient's device opens and loads the web page at a URL 51 * that you specify.</p></li></ul> 52 */ GetAction()53 inline const Action& GetAction() const{ return m_action; } 54 55 /** 56 * <p>The action to occur if a recipient taps a push notification that's based on 57 * the message template. Valid values are:</p> <ul><li><p>OPEN_APP - Your app opens 58 * or it becomes the foreground app if it was sent to the background. This is the 59 * default action.</p></li> <li><p>DEEP_LINK - Your app opens and displays a 60 * designated user interface in the app. This setting uses the deep-linking 61 * features of the iOS and Android platforms.</p></li> <li><p>URL - The default 62 * mobile browser on the recipient's device opens and loads the web page at a URL 63 * that you specify.</p></li></ul> 64 */ ActionHasBeenSet()65 inline bool ActionHasBeenSet() const { return m_actionHasBeenSet; } 66 67 /** 68 * <p>The action to occur if a recipient taps a push notification that's based on 69 * the message template. Valid values are:</p> <ul><li><p>OPEN_APP - Your app opens 70 * or it becomes the foreground app if it was sent to the background. This is the 71 * default action.</p></li> <li><p>DEEP_LINK - Your app opens and displays a 72 * designated user interface in the app. This setting uses the deep-linking 73 * features of the iOS and Android platforms.</p></li> <li><p>URL - The default 74 * mobile browser on the recipient's device opens and loads the web page at a URL 75 * that you specify.</p></li></ul> 76 */ SetAction(const Action & value)77 inline void SetAction(const Action& value) { m_actionHasBeenSet = true; m_action = value; } 78 79 /** 80 * <p>The action to occur if a recipient taps a push notification that's based on 81 * the message template. Valid values are:</p> <ul><li><p>OPEN_APP - Your app opens 82 * or it becomes the foreground app if it was sent to the background. This is the 83 * default action.</p></li> <li><p>DEEP_LINK - Your app opens and displays a 84 * designated user interface in the app. This setting uses the deep-linking 85 * features of the iOS and Android platforms.</p></li> <li><p>URL - The default 86 * mobile browser on the recipient's device opens and loads the web page at a URL 87 * that you specify.</p></li></ul> 88 */ SetAction(Action && value)89 inline void SetAction(Action&& value) { m_actionHasBeenSet = true; m_action = std::move(value); } 90 91 /** 92 * <p>The action to occur if a recipient taps a push notification that's based on 93 * the message template. Valid values are:</p> <ul><li><p>OPEN_APP - Your app opens 94 * or it becomes the foreground app if it was sent to the background. This is the 95 * default action.</p></li> <li><p>DEEP_LINK - Your app opens and displays a 96 * designated user interface in the app. This setting uses the deep-linking 97 * features of the iOS and Android platforms.</p></li> <li><p>URL - The default 98 * mobile browser on the recipient's device opens and loads the web page at a URL 99 * that you specify.</p></li></ul> 100 */ WithAction(const Action & value)101 inline DefaultPushNotificationTemplate& WithAction(const Action& value) { SetAction(value); return *this;} 102 103 /** 104 * <p>The action to occur if a recipient taps a push notification that's based on 105 * the message template. Valid values are:</p> <ul><li><p>OPEN_APP - Your app opens 106 * or it becomes the foreground app if it was sent to the background. This is the 107 * default action.</p></li> <li><p>DEEP_LINK - Your app opens and displays a 108 * designated user interface in the app. This setting uses the deep-linking 109 * features of the iOS and Android platforms.</p></li> <li><p>URL - The default 110 * mobile browser on the recipient's device opens and loads the web page at a URL 111 * that you specify.</p></li></ul> 112 */ WithAction(Action && value)113 inline DefaultPushNotificationTemplate& WithAction(Action&& value) { SetAction(std::move(value)); return *this;} 114 115 116 /** 117 * <p>The message body to use in push notifications that are based on the message 118 * template.</p> 119 */ GetBody()120 inline const Aws::String& GetBody() const{ return m_body; } 121 122 /** 123 * <p>The message body to use in push notifications that are based on the message 124 * template.</p> 125 */ BodyHasBeenSet()126 inline bool BodyHasBeenSet() const { return m_bodyHasBeenSet; } 127 128 /** 129 * <p>The message body to use in push notifications that are based on the message 130 * template.</p> 131 */ SetBody(const Aws::String & value)132 inline void SetBody(const Aws::String& value) { m_bodyHasBeenSet = true; m_body = value; } 133 134 /** 135 * <p>The message body to use in push notifications that are based on the message 136 * template.</p> 137 */ SetBody(Aws::String && value)138 inline void SetBody(Aws::String&& value) { m_bodyHasBeenSet = true; m_body = std::move(value); } 139 140 /** 141 * <p>The message body to use in push notifications that are based on the message 142 * template.</p> 143 */ SetBody(const char * value)144 inline void SetBody(const char* value) { m_bodyHasBeenSet = true; m_body.assign(value); } 145 146 /** 147 * <p>The message body to use in push notifications that are based on the message 148 * template.</p> 149 */ WithBody(const Aws::String & value)150 inline DefaultPushNotificationTemplate& WithBody(const Aws::String& value) { SetBody(value); return *this;} 151 152 /** 153 * <p>The message body to use in push notifications that are based on the message 154 * template.</p> 155 */ WithBody(Aws::String && value)156 inline DefaultPushNotificationTemplate& WithBody(Aws::String&& value) { SetBody(std::move(value)); return *this;} 157 158 /** 159 * <p>The message body to use in push notifications that are based on the message 160 * template.</p> 161 */ WithBody(const char * value)162 inline DefaultPushNotificationTemplate& WithBody(const char* value) { SetBody(value); return *this;} 163 164 165 /** 166 * <p>The sound to play when a recipient receives a push notification that's based 167 * on the message template. You can use the default stream or specify the file name 168 * of a sound resource that's bundled in your app. On an Android platform, the 169 * sound file must reside in /res/raw/.</p> <p>For an iOS platform, this value is 170 * the key for the name of a sound file in your app's main bundle or the 171 * Library/Sounds folder in your app's data container. If the sound file can't be 172 * found or you specify default for the value, the system plays the default alert 173 * sound.</p> 174 */ GetSound()175 inline const Aws::String& GetSound() const{ return m_sound; } 176 177 /** 178 * <p>The sound to play when a recipient receives a push notification that's based 179 * on the message template. You can use the default stream or specify the file name 180 * of a sound resource that's bundled in your app. On an Android platform, the 181 * sound file must reside in /res/raw/.</p> <p>For an iOS platform, this value is 182 * the key for the name of a sound file in your app's main bundle or the 183 * Library/Sounds folder in your app's data container. If the sound file can't be 184 * found or you specify default for the value, the system plays the default alert 185 * sound.</p> 186 */ SoundHasBeenSet()187 inline bool SoundHasBeenSet() const { return m_soundHasBeenSet; } 188 189 /** 190 * <p>The sound to play when a recipient receives a push notification that's based 191 * on the message template. You can use the default stream or specify the file name 192 * of a sound resource that's bundled in your app. On an Android platform, the 193 * sound file must reside in /res/raw/.</p> <p>For an iOS platform, this value is 194 * the key for the name of a sound file in your app's main bundle or the 195 * Library/Sounds folder in your app's data container. If the sound file can't be 196 * found or you specify default for the value, the system plays the default alert 197 * sound.</p> 198 */ SetSound(const Aws::String & value)199 inline void SetSound(const Aws::String& value) { m_soundHasBeenSet = true; m_sound = value; } 200 201 /** 202 * <p>The sound to play when a recipient receives a push notification that's based 203 * on the message template. You can use the default stream or specify the file name 204 * of a sound resource that's bundled in your app. On an Android platform, the 205 * sound file must reside in /res/raw/.</p> <p>For an iOS platform, this value is 206 * the key for the name of a sound file in your app's main bundle or the 207 * Library/Sounds folder in your app's data container. If the sound file can't be 208 * found or you specify default for the value, the system plays the default alert 209 * sound.</p> 210 */ SetSound(Aws::String && value)211 inline void SetSound(Aws::String&& value) { m_soundHasBeenSet = true; m_sound = std::move(value); } 212 213 /** 214 * <p>The sound to play when a recipient receives a push notification that's based 215 * on the message template. You can use the default stream or specify the file name 216 * of a sound resource that's bundled in your app. On an Android platform, the 217 * sound file must reside in /res/raw/.</p> <p>For an iOS platform, this value is 218 * the key for the name of a sound file in your app's main bundle or the 219 * Library/Sounds folder in your app's data container. If the sound file can't be 220 * found or you specify default for the value, the system plays the default alert 221 * sound.</p> 222 */ SetSound(const char * value)223 inline void SetSound(const char* value) { m_soundHasBeenSet = true; m_sound.assign(value); } 224 225 /** 226 * <p>The sound to play when a recipient receives a push notification that's based 227 * on the message template. You can use the default stream or specify the file name 228 * of a sound resource that's bundled in your app. On an Android platform, the 229 * sound file must reside in /res/raw/.</p> <p>For an iOS platform, this value is 230 * the key for the name of a sound file in your app's main bundle or the 231 * Library/Sounds folder in your app's data container. If the sound file can't be 232 * found or you specify default for the value, the system plays the default alert 233 * sound.</p> 234 */ WithSound(const Aws::String & value)235 inline DefaultPushNotificationTemplate& WithSound(const Aws::String& value) { SetSound(value); return *this;} 236 237 /** 238 * <p>The sound to play when a recipient receives a push notification that's based 239 * on the message template. You can use the default stream or specify the file name 240 * of a sound resource that's bundled in your app. On an Android platform, the 241 * sound file must reside in /res/raw/.</p> <p>For an iOS platform, this value is 242 * the key for the name of a sound file in your app's main bundle or the 243 * Library/Sounds folder in your app's data container. If the sound file can't be 244 * found or you specify default for the value, the system plays the default alert 245 * sound.</p> 246 */ WithSound(Aws::String && value)247 inline DefaultPushNotificationTemplate& WithSound(Aws::String&& value) { SetSound(std::move(value)); return *this;} 248 249 /** 250 * <p>The sound to play when a recipient receives a push notification that's based 251 * on the message template. You can use the default stream or specify the file name 252 * of a sound resource that's bundled in your app. On an Android platform, the 253 * sound file must reside in /res/raw/.</p> <p>For an iOS platform, this value is 254 * the key for the name of a sound file in your app's main bundle or the 255 * Library/Sounds folder in your app's data container. If the sound file can't be 256 * found or you specify default for the value, the system plays the default alert 257 * sound.</p> 258 */ WithSound(const char * value)259 inline DefaultPushNotificationTemplate& WithSound(const char* value) { SetSound(value); return *this;} 260 261 262 /** 263 * <p>The title to use in push notifications that are based on the message 264 * template. This title appears above the notification message on a recipient's 265 * device.</p> 266 */ GetTitle()267 inline const Aws::String& GetTitle() const{ return m_title; } 268 269 /** 270 * <p>The title to use in push notifications that are based on the message 271 * template. This title appears above the notification message on a recipient's 272 * device.</p> 273 */ TitleHasBeenSet()274 inline bool TitleHasBeenSet() const { return m_titleHasBeenSet; } 275 276 /** 277 * <p>The title to use in push notifications that are based on the message 278 * template. This title appears above the notification message on a recipient's 279 * device.</p> 280 */ SetTitle(const Aws::String & value)281 inline void SetTitle(const Aws::String& value) { m_titleHasBeenSet = true; m_title = value; } 282 283 /** 284 * <p>The title to use in push notifications that are based on the message 285 * template. This title appears above the notification message on a recipient's 286 * device.</p> 287 */ SetTitle(Aws::String && value)288 inline void SetTitle(Aws::String&& value) { m_titleHasBeenSet = true; m_title = std::move(value); } 289 290 /** 291 * <p>The title to use in push notifications that are based on the message 292 * template. This title appears above the notification message on a recipient's 293 * device.</p> 294 */ SetTitle(const char * value)295 inline void SetTitle(const char* value) { m_titleHasBeenSet = true; m_title.assign(value); } 296 297 /** 298 * <p>The title to use in push notifications that are based on the message 299 * template. This title appears above the notification message on a recipient's 300 * device.</p> 301 */ WithTitle(const Aws::String & value)302 inline DefaultPushNotificationTemplate& WithTitle(const Aws::String& value) { SetTitle(value); return *this;} 303 304 /** 305 * <p>The title to use in push notifications that are based on the message 306 * template. This title appears above the notification message on a recipient's 307 * device.</p> 308 */ WithTitle(Aws::String && value)309 inline DefaultPushNotificationTemplate& WithTitle(Aws::String&& value) { SetTitle(std::move(value)); return *this;} 310 311 /** 312 * <p>The title to use in push notifications that are based on the message 313 * template. This title appears above the notification message on a recipient's 314 * device.</p> 315 */ WithTitle(const char * value)316 inline DefaultPushNotificationTemplate& WithTitle(const char* value) { SetTitle(value); return *this;} 317 318 319 /** 320 * <p>The URL to open in a recipient's default mobile browser, if a recipient taps 321 * a push notification that's based on the message template and the value of the 322 * Action property is URL.</p> 323 */ GetUrl()324 inline const Aws::String& GetUrl() const{ return m_url; } 325 326 /** 327 * <p>The URL to open in a recipient's default mobile browser, if a recipient taps 328 * a push notification that's based on the message template and the value of the 329 * Action property is URL.</p> 330 */ UrlHasBeenSet()331 inline bool UrlHasBeenSet() const { return m_urlHasBeenSet; } 332 333 /** 334 * <p>The URL to open in a recipient's default mobile browser, if a recipient taps 335 * a push notification that's based on the message template and the value of the 336 * Action property is URL.</p> 337 */ SetUrl(const Aws::String & value)338 inline void SetUrl(const Aws::String& value) { m_urlHasBeenSet = true; m_url = value; } 339 340 /** 341 * <p>The URL to open in a recipient's default mobile browser, if a recipient taps 342 * a push notification that's based on the message template and the value of the 343 * Action property is URL.</p> 344 */ SetUrl(Aws::String && value)345 inline void SetUrl(Aws::String&& value) { m_urlHasBeenSet = true; m_url = std::move(value); } 346 347 /** 348 * <p>The URL to open in a recipient's default mobile browser, if a recipient taps 349 * a push notification that's based on the message template and the value of the 350 * Action property is URL.</p> 351 */ SetUrl(const char * value)352 inline void SetUrl(const char* value) { m_urlHasBeenSet = true; m_url.assign(value); } 353 354 /** 355 * <p>The URL to open in a recipient's default mobile browser, if a recipient taps 356 * a push notification that's based on the message template and the value of the 357 * Action property is URL.</p> 358 */ WithUrl(const Aws::String & value)359 inline DefaultPushNotificationTemplate& WithUrl(const Aws::String& value) { SetUrl(value); return *this;} 360 361 /** 362 * <p>The URL to open in a recipient's default mobile browser, if a recipient taps 363 * a push notification that's based on the message template and the value of the 364 * Action property is URL.</p> 365 */ WithUrl(Aws::String && value)366 inline DefaultPushNotificationTemplate& WithUrl(Aws::String&& value) { SetUrl(std::move(value)); return *this;} 367 368 /** 369 * <p>The URL to open in a recipient's default mobile browser, if a recipient taps 370 * a push notification that's based on the message template and the value of the 371 * Action property is URL.</p> 372 */ WithUrl(const char * value)373 inline DefaultPushNotificationTemplate& WithUrl(const char* value) { SetUrl(value); return *this;} 374 375 private: 376 377 Action m_action; 378 bool m_actionHasBeenSet; 379 380 Aws::String m_body; 381 bool m_bodyHasBeenSet; 382 383 Aws::String m_sound; 384 bool m_soundHasBeenSet; 385 386 Aws::String m_title; 387 bool m_titleHasBeenSet; 388 389 Aws::String m_url; 390 bool m_urlHasBeenSet; 391 }; 392 393 } // namespace Model 394 } // namespace Pinpoint 395 } // namespace Aws 396