aws_sdk_lookoutmetrics/operation/update_alert/
_update_alert_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateAlertInput {
6    /// <p>The ARN of the alert to update.</p>
7    pub alert_arn: ::std::option::Option<::std::string::String>,
8    /// <p>A description of the alert.</p>
9    pub alert_description: ::std::option::Option<::std::string::String>,
10    /// <p>An integer from 0 to 100 specifying the alert sensitivity threshold.</p>
11    pub alert_sensitivity_threshold: ::std::option::Option<i32>,
12    /// <p>Action that will be triggered when there is an alert.</p>
13    pub action: ::std::option::Option<crate::types::Action>,
14    /// <p>The configuration of the alert filters, containing MetricList and DimensionFilterList.</p>
15    pub alert_filters: ::std::option::Option<crate::types::AlertFilters>,
16}
17impl UpdateAlertInput {
18    /// <p>The ARN of the alert to update.</p>
19    pub fn alert_arn(&self) -> ::std::option::Option<&str> {
20        self.alert_arn.as_deref()
21    }
22    /// <p>A description of the alert.</p>
23    pub fn alert_description(&self) -> ::std::option::Option<&str> {
24        self.alert_description.as_deref()
25    }
26    /// <p>An integer from 0 to 100 specifying the alert sensitivity threshold.</p>
27    pub fn alert_sensitivity_threshold(&self) -> ::std::option::Option<i32> {
28        self.alert_sensitivity_threshold
29    }
30    /// <p>Action that will be triggered when there is an alert.</p>
31    pub fn action(&self) -> ::std::option::Option<&crate::types::Action> {
32        self.action.as_ref()
33    }
34    /// <p>The configuration of the alert filters, containing MetricList and DimensionFilterList.</p>
35    pub fn alert_filters(&self) -> ::std::option::Option<&crate::types::AlertFilters> {
36        self.alert_filters.as_ref()
37    }
38}
39impl UpdateAlertInput {
40    /// Creates a new builder-style object to manufacture [`UpdateAlertInput`](crate::operation::update_alert::UpdateAlertInput).
41    pub fn builder() -> crate::operation::update_alert::builders::UpdateAlertInputBuilder {
42        crate::operation::update_alert::builders::UpdateAlertInputBuilder::default()
43    }
44}
45
46/// A builder for [`UpdateAlertInput`](crate::operation::update_alert::UpdateAlertInput).
47#[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    /// <p>The ARN of the alert to update.</p>
58    /// This field is required.
59    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    /// <p>The ARN of the alert to update.</p>
64    pub fn set_alert_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.alert_arn = input;
66        self
67    }
68    /// <p>The ARN of the alert to update.</p>
69    pub fn get_alert_arn(&self) -> &::std::option::Option<::std::string::String> {
70        &self.alert_arn
71    }
72    /// <p>A description of the alert.</p>
73    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    /// <p>A description of the alert.</p>
78    pub fn set_alert_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.alert_description = input;
80        self
81    }
82    /// <p>A description of the alert.</p>
83    pub fn get_alert_description(&self) -> &::std::option::Option<::std::string::String> {
84        &self.alert_description
85    }
86    /// <p>An integer from 0 to 100 specifying the alert sensitivity threshold.</p>
87    pub fn alert_sensitivity_threshold(mut self, input: i32) -> Self {
88        self.alert_sensitivity_threshold = ::std::option::Option::Some(input);
89        self
90    }
91    /// <p>An integer from 0 to 100 specifying the alert sensitivity threshold.</p>
92    pub fn set_alert_sensitivity_threshold(mut self, input: ::std::option::Option<i32>) -> Self {
93        self.alert_sensitivity_threshold = input;
94        self
95    }
96    /// <p>An integer from 0 to 100 specifying the alert sensitivity threshold.</p>
97    pub fn get_alert_sensitivity_threshold(&self) -> &::std::option::Option<i32> {
98        &self.alert_sensitivity_threshold
99    }
100    /// <p>Action that will be triggered when there is an alert.</p>
101    pub fn action(mut self, input: crate::types::Action) -> Self {
102        self.action = ::std::option::Option::Some(input);
103        self
104    }
105    /// <p>Action that will be triggered when there is an alert.</p>
106    pub fn set_action(mut self, input: ::std::option::Option<crate::types::Action>) -> Self {
107        self.action = input;
108        self
109    }
110    /// <p>Action that will be triggered when there is an alert.</p>
111    pub fn get_action(&self) -> &::std::option::Option<crate::types::Action> {
112        &self.action
113    }
114    /// <p>The configuration of the alert filters, containing MetricList and DimensionFilterList.</p>
115    pub fn alert_filters(mut self, input: crate::types::AlertFilters) -> Self {
116        self.alert_filters = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>The configuration of the alert filters, containing MetricList and DimensionFilterList.</p>
120    pub fn set_alert_filters(mut self, input: ::std::option::Option<crate::types::AlertFilters>) -> Self {
121        self.alert_filters = input;
122        self
123    }
124    /// <p>The configuration of the alert filters, containing MetricList and DimensionFilterList.</p>
125    pub fn get_alert_filters(&self) -> &::std::option::Option<crate::types::AlertFilters> {
126        &self.alert_filters
127    }
128    /// Consumes the builder and constructs a [`UpdateAlertInput`](crate::operation::update_alert::UpdateAlertInput).
129    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}