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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p> Request of CreateNotification </p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateNotificationInput {
/// <p>The <code>accountId</code> that is associated with the budget that you want to create a notification for.</p>
pub account_id: ::std::option::Option<::std::string::String>,
/// <p>The name of the budget that you want Amazon Web Services to notify you about. Budget names must be unique within an account.</p>
pub budget_name: ::std::option::Option<::std::string::String>,
/// <p>The notification that you want to create.</p>
pub notification: ::std::option::Option<crate::types::Notification>,
/// <p>A list of subscribers that you want to associate with the notification. Each notification can have one SNS subscriber and up to 10 email subscribers.</p>
pub subscribers: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>,
}
impl CreateNotificationInput {
/// <p>The <code>accountId</code> that is associated with the budget that you want to create a notification for.</p>
pub fn account_id(&self) -> ::std::option::Option<&str> {
self.account_id.as_deref()
}
/// <p>The name of the budget that you want Amazon Web Services to notify you about. Budget names must be unique within an account.</p>
pub fn budget_name(&self) -> ::std::option::Option<&str> {
self.budget_name.as_deref()
}
/// <p>The notification that you want to create.</p>
pub fn notification(&self) -> ::std::option::Option<&crate::types::Notification> {
self.notification.as_ref()
}
/// <p>A list of subscribers that you want to associate with the notification. Each notification can have one SNS subscriber and up to 10 email subscribers.</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 `.subscribers.is_none()`.
pub fn subscribers(&self) -> &[crate::types::Subscriber] {
self.subscribers.as_deref().unwrap_or_default()
}
}
impl CreateNotificationInput {
/// Creates a new builder-style object to manufacture [`CreateNotificationInput`](crate::operation::create_notification::CreateNotificationInput).
pub fn builder() -> crate::operation::create_notification::builders::CreateNotificationInputBuilder {
crate::operation::create_notification::builders::CreateNotificationInputBuilder::default()
}
}
/// A builder for [`CreateNotificationInput`](crate::operation::create_notification::CreateNotificationInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateNotificationInputBuilder {
pub(crate) account_id: ::std::option::Option<::std::string::String>,
pub(crate) budget_name: ::std::option::Option<::std::string::String>,
pub(crate) notification: ::std::option::Option<crate::types::Notification>,
pub(crate) subscribers: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>,
}
impl CreateNotificationInputBuilder {
/// <p>The <code>accountId</code> that is associated with the budget that you want to create a notification for.</p>
/// This field is required.
pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.account_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The <code>accountId</code> that is associated with the budget that you want to create a notification for.</p>
pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.account_id = input;
self
}
/// <p>The <code>accountId</code> that is associated with the budget that you want to create a notification for.</p>
pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.account_id
}
/// <p>The name of the budget that you want Amazon Web Services to notify you about. Budget names must be unique within an account.</p>
/// This field is required.
pub fn budget_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.budget_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the budget that you want Amazon Web Services to notify you about. Budget names must be unique within an account.</p>
pub fn set_budget_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.budget_name = input;
self
}
/// <p>The name of the budget that you want Amazon Web Services to notify you about. Budget names must be unique within an account.</p>
pub fn get_budget_name(&self) -> &::std::option::Option<::std::string::String> {
&self.budget_name
}
/// <p>The notification that you want to create.</p>
/// This field is required.
pub fn notification(mut self, input: crate::types::Notification) -> Self {
self.notification = ::std::option::Option::Some(input);
self
}
/// <p>The notification that you want to create.</p>
pub fn set_notification(mut self, input: ::std::option::Option<crate::types::Notification>) -> Self {
self.notification = input;
self
}
/// <p>The notification that you want to create.</p>
pub fn get_notification(&self) -> &::std::option::Option<crate::types::Notification> {
&self.notification
}
/// Appends an item to `subscribers`.
///
/// To override the contents of this collection use [`set_subscribers`](Self::set_subscribers).
///
/// <p>A list of subscribers that you want to associate with the notification. Each notification can have one SNS subscriber and up to 10 email subscribers.</p>
pub fn subscribers(mut self, input: crate::types::Subscriber) -> Self {
let mut v = self.subscribers.unwrap_or_default();
v.push(input);
self.subscribers = ::std::option::Option::Some(v);
self
}
/// <p>A list of subscribers that you want to associate with the notification. Each notification can have one SNS subscriber and up to 10 email subscribers.</p>
pub fn set_subscribers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>) -> Self {
self.subscribers = input;
self
}
/// <p>A list of subscribers that you want to associate with the notification. Each notification can have one SNS subscriber and up to 10 email subscribers.</p>
pub fn get_subscribers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Subscriber>> {
&self.subscribers
}
/// Consumes the builder and constructs a [`CreateNotificationInput`](crate::operation::create_notification::CreateNotificationInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_notification::CreateNotificationInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_notification::CreateNotificationInput {
account_id: self.account_id,
budget_name: self.budget_name,
notification: self.notification,
subscribers: self.subscribers,
})
}
}