aws_sdk_pinpoint/types/_journey_push_message.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies the message configuration for a push notification that's sent to participants in a journey.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct JourneyPushMessage {
7 /// <p>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.</p>
8 /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
9 pub time_to_live: ::std::option::Option<::std::string::String>,
10}
11impl JourneyPushMessage {
12 /// <p>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.</p>
13 /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
14 pub fn time_to_live(&self) -> ::std::option::Option<&str> {
15 self.time_to_live.as_deref()
16 }
17}
18impl JourneyPushMessage {
19 /// Creates a new builder-style object to manufacture [`JourneyPushMessage`](crate::types::JourneyPushMessage).
20 pub fn builder() -> crate::types::builders::JourneyPushMessageBuilder {
21 crate::types::builders::JourneyPushMessageBuilder::default()
22 }
23}
24
25/// A builder for [`JourneyPushMessage`](crate::types::JourneyPushMessage).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct JourneyPushMessageBuilder {
29 pub(crate) time_to_live: ::std::option::Option<::std::string::String>,
30}
31impl JourneyPushMessageBuilder {
32 /// <p>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.</p>
33 /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
34 pub fn time_to_live(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
35 self.time_to_live = ::std::option::Option::Some(input.into());
36 self
37 }
38 /// <p>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.</p>
39 /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
40 pub fn set_time_to_live(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
41 self.time_to_live = input;
42 self
43 }
44 /// <p>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.</p>
45 /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
46 pub fn get_time_to_live(&self) -> &::std::option::Option<::std::string::String> {
47 &self.time_to_live
48 }
49 /// Consumes the builder and constructs a [`JourneyPushMessage`](crate::types::JourneyPushMessage).
50 pub fn build(self) -> crate::types::JourneyPushMessage {
51 crate::types::JourneyPushMessage {
52 time_to_live: self.time_to_live,
53 }
54 }
55}