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 channel-specific content and settings for a message template that
29    * can be used in push notifications that are sent through the APNs (Apple Push
30    * Notification service) channel.</p><p><h3>See Also:</h3>   <a
31    * href="http://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/APNSPushNotificationTemplate">AWS
32    * API Reference</a></p>
33    */
34   class AWS_PINPOINT_API APNSPushNotificationTemplate
35   {
36   public:
37     APNSPushNotificationTemplate();
38     APNSPushNotificationTemplate(Aws::Utils::Json::JsonView jsonValue);
39     APNSPushNotificationTemplate& 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 platform.</p></li> <li><p>URL - The default mobile browser
50      * on the recipient's device opens and loads the web page at a URL that you
51      * 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 platform.</p></li> <li><p>URL - The default mobile browser
62      * on the recipient's device opens and loads the web page at a URL that you
63      * 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 platform.</p></li> <li><p>URL - The default mobile browser
74      * on the recipient's device opens and loads the web page at a URL that you
75      * 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 platform.</p></li> <li><p>URL - The default mobile browser
86      * on the recipient's device opens and loads the web page at a URL that you
87      * 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 platform.</p></li> <li><p>URL - The default mobile browser
98      * on the recipient's device opens and loads the web page at a URL that you
99      * specify.</p></li></ul>
100      */
WithAction(const Action & value)101     inline APNSPushNotificationTemplate& 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 platform.</p></li> <li><p>URL - The default mobile browser
110      * on the recipient's device opens and loads the web page at a URL that you
111      * specify.</p></li></ul>
112      */
WithAction(Action && value)113     inline APNSPushNotificationTemplate& 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 APNSPushNotificationTemplate& 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 APNSPushNotificationTemplate& 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 APNSPushNotificationTemplate& WithBody(const char* value) { SetBody(value); return *this;}
163 
164 
165     /**
166      * <p>The URL of an image or video to display in push notifications that are based
167      * on the message template.</p>
168      */
GetMediaUrl()169     inline const Aws::String& GetMediaUrl() const{ return m_mediaUrl; }
170 
171     /**
172      * <p>The URL of an image or video to display in push notifications that are based
173      * on the message template.</p>
174      */
MediaUrlHasBeenSet()175     inline bool MediaUrlHasBeenSet() const { return m_mediaUrlHasBeenSet; }
176 
177     /**
178      * <p>The URL of an image or video to display in push notifications that are based
179      * on the message template.</p>
180      */
SetMediaUrl(const Aws::String & value)181     inline void SetMediaUrl(const Aws::String& value) { m_mediaUrlHasBeenSet = true; m_mediaUrl = value; }
182 
183     /**
184      * <p>The URL of an image or video to display in push notifications that are based
185      * on the message template.</p>
186      */
SetMediaUrl(Aws::String && value)187     inline void SetMediaUrl(Aws::String&& value) { m_mediaUrlHasBeenSet = true; m_mediaUrl = std::move(value); }
188 
189     /**
190      * <p>The URL of an image or video to display in push notifications that are based
191      * on the message template.</p>
192      */
SetMediaUrl(const char * value)193     inline void SetMediaUrl(const char* value) { m_mediaUrlHasBeenSet = true; m_mediaUrl.assign(value); }
194 
195     /**
196      * <p>The URL of an image or video to display in push notifications that are based
197      * on the message template.</p>
198      */
WithMediaUrl(const Aws::String & value)199     inline APNSPushNotificationTemplate& WithMediaUrl(const Aws::String& value) { SetMediaUrl(value); return *this;}
200 
201     /**
202      * <p>The URL of an image or video to display in push notifications that are based
203      * on the message template.</p>
204      */
WithMediaUrl(Aws::String && value)205     inline APNSPushNotificationTemplate& WithMediaUrl(Aws::String&& value) { SetMediaUrl(std::move(value)); return *this;}
206 
207     /**
208      * <p>The URL of an image or video to display in push notifications that are based
209      * on the message template.</p>
210      */
WithMediaUrl(const char * value)211     inline APNSPushNotificationTemplate& WithMediaUrl(const char* value) { SetMediaUrl(value); return *this;}
212 
213 
214     /**
215      * <p>The raw, JSON-formatted string to use as the payload for push notifications
216      * that are based on the message template. If specified, this value overrides all
217      * other content for the message template.</p>
218      */
GetRawContent()219     inline const Aws::String& GetRawContent() const{ return m_rawContent; }
220 
221     /**
222      * <p>The raw, JSON-formatted string to use as the payload for push notifications
223      * that are based on the message template. If specified, this value overrides all
224      * other content for the message template.</p>
225      */
RawContentHasBeenSet()226     inline bool RawContentHasBeenSet() const { return m_rawContentHasBeenSet; }
227 
228     /**
229      * <p>The raw, JSON-formatted string to use as the payload for push notifications
230      * that are based on the message template. If specified, this value overrides all
231      * other content for the message template.</p>
232      */
SetRawContent(const Aws::String & value)233     inline void SetRawContent(const Aws::String& value) { m_rawContentHasBeenSet = true; m_rawContent = value; }
234 
235     /**
236      * <p>The raw, JSON-formatted string to use as the payload for push notifications
237      * that are based on the message template. If specified, this value overrides all
238      * other content for the message template.</p>
239      */
SetRawContent(Aws::String && value)240     inline void SetRawContent(Aws::String&& value) { m_rawContentHasBeenSet = true; m_rawContent = std::move(value); }
241 
242     /**
243      * <p>The raw, JSON-formatted string to use as the payload for push notifications
244      * that are based on the message template. If specified, this value overrides all
245      * other content for the message template.</p>
246      */
SetRawContent(const char * value)247     inline void SetRawContent(const char* value) { m_rawContentHasBeenSet = true; m_rawContent.assign(value); }
248 
249     /**
250      * <p>The raw, JSON-formatted string to use as the payload for push notifications
251      * that are based on the message template. If specified, this value overrides all
252      * other content for the message template.</p>
253      */
WithRawContent(const Aws::String & value)254     inline APNSPushNotificationTemplate& WithRawContent(const Aws::String& value) { SetRawContent(value); return *this;}
255 
256     /**
257      * <p>The raw, JSON-formatted string to use as the payload for push notifications
258      * that are based on the message template. If specified, this value overrides all
259      * other content for the message template.</p>
260      */
WithRawContent(Aws::String && value)261     inline APNSPushNotificationTemplate& WithRawContent(Aws::String&& value) { SetRawContent(std::move(value)); return *this;}
262 
263     /**
264      * <p>The raw, JSON-formatted string to use as the payload for push notifications
265      * that are based on the message template. If specified, this value overrides all
266      * other content for the message template.</p>
267      */
WithRawContent(const char * value)268     inline APNSPushNotificationTemplate& WithRawContent(const char* value) { SetRawContent(value); return *this;}
269 
270 
271     /**
272      * <p>The key for the sound to play when the recipient receives a push notification
273      * that's based on the message template. The value for this key is the name of a
274      * sound file in your app's main bundle or the Library/Sounds folder in your app's
275      * data container. If the sound file can't be found or you specify default for the
276      * value, the system plays the default alert sound.</p>
277      */
GetSound()278     inline const Aws::String& GetSound() const{ return m_sound; }
279 
280     /**
281      * <p>The key for the sound to play when the recipient receives a push notification
282      * that's based on the message template. The value for this key is the name of a
283      * sound file in your app's main bundle or the Library/Sounds folder in your app's
284      * data container. If the sound file can't be found or you specify default for the
285      * value, the system plays the default alert sound.</p>
286      */
SoundHasBeenSet()287     inline bool SoundHasBeenSet() const { return m_soundHasBeenSet; }
288 
289     /**
290      * <p>The key for the sound to play when the recipient receives a push notification
291      * that's based on the message template. The value for this key is the name of a
292      * sound file in your app's main bundle or the Library/Sounds folder in your app's
293      * data container. If the sound file can't be found or you specify default for the
294      * value, the system plays the default alert sound.</p>
295      */
SetSound(const Aws::String & value)296     inline void SetSound(const Aws::String& value) { m_soundHasBeenSet = true; m_sound = value; }
297 
298     /**
299      * <p>The key for the sound to play when the recipient receives a push notification
300      * that's based on the message template. The value for this key is the name of a
301      * sound file in your app's main bundle or the Library/Sounds folder in your app's
302      * data container. If the sound file can't be found or you specify default for the
303      * value, the system plays the default alert sound.</p>
304      */
SetSound(Aws::String && value)305     inline void SetSound(Aws::String&& value) { m_soundHasBeenSet = true; m_sound = std::move(value); }
306 
307     /**
308      * <p>The key for the sound to play when the recipient receives a push notification
309      * that's based on the message template. The value for this key is the name of a
310      * sound file in your app's main bundle or the Library/Sounds folder in your app's
311      * data container. If the sound file can't be found or you specify default for the
312      * value, the system plays the default alert sound.</p>
313      */
SetSound(const char * value)314     inline void SetSound(const char* value) { m_soundHasBeenSet = true; m_sound.assign(value); }
315 
316     /**
317      * <p>The key for the sound to play when the recipient receives a push notification
318      * that's based on the message template. The value for this key is the name of a
319      * sound file in your app's main bundle or the Library/Sounds folder in your app's
320      * data container. If the sound file can't be found or you specify default for the
321      * value, the system plays the default alert sound.</p>
322      */
WithSound(const Aws::String & value)323     inline APNSPushNotificationTemplate& WithSound(const Aws::String& value) { SetSound(value); return *this;}
324 
325     /**
326      * <p>The key for the sound to play when the recipient receives a push notification
327      * that's based on the message template. The value for this key is the name of a
328      * sound file in your app's main bundle or the Library/Sounds folder in your app's
329      * data container. If the sound file can't be found or you specify default for the
330      * value, the system plays the default alert sound.</p>
331      */
WithSound(Aws::String && value)332     inline APNSPushNotificationTemplate& WithSound(Aws::String&& value) { SetSound(std::move(value)); return *this;}
333 
334     /**
335      * <p>The key for the sound to play when the recipient receives a push notification
336      * that's based on the message template. The value for this key is the name of a
337      * sound file in your app's main bundle or the Library/Sounds folder in your app's
338      * data container. If the sound file can't be found or you specify default for the
339      * value, the system plays the default alert sound.</p>
340      */
WithSound(const char * value)341     inline APNSPushNotificationTemplate& WithSound(const char* value) { SetSound(value); return *this;}
342 
343 
344     /**
345      * <p>The title to use in push notifications that are based on the message
346      * template. This title appears above the notification message on a recipient's
347      * device.</p>
348      */
GetTitle()349     inline const Aws::String& GetTitle() const{ return m_title; }
350 
351     /**
352      * <p>The title to use in push notifications that are based on the message
353      * template. This title appears above the notification message on a recipient's
354      * device.</p>
355      */
TitleHasBeenSet()356     inline bool TitleHasBeenSet() const { return m_titleHasBeenSet; }
357 
358     /**
359      * <p>The title to use in push notifications that are based on the message
360      * template. This title appears above the notification message on a recipient's
361      * device.</p>
362      */
SetTitle(const Aws::String & value)363     inline void SetTitle(const Aws::String& value) { m_titleHasBeenSet = true; m_title = value; }
364 
365     /**
366      * <p>The title to use in push notifications that are based on the message
367      * template. This title appears above the notification message on a recipient's
368      * device.</p>
369      */
SetTitle(Aws::String && value)370     inline void SetTitle(Aws::String&& value) { m_titleHasBeenSet = true; m_title = std::move(value); }
371 
372     /**
373      * <p>The title to use in push notifications that are based on the message
374      * template. This title appears above the notification message on a recipient's
375      * device.</p>
376      */
SetTitle(const char * value)377     inline void SetTitle(const char* value) { m_titleHasBeenSet = true; m_title.assign(value); }
378 
379     /**
380      * <p>The title to use in push notifications that are based on the message
381      * template. This title appears above the notification message on a recipient's
382      * device.</p>
383      */
WithTitle(const Aws::String & value)384     inline APNSPushNotificationTemplate& WithTitle(const Aws::String& value) { SetTitle(value); return *this;}
385 
386     /**
387      * <p>The title to use in push notifications that are based on the message
388      * template. This title appears above the notification message on a recipient's
389      * device.</p>
390      */
WithTitle(Aws::String && value)391     inline APNSPushNotificationTemplate& WithTitle(Aws::String&& value) { SetTitle(std::move(value)); return *this;}
392 
393     /**
394      * <p>The title to use in push notifications that are based on the message
395      * template. This title appears above the notification message on a recipient's
396      * device.</p>
397      */
WithTitle(const char * value)398     inline APNSPushNotificationTemplate& WithTitle(const char* value) { SetTitle(value); return *this;}
399 
400 
401     /**
402      * <p>The URL to open in the recipient's default mobile browser, if a recipient
403      * taps a push notification that's based on the message template and the value of
404      * the Action property is URL.</p>
405      */
GetUrl()406     inline const Aws::String& GetUrl() const{ return m_url; }
407 
408     /**
409      * <p>The URL to open in the recipient's default mobile browser, if a recipient
410      * taps a push notification that's based on the message template and the value of
411      * the Action property is URL.</p>
412      */
UrlHasBeenSet()413     inline bool UrlHasBeenSet() const { return m_urlHasBeenSet; }
414 
415     /**
416      * <p>The URL to open in the recipient's default mobile browser, if a recipient
417      * taps a push notification that's based on the message template and the value of
418      * the Action property is URL.</p>
419      */
SetUrl(const Aws::String & value)420     inline void SetUrl(const Aws::String& value) { m_urlHasBeenSet = true; m_url = value; }
421 
422     /**
423      * <p>The URL to open in the recipient's default mobile browser, if a recipient
424      * taps a push notification that's based on the message template and the value of
425      * the Action property is URL.</p>
426      */
SetUrl(Aws::String && value)427     inline void SetUrl(Aws::String&& value) { m_urlHasBeenSet = true; m_url = std::move(value); }
428 
429     /**
430      * <p>The URL to open in the recipient's default mobile browser, if a recipient
431      * taps a push notification that's based on the message template and the value of
432      * the Action property is URL.</p>
433      */
SetUrl(const char * value)434     inline void SetUrl(const char* value) { m_urlHasBeenSet = true; m_url.assign(value); }
435 
436     /**
437      * <p>The URL to open in the recipient's default mobile browser, if a recipient
438      * taps a push notification that's based on the message template and the value of
439      * the Action property is URL.</p>
440      */
WithUrl(const Aws::String & value)441     inline APNSPushNotificationTemplate& WithUrl(const Aws::String& value) { SetUrl(value); return *this;}
442 
443     /**
444      * <p>The URL to open in the recipient's default mobile browser, if a recipient
445      * taps a push notification that's based on the message template and the value of
446      * the Action property is URL.</p>
447      */
WithUrl(Aws::String && value)448     inline APNSPushNotificationTemplate& WithUrl(Aws::String&& value) { SetUrl(std::move(value)); return *this;}
449 
450     /**
451      * <p>The URL to open in the recipient's default mobile browser, if a recipient
452      * taps a push notification that's based on the message template and the value of
453      * the Action property is URL.</p>
454      */
WithUrl(const char * value)455     inline APNSPushNotificationTemplate& WithUrl(const char* value) { SetUrl(value); return *this;}
456 
457   private:
458 
459     Action m_action;
460     bool m_actionHasBeenSet;
461 
462     Aws::String m_body;
463     bool m_bodyHasBeenSet;
464 
465     Aws::String m_mediaUrl;
466     bool m_mediaUrlHasBeenSet;
467 
468     Aws::String m_rawContent;
469     bool m_rawContentHasBeenSet;
470 
471     Aws::String m_sound;
472     bool m_soundHasBeenSet;
473 
474     Aws::String m_title;
475     bool m_titleHasBeenSet;
476 
477     Aws::String m_url;
478     bool m_urlHasBeenSet;
479   };
480 
481 } // namespace Model
482 } // namespace Pinpoint
483 } // namespace Aws
484