aws_sdk_cloudwatchlogs/operation/update_anomaly/_update_anomaly_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 UpdateAnomalyInput {
6 /// <p>If you are suppressing or unsuppressing an anomaly, specify its unique ID here. You can find anomaly IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
7 pub anomaly_id: ::std::option::Option<::std::string::String>,
8 /// <p>If you are suppressing or unsuppressing an pattern, specify its unique ID here. You can find pattern IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
9 pub pattern_id: ::std::option::Option<::std::string::String>,
10 /// <p>The ARN of the anomaly detector that this operation is to act on.</p>
11 pub anomaly_detector_arn: ::std::option::Option<::std::string::String>,
12 /// <p>Use this to specify whether the suppression to be temporary or infinite. If you specify <code>LIMITED</code>, you must also specify a <code>suppressionPeriod</code>. If you specify <code>INFINITE</code>, any value for <code>suppressionPeriod</code> is ignored.</p>
13 pub suppression_type: ::std::option::Option<crate::types::SuppressionType>,
14 /// <p>If you are temporarily suppressing an anomaly or pattern, use this structure to specify how long the suppression is to last.</p>
15 pub suppression_period: ::std::option::Option<crate::types::SuppressionPeriod>,
16 /// <p>Set this to <code>true</code> to prevent CloudWatch Logs from displaying this behavior as an anomaly in the future. The behavior is then treated as baseline behavior. However, if similar but more severe occurrences of this behavior occur in the future, those will still be reported as anomalies.</p>
17 /// <p>The default is <code>false</code></p>
18 pub baseline: ::std::option::Option<bool>,
19}
20impl UpdateAnomalyInput {
21 /// <p>If you are suppressing or unsuppressing an anomaly, specify its unique ID here. You can find anomaly IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
22 pub fn anomaly_id(&self) -> ::std::option::Option<&str> {
23 self.anomaly_id.as_deref()
24 }
25 /// <p>If you are suppressing or unsuppressing an pattern, specify its unique ID here. You can find pattern IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
26 pub fn pattern_id(&self) -> ::std::option::Option<&str> {
27 self.pattern_id.as_deref()
28 }
29 /// <p>The ARN of the anomaly detector that this operation is to act on.</p>
30 pub fn anomaly_detector_arn(&self) -> ::std::option::Option<&str> {
31 self.anomaly_detector_arn.as_deref()
32 }
33 /// <p>Use this to specify whether the suppression to be temporary or infinite. If you specify <code>LIMITED</code>, you must also specify a <code>suppressionPeriod</code>. If you specify <code>INFINITE</code>, any value for <code>suppressionPeriod</code> is ignored.</p>
34 pub fn suppression_type(&self) -> ::std::option::Option<&crate::types::SuppressionType> {
35 self.suppression_type.as_ref()
36 }
37 /// <p>If you are temporarily suppressing an anomaly or pattern, use this structure to specify how long the suppression is to last.</p>
38 pub fn suppression_period(&self) -> ::std::option::Option<&crate::types::SuppressionPeriod> {
39 self.suppression_period.as_ref()
40 }
41 /// <p>Set this to <code>true</code> to prevent CloudWatch Logs from displaying this behavior as an anomaly in the future. The behavior is then treated as baseline behavior. However, if similar but more severe occurrences of this behavior occur in the future, those will still be reported as anomalies.</p>
42 /// <p>The default is <code>false</code></p>
43 pub fn baseline(&self) -> ::std::option::Option<bool> {
44 self.baseline
45 }
46}
47impl UpdateAnomalyInput {
48 /// Creates a new builder-style object to manufacture [`UpdateAnomalyInput`](crate::operation::update_anomaly::UpdateAnomalyInput).
49 pub fn builder() -> crate::operation::update_anomaly::builders::UpdateAnomalyInputBuilder {
50 crate::operation::update_anomaly::builders::UpdateAnomalyInputBuilder::default()
51 }
52}
53
54/// A builder for [`UpdateAnomalyInput`](crate::operation::update_anomaly::UpdateAnomalyInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct UpdateAnomalyInputBuilder {
58 pub(crate) anomaly_id: ::std::option::Option<::std::string::String>,
59 pub(crate) pattern_id: ::std::option::Option<::std::string::String>,
60 pub(crate) anomaly_detector_arn: ::std::option::Option<::std::string::String>,
61 pub(crate) suppression_type: ::std::option::Option<crate::types::SuppressionType>,
62 pub(crate) suppression_period: ::std::option::Option<crate::types::SuppressionPeriod>,
63 pub(crate) baseline: ::std::option::Option<bool>,
64}
65impl UpdateAnomalyInputBuilder {
66 /// <p>If you are suppressing or unsuppressing an anomaly, specify its unique ID here. You can find anomaly IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
67 pub fn anomaly_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68 self.anomaly_id = ::std::option::Option::Some(input.into());
69 self
70 }
71 /// <p>If you are suppressing or unsuppressing an anomaly, specify its unique ID here. You can find anomaly IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
72 pub fn set_anomaly_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73 self.anomaly_id = input;
74 self
75 }
76 /// <p>If you are suppressing or unsuppressing an anomaly, specify its unique ID here. You can find anomaly IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
77 pub fn get_anomaly_id(&self) -> &::std::option::Option<::std::string::String> {
78 &self.anomaly_id
79 }
80 /// <p>If you are suppressing or unsuppressing an pattern, specify its unique ID here. You can find pattern IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
81 pub fn pattern_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.pattern_id = ::std::option::Option::Some(input.into());
83 self
84 }
85 /// <p>If you are suppressing or unsuppressing an pattern, specify its unique ID here. You can find pattern IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
86 pub fn set_pattern_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.pattern_id = input;
88 self
89 }
90 /// <p>If you are suppressing or unsuppressing an pattern, specify its unique ID here. You can find pattern IDs by using the <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html">ListAnomalies</a> operation.</p>
91 pub fn get_pattern_id(&self) -> &::std::option::Option<::std::string::String> {
92 &self.pattern_id
93 }
94 /// <p>The ARN of the anomaly detector that this operation is to act on.</p>
95 /// This field is required.
96 pub fn anomaly_detector_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.anomaly_detector_arn = ::std::option::Option::Some(input.into());
98 self
99 }
100 /// <p>The ARN of the anomaly detector that this operation is to act on.</p>
101 pub fn set_anomaly_detector_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.anomaly_detector_arn = input;
103 self
104 }
105 /// <p>The ARN of the anomaly detector that this operation is to act on.</p>
106 pub fn get_anomaly_detector_arn(&self) -> &::std::option::Option<::std::string::String> {
107 &self.anomaly_detector_arn
108 }
109 /// <p>Use this to specify whether the suppression to be temporary or infinite. If you specify <code>LIMITED</code>, you must also specify a <code>suppressionPeriod</code>. If you specify <code>INFINITE</code>, any value for <code>suppressionPeriod</code> is ignored.</p>
110 pub fn suppression_type(mut self, input: crate::types::SuppressionType) -> Self {
111 self.suppression_type = ::std::option::Option::Some(input);
112 self
113 }
114 /// <p>Use this to specify whether the suppression to be temporary or infinite. If you specify <code>LIMITED</code>, you must also specify a <code>suppressionPeriod</code>. If you specify <code>INFINITE</code>, any value for <code>suppressionPeriod</code> is ignored.</p>
115 pub fn set_suppression_type(mut self, input: ::std::option::Option<crate::types::SuppressionType>) -> Self {
116 self.suppression_type = input;
117 self
118 }
119 /// <p>Use this to specify whether the suppression to be temporary or infinite. If you specify <code>LIMITED</code>, you must also specify a <code>suppressionPeriod</code>. If you specify <code>INFINITE</code>, any value for <code>suppressionPeriod</code> is ignored.</p>
120 pub fn get_suppression_type(&self) -> &::std::option::Option<crate::types::SuppressionType> {
121 &self.suppression_type
122 }
123 /// <p>If you are temporarily suppressing an anomaly or pattern, use this structure to specify how long the suppression is to last.</p>
124 pub fn suppression_period(mut self, input: crate::types::SuppressionPeriod) -> Self {
125 self.suppression_period = ::std::option::Option::Some(input);
126 self
127 }
128 /// <p>If you are temporarily suppressing an anomaly or pattern, use this structure to specify how long the suppression is to last.</p>
129 pub fn set_suppression_period(mut self, input: ::std::option::Option<crate::types::SuppressionPeriod>) -> Self {
130 self.suppression_period = input;
131 self
132 }
133 /// <p>If you are temporarily suppressing an anomaly or pattern, use this structure to specify how long the suppression is to last.</p>
134 pub fn get_suppression_period(&self) -> &::std::option::Option<crate::types::SuppressionPeriod> {
135 &self.suppression_period
136 }
137 /// <p>Set this to <code>true</code> to prevent CloudWatch Logs from displaying this behavior as an anomaly in the future. The behavior is then treated as baseline behavior. However, if similar but more severe occurrences of this behavior occur in the future, those will still be reported as anomalies.</p>
138 /// <p>The default is <code>false</code></p>
139 pub fn baseline(mut self, input: bool) -> Self {
140 self.baseline = ::std::option::Option::Some(input);
141 self
142 }
143 /// <p>Set this to <code>true</code> to prevent CloudWatch Logs from displaying this behavior as an anomaly in the future. The behavior is then treated as baseline behavior. However, if similar but more severe occurrences of this behavior occur in the future, those will still be reported as anomalies.</p>
144 /// <p>The default is <code>false</code></p>
145 pub fn set_baseline(mut self, input: ::std::option::Option<bool>) -> Self {
146 self.baseline = input;
147 self
148 }
149 /// <p>Set this to <code>true</code> to prevent CloudWatch Logs from displaying this behavior as an anomaly in the future. The behavior is then treated as baseline behavior. However, if similar but more severe occurrences of this behavior occur in the future, those will still be reported as anomalies.</p>
150 /// <p>The default is <code>false</code></p>
151 pub fn get_baseline(&self) -> &::std::option::Option<bool> {
152 &self.baseline
153 }
154 /// Consumes the builder and constructs a [`UpdateAnomalyInput`](crate::operation::update_anomaly::UpdateAnomalyInput).
155 pub fn build(
156 self,
157 ) -> ::std::result::Result<crate::operation::update_anomaly::UpdateAnomalyInput, ::aws_smithy_types::error::operation::BuildError> {
158 ::std::result::Result::Ok(crate::operation::update_anomaly::UpdateAnomalyInput {
159 anomaly_id: self.anomaly_id,
160 pattern_id: self.pattern_id,
161 anomaly_detector_arn: self.anomaly_detector_arn,
162 suppression_type: self.suppression_type,
163 suppression_period: self.suppression_period,
164 baseline: self.baseline,
165 })
166 }
167}