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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The Amazon Simple Notification Service (Amazon SNS) notification settings associated with a specific job. The <code>Notification</code> object is returned as a part of the response syntax of the <code>DescribeJob</code> action in the <code>JobMetadata</code> data type.</p>
/// <p>When the notification settings are defined during job creation, you can choose to notify based on a specific set of job states using the <code>JobStatesToNotify</code> array of strings, or you can specify that you want to have Amazon SNS notifications sent out for all job states with <code>NotifyAll</code> set to true.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Notification {
/// <p>The new SNS <code>TopicArn</code> that you want to associate with this job. You can create Amazon Resource Names (ARNs) for topics by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html">CreateTopic</a> Amazon SNS API action.</p>
/// <p>You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management Console, or by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html">Subscribe</a> Amazon Simple Notification Service (Amazon SNS) API action.</p>
pub sns_topic_arn: ::std::option::Option<::std::string::String>,
/// <p>The list of job states that will trigger a notification for this job.</p>
pub job_states_to_notify: ::std::option::Option<::std::vec::Vec<crate::types::JobState>>,
/// <p>Any change in job state will trigger a notification for this job.</p>
pub notify_all: bool,
/// <p>Used to send SNS notifications for the person picking up the device (identified during job creation).</p>
pub device_pickup_sns_topic_arn: ::std::option::Option<::std::string::String>,
}
impl Notification {
/// <p>The new SNS <code>TopicArn</code> that you want to associate with this job. You can create Amazon Resource Names (ARNs) for topics by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html">CreateTopic</a> Amazon SNS API action.</p>
/// <p>You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management Console, or by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html">Subscribe</a> Amazon Simple Notification Service (Amazon SNS) API action.</p>
pub fn sns_topic_arn(&self) -> ::std::option::Option<&str> {
self.sns_topic_arn.as_deref()
}
/// <p>The list of job states that will trigger a notification for this job.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.job_states_to_notify.is_none()`.
pub fn job_states_to_notify(&self) -> &[crate::types::JobState] {
self.job_states_to_notify.as_deref().unwrap_or_default()
}
/// <p>Any change in job state will trigger a notification for this job.</p>
pub fn notify_all(&self) -> bool {
self.notify_all
}
/// <p>Used to send SNS notifications for the person picking up the device (identified during job creation).</p>
pub fn device_pickup_sns_topic_arn(&self) -> ::std::option::Option<&str> {
self.device_pickup_sns_topic_arn.as_deref()
}
}
impl Notification {
/// Creates a new builder-style object to manufacture [`Notification`](crate::types::Notification).
pub fn builder() -> crate::types::builders::NotificationBuilder {
crate::types::builders::NotificationBuilder::default()
}
}
/// A builder for [`Notification`](crate::types::Notification).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct NotificationBuilder {
pub(crate) sns_topic_arn: ::std::option::Option<::std::string::String>,
pub(crate) job_states_to_notify: ::std::option::Option<::std::vec::Vec<crate::types::JobState>>,
pub(crate) notify_all: ::std::option::Option<bool>,
pub(crate) device_pickup_sns_topic_arn: ::std::option::Option<::std::string::String>,
}
impl NotificationBuilder {
/// <p>The new SNS <code>TopicArn</code> that you want to associate with this job. You can create Amazon Resource Names (ARNs) for topics by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html">CreateTopic</a> Amazon SNS API action.</p>
/// <p>You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management Console, or by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html">Subscribe</a> Amazon Simple Notification Service (Amazon SNS) API action.</p>
pub fn sns_topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.sns_topic_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The new SNS <code>TopicArn</code> that you want to associate with this job. You can create Amazon Resource Names (ARNs) for topics by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html">CreateTopic</a> Amazon SNS API action.</p>
/// <p>You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management Console, or by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html">Subscribe</a> Amazon Simple Notification Service (Amazon SNS) API action.</p>
pub fn set_sns_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.sns_topic_arn = input;
self
}
/// <p>The new SNS <code>TopicArn</code> that you want to associate with this job. You can create Amazon Resource Names (ARNs) for topics by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html">CreateTopic</a> Amazon SNS API action.</p>
/// <p>You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management Console, or by using the <a href="https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html">Subscribe</a> Amazon Simple Notification Service (Amazon SNS) API action.</p>
pub fn get_sns_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.sns_topic_arn
}
/// Appends an item to `job_states_to_notify`.
///
/// To override the contents of this collection use [`set_job_states_to_notify`](Self::set_job_states_to_notify).
///
/// <p>The list of job states that will trigger a notification for this job.</p>
pub fn job_states_to_notify(mut self, input: crate::types::JobState) -> Self {
let mut v = self.job_states_to_notify.unwrap_or_default();
v.push(input);
self.job_states_to_notify = ::std::option::Option::Some(v);
self
}
/// <p>The list of job states that will trigger a notification for this job.</p>
pub fn set_job_states_to_notify(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::JobState>>) -> Self {
self.job_states_to_notify = input;
self
}
/// <p>The list of job states that will trigger a notification for this job.</p>
pub fn get_job_states_to_notify(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::JobState>> {
&self.job_states_to_notify
}
/// <p>Any change in job state will trigger a notification for this job.</p>
pub fn notify_all(mut self, input: bool) -> Self {
self.notify_all = ::std::option::Option::Some(input);
self
}
/// <p>Any change in job state will trigger a notification for this job.</p>
pub fn set_notify_all(mut self, input: ::std::option::Option<bool>) -> Self {
self.notify_all = input;
self
}
/// <p>Any change in job state will trigger a notification for this job.</p>
pub fn get_notify_all(&self) -> &::std::option::Option<bool> {
&self.notify_all
}
/// <p>Used to send SNS notifications for the person picking up the device (identified during job creation).</p>
pub fn device_pickup_sns_topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.device_pickup_sns_topic_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>Used to send SNS notifications for the person picking up the device (identified during job creation).</p>
pub fn set_device_pickup_sns_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.device_pickup_sns_topic_arn = input;
self
}
/// <p>Used to send SNS notifications for the person picking up the device (identified during job creation).</p>
pub fn get_device_pickup_sns_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.device_pickup_sns_topic_arn
}
/// Consumes the builder and constructs a [`Notification`](crate::types::Notification).
pub fn build(self) -> crate::types::Notification {
crate::types::Notification {
sns_topic_arn: self.sns_topic_arn,
job_states_to_notify: self.job_states_to_notify,
notify_all: self.notify_all.unwrap_or_default(),
device_pickup_sns_topic_arn: self.device_pickup_sns_topic_arn,
}
}
}