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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies the message configuration for a push notification that's sent to participants in a journey.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct JourneyPushMessage {
    /// <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>
    /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
    pub time_to_live: ::std::option::Option<::std::string::String>,
}
impl JourneyPushMessage {
    /// <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>
    /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
    pub fn time_to_live(&self) -> ::std::option::Option<&str> {
        self.time_to_live.as_deref()
    }
}
impl JourneyPushMessage {
    /// Creates a new builder-style object to manufacture [`JourneyPushMessage`](crate::types::JourneyPushMessage).
    pub fn builder() -> crate::types::builders::JourneyPushMessageBuilder {
        crate::types::builders::JourneyPushMessageBuilder::default()
    }
}

/// A builder for [`JourneyPushMessage`](crate::types::JourneyPushMessage).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct JourneyPushMessageBuilder {
    pub(crate) time_to_live: ::std::option::Option<::std::string::String>,
}
impl JourneyPushMessageBuilder {
    /// <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>
    /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
    pub fn time_to_live(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.time_to_live = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
    pub fn set_time_to_live(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.time_to_live = input;
        self
    }
    /// <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>
    /// <p>This value doesn't apply to messages that are sent through the Amazon Device Messaging (ADM) service.</p>
    pub fn get_time_to_live(&self) -> &::std::option::Option<::std::string::String> {
        &self.time_to_live
    }
    /// Consumes the builder and constructs a [`JourneyPushMessage`](crate::types::JourneyPushMessage).
    pub fn build(self) -> crate::types::JourneyPushMessage {
        crate::types::JourneyPushMessage {
            time_to_live: self.time_to_live,
        }
    }
}