aws_sdk_budgets/operation/update_notification/
_update_notification_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request of UpdateNotification</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateNotificationInput {
7    /// <p>The <code>accountId</code> that is associated with the budget whose notification you want to update.</p>
8    pub account_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the budget whose notification you want to update.</p>
10    pub budget_name: ::std::option::Option<::std::string::String>,
11    /// <p>The previous notification that is associated with a budget.</p>
12    pub old_notification: ::std::option::Option<crate::types::Notification>,
13    /// <p>The updated notification to be associated with a budget.</p>
14    pub new_notification: ::std::option::Option<crate::types::Notification>,
15}
16impl UpdateNotificationInput {
17    /// <p>The <code>accountId</code> that is associated with the budget whose notification you want to update.</p>
18    pub fn account_id(&self) -> ::std::option::Option<&str> {
19        self.account_id.as_deref()
20    }
21    /// <p>The name of the budget whose notification you want to update.</p>
22    pub fn budget_name(&self) -> ::std::option::Option<&str> {
23        self.budget_name.as_deref()
24    }
25    /// <p>The previous notification that is associated with a budget.</p>
26    pub fn old_notification(&self) -> ::std::option::Option<&crate::types::Notification> {
27        self.old_notification.as_ref()
28    }
29    /// <p>The updated notification to be associated with a budget.</p>
30    pub fn new_notification(&self) -> ::std::option::Option<&crate::types::Notification> {
31        self.new_notification.as_ref()
32    }
33}
34impl UpdateNotificationInput {
35    /// Creates a new builder-style object to manufacture [`UpdateNotificationInput`](crate::operation::update_notification::UpdateNotificationInput).
36    pub fn builder() -> crate::operation::update_notification::builders::UpdateNotificationInputBuilder {
37        crate::operation::update_notification::builders::UpdateNotificationInputBuilder::default()
38    }
39}
40
41/// A builder for [`UpdateNotificationInput`](crate::operation::update_notification::UpdateNotificationInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct UpdateNotificationInputBuilder {
45    pub(crate) account_id: ::std::option::Option<::std::string::String>,
46    pub(crate) budget_name: ::std::option::Option<::std::string::String>,
47    pub(crate) old_notification: ::std::option::Option<crate::types::Notification>,
48    pub(crate) new_notification: ::std::option::Option<crate::types::Notification>,
49}
50impl UpdateNotificationInputBuilder {
51    /// <p>The <code>accountId</code> that is associated with the budget whose notification you want to update.</p>
52    /// This field is required.
53    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.account_id = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>The <code>accountId</code> that is associated with the budget whose notification you want to update.</p>
58    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.account_id = input;
60        self
61    }
62    /// <p>The <code>accountId</code> that is associated with the budget whose notification you want to update.</p>
63    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
64        &self.account_id
65    }
66    /// <p>The name of the budget whose notification you want to update.</p>
67    /// This field is required.
68    pub fn budget_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.budget_name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The name of the budget whose notification you want to update.</p>
73    pub fn set_budget_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.budget_name = input;
75        self
76    }
77    /// <p>The name of the budget whose notification you want to update.</p>
78    pub fn get_budget_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.budget_name
80    }
81    /// <p>The previous notification that is associated with a budget.</p>
82    /// This field is required.
83    pub fn old_notification(mut self, input: crate::types::Notification) -> Self {
84        self.old_notification = ::std::option::Option::Some(input);
85        self
86    }
87    /// <p>The previous notification that is associated with a budget.</p>
88    pub fn set_old_notification(mut self, input: ::std::option::Option<crate::types::Notification>) -> Self {
89        self.old_notification = input;
90        self
91    }
92    /// <p>The previous notification that is associated with a budget.</p>
93    pub fn get_old_notification(&self) -> &::std::option::Option<crate::types::Notification> {
94        &self.old_notification
95    }
96    /// <p>The updated notification to be associated with a budget.</p>
97    /// This field is required.
98    pub fn new_notification(mut self, input: crate::types::Notification) -> Self {
99        self.new_notification = ::std::option::Option::Some(input);
100        self
101    }
102    /// <p>The updated notification to be associated with a budget.</p>
103    pub fn set_new_notification(mut self, input: ::std::option::Option<crate::types::Notification>) -> Self {
104        self.new_notification = input;
105        self
106    }
107    /// <p>The updated notification to be associated with a budget.</p>
108    pub fn get_new_notification(&self) -> &::std::option::Option<crate::types::Notification> {
109        &self.new_notification
110    }
111    /// Consumes the builder and constructs a [`UpdateNotificationInput`](crate::operation::update_notification::UpdateNotificationInput).
112    pub fn build(
113        self,
114    ) -> ::std::result::Result<crate::operation::update_notification::UpdateNotificationInput, ::aws_smithy_types::error::operation::BuildError> {
115        ::std::result::Result::Ok(crate::operation::update_notification::UpdateNotificationInput {
116            account_id: self.account_id,
117            budget_name: self.budget_name,
118            old_notification: self.old_notification,
119            new_notification: self.new_notification,
120        })
121    }
122}