Skip to main content

aws_sdk_cloudwatch/operation/put_metric_alarm/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_metric_alarm::_put_metric_alarm_input::PutMetricAlarmInputBuilder;
3
4pub use crate::operation::put_metric_alarm::_put_metric_alarm_output::PutMetricAlarmOutputBuilder;
5
6impl crate::operation::put_metric_alarm::builders::PutMetricAlarmInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::put_metric_alarm::PutMetricAlarmOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_metric_alarm::PutMetricAlarmError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_metric_alarm();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutMetricAlarm`.
24///
25/// <p>Creates or updates an alarm and associates it with the specified metric, metric math expression, anomaly detection model, or Metrics Insights query. For more information about using a Metrics Insights query for an alarm, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Metrics_Insights_Alarm.html">Create alarms on Metrics Insights queries</a>.</p>
26/// <p>Alarms based on anomaly detection models cannot have Auto Scaling actions.</p>
27/// <p>When this operation creates an alarm, the alarm state is immediately set to <code>INSUFFICIENT_DATA</code>. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed.</p>
28/// <p>When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.</p>
29/// <p>If you are an IAM user, you must have Amazon EC2 permissions for some alarm operations:</p>
30/// <ul>
31/// <li>
32/// <p>The <code>iam:CreateServiceLinkedRole</code> permission for all alarms with EC2 actions</p></li>
33/// <li>
34/// <p>The <code>iam:CreateServiceLinkedRole</code> permissions to create an alarm with Systems Manager OpsItem or response plan actions.</p></li>
35/// </ul>
36/// <p>The first time you create an alarm in the Amazon Web Services Management Console, the CLI, or by using the PutMetricAlarm API, CloudWatch creates the necessary service-linked role for you. The service-linked roles are called <code>AWSServiceRoleForCloudWatchEvents</code> and <code>AWSServiceRoleForCloudWatchAlarms_ActionSSM</code>. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role">Amazon Web Services service-linked role</a>.</p>
37/// <p>Each <code>PutMetricAlarm</code> action has a maximum uncompressed payload of 120 KB.</p>
38/// <p><b>Cross-account alarms</b></p>
39/// <p>You can set an alarm on metrics in the current account, or in another account. To create a cross-account alarm that watches a metric in a different account, you must have completed the following pre-requisites:</p>
40/// <ul>
41/// <li>
42/// <p>The account where the metrics are located (the <i>sharing account</i>) must already have a sharing role named <b>CloudWatch-CrossAccountSharingRole</b>. If it does not already have this role, you must create it using the instructions in <b>Set up a sharing account</b> in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html#enable-cross-account-cross-Region"> Cross-account cross-Region CloudWatch console</a>. The policy for that role must grant access to the ID of the account where you are creating the alarm.</p></li>
43/// <li>
44/// <p>The account where you are creating the alarm (the <i>monitoring account</i>) must already have a service-linked role named <b>AWSServiceRoleForCloudWatchCrossAccount</b> to allow CloudWatch to assume the sharing role in the sharing account. If it does not, you must create it following the directions in <b>Set up a monitoring account</b> in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html#enable-cross-account-cross-Region"> Cross-account cross-Region CloudWatch console</a>.</p></li>
45/// </ul>
46#[derive(::std::clone::Clone, ::std::fmt::Debug)]
47pub struct PutMetricAlarmFluentBuilder {
48    handle: ::std::sync::Arc<crate::client::Handle>,
49    inner: crate::operation::put_metric_alarm::builders::PutMetricAlarmInputBuilder,
50    config_override: ::std::option::Option<crate::config::Builder>,
51}
52impl
53    crate::client::customize::internal::CustomizableSend<
54        crate::operation::put_metric_alarm::PutMetricAlarmOutput,
55        crate::operation::put_metric_alarm::PutMetricAlarmError,
56    > for PutMetricAlarmFluentBuilder
57{
58    fn send(
59        self,
60        config_override: crate::config::Builder,
61    ) -> crate::client::customize::internal::BoxFuture<
62        crate::client::customize::internal::SendResult<
63            crate::operation::put_metric_alarm::PutMetricAlarmOutput,
64            crate::operation::put_metric_alarm::PutMetricAlarmError,
65        >,
66    > {
67        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
68    }
69}
70impl PutMetricAlarmFluentBuilder {
71    /// Creates a new `PutMetricAlarmFluentBuilder`.
72    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
73        Self {
74            handle,
75            inner: ::std::default::Default::default(),
76            config_override: ::std::option::Option::None,
77        }
78    }
79    /// Access the PutMetricAlarm as a reference.
80    pub fn as_input(&self) -> &crate::operation::put_metric_alarm::builders::PutMetricAlarmInputBuilder {
81        &self.inner
82    }
83    /// Sends the request and returns the response.
84    ///
85    /// If an error occurs, an `SdkError` will be returned with additional details that
86    /// can be matched against.
87    ///
88    /// By default, any retryable failures will be retried twice. Retry behavior
89    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
90    /// set when configuring the client.
91    pub async fn send(
92        self,
93    ) -> ::std::result::Result<
94        crate::operation::put_metric_alarm::PutMetricAlarmOutput,
95        ::aws_smithy_runtime_api::client::result::SdkError<
96            crate::operation::put_metric_alarm::PutMetricAlarmError,
97            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
98        >,
99    > {
100        let input = self
101            .inner
102            .build()
103            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
104        let runtime_plugins = crate::operation::put_metric_alarm::PutMetricAlarm::operation_runtime_plugins(
105            self.handle.runtime_plugins.clone(),
106            &self.handle.conf,
107            self.config_override,
108        );
109        crate::operation::put_metric_alarm::PutMetricAlarm::orchestrate(&runtime_plugins, input).await
110    }
111
112    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
113    pub fn customize(
114        self,
115    ) -> crate::client::customize::CustomizableOperation<
116        crate::operation::put_metric_alarm::PutMetricAlarmOutput,
117        crate::operation::put_metric_alarm::PutMetricAlarmError,
118        Self,
119    > {
120        crate::client::customize::CustomizableOperation::new(self)
121    }
122    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
123        self.set_config_override(::std::option::Option::Some(config_override.into()));
124        self
125    }
126
127    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
128        self.config_override = config_override;
129        self
130    }
131    /// <p>The name for the alarm. This name must be unique within the Region.</p>
132    /// <p>The name must contain only UTF-8 characters, and can't contain ASCII control characters</p>
133    pub fn alarm_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.alarm_name(input.into());
135        self
136    }
137    /// <p>The name for the alarm. This name must be unique within the Region.</p>
138    /// <p>The name must contain only UTF-8 characters, and can't contain ASCII control characters</p>
139    pub fn set_alarm_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_alarm_name(input);
141        self
142    }
143    /// <p>The name for the alarm. This name must be unique within the Region.</p>
144    /// <p>The name must contain only UTF-8 characters, and can't contain ASCII control characters</p>
145    pub fn get_alarm_name(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_alarm_name()
147    }
148    /// <p>The description for the alarm.</p>
149    pub fn alarm_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.alarm_description(input.into());
151        self
152    }
153    /// <p>The description for the alarm.</p>
154    pub fn set_alarm_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_alarm_description(input);
156        self
157    }
158    /// <p>The description for the alarm.</p>
159    pub fn get_alarm_description(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_alarm_description()
161    }
162    /// <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
163    pub fn actions_enabled(mut self, input: bool) -> Self {
164        self.inner = self.inner.actions_enabled(input);
165        self
166    }
167    /// <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
168    pub fn set_actions_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
169        self.inner = self.inner.set_actions_enabled(input);
170        self
171    }
172    /// <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
173    pub fn get_actions_enabled(&self) -> &::std::option::Option<bool> {
174        self.inner.get_actions_enabled()
175    }
176    ///
177    /// Appends an item to `OKActions`.
178    ///
179    /// To override the contents of this collection use [`set_ok_actions`](Self::set_ok_actions).
180    ///
181    /// <p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p>
182    /// <p><b>EC2 actions:</b></p>
183    /// <ul>
184    /// <li>
185    /// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
186    /// <li>
187    /// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
188    /// <li>
189    /// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
190    /// <li>
191    /// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
192    /// <li>
193    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
194    /// <li>
195    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
196    /// <li>
197    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
198    /// <li>
199    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
200    /// </ul>
201    /// <p><b>Autoscaling action:</b></p>
202    /// <ul>
203    /// <li>
204    /// <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li>
205    /// </ul>
206    /// <p><b>Lambda actions:</b></p>
207    /// <ul>
208    /// <li>
209    /// <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>
210    /// <li>
211    /// <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>
212    /// <li>
213    /// <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li>
214    /// </ul>
215    /// <p><b>SNS notification action:</b></p>
216    /// <ul>
217    /// <li>
218    /// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
219    /// </ul>
220    /// <p><b>SSM integration actions:</b></p>
221    /// <ul>
222    /// <li>
223    /// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
224    /// <li>
225    /// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
226    /// </ul>
227    pub fn ok_actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228        self.inner = self.inner.ok_actions(input.into());
229        self
230    }
231    /// <p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p>
232    /// <p><b>EC2 actions:</b></p>
233    /// <ul>
234    /// <li>
235    /// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
236    /// <li>
237    /// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
238    /// <li>
239    /// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
240    /// <li>
241    /// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
242    /// <li>
243    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
244    /// <li>
245    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
246    /// <li>
247    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
248    /// <li>
249    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
250    /// </ul>
251    /// <p><b>Autoscaling action:</b></p>
252    /// <ul>
253    /// <li>
254    /// <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li>
255    /// </ul>
256    /// <p><b>Lambda actions:</b></p>
257    /// <ul>
258    /// <li>
259    /// <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>
260    /// <li>
261    /// <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>
262    /// <li>
263    /// <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li>
264    /// </ul>
265    /// <p><b>SNS notification action:</b></p>
266    /// <ul>
267    /// <li>
268    /// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
269    /// </ul>
270    /// <p><b>SSM integration actions:</b></p>
271    /// <ul>
272    /// <li>
273    /// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
274    /// <li>
275    /// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
276    /// </ul>
277    pub fn set_ok_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
278        self.inner = self.inner.set_ok_actions(input);
279        self
280    }
281    /// <p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p>
282    /// <p><b>EC2 actions:</b></p>
283    /// <ul>
284    /// <li>
285    /// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
286    /// <li>
287    /// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
288    /// <li>
289    /// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
290    /// <li>
291    /// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
292    /// <li>
293    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
294    /// <li>
295    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
296    /// <li>
297    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
298    /// <li>
299    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
300    /// </ul>
301    /// <p><b>Autoscaling action:</b></p>
302    /// <ul>
303    /// <li>
304    /// <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li>
305    /// </ul>
306    /// <p><b>Lambda actions:</b></p>
307    /// <ul>
308    /// <li>
309    /// <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>
310    /// <li>
311    /// <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>
312    /// <li>
313    /// <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li>
314    /// </ul>
315    /// <p><b>SNS notification action:</b></p>
316    /// <ul>
317    /// <li>
318    /// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
319    /// </ul>
320    /// <p><b>SSM integration actions:</b></p>
321    /// <ul>
322    /// <li>
323    /// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
324    /// <li>
325    /// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
326    /// </ul>
327    pub fn get_ok_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
328        self.inner.get_ok_actions()
329    }
330    ///
331    /// Appends an item to `AlarmActions`.
332    ///
333    /// To override the contents of this collection use [`set_alarm_actions`](Self::set_alarm_actions).
334    ///
335    /// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p>
336    /// <p><b>EC2 actions:</b></p>
337    /// <ul>
338    /// <li>
339    /// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
340    /// <li>
341    /// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
342    /// <li>
343    /// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
344    /// <li>
345    /// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
346    /// <li>
347    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
348    /// <li>
349    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
350    /// <li>
351    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
352    /// <li>
353    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
354    /// </ul>
355    /// <p><b>Autoscaling action:</b></p>
356    /// <ul>
357    /// <li>
358    /// <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li>
359    /// </ul>
360    /// <p><b>Lambda actions:</b></p>
361    /// <ul>
362    /// <li>
363    /// <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>
364    /// <li>
365    /// <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>
366    /// <li>
367    /// <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li>
368    /// </ul>
369    /// <p><b>SNS notification action:</b></p>
370    /// <ul>
371    /// <li>
372    /// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
373    /// </ul>
374    /// <p><b>SSM integration actions:</b></p>
375    /// <ul>
376    /// <li>
377    /// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
378    /// <li>
379    /// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
380    /// </ul>
381    /// <p><b>Start a Amazon Q Developer operational investigation</b></p>
382    /// <p><code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>investigation-group-id</i> </code></p>
383    pub fn alarm_actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
384        self.inner = self.inner.alarm_actions(input.into());
385        self
386    }
387    /// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p>
388    /// <p><b>EC2 actions:</b></p>
389    /// <ul>
390    /// <li>
391    /// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
392    /// <li>
393    /// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
394    /// <li>
395    /// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
396    /// <li>
397    /// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
398    /// <li>
399    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
400    /// <li>
401    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
402    /// <li>
403    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
404    /// <li>
405    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
406    /// </ul>
407    /// <p><b>Autoscaling action:</b></p>
408    /// <ul>
409    /// <li>
410    /// <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li>
411    /// </ul>
412    /// <p><b>Lambda actions:</b></p>
413    /// <ul>
414    /// <li>
415    /// <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>
416    /// <li>
417    /// <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>
418    /// <li>
419    /// <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li>
420    /// </ul>
421    /// <p><b>SNS notification action:</b></p>
422    /// <ul>
423    /// <li>
424    /// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
425    /// </ul>
426    /// <p><b>SSM integration actions:</b></p>
427    /// <ul>
428    /// <li>
429    /// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
430    /// <li>
431    /// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
432    /// </ul>
433    /// <p><b>Start a Amazon Q Developer operational investigation</b></p>
434    /// <p><code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>investigation-group-id</i> </code></p>
435    pub fn set_alarm_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
436        self.inner = self.inner.set_alarm_actions(input);
437        self
438    }
439    /// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p>
440    /// <p><b>EC2 actions:</b></p>
441    /// <ul>
442    /// <li>
443    /// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
444    /// <li>
445    /// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
446    /// <li>
447    /// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
448    /// <li>
449    /// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
450    /// <li>
451    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
452    /// <li>
453    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
454    /// <li>
455    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
456    /// <li>
457    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
458    /// </ul>
459    /// <p><b>Autoscaling action:</b></p>
460    /// <ul>
461    /// <li>
462    /// <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li>
463    /// </ul>
464    /// <p><b>Lambda actions:</b></p>
465    /// <ul>
466    /// <li>
467    /// <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>
468    /// <li>
469    /// <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>
470    /// <li>
471    /// <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li>
472    /// </ul>
473    /// <p><b>SNS notification action:</b></p>
474    /// <ul>
475    /// <li>
476    /// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
477    /// </ul>
478    /// <p><b>SSM integration actions:</b></p>
479    /// <ul>
480    /// <li>
481    /// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
482    /// <li>
483    /// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
484    /// </ul>
485    /// <p><b>Start a Amazon Q Developer operational investigation</b></p>
486    /// <p><code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>investigation-group-id</i> </code></p>
487    pub fn get_alarm_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
488        self.inner.get_alarm_actions()
489    }
490    ///
491    /// Appends an item to `InsufficientDataActions`.
492    ///
493    /// To override the contents of this collection use [`set_insufficient_data_actions`](Self::set_insufficient_data_actions).
494    ///
495    /// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p>
496    /// <p><b>EC2 actions:</b></p>
497    /// <ul>
498    /// <li>
499    /// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
500    /// <li>
501    /// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
502    /// <li>
503    /// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
504    /// <li>
505    /// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
506    /// <li>
507    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
508    /// <li>
509    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
510    /// <li>
511    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
512    /// <li>
513    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
514    /// </ul>
515    /// <p><b>Autoscaling action:</b></p>
516    /// <ul>
517    /// <li>
518    /// <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li>
519    /// </ul>
520    /// <p><b>Lambda actions:</b></p>
521    /// <ul>
522    /// <li>
523    /// <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>
524    /// <li>
525    /// <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>
526    /// <li>
527    /// <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li>
528    /// </ul>
529    /// <p><b>SNS notification action:</b></p>
530    /// <ul>
531    /// <li>
532    /// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
533    /// </ul>
534    /// <p><b>SSM integration actions:</b></p>
535    /// <ul>
536    /// <li>
537    /// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
538    /// <li>
539    /// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
540    /// </ul>
541    pub fn insufficient_data_actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
542        self.inner = self.inner.insufficient_data_actions(input.into());
543        self
544    }
545    /// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p>
546    /// <p><b>EC2 actions:</b></p>
547    /// <ul>
548    /// <li>
549    /// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
550    /// <li>
551    /// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
552    /// <li>
553    /// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
554    /// <li>
555    /// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
556    /// <li>
557    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
558    /// <li>
559    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
560    /// <li>
561    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
562    /// <li>
563    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
564    /// </ul>
565    /// <p><b>Autoscaling action:</b></p>
566    /// <ul>
567    /// <li>
568    /// <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li>
569    /// </ul>
570    /// <p><b>Lambda actions:</b></p>
571    /// <ul>
572    /// <li>
573    /// <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>
574    /// <li>
575    /// <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>
576    /// <li>
577    /// <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li>
578    /// </ul>
579    /// <p><b>SNS notification action:</b></p>
580    /// <ul>
581    /// <li>
582    /// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
583    /// </ul>
584    /// <p><b>SSM integration actions:</b></p>
585    /// <ul>
586    /// <li>
587    /// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
588    /// <li>
589    /// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
590    /// </ul>
591    pub fn set_insufficient_data_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
592        self.inner = self.inner.set_insufficient_data_actions(input);
593        self
594    }
595    /// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p>
596    /// <p><b>EC2 actions:</b></p>
597    /// <ul>
598    /// <li>
599    /// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
600    /// <li>
601    /// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
602    /// <li>
603    /// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
604    /// <li>
605    /// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
606    /// <li>
607    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
608    /// <li>
609    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
610    /// <li>
611    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
612    /// <li>
613    /// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
614    /// </ul>
615    /// <p><b>Autoscaling action:</b></p>
616    /// <ul>
617    /// <li>
618    /// <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li>
619    /// </ul>
620    /// <p><b>Lambda actions:</b></p>
621    /// <ul>
622    /// <li>
623    /// <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>
624    /// <li>
625    /// <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>
626    /// <li>
627    /// <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li>
628    /// </ul>
629    /// <p><b>SNS notification action:</b></p>
630    /// <ul>
631    /// <li>
632    /// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
633    /// </ul>
634    /// <p><b>SSM integration actions:</b></p>
635    /// <ul>
636    /// <li>
637    /// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
638    /// <li>
639    /// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
640    /// </ul>
641    pub fn get_insufficient_data_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
642        self.inner.get_insufficient_data_actions()
643    }
644    /// <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
645    /// <p>If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the <code>Namespace</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters. Instead, you specify all this information in the <code>Metrics</code> array.</p>
646    pub fn metric_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
647        self.inner = self.inner.metric_name(input.into());
648        self
649    }
650    /// <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
651    /// <p>If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the <code>Namespace</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters. Instead, you specify all this information in the <code>Metrics</code> array.</p>
652    pub fn set_metric_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
653        self.inner = self.inner.set_metric_name(input);
654        self
655    }
656    /// <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
657    /// <p>If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the <code>Namespace</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters. Instead, you specify all this information in the <code>Metrics</code> array.</p>
658    pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
659        self.inner.get_metric_name()
660    }
661    /// <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
662    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
663        self.inner = self.inner.namespace(input.into());
664        self
665    }
666    /// <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
667    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
668        self.inner = self.inner.set_namespace(input);
669        self
670    }
671    /// <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
672    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
673        self.inner.get_namespace()
674    }
675    /// <p>The statistic for the metric specified in <code>MetricName</code>, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p>
676    pub fn statistic(mut self, input: crate::types::Statistic) -> Self {
677        self.inner = self.inner.statistic(input);
678        self
679    }
680    /// <p>The statistic for the metric specified in <code>MetricName</code>, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p>
681    pub fn set_statistic(mut self, input: ::std::option::Option<crate::types::Statistic>) -> Self {
682        self.inner = self.inner.set_statistic(input);
683        self
684    }
685    /// <p>The statistic for the metric specified in <code>MetricName</code>, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p>
686    pub fn get_statistic(&self) -> &::std::option::Option<crate::types::Statistic> {
687        self.inner.get_statistic()
688    }
689    /// <p>The extended statistic for the metric specified in <code>MetricName</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic</code> but not both.</p>
690    /// <p>If you specify <code>ExtendedStatistic</code>, the following are valid values:</p>
691    /// <ul>
692    /// <li>
693    /// <p><code>p90</code></p></li>
694    /// <li>
695    /// <p><code>tm90</code></p></li>
696    /// <li>
697    /// <p><code>tc90</code></p></li>
698    /// <li>
699    /// <p><code>ts90</code></p></li>
700    /// <li>
701    /// <p><code>wm90</code></p></li>
702    /// <li>
703    /// <p><code>IQM</code></p></li>
704    /// <li>
705    /// <p><code>PR(<i>n</i>:<i>m</i>)</code> where n and m are values of the metric</p></li>
706    /// <li>
707    /// <p><code>TC(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
708    /// <li>
709    /// <p><code>TM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
710    /// <li>
711    /// <p><code>TS(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
712    /// <li>
713    /// <p><code>WM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
714    /// </ul>
715    /// <p>For more information about these extended statistics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html">CloudWatch statistics definitions</a>.</p>
716    pub fn extended_statistic(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
717        self.inner = self.inner.extended_statistic(input.into());
718        self
719    }
720    /// <p>The extended statistic for the metric specified in <code>MetricName</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic</code> but not both.</p>
721    /// <p>If you specify <code>ExtendedStatistic</code>, the following are valid values:</p>
722    /// <ul>
723    /// <li>
724    /// <p><code>p90</code></p></li>
725    /// <li>
726    /// <p><code>tm90</code></p></li>
727    /// <li>
728    /// <p><code>tc90</code></p></li>
729    /// <li>
730    /// <p><code>ts90</code></p></li>
731    /// <li>
732    /// <p><code>wm90</code></p></li>
733    /// <li>
734    /// <p><code>IQM</code></p></li>
735    /// <li>
736    /// <p><code>PR(<i>n</i>:<i>m</i>)</code> where n and m are values of the metric</p></li>
737    /// <li>
738    /// <p><code>TC(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
739    /// <li>
740    /// <p><code>TM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
741    /// <li>
742    /// <p><code>TS(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
743    /// <li>
744    /// <p><code>WM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
745    /// </ul>
746    /// <p>For more information about these extended statistics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html">CloudWatch statistics definitions</a>.</p>
747    pub fn set_extended_statistic(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
748        self.inner = self.inner.set_extended_statistic(input);
749        self
750    }
751    /// <p>The extended statistic for the metric specified in <code>MetricName</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic</code> but not both.</p>
752    /// <p>If you specify <code>ExtendedStatistic</code>, the following are valid values:</p>
753    /// <ul>
754    /// <li>
755    /// <p><code>p90</code></p></li>
756    /// <li>
757    /// <p><code>tm90</code></p></li>
758    /// <li>
759    /// <p><code>tc90</code></p></li>
760    /// <li>
761    /// <p><code>ts90</code></p></li>
762    /// <li>
763    /// <p><code>wm90</code></p></li>
764    /// <li>
765    /// <p><code>IQM</code></p></li>
766    /// <li>
767    /// <p><code>PR(<i>n</i>:<i>m</i>)</code> where n and m are values of the metric</p></li>
768    /// <li>
769    /// <p><code>TC(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
770    /// <li>
771    /// <p><code>TM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
772    /// <li>
773    /// <p><code>TS(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
774    /// <li>
775    /// <p><code>WM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
776    /// </ul>
777    /// <p>For more information about these extended statistics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html">CloudWatch statistics definitions</a>.</p>
778    pub fn get_extended_statistic(&self) -> &::std::option::Option<::std::string::String> {
779        self.inner.get_extended_statistic()
780    }
781    ///
782    /// Appends an item to `Dimensions`.
783    ///
784    /// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
785    ///
786    /// <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
787    pub fn dimensions(mut self, input: crate::types::Dimension) -> Self {
788        self.inner = self.inner.dimensions(input);
789        self
790    }
791    /// <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
792    pub fn set_dimensions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Dimension>>) -> Self {
793        self.inner = self.inner.set_dimensions(input);
794        self
795    }
796    /// <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
797    pub fn get_dimensions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Dimension>> {
798        self.inner.get_dimensions()
799    }
800    /// <p>The length, in seconds, used each time the metric specified in <code>MetricName</code> is evaluated. Valid values are 10, 20, 30, and any multiple of 60.</p>
801    /// <p><code>Period</code> is required for alarms based on static thresholds. If you are creating an alarm based on a metric math expression, you specify the period for each metric within the objects in the <code>Metrics</code> array.</p>
802    /// <p>Be sure to specify 10, 20, or 30 only for metrics that are stored by a <code>PutMetricData</code> call with a <code>StorageResolution</code> of 1. If you specify a period of 10, 20, or 30 for a metric that does not have sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case, it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10, 20, or 30 also sets this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information about pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>.</p>
803    /// <p>An alarm's total current evaluation period can be no longer than seven days, so <code>Period</code> multiplied by <code>EvaluationPeriods</code> can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).</p>
804    pub fn period(mut self, input: i32) -> Self {
805        self.inner = self.inner.period(input);
806        self
807    }
808    /// <p>The length, in seconds, used each time the metric specified in <code>MetricName</code> is evaluated. Valid values are 10, 20, 30, and any multiple of 60.</p>
809    /// <p><code>Period</code> is required for alarms based on static thresholds. If you are creating an alarm based on a metric math expression, you specify the period for each metric within the objects in the <code>Metrics</code> array.</p>
810    /// <p>Be sure to specify 10, 20, or 30 only for metrics that are stored by a <code>PutMetricData</code> call with a <code>StorageResolution</code> of 1. If you specify a period of 10, 20, or 30 for a metric that does not have sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case, it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10, 20, or 30 also sets this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information about pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>.</p>
811    /// <p>An alarm's total current evaluation period can be no longer than seven days, so <code>Period</code> multiplied by <code>EvaluationPeriods</code> can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).</p>
812    pub fn set_period(mut self, input: ::std::option::Option<i32>) -> Self {
813        self.inner = self.inner.set_period(input);
814        self
815    }
816    /// <p>The length, in seconds, used each time the metric specified in <code>MetricName</code> is evaluated. Valid values are 10, 20, 30, and any multiple of 60.</p>
817    /// <p><code>Period</code> is required for alarms based on static thresholds. If you are creating an alarm based on a metric math expression, you specify the period for each metric within the objects in the <code>Metrics</code> array.</p>
818    /// <p>Be sure to specify 10, 20, or 30 only for metrics that are stored by a <code>PutMetricData</code> call with a <code>StorageResolution</code> of 1. If you specify a period of 10, 20, or 30 for a metric that does not have sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case, it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10, 20, or 30 also sets this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information about pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>.</p>
819    /// <p>An alarm's total current evaluation period can be no longer than seven days, so <code>Period</code> multiplied by <code>EvaluationPeriods</code> can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).</p>
820    pub fn get_period(&self) -> &::std::option::Option<i32> {
821        self.inner.get_period()
822    }
823    /// <p>The unit of measure for the statistic. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately. If you are creating an alarm based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the <code>Metrics</code> array.</p>
824    /// <p>If you don't specify <code>Unit</code>, CloudWatch retrieves all unit types that have been published for the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works as intended.</p>
825    /// <p>However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's behavior is not defined and it behaves unpredictably.</p>
826    /// <p>We recommend omitting <code>Unit</code> so that you don't inadvertently specify an incorrect unit that is not published for this metric. Doing so causes the alarm to be stuck in the <code>INSUFFICIENT DATA</code> state.</p>
827    pub fn unit(mut self, input: crate::types::StandardUnit) -> Self {
828        self.inner = self.inner.unit(input);
829        self
830    }
831    /// <p>The unit of measure for the statistic. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately. If you are creating an alarm based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the <code>Metrics</code> array.</p>
832    /// <p>If you don't specify <code>Unit</code>, CloudWatch retrieves all unit types that have been published for the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works as intended.</p>
833    /// <p>However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's behavior is not defined and it behaves unpredictably.</p>
834    /// <p>We recommend omitting <code>Unit</code> so that you don't inadvertently specify an incorrect unit that is not published for this metric. Doing so causes the alarm to be stuck in the <code>INSUFFICIENT DATA</code> state.</p>
835    pub fn set_unit(mut self, input: ::std::option::Option<crate::types::StandardUnit>) -> Self {
836        self.inner = self.inner.set_unit(input);
837        self
838    }
839    /// <p>The unit of measure for the statistic. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately. If you are creating an alarm based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the <code>Metrics</code> array.</p>
840    /// <p>If you don't specify <code>Unit</code>, CloudWatch retrieves all unit types that have been published for the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works as intended.</p>
841    /// <p>However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's behavior is not defined and it behaves unpredictably.</p>
842    /// <p>We recommend omitting <code>Unit</code> so that you don't inadvertently specify an incorrect unit that is not published for this metric. Doing so causes the alarm to be stuck in the <code>INSUFFICIENT DATA</code> state.</p>
843    pub fn get_unit(&self) -> &::std::option::Option<crate::types::StandardUnit> {
844        self.inner.get_unit()
845    }
846    /// <p>The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N.</p>
847    pub fn evaluation_periods(mut self, input: i32) -> Self {
848        self.inner = self.inner.evaluation_periods(input);
849        self
850    }
851    /// <p>The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N.</p>
852    pub fn set_evaluation_periods(mut self, input: ::std::option::Option<i32>) -> Self {
853        self.inner = self.inner.set_evaluation_periods(input);
854        self
855    }
856    /// <p>The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N.</p>
857    pub fn get_evaluation_periods(&self) -> &::std::option::Option<i32> {
858        self.inner.get_evaluation_periods()
859    }
860    /// <p>The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation">Evaluating an Alarm</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
861    pub fn datapoints_to_alarm(mut self, input: i32) -> Self {
862        self.inner = self.inner.datapoints_to_alarm(input);
863        self
864    }
865    /// <p>The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation">Evaluating an Alarm</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
866    pub fn set_datapoints_to_alarm(mut self, input: ::std::option::Option<i32>) -> Self {
867        self.inner = self.inner.set_datapoints_to_alarm(input);
868        self
869    }
870    /// <p>The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation">Evaluating an Alarm</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
871    pub fn get_datapoints_to_alarm(&self) -> &::std::option::Option<i32> {
872        self.inner.get_datapoints_to_alarm()
873    }
874    /// <p>The value against which the specified statistic is compared.</p>
875    /// <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p>
876    pub fn threshold(mut self, input: f64) -> Self {
877        self.inner = self.inner.threshold(input);
878        self
879    }
880    /// <p>The value against which the specified statistic is compared.</p>
881    /// <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p>
882    pub fn set_threshold(mut self, input: ::std::option::Option<f64>) -> Self {
883        self.inner = self.inner.set_threshold(input);
884        self
885    }
886    /// <p>The value against which the specified statistic is compared.</p>
887    /// <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p>
888    pub fn get_threshold(&self) -> &::std::option::Option<f64> {
889        self.inner.get_threshold()
890    }
891    /// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
892    /// <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p>
893    pub fn comparison_operator(mut self, input: crate::types::ComparisonOperator) -> Self {
894        self.inner = self.inner.comparison_operator(input);
895        self
896    }
897    /// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
898    /// <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p>
899    pub fn set_comparison_operator(mut self, input: ::std::option::Option<crate::types::ComparisonOperator>) -> Self {
900        self.inner = self.inner.set_comparison_operator(input);
901        self
902    }
903    /// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
904    /// <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p>
905    pub fn get_comparison_operator(&self) -> &::std::option::Option<crate::types::ComparisonOperator> {
906        self.inner.get_comparison_operator()
907    }
908    /// <p>Sets how this alarm is to handle missing data points. If <code>TreatMissingData</code> is omitted, the default behavior of <code>missing</code> is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring How CloudWatch Alarms Treats Missing Data</a>.</p>
909    /// <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code></p><note>
910    /// <p>Alarms that evaluate metrics in the <code>AWS/DynamoDB</code> namespace always <code>ignore</code> missing data even if you choose a different option for <code>TreatMissingData</code>. When an <code>AWS/DynamoDB</code> metric has missing data, alarms that evaluate that metric remain in their current state.</p>
911    /// </note>
912    pub fn treat_missing_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
913        self.inner = self.inner.treat_missing_data(input.into());
914        self
915    }
916    /// <p>Sets how this alarm is to handle missing data points. If <code>TreatMissingData</code> is omitted, the default behavior of <code>missing</code> is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring How CloudWatch Alarms Treats Missing Data</a>.</p>
917    /// <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code></p><note>
918    /// <p>Alarms that evaluate metrics in the <code>AWS/DynamoDB</code> namespace always <code>ignore</code> missing data even if you choose a different option for <code>TreatMissingData</code>. When an <code>AWS/DynamoDB</code> metric has missing data, alarms that evaluate that metric remain in their current state.</p>
919    /// </note>
920    pub fn set_treat_missing_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
921        self.inner = self.inner.set_treat_missing_data(input);
922        self
923    }
924    /// <p>Sets how this alarm is to handle missing data points. If <code>TreatMissingData</code> is omitted, the default behavior of <code>missing</code> is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring How CloudWatch Alarms Treats Missing Data</a>.</p>
925    /// <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code></p><note>
926    /// <p>Alarms that evaluate metrics in the <code>AWS/DynamoDB</code> namespace always <code>ignore</code> missing data even if you choose a different option for <code>TreatMissingData</code>. When an <code>AWS/DynamoDB</code> metric has missing data, alarms that evaluate that metric remain in their current state.</p>
927    /// </note>
928    pub fn get_treat_missing_data(&self) -> &::std::option::Option<::std::string::String> {
929        self.inner.get_treat_missing_data()
930    }
931    /// <p>Used only for alarms based on percentiles. If you specify <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If you specify <code>evaluate</code> or omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are available. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples">Percentile-Based CloudWatch Alarms and Low Data Samples</a>.</p>
932    /// <p>Valid Values: <code>evaluate | ignore</code></p>
933    pub fn evaluate_low_sample_count_percentile(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
934        self.inner = self.inner.evaluate_low_sample_count_percentile(input.into());
935        self
936    }
937    /// <p>Used only for alarms based on percentiles. If you specify <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If you specify <code>evaluate</code> or omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are available. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples">Percentile-Based CloudWatch Alarms and Low Data Samples</a>.</p>
938    /// <p>Valid Values: <code>evaluate | ignore</code></p>
939    pub fn set_evaluate_low_sample_count_percentile(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
940        self.inner = self.inner.set_evaluate_low_sample_count_percentile(input);
941        self
942    }
943    /// <p>Used only for alarms based on percentiles. If you specify <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If you specify <code>evaluate</code> or omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are available. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples">Percentile-Based CloudWatch Alarms and Low Data Samples</a>.</p>
944    /// <p>Valid Values: <code>evaluate | ignore</code></p>
945    pub fn get_evaluate_low_sample_count_percentile(&self) -> &::std::option::Option<::std::string::String> {
946        self.inner.get_evaluate_low_sample_count_percentile()
947    }
948    ///
949    /// Appends an item to `Metrics`.
950    ///
951    /// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
952    ///
953    /// <p>An array of <code>MetricDataQuery</code> structures that enable you to create an alarm based on the result of a metric math expression. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
954    /// <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p>
955    /// <p>One item in the <code>Metrics</code> array is the expression that the alarm watches. You designate this expression by setting <code>ReturnData</code> to true for this object in the array. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html">MetricDataQuery</a>.</p>
956    /// <p>If you use the <code>Metrics</code> parameter, you cannot include the <code>Namespace</code>, <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, you retrieve the metrics you are using in your math expression as part of the <code>Metrics</code> array.</p>
957    pub fn metrics(mut self, input: crate::types::MetricDataQuery) -> Self {
958        self.inner = self.inner.metrics(input);
959        self
960    }
961    /// <p>An array of <code>MetricDataQuery</code> structures that enable you to create an alarm based on the result of a metric math expression. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
962    /// <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p>
963    /// <p>One item in the <code>Metrics</code> array is the expression that the alarm watches. You designate this expression by setting <code>ReturnData</code> to true for this object in the array. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html">MetricDataQuery</a>.</p>
964    /// <p>If you use the <code>Metrics</code> parameter, you cannot include the <code>Namespace</code>, <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, you retrieve the metrics you are using in your math expression as part of the <code>Metrics</code> array.</p>
965    pub fn set_metrics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricDataQuery>>) -> Self {
966        self.inner = self.inner.set_metrics(input);
967        self
968    }
969    /// <p>An array of <code>MetricDataQuery</code> structures that enable you to create an alarm based on the result of a metric math expression. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
970    /// <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p>
971    /// <p>One item in the <code>Metrics</code> array is the expression that the alarm watches. You designate this expression by setting <code>ReturnData</code> to true for this object in the array. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html">MetricDataQuery</a>.</p>
972    /// <p>If you use the <code>Metrics</code> parameter, you cannot include the <code>Namespace</code>, <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, you retrieve the metrics you are using in your math expression as part of the <code>Metrics</code> array.</p>
973    pub fn get_metrics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricDataQuery>> {
974        self.inner.get_metrics()
975    }
976    ///
977    /// Appends an item to `Tags`.
978    ///
979    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
980    ///
981    /// <p>A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the <code>cloudwatch:TagResource</code> permission.</p>
982    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
983    /// <p>If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
984    /// <p>To use this field to set tags for an alarm when you create it, you must be signed on with both the <code>cloudwatch:PutMetricAlarm</code> and <code>cloudwatch:TagResource</code> permissions.</p>
985    pub fn tags(mut self, input: crate::types::Tag) -> Self {
986        self.inner = self.inner.tags(input);
987        self
988    }
989    /// <p>A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the <code>cloudwatch:TagResource</code> permission.</p>
990    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
991    /// <p>If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
992    /// <p>To use this field to set tags for an alarm when you create it, you must be signed on with both the <code>cloudwatch:PutMetricAlarm</code> and <code>cloudwatch:TagResource</code> permissions.</p>
993    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
994        self.inner = self.inner.set_tags(input);
995        self
996    }
997    /// <p>A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the <code>cloudwatch:TagResource</code> permission.</p>
998    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
999    /// <p>If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
1000    /// <p>To use this field to set tags for an alarm when you create it, you must be signed on with both the <code>cloudwatch:PutMetricAlarm</code> and <code>cloudwatch:TagResource</code> permissions.</p>
1001    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
1002        self.inner.get_tags()
1003    }
1004    /// <p>If this is an alarm based on an anomaly detection model, make this value match the ID of the <code>ANOMALY_DETECTION_BAND</code> function.</p>
1005    /// <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p>
1006    /// <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p>
1007    pub fn threshold_metric_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
1008        self.inner = self.inner.threshold_metric_id(input.into());
1009        self
1010    }
1011    /// <p>If this is an alarm based on an anomaly detection model, make this value match the ID of the <code>ANOMALY_DETECTION_BAND</code> function.</p>
1012    /// <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p>
1013    /// <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p>
1014    pub fn set_threshold_metric_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
1015        self.inner = self.inner.set_threshold_metric_id(input);
1016        self
1017    }
1018    /// <p>If this is an alarm based on an anomaly detection model, make this value match the ID of the <code>ANOMALY_DETECTION_BAND</code> function.</p>
1019    /// <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p>
1020    /// <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p>
1021    pub fn get_threshold_metric_id(&self) -> &::std::option::Option<::std::string::String> {
1022        self.inner.get_threshold_metric_id()
1023    }
1024}