aws_sdk_lookoutmetrics/operation/update_alert/
_update_alert_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateAlertInput {
6 pub alert_arn: ::std::option::Option<::std::string::String>,
8 pub alert_description: ::std::option::Option<::std::string::String>,
10 pub alert_sensitivity_threshold: ::std::option::Option<i32>,
12 pub action: ::std::option::Option<crate::types::Action>,
14 pub alert_filters: ::std::option::Option<crate::types::AlertFilters>,
16}
17impl UpdateAlertInput {
18 pub fn alert_arn(&self) -> ::std::option::Option<&str> {
20 self.alert_arn.as_deref()
21 }
22 pub fn alert_description(&self) -> ::std::option::Option<&str> {
24 self.alert_description.as_deref()
25 }
26 pub fn alert_sensitivity_threshold(&self) -> ::std::option::Option<i32> {
28 self.alert_sensitivity_threshold
29 }
30 pub fn action(&self) -> ::std::option::Option<&crate::types::Action> {
32 self.action.as_ref()
33 }
34 pub fn alert_filters(&self) -> ::std::option::Option<&crate::types::AlertFilters> {
36 self.alert_filters.as_ref()
37 }
38}
39impl UpdateAlertInput {
40 pub fn builder() -> crate::operation::update_alert::builders::UpdateAlertInputBuilder {
42 crate::operation::update_alert::builders::UpdateAlertInputBuilder::default()
43 }
44}
45
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct UpdateAlertInputBuilder {
50 pub(crate) alert_arn: ::std::option::Option<::std::string::String>,
51 pub(crate) alert_description: ::std::option::Option<::std::string::String>,
52 pub(crate) alert_sensitivity_threshold: ::std::option::Option<i32>,
53 pub(crate) action: ::std::option::Option<crate::types::Action>,
54 pub(crate) alert_filters: ::std::option::Option<crate::types::AlertFilters>,
55}
56impl UpdateAlertInputBuilder {
57 pub fn alert_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60 self.alert_arn = ::std::option::Option::Some(input.into());
61 self
62 }
63 pub fn set_alert_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65 self.alert_arn = input;
66 self
67 }
68 pub fn get_alert_arn(&self) -> &::std::option::Option<::std::string::String> {
70 &self.alert_arn
71 }
72 pub fn alert_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74 self.alert_description = ::std::option::Option::Some(input.into());
75 self
76 }
77 pub fn set_alert_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79 self.alert_description = input;
80 self
81 }
82 pub fn get_alert_description(&self) -> &::std::option::Option<::std::string::String> {
84 &self.alert_description
85 }
86 pub fn alert_sensitivity_threshold(mut self, input: i32) -> Self {
88 self.alert_sensitivity_threshold = ::std::option::Option::Some(input);
89 self
90 }
91 pub fn set_alert_sensitivity_threshold(mut self, input: ::std::option::Option<i32>) -> Self {
93 self.alert_sensitivity_threshold = input;
94 self
95 }
96 pub fn get_alert_sensitivity_threshold(&self) -> &::std::option::Option<i32> {
98 &self.alert_sensitivity_threshold
99 }
100 pub fn action(mut self, input: crate::types::Action) -> Self {
102 self.action = ::std::option::Option::Some(input);
103 self
104 }
105 pub fn set_action(mut self, input: ::std::option::Option<crate::types::Action>) -> Self {
107 self.action = input;
108 self
109 }
110 pub fn get_action(&self) -> &::std::option::Option<crate::types::Action> {
112 &self.action
113 }
114 pub fn alert_filters(mut self, input: crate::types::AlertFilters) -> Self {
116 self.alert_filters = ::std::option::Option::Some(input);
117 self
118 }
119 pub fn set_alert_filters(mut self, input: ::std::option::Option<crate::types::AlertFilters>) -> Self {
121 self.alert_filters = input;
122 self
123 }
124 pub fn get_alert_filters(&self) -> &::std::option::Option<crate::types::AlertFilters> {
126 &self.alert_filters
127 }
128 pub fn build(self) -> ::std::result::Result<crate::operation::update_alert::UpdateAlertInput, ::aws_smithy_types::error::operation::BuildError> {
130 ::std::result::Result::Ok(crate::operation::update_alert::UpdateAlertInput {
131 alert_arn: self.alert_arn,
132 alert_description: self.alert_description,
133 alert_sensitivity_threshold: self.alert_sensitivity_threshold,
134 action: self.action,
135 alert_filters: self.alert_filters,
136 })
137 }
138}