// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::put_metric_alarm::_put_metric_alarm_input::PutMetricAlarmInputBuilder;
pub use crate::operation::put_metric_alarm::_put_metric_alarm_output::PutMetricAlarmOutputBuilder;
impl crate::operation::put_metric_alarm::builders::PutMetricAlarmInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::put_metric_alarm::PutMetricAlarmOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::put_metric_alarm::PutMetricAlarmError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.put_metric_alarm();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `PutMetricAlarm`.
///
/// <p>Creates or updates an alarm and associates it with the specified metric, metric math expression, anomaly detection model, Metrics Insights query, or PromQL 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>
/// <p>Alarms based on anomaly detection models cannot have Auto Scaling actions.</p>
/// <p>When this operation creates an alarm, the alarm state is immediately set to <code>INSUFFICIENT_DATA</code>. For PromQL alarms, the alarm state is instead immediately set to <code>OK</code>. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed.</p>
/// <p>When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.</p>
/// <p>If you are an IAM user, you must have Amazon EC2 permissions for some alarm operations:</p>
/// <ul>
/// <li>
/// <p>The <code>iam:CreateServiceLinkedRole</code> permission for all alarms with EC2 actions</p></li>
/// <li>
/// <p>The <code>iam:CreateServiceLinkedRole</code> permissions to create an alarm with Systems Manager OpsItem or response plan actions.</p></li>
/// </ul>
/// <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>
/// <p>Each <code>PutMetricAlarm</code> action has a maximum uncompressed payload of 120 KB.</p>
/// <p><b>Cross-account alarms</b></p>
/// <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>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutMetricAlarmFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::put_metric_alarm::builders::PutMetricAlarmInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::put_metric_alarm::PutMetricAlarmOutput,
crate::operation::put_metric_alarm::PutMetricAlarmError,
> for PutMetricAlarmFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::put_metric_alarm::PutMetricAlarmOutput,
crate::operation::put_metric_alarm::PutMetricAlarmError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl PutMetricAlarmFluentBuilder {
/// Creates a new `PutMetricAlarmFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the PutMetricAlarm as a reference.
pub fn as_input(&self) -> &crate::operation::put_metric_alarm::builders::PutMetricAlarmInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::put_metric_alarm::PutMetricAlarmOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::put_metric_alarm::PutMetricAlarmError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::put_metric_alarm::PutMetricAlarm::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::put_metric_alarm::PutMetricAlarm::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::put_metric_alarm::PutMetricAlarmOutput,
crate::operation::put_metric_alarm::PutMetricAlarmError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The name for the alarm. This name must be unique within the Region.</p>
/// <p>The name must contain only UTF-8 characters, and can't contain ASCII control characters</p>
pub fn alarm_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.alarm_name(input.into());
self
}
/// <p>The name for the alarm. This name must be unique within the Region.</p>
/// <p>The name must contain only UTF-8 characters, and can't contain ASCII control characters</p>
pub fn set_alarm_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_alarm_name(input);
self
}
/// <p>The name for the alarm. This name must be unique within the Region.</p>
/// <p>The name must contain only UTF-8 characters, and can't contain ASCII control characters</p>
pub fn get_alarm_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_alarm_name()
}
/// <p>The description for the alarm.</p>
pub fn alarm_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.alarm_description(input.into());
self
}
/// <p>The description for the alarm.</p>
pub fn set_alarm_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_alarm_description(input);
self
}
/// <p>The description for the alarm.</p>
pub fn get_alarm_description(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_alarm_description()
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
pub fn actions_enabled(mut self, input: bool) -> Self {
self.inner = self.inner.actions_enabled(input);
self
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
pub fn set_actions_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_actions_enabled(input);
self
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
pub fn get_actions_enabled(&self) -> &::std::option::Option<bool> {
self.inner.get_actions_enabled()
}
///
/// Appends an item to `OKActions`.
///
/// To override the contents of this collection use [`set_ok_actions`](Self::set_ok_actions).
///
/// <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>
/// <p><b>EC2 actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
/// </ul>
/// <p><b>Autoscaling action:</b></p>
/// <ul>
/// <li>
/// <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>
/// </ul>
/// <p><b>Lambda actions:</b></p>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
/// <p><b>SNS notification action:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
/// </ul>
/// <p><b>SSM integration actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
/// <li>
/// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
/// </ul>
pub fn ok_actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.ok_actions(input.into());
self
}
/// <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>
/// <p><b>EC2 actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
/// </ul>
/// <p><b>Autoscaling action:</b></p>
/// <ul>
/// <li>
/// <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>
/// </ul>
/// <p><b>Lambda actions:</b></p>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
/// <p><b>SNS notification action:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
/// </ul>
/// <p><b>SSM integration actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
/// <li>
/// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
/// </ul>
pub fn set_ok_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_ok_actions(input);
self
}
/// <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>
/// <p><b>EC2 actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
/// </ul>
/// <p><b>Autoscaling action:</b></p>
/// <ul>
/// <li>
/// <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>
/// </ul>
/// <p><b>Lambda actions:</b></p>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
/// <p><b>SNS notification action:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
/// </ul>
/// <p><b>SSM integration actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
/// <li>
/// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
/// </ul>
pub fn get_ok_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_ok_actions()
}
///
/// Appends an item to `AlarmActions`.
///
/// To override the contents of this collection use [`set_alarm_actions`](Self::set_alarm_actions).
///
/// <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>
/// <p><b>EC2 actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
/// </ul>
/// <p><b>Autoscaling action:</b></p>
/// <ul>
/// <li>
/// <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>
/// </ul>
/// <p><b>Lambda actions:</b></p>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
/// <p><b>SNS notification action:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
/// </ul>
/// <p><b>SSM integration actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
/// <li>
/// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
/// </ul>
/// <p><b>Start a Amazon Q Developer operational investigation</b></p>
/// <p><code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>investigation-group-id</i> </code></p>
pub fn alarm_actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.alarm_actions(input.into());
self
}
/// <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>
/// <p><b>EC2 actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
/// </ul>
/// <p><b>Autoscaling action:</b></p>
/// <ul>
/// <li>
/// <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>
/// </ul>
/// <p><b>Lambda actions:</b></p>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
/// <p><b>SNS notification action:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
/// </ul>
/// <p><b>SSM integration actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
/// <li>
/// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
/// </ul>
/// <p><b>Start a Amazon Q Developer operational investigation</b></p>
/// <p><code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>investigation-group-id</i> </code></p>
pub fn set_alarm_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_alarm_actions(input);
self
}
/// <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>
/// <p><b>EC2 actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
/// </ul>
/// <p><b>Autoscaling action:</b></p>
/// <ul>
/// <li>
/// <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>
/// </ul>
/// <p><b>Lambda actions:</b></p>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
/// <p><b>SNS notification action:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
/// </ul>
/// <p><b>SSM integration actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
/// <li>
/// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
/// </ul>
/// <p><b>Start a Amazon Q Developer operational investigation</b></p>
/// <p><code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>investigation-group-id</i> </code></p>
pub fn get_alarm_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_alarm_actions()
}
///
/// Appends an item to `InsufficientDataActions`.
///
/// To override the contents of this collection use [`set_insufficient_data_actions`](Self::set_insufficient_data_actions).
///
/// <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>
/// <p><b>EC2 actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
/// </ul>
/// <p><b>Autoscaling action:</b></p>
/// <ul>
/// <li>
/// <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>
/// </ul>
/// <p><b>Lambda actions:</b></p>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
/// <p><b>SNS notification action:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
/// </ul>
/// <p><b>SSM integration actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
/// <li>
/// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
/// </ul>
pub fn insufficient_data_actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.insufficient_data_actions(input.into());
self
}
/// <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>
/// <p><b>EC2 actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
/// </ul>
/// <p><b>Autoscaling action:</b></p>
/// <ul>
/// <li>
/// <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>
/// </ul>
/// <p><b>Lambda actions:</b></p>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
/// <p><b>SNS notification action:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
/// </ul>
/// <p><b>SSM integration actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
/// <li>
/// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
/// </ul>
pub fn set_insufficient_data_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_insufficient_data_actions(input);
self
}
/// <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>
/// <p><b>EC2 actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>
/// <li>
/// <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>
/// <li>
/// <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li>
/// </ul>
/// <p><b>Autoscaling action:</b></p>
/// <ul>
/// <li>
/// <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>
/// </ul>
/// <p><b>Lambda actions:</b></p>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
/// <p><b>SNS notification action:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li>
/// </ul>
/// <p><b>SSM integration actions:</b></p>
/// <ul>
/// <li>
/// <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>
/// <li>
/// <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li>
/// </ul>
pub fn get_insufficient_data_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_insufficient_data_actions()
}
/// <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p>
/// <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>
pub fn metric_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.metric_name(input.into());
self
}
/// <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p>
/// <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>
pub fn set_metric_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_metric_name(input);
self
}
/// <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p>
/// <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>
pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_metric_name()
}
/// <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.namespace(input.into());
self
}
/// <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_namespace(input);
self
}
/// <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_namespace()
}
/// <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>
pub fn statistic(mut self, input: crate::types::Statistic) -> Self {
self.inner = self.inner.statistic(input);
self
}
/// <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>
pub fn set_statistic(mut self, input: ::std::option::Option<crate::types::Statistic>) -> Self {
self.inner = self.inner.set_statistic(input);
self
}
/// <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>
pub fn get_statistic(&self) -> &::std::option::Option<crate::types::Statistic> {
self.inner.get_statistic()
}
/// <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>
/// <p>If you specify <code>ExtendedStatistic</code>, the following are valid values:</p>
/// <ul>
/// <li>
/// <p><code>p90</code></p></li>
/// <li>
/// <p><code>tm90</code></p></li>
/// <li>
/// <p><code>tc90</code></p></li>
/// <li>
/// <p><code>ts90</code></p></li>
/// <li>
/// <p><code>wm90</code></p></li>
/// <li>
/// <p><code>IQM</code></p></li>
/// <li>
/// <p><code>PR(<i>n</i>:<i>m</i>)</code> where n and m are values of the metric</p></li>
/// <li>
/// <p><code>TC(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// <li>
/// <p><code>TM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// <li>
/// <p><code>TS(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// <li>
/// <p><code>WM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// </ul>
/// <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>
pub fn extended_statistic(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.extended_statistic(input.into());
self
}
/// <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>
/// <p>If you specify <code>ExtendedStatistic</code>, the following are valid values:</p>
/// <ul>
/// <li>
/// <p><code>p90</code></p></li>
/// <li>
/// <p><code>tm90</code></p></li>
/// <li>
/// <p><code>tc90</code></p></li>
/// <li>
/// <p><code>ts90</code></p></li>
/// <li>
/// <p><code>wm90</code></p></li>
/// <li>
/// <p><code>IQM</code></p></li>
/// <li>
/// <p><code>PR(<i>n</i>:<i>m</i>)</code> where n and m are values of the metric</p></li>
/// <li>
/// <p><code>TC(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// <li>
/// <p><code>TM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// <li>
/// <p><code>TS(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// <li>
/// <p><code>WM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// </ul>
/// <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>
pub fn set_extended_statistic(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_extended_statistic(input);
self
}
/// <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>
/// <p>If you specify <code>ExtendedStatistic</code>, the following are valid values:</p>
/// <ul>
/// <li>
/// <p><code>p90</code></p></li>
/// <li>
/// <p><code>tm90</code></p></li>
/// <li>
/// <p><code>tc90</code></p></li>
/// <li>
/// <p><code>ts90</code></p></li>
/// <li>
/// <p><code>wm90</code></p></li>
/// <li>
/// <p><code>IQM</code></p></li>
/// <li>
/// <p><code>PR(<i>n</i>:<i>m</i>)</code> where n and m are values of the metric</p></li>
/// <li>
/// <p><code>TC(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// <li>
/// <p><code>TM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// <li>
/// <p><code>TS(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// <li>
/// <p><code>WM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>
/// </ul>
/// <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>
pub fn get_extended_statistic(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_extended_statistic()
}
///
/// Appends an item to `Dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
pub fn dimensions(mut self, input: crate::types::Dimension) -> Self {
self.inner = self.inner.dimensions(input);
self
}
/// <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
pub fn set_dimensions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Dimension>>) -> Self {
self.inner = self.inner.set_dimensions(input);
self
}
/// <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
pub fn get_dimensions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Dimension>> {
self.inner.get_dimensions()
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn period(mut self, input: i32) -> Self {
self.inner = self.inner.period(input);
self
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn set_period(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_period(input);
self
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn get_period(&self) -> &::std::option::Option<i32> {
self.inner.get_period()
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn unit(mut self, input: crate::types::StandardUnit) -> Self {
self.inner = self.inner.unit(input);
self
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn set_unit(mut self, input: ::std::option::Option<crate::types::StandardUnit>) -> Self {
self.inner = self.inner.set_unit(input);
self
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn get_unit(&self) -> &::std::option::Option<crate::types::StandardUnit> {
self.inner.get_unit()
}
/// <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>
pub fn evaluation_periods(mut self, input: i32) -> Self {
self.inner = self.inner.evaluation_periods(input);
self
}
/// <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>
pub fn set_evaluation_periods(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_evaluation_periods(input);
self
}
/// <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>
pub fn get_evaluation_periods(&self) -> &::std::option::Option<i32> {
self.inner.get_evaluation_periods()
}
/// <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>
pub fn datapoints_to_alarm(mut self, input: i32) -> Self {
self.inner = self.inner.datapoints_to_alarm(input);
self
}
/// <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>
pub fn set_datapoints_to_alarm(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_datapoints_to_alarm(input);
self
}
/// <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>
pub fn get_datapoints_to_alarm(&self) -> &::std::option::Option<i32> {
self.inner.get_datapoints_to_alarm()
}
/// <p>The value against which the specified statistic is compared.</p>
/// <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p>
pub fn threshold(mut self, input: f64) -> Self {
self.inner = self.inner.threshold(input);
self
}
/// <p>The value against which the specified statistic is compared.</p>
/// <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p>
pub fn set_threshold(mut self, input: ::std::option::Option<f64>) -> Self {
self.inner = self.inner.set_threshold(input);
self
}
/// <p>The value against which the specified statistic is compared.</p>
/// <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p>
pub fn get_threshold(&self) -> &::std::option::Option<f64> {
self.inner.get_threshold()
}
/// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
/// <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p>
pub fn comparison_operator(mut self, input: crate::types::ComparisonOperator) -> Self {
self.inner = self.inner.comparison_operator(input);
self
}
/// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
/// <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p>
pub fn set_comparison_operator(mut self, input: ::std::option::Option<crate::types::ComparisonOperator>) -> Self {
self.inner = self.inner.set_comparison_operator(input);
self
}
/// <p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
/// <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p>
pub fn get_comparison_operator(&self) -> &::std::option::Option<crate::types::ComparisonOperator> {
self.inner.get_comparison_operator()
}
/// <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>
/// <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code></p><note>
/// <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>
/// </note> <note>
/// <p>This parameter is not applicable to PromQL alarms.</p>
/// </note>
pub fn treat_missing_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.treat_missing_data(input.into());
self
}
/// <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>
/// <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code></p><note>
/// <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>
/// </note> <note>
/// <p>This parameter is not applicable to PromQL alarms.</p>
/// </note>
pub fn set_treat_missing_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_treat_missing_data(input);
self
}
/// <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>
/// <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code></p><note>
/// <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>
/// </note> <note>
/// <p>This parameter is not applicable to PromQL alarms.</p>
/// </note>
pub fn get_treat_missing_data(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_treat_missing_data()
}
/// <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>
/// <p>Valid Values: <code>evaluate | ignore</code></p>
pub fn evaluate_low_sample_count_percentile(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.evaluate_low_sample_count_percentile(input.into());
self
}
/// <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>
/// <p>Valid Values: <code>evaluate | ignore</code></p>
pub fn set_evaluate_low_sample_count_percentile(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_evaluate_low_sample_count_percentile(input);
self
}
/// <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>
/// <p>Valid Values: <code>evaluate | ignore</code></p>
pub fn get_evaluate_low_sample_count_percentile(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_evaluate_low_sample_count_percentile()
}
///
/// Appends an item to `Metrics`.
///
/// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
///
/// <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>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p>
/// <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p>
/// <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>
/// <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>
pub fn metrics(mut self, input: crate::types::MetricDataQuery) -> Self {
self.inner = self.inner.metrics(input);
self
}
/// <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>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p>
/// <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p>
/// <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>
/// <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>
pub fn set_metrics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricDataQuery>>) -> Self {
self.inner = self.inner.set_metrics(input);
self
}
/// <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>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p>
/// <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p>
/// <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>
/// <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>
pub fn get_metrics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricDataQuery>> {
self.inner.get_metrics()
}
///
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <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>
/// <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>
/// <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>
/// <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>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
self.inner.get_tags()
}
/// <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>
/// <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p>
/// <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p>
pub fn threshold_metric_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.threshold_metric_id(input.into());
self
}
/// <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>
/// <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p>
/// <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p>
pub fn set_threshold_metric_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_threshold_metric_id(input);
self
}
/// <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>
/// <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p>
/// <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p>
pub fn get_threshold_metric_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_threshold_metric_id()
}
/// <p>The evaluation criteria for the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p>
/// <p>If you use the <code>EvaluationCriteria</code> parameter, you cannot include the <code>Namespace</code>, <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, <code>ExtendedStatistic</code>, <code>Metrics</code>, <code>Threshold</code>, <code>ComparisonOperator</code>, <code>ThresholdMetricId</code>, <code>EvaluationPeriods</code>, or <code>DatapointsToAlarm</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, all evaluation parameters are defined within this structure.</p>
/// <p>For an example of how to use this parameter, see the <b>PromQL alarm</b> example on this page.</p>
pub fn evaluation_criteria(mut self, input: crate::types::EvaluationCriteria) -> Self {
self.inner = self.inner.evaluation_criteria(input);
self
}
/// <p>The evaluation criteria for the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p>
/// <p>If you use the <code>EvaluationCriteria</code> parameter, you cannot include the <code>Namespace</code>, <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, <code>ExtendedStatistic</code>, <code>Metrics</code>, <code>Threshold</code>, <code>ComparisonOperator</code>, <code>ThresholdMetricId</code>, <code>EvaluationPeriods</code>, or <code>DatapointsToAlarm</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, all evaluation parameters are defined within this structure.</p>
/// <p>For an example of how to use this parameter, see the <b>PromQL alarm</b> example on this page.</p>
pub fn set_evaluation_criteria(mut self, input: ::std::option::Option<crate::types::EvaluationCriteria>) -> Self {
self.inner = self.inner.set_evaluation_criteria(input);
self
}
/// <p>The evaluation criteria for the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p>
/// <p>If you use the <code>EvaluationCriteria</code> parameter, you cannot include the <code>Namespace</code>, <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, <code>ExtendedStatistic</code>, <code>Metrics</code>, <code>Threshold</code>, <code>ComparisonOperator</code>, <code>ThresholdMetricId</code>, <code>EvaluationPeriods</code>, or <code>DatapointsToAlarm</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, all evaluation parameters are defined within this structure.</p>
/// <p>For an example of how to use this parameter, see the <b>PromQL alarm</b> example on this page.</p>
pub fn get_evaluation_criteria(&self) -> &::std::option::Option<crate::types::EvaluationCriteria> {
self.inner.get_evaluation_criteria()
}
/// <p>The frequency, in seconds, at which the alarm is evaluated. Valid values are 10, 20, 30, and any multiple of 60.</p>
/// <p>This parameter is required for alarms that use <code>EvaluationCriteria</code>, and cannot be specified for alarms configured with <code>MetricName</code> or <code>Metrics</code>.</p>
pub fn evaluation_interval(mut self, input: i32) -> Self {
self.inner = self.inner.evaluation_interval(input);
self
}
/// <p>The frequency, in seconds, at which the alarm is evaluated. Valid values are 10, 20, 30, and any multiple of 60.</p>
/// <p>This parameter is required for alarms that use <code>EvaluationCriteria</code>, and cannot be specified for alarms configured with <code>MetricName</code> or <code>Metrics</code>.</p>
pub fn set_evaluation_interval(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_evaluation_interval(input);
self
}
/// <p>The frequency, in seconds, at which the alarm is evaluated. Valid values are 10, 20, 30, and any multiple of 60.</p>
/// <p>This parameter is required for alarms that use <code>EvaluationCriteria</code>, and cannot be specified for alarms configured with <code>MetricName</code> or <code>Metrics</code>.</p>
pub fn get_evaluation_interval(&self) -> &::std::option::Option<i32> {
self.inner.get_evaluation_interval()
}
}